当前位置: 首页>>代码示例>>PHP>>正文


PHP RepairAndClear::repairAndClearAll方法代码示例

本文整理汇总了PHP中RepairAndClear::repairAndClearAll方法的典型用法代码示例。如果您正苦于以下问题:PHP RepairAndClear::repairAndClearAll方法的具体用法?PHP RepairAndClear::repairAndClearAll怎么用?PHP RepairAndClear::repairAndClearAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RepairAndClear的用法示例。


在下文中一共展示了RepairAndClear::repairAndClearAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

    /**
     * @see SugarView::display()
     */
    public function display()
    {
        $randc = new RepairAndClear();
        $randc->repairAndClearAll(array('clearAll'), array(translate('LBL_ALL_MODULES')), false, true);
        echo <<<EOHTML
<br /><br /><a href="index.php?module=Administration&action=index">{$GLOBALS['mod_strings']['LBL_DIAGNOSTIC_DELETE_RETURN']}</a>
EOHTML;
    }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:11,代码来源:view.repair.php

示例2: createCustomField

 /**
  * Create the custom field with type 'relate'
  */
 protected function createCustomField()
 {
     $field = get_widget('relate');
     $field->id = 'Contacts' . $this->field_name_c;
     $field->name = $this->field_name_c;
     $field->type = 'relate';
     $field->label = 'LBL_' . strtoupper($this->field_name_c);
     $field->ext2 = 'Accounts';
     $field->view_module = 'Contacts';
     $this->relateField = $field;
     $this->bean = BeanFactory::getBean('Contacts');
     $this->df = new DynamicField($this->bean->module_name);
     $this->df->setup($this->bean);
     $field->save($this->df);
     $this->rc = new RepairAndClear();
     $this->rc->repairAndClearAll(array("rebuildExtensions", "clearVardefs"), array('Contact'), false, false);
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:20,代码来源:Bug52173Test.php

示例3: post_install

function post_install()
{
    $autoexecute = false;
    //execute the SQL
    $show_output = true;
    //output to the screen
    require_once "modules/Administration/QuickRepairAndRebuild.php";
    $randc = new RepairAndClear();
    $randc->repairAndClearAll(array('clearAll', 'clearMetadataAPICache'), array(translate('LBL_ALL_MODULES')), $autoexecute, $show_output);
}
开发者ID:delkyd,项目名称:examples,代码行数:10,代码来源:post_install.php

示例4: tearDown

 public function tearDown()
 {
     if ($this->accountFieldWidget) {
         $this->accountFieldWidget->delete($this->accountField);
     }
     if ($this->opportunityFieldWidget) {
         $this->opportunityFieldWidget->delete($this->opportunityField);
     }
     $repair = new RepairAndClear();
     $repair->repairAndClearAll(array('rebuildExtensions', 'clearVardefs'), array($GLOBALS['beanList']['Accounts'], $GLOBALS['beanList']['Opportunities']), true, false);
     $_REQUEST = $_POST = array();
     SugarTestHelper::tearDown();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:13,代码来源:Bug56423Test.php

示例5: display

    /**
     * @see SugarView::display()
     */
    public function display()
    {
        // To prevent lag in the rendering of the page after clicking the quick repair link...
        echo "<h2>{$GLOBALS['mod_strings']['LBL_BEGIN_QUICK_REPAIR_AND_REBUILD']}</h2>";
        ob_flush();
        $randc = new RepairAndClear();
        $actions = array();
        $actions[] = 'clearAll';
        $randc->repairAndClearAll($actions, array(translate('LBL_ALL_MODULES')), false, true, '');
        echo <<<EOHTML
<br /><br /><a href="index.php?module=Administration&action=index">{$GLOBALS['mod_strings']['LBL_DIAGNOSTIC_DELETE_RETURN']}</a>
EOHTML;
    }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:16,代码来源:view.repair.php

示例6: post_install

function post_install()
{
    if (strtolower($_POST['mode']) == 'install') {
        ?>
<br/>
	<h3>Advanced OpenSales by <a href="http://www.salesagility.com">SalesAgility</a></h3>
	<br/>
	German translation by Claudia Haring & Georg Schütz <a href="http://www.kamux.de">www.kamux.de</a><br/>
	Russian tranlsation by likhobory <a href="mailto:likhobory@mail.ru">likhobory@mail.ru</a><br/>
	Dutch translation by OpenSesame ICT <a href="http://www.osict.com">www.osict.com</a> <a href="mailto:bdm@osict.com">bdm@osict.com</a><br/>
	Finnish translation by Henri Vuolle <a href="mailto:henri.vuolle@kiwai.fi">henri.vuolle@kiwai.fi</a><br/>
	Italian translation by Andrea Motta<br/>
	Spanish translation by Morris X<br/>
	<br/><?php 
        $modules = array('AOS_Contracts', 'AOS_Invoices', 'AOS_PDF_Templates', 'AOS_Products', 'AOS_Products_Quotes', 'AOS_Quotes');
        $actions = array('clearAll', 'rebuildAuditTables', 'rebuildExtensions', 'repairDatabase');
        require_once 'modules/Administration/QuickRepairAndRebuild.php';
        $randc = new RepairAndClear();
        $randc->repairAndClearAll($actions, $modules, true, false);
        $_REQUEST['upgradeWizard'] = true;
        require_once 'modules/ACL/install_actions.php';
        unset($_REQUEST['upgradeWizard']);
    }
}
开发者ID:santara12,项目名称:advanced-opensales,代码行数:24,代码来源:post_install.php

示例7: action_DeleteField

 public function action_DeleteField()
 {
     $field = get_widget($_REQUEST['type']);
     $field->name = $_REQUEST['name'];
     if (!isset($_REQUEST['view_package'])) {
         if (!empty($_REQUEST['name']) && !empty($_REQUEST['view_module'])) {
             $moduleName = $_REQUEST['view_module'];
             // bug 51325 make sure we make this switch or delete will not work
             if ($moduleName == 'Employees') {
                 $moduleName = 'Users';
             }
             $seed = BeanFactory::getBean($moduleName);
             $df = new DynamicField($moduleName);
             $df->setup($seed);
             //Need to load the entire field_meta_data for some field types
             $field = $df->getFieldWidget($moduleName, $field->name);
             $field->delete($df);
             $GLOBALS['mod_strings']['LBL_ALL_MODULES'] = 'all_modules';
             $_REQUEST['execute_sql'] = true;
             include_once 'modules/Administration/QuickRepairAndRebuild.php';
             $repair = new RepairAndClear();
             $repair->repairAndClearAll(array('rebuildExtensions', 'clearVardefs', 'clearTpls'), array($moduleName), true, false);
             require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php';
             $module = StudioModuleFactory::getStudioModule($moduleName);
         }
     } else {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         $field = $module->getField($field->name);
         $field->delete($module);
         $mb->save();
     }
     $module->removeFieldFromLayouts($field->name);
     $this->view = 'modulefields';
     if (isset($GLOBALS['current_language']) && isset($_REQUEST['label']) && isset($_REQUEST['labelValue']) && isset($_REQUEST['view_module'])) {
         $this->DeleteLabel($GLOBALS['current_language'], $_REQUEST['label'], $_REQUEST['labelValue'], $_REQUEST['view_module']);
         $this->metadataApiCacheCleared = true;
     }
     // Clear the metadata cache if it hasn't been done already
     if (!$this->metadataApiCacheCleared && !empty($moduleName)) {
         // This removes the labels associated with the field and rebuilds
         // the api cache for the module
         $repair->module_list = array($moduleName);
         $repair->repairMetadataAPICache('labels');
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:46,代码来源:controller.php

示例8: array

//retrieve old modules list
writeLog('check to see if new modules exist');
$oldModuleList = array();
$newModuleList = array();
include $old_template . '/include/modules.php';
$oldModuleList = $moduleList;
$moduleList = array();
include 'include/modules.php';
$newModuleList = $moduleList;
///////////////////////////////////////////////////////////////////////////////
////	HANDLE DATABASE
$mod_strings = $mod_strings_copy;
writeLog('About to repair the database.');
//Use Repair and rebuild to update the database.
$rac = new RepairAndClear();
$rac->repairAndClearAll(array('clearAll'), array($mod_strings['LBL_ALL_MODULES']), true, false);
writeLog('database repaired');
//include tab controller
$newTB = new TabController();
//make sure new modules list has a key we can reference directly
$newModuleList = $newTB->get_key_array($newModuleList);
$oldModuleList = $newTB->get_key_array($oldModuleList);
//iterate through list and remove commonalities to get new modules
foreach ($newModuleList as $remove_mod) {
    if (in_array($remove_mod, $oldModuleList)) {
        unset($newModuleList[$remove_mod]);
    }
}
//new modules list now has left over modules which are new to this install, so lets add them to the system tabs
writeLog('new modules to add are ' . var_export($newModuleList, true));
//grab the existing system tabs
开发者ID:adderall,项目名称:shadow,代码行数:31,代码来源:shadowUpgrade.php

示例9: rebuildExtensions

 /**
  * Rebuild only Extensions.
  * @param     array      $modules       Rebuild only the specified modules
  * @param     string     $user_id       User id of the admin user
  * @return    array                     Messages
  */
 public function rebuildExtensions(array $modules = array(), $user_id = '1')
 {
     $this->setUpQuickRepair($user_id);
     $repair = new \RepairAndClear();
     $repair->repairAndClearAll(array('rebuildExtensions'), $modules);
     return $this->getMessages();
 }
开发者ID:inetprocess,项目名称:libsugarcrm,代码行数:13,代码来源:System.php

示例10: RepairAndClear

 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
if (isset($_REQUEST['action']) && isset($_REQUEST['selected_actions']) && isset($_REQUEST['repair_module'])) {
    $randc = new RepairAndClear();
    $randc->repairAndClearAll($_REQUEST['selected_actions'], $_REQUEST['repair_module'], false, true);
}
class RepairAndClear
{
    var $module_list;
    var $show_output;
    var $actions;
    var $execute;
    var $module_list_from_cache;
    function repairAndClearAll($selected_actions, $modules, $autoexecute = false, $show_output = true)
    {
        global $mod_strings;
        $this->module_list = $modules;
        $this->show_output = $show_output;
        $this->actions = $selected_actions;
        $this->execute = $autoexecute;
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:31,代码来源:QuickRepairAndRebuild.php

示例11: build

 function build()
 {
     $basepath = "custom/Extension/modules";
     $this->activitiesToAdd = false;
     // and mark all as built so that the next time we come through we'll know and won't build again
     foreach ($this->relationships as $name => $relationship) {
         $definition = $relationship->getDefinition();
         // activities will always appear on the rhs only - lhs will be always be this module in MB
         if (strtolower($definition['rhs_module']) == 'activities') {
             $this->activitiesToAdd = true;
             $relationshipName = $definition['relationship_name'];
             foreach (self::$activities as $activitiesSubModuleLower => $activitiesSubModuleName) {
                 $definition['rhs_module'] = $activitiesSubModuleName;
                 $definition['for_activities'] = true;
                 $definition['relationship_name'] = $relationshipName . '_' . $activitiesSubModuleLower;
                 $this->relationships[$definition['relationship_name']] = RelationshipFactory::newRelationship($definition);
             }
             unset($this->relationships[$name]);
         }
     }
     $GLOBALS['log']->info(get_class($this) . "->build(): installing relationships");
     $MBModStrings = $GLOBALS['mod_strings'];
     $adminModStrings = return_module_language('', 'Administration');
     // required by ModuleInstaller
     foreach ($this->relationships as $name => $relationship) {
         $relationship->setFromStudio();
         $GLOBALS['mod_strings'] = $MBModStrings;
         $installDefs = parent::build($basepath, "<basepath>", array($name => $relationship));
         // and mark as built so that the next time we come through we'll know and won't build again
         $relationship->setReadonly();
         $this->relationships[$name] = $relationship;
         // now install the relationship - ModuleInstaller normally only does this as part of a package load where it installs the relationships defined in the manifest. However, we don't have a manifest or a package, so...
         // If we were to chose to just use the Extension mechanism, without using the ModuleInstaller install_...() methods, we must :
         // 1)   place the information for each side of the relationship in the appropriate Ext directory for the module, which means specific $this->save...() methods for DeployedRelationships, and
         // 2)   we must also manually add the relationship into the custom/application/Ext/TableDictionary/tabledictionary.ext.php file as install_relationship doesn't handle that (install_relationships which requires the manifest however does)
         //      Relationships must be in tabledictionary.ext.php for the Admin command Rebuild Relationships to reliably work:
         //      Rebuild Relationships looks for relationships in the modules vardefs.php, in custom/modules/<modulename>/Ext/vardefs/vardefs.ext.php, and in modules/TableDictionary.php and custom/application/Ext/TableDictionary/tabledictionary.ext.php
         //      if the relationship is not defined in one of those four places it could be deleted during a rebuilt, or during a module installation (when RebuildRelationships.php deletes all entries in the Relationships table)
         // So instead of doing this, we use common save...() methods between DeployedRelationships and UndeployedRelationships that will produce installDefs,
         // and rather than building a full manifest file to carry them, we manually add these installDefs to the ModuleInstaller, and then
         // individually call the appropriate ModuleInstaller->install_...() methods to take our relationship out of our staging area and expand it out to the individual module Ext areas
         $GLOBALS['mod_strings'] = $adminModStrings;
         require_once 'ModuleInstall/ModuleInstaller.php';
         $mi = new ModuleInstaller();
         $mi->id_name = 'custom' . $name;
         // provide the moduleinstaller with a unique name for this relationship - normally this value is set to the package key...
         $mi->installdefs = $installDefs;
         $mi->base_dir = $basepath;
         $mi->silent = true;
         VardefManager::clearVardef();
         $mi->install_relationships();
         $mi->install_languages();
         $mi->install_vardefs();
         $mi->install_layoutdefs();
     }
     // now clear all caches so that our changes are visible
     require_once 'modules/Administration/QuickRepairAndRebuild.php';
     $rac = new RepairAndClear();
     $rac->repairAndClearAll(array('clearAll'), array($GLOBALS['mod_strings']['LBL_ALL_MODULES']), true, false);
     $GLOBALS['mod_strings'] = $MBModStrings;
     // finally, restore the ModuleBuilder mod_strings
     // save out the updated definitions so that we keep track of the change in built status
     $this->save();
     $GLOBALS['log']->info(get_class($this) . "->build(): finished relationship installation");
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:65,代码来源:DeployedRelationships.php

示例12: post_install

function post_install()
{
    // create directory for external contract pdf files
    $externalContractsPdfDir = "{$GLOBALS['sugar_config']['cache_dir']}/modules/Emails/attachments/";
    mkdir_recursive($externalContractsPdfDir);
    if (file_exists($externalContractsPdfDir)) {
        $GLOBALS['log']->debug("Successfully created directory '{$externalContractsPdfDir}'");
    } else {
        $GLOBALS['log']->fatal("Could not create directory for creation of pdf files: '{$externalContractsPdfDir}'");
    }
    global $sugar_config;
    global $sugar_version;
    $module_list = array('oqc_TextBlock', 'oqc_Offering', 'oqc_Product', 'oqc_Contract', 'oqc_ExternalContract', 'oqc_ProductCatalog', 'oqc_Addition', 'oqc_Task');
    // Add banning of AjaxUI for openqc modules
    require_once 'modules/Configurator/Configurator.php';
    $cfg = new Configurator();
    $overrideArray = $cfg->readOverride();
    if (array_key_exists('addAjaxBannedModules', $overrideArray)) {
        $disabled_modules = $overrideArray['addAjaxBannedModules'];
        $updatedArray = array_merge($disabled_modules, array_diff($module_list, $disabled_modules));
    } else {
        $updatedArray = $module_list;
    }
    $cfg->config['addAjaxBannedModules'] = empty($updatedArray) ? FALSE : $updatedArray;
    $cfg->handleOverride();
    // Configure documents.properties file depending on OS. There is three choices atm
    //1. Default- Linux (OpenSuse, Ubuntu); 2. WinXP; 3. MACOSX
    $oqc_config_directory = 'include/oqc/conf/';
    if (strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') {
        if (file_exists($oqc_config_directory . 'documents_linux.properties')) {
            unlink($oqc_config_directory . 'documents_linux.properties');
        }
        rename($oqc_config_directory . 'documents.properties', $oqc_config_directory . 'documents_linux.properties');
        rename($oqc_config_directory . 'documents_windows.properties', $oqc_config_directory . 'documents.properties');
    } elseif (strtoupper(substr(php_uname('s'), 0, 3)) === 'DAR') {
        if (file_exists($oqc_config_directory . 'documents_linux.properties')) {
            unlink($oqc_config_directory . 'documents_linux.properties');
        }
        rename($oqc_config_directory . 'documents.properties', $oqc_config_directory . 'documents_linux.properties');
        rename($oqc_config_directory . 'documents_macosx.properties', $oqc_config_directory . 'documents.properties');
    }
    //Do some sanity checks before installing scheduler file if sugar version is lower than 6.3
    if (floatval(substr($sugar_version, 0, 3)) < 6.3) {
        $scheduler_directory = 'custom/modules/Schedulers/';
        if (file_exists($scheduler_directory . '_AddJobsHere.php')) {
            //rename existing file; User can merge oqc file with original one manually
            if (file_exists($scheduler_directory . '_AddJobsHere_original.php')) {
                unlink($scheduler_directory . '_AddJobsHere_original.php');
            }
            rename($scheduler_directory . '_AddJobsHere.php', $scheduler_directory . '_AddJobsHere_original.php');
        }
        rename($scheduler_directory . 'oqc_AddJobsHere.php', $scheduler_directory . '_AddJobsHere.php');
    }
    // Rebuild Roles after install
    require_once 'modules/ACL/install_actions.php';
    //Last, Do a Quick Repair & Rebuild
    $module = array('All Modules');
    $selected_actions = array('clearAll');
    require_once 'modules/Administration/QuickRepairAndRebuild.php';
    $randc = new RepairAndClear();
    $randc->repairAndClearAll($selected_actions, $module, false, false);
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:62,代码来源:post_install.php

示例13: die

<?php

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
global $db;
//***********************************************************//
//********** Restauramos los ficheros originales ************//
//***********************************************************//
echo "<b>Restored Files:</b><br/><br/>";
//***********************************************************//
//********** Restauramos los ficheros originales ************//
//***********************************************************//
echo "<br/><br/><br/><b>Modified Files:</b><br/><br/>";
echo "<br/><b>AlineaSol Repair Done.</b>";
//Repair and Rebuild
$module = array('All Modules');
$selected_actions = array('clearAll');
require_once 'modules/Administration/QuickRepairAndRebuild.php';
$randc = new RepairAndClear();
$randc->repairAndClearAll($selected_actions, $module, false, false);
//Repair and Rebuild
echo "<br/><b>SugarCRM Repair & Rebuild Done.</b>";
开发者ID:jeffcao,项目名称:fzglsys_v5,代码行数:23,代码来源:asolRepair.php

示例14: install


//.........这里部分代码省略.........
                         $installdefs = $upgrade_manifest['upgrade_paths'][$previous_version];
                     } else {
                         $errors[] = 'No Upgrade Path Found in manifest.';
                         $this->abort($errors);
                     }
                     //fi
                 }
                 //fi
             }
             //fi
         }
         //fi
         $this->id_name = $installdefs['id'];
         $this->installdefs = $installdefs;
         $installed_modules = array();
         $tab_modules = array();
         if (isset($installdefs['beans'])) {
             $str = "<?php \n //WARNING: The contents of this file are auto-generated\n";
             foreach ($installdefs['beans'] as $bean) {
                 if (!empty($bean['module']) && !empty($bean['class']) && !empty($bean['path'])) {
                     $module = $bean['module'];
                     $class = $bean['class'];
                     $path = $bean['path'];
                     $str .= "\$beanList['{$module}'] = '{$class}';\n";
                     $str .= "\$beanFiles['{$class}'] = '{$path}';\n";
                     if ($bean['tab']) {
                         $str .= "\$moduleList[] = '{$module}';\n";
                         $this->install_user_prefs($module, empty($bean['hide_by_default']));
                         $tab_modules[] = $module;
                     } else {
                         $str .= "\$modules_exempt_from_availability_check['{$module}'] = '{$module}';\n";
                         $str .= "\$modInvisList[] = '{$module}';\n";
                     }
                     $installed_modules[] = $module;
                 } else {
                     $errors[] = 'Bean array not well defined.';
                     $this->abort($errors);
                 }
             }
             $str .= "\n?>";
             if (!file_exists("custom/Extension/application/Ext/Include")) {
                 mkdir_recursive("custom/Extension/application/Ext/Include", true);
             }
             $out = sugar_fopen("custom/Extension/application/Ext/Include/{$this->id_name}.php", 'w');
             fwrite($out, $str);
             fclose($out);
             $this->rebuild_modules();
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
         }
         foreach ($tasks as $task) {
             $this->{$task}();
             if (!$this->silent) {
                 $current_step++;
                 update_progress_bar('install', $current_step, $total_steps);
             }
         }
         $this->install_beans($installed_modules);
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $total_steps, $total_steps);
         }
         if (isset($installdefs['custom_fields'])) {
             $this->log(translate('LBL_MI_IN_CUSTOMFIELD'));
             $this->install_custom_fields($installdefs['custom_fields']);
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
             echo '</div>';
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
             echo '</div>';
         }
         $selectedActions = array('clearTpls', 'clearJsFiles', 'clearDashlets', 'clearVardefs', 'clearJsLangFiles', 'rebuildAuditTables', 'repairDatabase');
         VardefManager::clearVardef();
         global $beanList, $beanFiles, $moduleList;
         if (file_exists('custom/application/Ext/Include/modules.ext.php')) {
             include 'custom/application/Ext/Include/modules.ext.php';
         }
         require_once "modules/Administration/upgrade_custom_relationships.php";
         upgrade_custom_relationships($installed_modules);
         $this->rebuild_all(true);
         require_once 'modules/Administration/QuickRepairAndRebuild.php';
         $rac = new RepairAndClear();
         $rac->repairAndClearAll($selectedActions, $installed_modules, true, false);
         $this->rebuild_relationships();
         UpdateSystemTabs('Add', $tab_modules);
         //clear the unified_search_module.php file
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
         $this->log('<br><b>' . translate('LBL_MI_COMPLETE') . '</b>');
     } else {
         die("No \$installdefs Defined In {$this->base_dir}/manifest.php");
     }
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:101,代码来源:ModuleInstaller.php

示例15: createCustom

    public function createCustom()
    {
        //create new varchar widget and associate with Accounts
        $this->custField = get_widget('varchar');
        $this->custField->id = 'Accounts' . $this->custFieldName;
        $this->custField->name = $this->custFieldName;
        $this->custField->type = 'varchar';
        $this->custField->label = 'LBL_' . strtoupper($this->custFieldName);
        $this->custField->vname = 'LBL_' . strtoupper($this->custFieldName);
        $this->custField->len = 255;
        $this->custField->custom_module = 'Accounts';
        $this->custField->required = 0;
        $this->custField->default = 'goofy';
        $this->acc = new Account();
        $this->df = new DynamicField('Accounts');
        $this->df->setup($this->acc);
        $this->df->addFieldObject($this->custField);
        $this->df->buildCache('Accounts');
        $this->custField->save($this->df);
        VardefManager::clearVardef();
        VardefManager::refreshVardefs('Accounts', 'Account');
        //Now create the meta files to make this a Calculated Field.
        $fn = $this->custFieldName;
        $extensionContent = <<<EOQ
<?php
\$dictionary['Account']['fields']['{$fn}']['duplicate_merge_dom_value']=0;
\$dictionary['Account']['fields']['{$fn}']['calculated']='true';
\$dictionary['Account']['fields']['{$fn}']['formula']='related(\$assigned_user_link,"name")';
\$dictionary['Account']['fields']['{$fn}']['enforced']='true';
\$dictionary['Account']['fields']['{$fn}']['dependency']='';
\$dictionary['Account']['fields']['{$fn}']['type']='varchar';
\$dictionary['Account']['fields']['{$fn}']['name']='{$fn}';


EOQ;
        //create custom field file
        $this->custFileDirPath = create_custom_directory($this->custFileDirPath);
        $fileLoc = $this->custFileDirPath . 'sugarfield_' . $this->custFieldName . '.php';
        file_put_contents($fileLoc, $extensionContent);
        //run repair and clear to make sure the meta gets picked up
        $_REQUEST['repair_silent'] = 1;
        $rc = new RepairAndClear();
        $rc->repairAndClearAll(array("clearAll", "rebuildExtensions"), array("Accounts"), false, false);
        $fn = $this->custFieldName;
    }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:45,代码来源:Bug61734Test.php


注:本文中的RepairAndClear::repairAndClearAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。