コード例 #1
0
ファイル: parser.label.php プロジェクト: jglaine/sugar761-ent
 /**
  * Rebuilds extensions and language files for this language and module
  * 
  * @param string $language The language to rebuild extensions for
  * @param string $moduleName The name of the module whose extensions are being rebuilt
  */
 protected static function rebuildLanguageExtensions($language, $moduleName)
 {
     if (empty(self::$moduleInstaller)) {
         self::$moduleInstaller = new ModuleInstaller();
         self::$moduleInstaller->silent = true;
     }
     self::$moduleInstaller->rebuild_extensions(array($moduleName), array('languages'));
     // While this *is* called from rebuild_extensions, it doesn't do anything
     // there because there is no language or module provided to it. This fixes
     // that.
     self::$moduleInstaller->rebuild_languages(array($language => $language), array($moduleName));
 }
コード例 #2
0
 function action_saveSugarField()
 {
     global $mod_strings;
     require_once 'modules/DynamicFields/FieldCases.php';
     $field = get_widget($_REQUEST['type']);
     $_REQUEST['name'] = trim($_POST['name']);
     $field->populateFromPost();
     require_once 'modules/ModuleBuilder/parsers/StandardField.php';
     $module = $_REQUEST['view_module'];
     // Need to map Employees -> Users
     if ($module == 'Employees') {
         $module = 'Users';
     }
     $df = new StandardField($module);
     $mod = BeanFactory::getBean($module);
     $class_name = $GLOBALS['beanList'][$module];
     $df->setup($mod);
     $field->module = $mod;
     $field->save($df);
     $this->action_SaveLabel();
     $MBmodStrings = $mod_strings;
     $GLOBALS['mod_strings'] = return_module_language('', 'Administration');
     include_once 'modules/Administration/QuickRepairAndRebuild.php';
     $GLOBALS['mod_strings']['LBL_ALL_MODULES'] = 'all_modules';
     $_REQUEST['execute_sql'] = true;
     require_once 'ModuleInstall/ModuleInstaller.php';
     $mi = new ModuleInstaller();
     $mi->silent = true;
     $mi->rebuild_extensions();
     $repair = new RepairAndClear();
     $repair->repairAndClearAll(array('clearVardefs', 'clearTpls'), array($class_name), true, false);
     //#28707 ,clear all the js files in cache
     $repair->module_list = array();
     $repair->clearJsFiles();
     // now clear the cache so that the results are immediately visible
     include_once 'include/TemplateHandler/TemplateHandler.php';
     TemplateHandler::clearCache($module);
     if ($module == 'Users') {
         TemplateHandler::clearCache('Employees');
     }
     $GLOBALS['mod_strings'] = $MBmodStrings;
 }
コード例 #3
0
ファイル: controller.php プロジェクト: jglaine/sugar761-ent
 public function action_saveSugarField()
 {
     global $mod_strings;
     $field = get_widget($_REQUEST['type']);
     $_REQUEST['name'] = trim($_POST['name']);
     $field->populateFromPost();
     $module = $_REQUEST['view_module'];
     $df = new StandardField($module);
     $mod = BeanFactory::getBean($module);
     $obj = BeanFactory::getObjectName($module);
     $df->setup($mod);
     $field->module = $mod;
     $field->save($df);
     $this->action_SaveLabel();
     $MBmodStrings = $mod_strings;
     $GLOBALS['mod_strings'] = return_module_language('', 'Administration');
     include_once 'modules/Administration/QuickRepairAndRebuild.php';
     $GLOBALS['mod_strings']['LBL_ALL_MODULES'] = 'all_modules';
     $_REQUEST['execute_sql'] = true;
     $mi = new ModuleInstaller();
     $mi->silent = true;
     $mi->rebuild_extensions();
     $repair = new RepairAndClear();
     $repair->repairAndClearAll(array('clearVardefs', 'clearTpls', 'clearSearchCache'), array($module), true, false);
     //#28707 ,clear all the js files in cache
     $repair->module_list = array();
     $repair->clearJsFiles();
     //Ensure the vardefs are up to date for this module before we rebuild the cache now.
     VardefManager::loadVardef($module, $obj, true);
     //Make sure to clear the vardef for related modules as well
     $relatedMods = array();
     if (!empty($field->dependency)) {
         $relatedMods = array_merge($relatedMods, VardefManager::getLinkedModulesFromFormula($mod, $field->dependency));
     }
     if (!empty($field->formula)) {
         $relatedMods = array_merge($relatedMods, VardefManager::getLinkedModulesFromFormula($mod, $field->formula));
     }
     foreach ($relatedMods as $mName => $oName) {
         $repair->repairAndClearAll(array('clearVardefs', 'clearTpls'), array($mName), true, false);
         VardefManager::clearVardef($mName, $oName);
     }
     // now clear the cache so that the results are immediately visible
     TemplateHandler::clearCache($module);
     if ($module == 'Users') {
         TemplateHandler::clearCache('Employees');
     }
     // Bug 59210
     // Clear the metadata cache so this change can be reflected
     // immediately.
     $repair->module_list = array($module);
     // Sending false will only rebuild the $module section of the cache
     $repair->repairMetadataAPICache(false);
     $GLOBALS['mod_strings'] = $MBmodStrings;
 }
コード例 #4
0
ファイル: performSetup.php プロジェクト: jglaine/sugar761-ent
            if ($bean == "SavedReport") {
                $new_report = 1;
            }
        }
        installLog("creating Relationship Meta for " . $focus->getObjectName());
        installerHook('pre_createModuleTable', array('module' => $focus->getObjectName()));
        SugarBean::createRelationshipMeta($focus->getObjectName(), $db, $table_name, $empty, $focus->module_dir);
        installerHook('post_createModuleTable', array('module' => $focus->getObjectName()));
        echo ".";
    }
    // end if()
}
installerHook('post_createAllModuleTables');
// re-add this back to re-generate everything here $mi is created above
$mi->silent = true;
$mi->rebuild_extensions();
echo "<br>";
////    END TABLE STUFF
///////////////////////////////////////////////////////////////////////////////
////    START RELATIONSHIP CREATION
ksort($rel_dictionary);
foreach ($rel_dictionary as $rel_name => $rel_data) {
    $table = $rel_data['table'];
    if ($setup_db_drop_tables) {
        if ($db->tableExists($table)) {
            $db->dropTableName($table);
        }
    }
    if (!$db->tableExists($table)) {
        $db->createTableParams($table, $rel_data['fields'], isset($rel_data['indices']) ? $rel_data['indices'] : array());
    }