Example #1
0
function getLicenseDisplay($type, $manifest, $zipFile, $next_step, $license_file, $clean_file)
{
    return PackageManagerDisplay::getLicenseDisplay($license_file, 'install.php', $next_step, $zipFile, $type, $manifest, $clean_file);
}
 /**
  * A Static method used to generate the javascript for the page
  *
  * @return String - the javascript required for the page
  */
 function getDisplayScript($install = false, $type = 'module', $releases = null, $types = array(), $isAlive = true)
 {
     global $sugar_version, $sugar_config;
     global $current_language;
     $mod_strings = return_module_language($current_language, "Administration");
     $ss = new Sugar_Smarty();
     $ss->assign('MOD', $mod_strings);
     if (!$install) {
         $install = 0;
     }
     $ss->assign('INSTALLATION', $install);
     $ss->assign('WAIT_IMAGE', SugarThemeRegistry::current()->getImage("loading", "border='0' align='bottom'", null, null, '.gif', "Loading"));
     $ss->assign('sugar_version', $sugar_version);
     $ss->assign('js_custom_version', $sugar_config['js_custom_version']);
     $ss->assign('IS_ALIVE', $isAlive);
     //if($type == 'patch' && $releases != null){
     if ($type == 'patch') {
         $ss->assign('module_load', 'false');
         $patches = PackageManagerDisplay::createJavascriptPackageArray($releases);
         $ss->assign('PATCHES', $patches);
         $ss->assign('GRID_TYPE', implode(',', $types));
     } else {
         $pm = new PackageManager();
         $releases = $pm->getPackagesInStaging();
         $patches = PackageManagerDisplay::createJavascriptModuleArray($releases);
         $ss->assign('PATCHES', $patches);
         $installeds = $pm->getinstalledPackages();
         $patches = PackageManagerDisplay::createJavascriptModuleArray($installeds, 'mti_installed_data');
         $ss->assign('INSTALLED_MODULES', $patches);
         $ss->assign('UPGARDE_WIZARD_URL', 'index.php?module=UpgradeWizard&action=index');
         $ss->assign('module_load', 'true');
     }
     if (!empty($GLOBALS['ML_STATUS_MESSAGE'])) {
         $ss->assign('ML_STATUS_MESSAGE', $GLOBALS['ML_STATUS_MESSAGE']);
     }
     //Bug 24064. Checking and Defining labels since these might not be cached during Upgrade
     if (!isset($mod_strings['LBL_ML_INSTALL']) || empty($mod_strings['LBL_ML_INSTALL'])) {
         $mod_strings['LBL_ML_INSTALL'] = 'Install';
     }
     if (!isset($mod_strings['LBL_ML_ENABLE_OR_DISABLE']) || empty($mod_strings['LBL_ML_ENABLE_OR_DISABLE'])) {
         $mod_strings['LBL_ML_ENABLE_OR_DISABLE'] = 'Enable/Disable';
     }
     if (!isset($mod_strings['LBL_ML_DELETE']) || empty($mod_strings['LBL_ML_DELETE'])) {
         $mod_strings['LBL_ML_DELETE'] = 'Delete';
     }
     //Add by jchi 6/23/2008 to fix the bug 21667
     $filegrid_column_ary = array('Name' => $mod_strings['LBL_ML_NAME'], 'Install' => $mod_strings['LBL_ML_INSTALL'], 'Delete' => $mod_strings['LBL_ML_DELETE'], 'Type' => $mod_strings['LBL_ML_TYPE'], 'Version' => $mod_strings['LBL_ML_VERSION'], 'Published' => $mod_strings['LBL_ML_PUBLISHED'], 'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'], 'Description' => $mod_strings['LBL_ML_DESCRIPTION']);
     $filegridinstalled_column_ary = array('Name' => $mod_strings['LBL_ML_NAME'], 'Install' => $mod_strings['LBL_ML_INSTALL'], 'Action' => $mod_strings['LBL_ML_ACTION'], 'Enable_Or_Disable' => $mod_strings['LBL_ML_ENABLE_OR_DISABLE'], 'Type' => $mod_strings['LBL_ML_TYPE'], 'Version' => $mod_strings['LBL_ML_VERSION'], 'Date_Installed' => $mod_strings['LBL_ML_INSTALLED'], 'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'], 'Description' => $mod_strings['LBL_ML_DESCRIPTION']);
     $ss->assign('ML_FILEGRID_COLUMN', $filegrid_column_ary);
     $ss->assign('ML_FILEGRIDINSTALLED_COLUMN', $filegridinstalled_column_ary);
     //end
     $ss->assign('SHOW_IMG', SugarThemeRegistry::current()->getImage('advanced_search', 'border="0"', 8, 8, '.gif', 'Show'));
     $ss->assign('HIDE_IMG', SugarThemeRegistry::current()->getImage('basic_search', 'border="0"', 8, 8, '.gif', 'Hide'));
     $str = $ss->fetch('ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl');
     return $str;
 }
Example #3
0
 function getLicenseText()
 {
     $json = getJSONobj();
     $file = '';
     if (isset($_REQUEST['file'])) {
         $file = hashToFile($_REQUEST['file']);
     }
     $GLOBALS['log']->debug("FILE : " . $file);
     echo 'result = ' . $json->encode(array('license_display' => PackageManagerDisplay::buildLicenseOutput($file)));
 }
Example #4
0
                        <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
                            <tr>

                                <td>
                                   <input type="hidden" name="default_user_name" value="admin">
                                </td>
                                <td>
                                    <input class="button" type="submit" name="goto" value="{$mod_strings['LBL_NEXT']}" id="defaultFocus" {$disabled} />
                                </td>
                            </tr>
                        </table>
                        </form>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

</body>
</html>
EOQ2;
$hidden_fields = "<input type=\"hidden\" name=\"current_step\" value=\"{$next_step}\">";
$hidden_fields .= "<input type=\"hidden\" name=\"goto\" value=\"{$mod_strings['LBL_CHECKSYS_RECHECK']}\">";
$hidden_fields .= "<input type=\"hidden\" name=\"languagePackAction\" value=\"commit\">";
//$form2 = PackageManagerDisplay::buildPackageDisplay($form, $hidden_fields, 'install.php', array('langpack'), 'form1', true);
$form2 = PackageManagerDisplay::buildPatchDisplay($form, $hidden_fields, 'install.php', array('langpack'));
echo $out . $form2 . $out1;
//unlinkTempFiles('','');
////    END PAGEOUTPUT
///////////////////////////////////////////////////////////////////////////////
{$uploaddLabel}
<input type="file" name="upgrade_zip" size="40" />
</td>
<td>
<input type=button class="button" value="{$mod_strings['LBL_UW_BTN_UPLOAD']}" onClick="document.the_form.upgrade_zip_escaped.value = escape( document.the_form.upgrade_zip.value );document.the_form.submit();" />
<input type=hidden name="run" value="upload" />
<input type=hidden name="upgrade_zip_escaped" value="" />
</td>
</tr>
</table></td></tr></table>
</form>
eoq;
}
$hidden_fields = "<input type=hidden name=\"run\" value=\"upload\" />";
$hidden_fields .= "<input type=hidden name=\"mode\"/>";
$form2 = PackageManagerDisplay::buildPackageDisplay($form, $hidden_fields, $form_action, array('module'));
$form3 = <<<eoq3


eoq3;
echo $form2 . $form3;
// scan for new files (that are not installed)
/*print( "$descItemsQueued<br>\n");
print( "<ul>\n" );
$upgrade_contents = findAllFiles( "$base_upgrade_dir", array() );
$upgrades_available = 0;

print( "<table>\n" );
print( "<tr><th></th><th align=left>{$mod_strings['LBL_ML_NAME']}</th><th>{$mod_strings['LBL_ML_TYPE']}</th><th>{$mod_strings['LBL_ML_VERSION']}</th><th>{$mod_strings['LBL_ML_PUBLISHED']}</th><th>{$mod_strings['LBL_ML_UNINSTALLABLE']}</th><th>{$mod_strings['LBL_ML_DESCRIPTION']}</th></tr>\n" );
foreach($upgrade_contents as $upgrade_content)
{
 function getLicenseText()
 {
     require_once 'include/json_config.php';
     $json_config = new json_config();
     $json = getJSONobj();
     $file = '';
     if (isset($_REQUEST['file'])) {
         $file = nl2br($_REQUEST['file']);
     }
     $GLOBALS['log']->debug("FILE : " . $file);
     echo 'result = ' . $json->encode(array('license_display' => PackageManagerDisplay::buildLicenseOutput($file)));
 }