• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP VardefManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中VardefManager的典型用法代码示例。如果您正苦于以下问题:PHP VardefManager类的具体用法?PHP VardefManager怎么用?PHP VardefManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: createRelationship

 /**
  * Create a relationship
  *
  * Params should be passed in as this:
  *
  * array(
  *       'relationship_type' => 'one-to-many',
  *       'lhs_module' => 'Accounts',
  *       'rhs_module' => 'Accounts',
  *   )
  *
  * @static
  * @param array $relationship_def
  * @return ActivitiesRelationship|bool|ManyToManyRelationship|ManyToOneRelationship|OneToManyRelationship|OneToOneRelationship
  */
 public static function createRelationship(array $relationship_def)
 {
     if (!self::checkRequiredFields($relationship_def)) {
         return false;
     }
     $relationships = new DeployedRelationships($relationship_def['lhs_module']);
     if (!isset($relationship_def['view_module'])) {
         $relationship_def['view_module'] = $relationship_def['lhs_module'];
     }
     $REQUEST_Backup = $_REQUEST;
     $_REQUEST = $relationship_def;
     $relationship = $relationships->addFromPost();
     $relationships->save();
     $relationships->build();
     LanguageManager::clearLanguageCache($relationship_def['lhs_module']);
     SugarRelationshipFactory::rebuildCache();
     // rebuild the dictionary to make sure that it has the new relationship in it
     SugarTestHelper::setUp('dictionary');
     // reset the link fields since we added one
     VardefManager::$linkFields = array();
     $_REQUEST = $REQUEST_Backup;
     unset($REQUEST_Backup);
     self::$_relsAdded[] = $relationship->getDefinition();
     return $relationship;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:40,代码来源:SugarTestRelationshipUtilities.php


示例2: repairDictionary

 protected function repairDictionary()
 {
     $this->df->buildCache($this->modulename);
     VardefManager::clearVardef();
     VardefManager::refreshVardefs($this->modulename, $this->objectname);
     $this->seed->field_defs = $GLOBALS['dictionary'][$this->objectname]['fields'];
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:7,代码来源:RepairCustomFieldsTest.php


示例3: setUp

    public function setUp()
    {
        global $beanList, $beanFiles, $dictionary;
        //Add entries to simulate custom module
        $beanList['Bug44030_TestPerson'] = 'Bug44030_TestPerson';
        $beanFiles['Bug44030_TestPerson'] = 'modules/Bug44030_TestPerson/Bug44030_TestPerson.php';
        VardefManager::loadVardef('Contacts', 'Contact');
        $dictionary['Bug44030_TestPerson'] = $dictionary['Contact'];
        //Copy over custom SearchFields.php file
        if (!file_exists('custom/modules/Bug44030_TestPerson/metadata')) {
            mkdir_recursive('custom/modules/Bug44030_TestPerson/metadata');
        }
        if ($fh = @fopen('custom/modules/Bug44030_TestPerson/metadata/SearchFields.php', 'w+')) {
            $string = <<<EOQ
<?php
\$searchFields['Bug44030_TestPerson']['email'] = array(
'query_type' => 'default',
'operator' => 'subquery',
'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE',
'db_field' => array('id',),
'vname' =>'LBL_ANY_EMAIL',
);
?>
EOQ;
            fputs($fh, $string);
            fclose($fh);
        }
        //Remove the cached unified_search_modules.php file
        $this->unified_search_modules_file = $GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php';
        if (file_exists($this->unified_search_modules_file)) {
            copy($this->unified_search_modules_file, $this->unified_search_modules_file . '.bak');
            unlink($this->unified_search_modules_file);
        }
    }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:34,代码来源:Bug44030Test.php


示例4: setUp

 public function setUp()
 {
     global $dictionary;
     $this->_view = 'editview';
     VardefManager::loadVardef('Contacts', 'Contact');
     $this->def = $dictionary['Contact']['fields']['email1'];
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:7,代码来源:Bug39729Test.php


示例5: createRelationship

 private function createRelationship($lhs_module, $rhs_module = null, $relationship_type = 'one-to-many')
 {
     $rhs_module = $rhs_module == null ? $lhs_module : $rhs_module;
     // Adding relation between products and users
     $this->relationships = new DeployedRelationships($lhs_module);
     $definition = array('lhs_module' => $lhs_module, 'relationship_type' => $relationship_type, 'rhs_module' => $rhs_module, 'lhs_label' => $lhs_module, 'rhs_label' => $rhs_module, 'rhs_subpanel' => 'default');
     $this->relationship = RelationshipFactory::newRelationship($definition);
     $this->relationships->add($this->relationship);
     $this->relationships->save();
     $this->relationships->build();
     LanguageManager::clearLanguageCache($lhs_module);
     // Updating $dictionary by created relation
     global $dictionary;
     $moduleInstaller = new ModuleInstaller();
     $moduleInstaller->silent = true;
     $moduleInstaller->rebuild_tabledictionary();
     require 'modules/TableDictionary.php';
     // Updating vardefs
     VardefManager::$linkFields = array();
     VardefManager::clearVardef();
     VardefManager::refreshVardefs($lhs_module, BeanFactory::getObjectName($lhs_module));
     if ($lhs_module != $rhs_module) {
         VardefManager::refreshVardefs($rhs_module, BeanFactory::getObjectName($rhs_module));
     }
     SugarRelationshipFactory::rebuildCache();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:26,代码来源:Bug53223Test.php


示例6: tearDown

 public function tearDown()
 {
     global $dictionary, $bean_list;
     $dictionary = $this->old_dictionary;
     $bean_list = $this->old_bean_list;
     VardefManager::clearVardef('Accounts', 'Account');
     VardefManager::refreshVardefs('Accounts', 'Account');
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:8,代码来源:Bug51427Test.php


示例7: __construct

 /**
  * @param  $linkName String name of a link field in the module's vardefs
  * @param  $bean SugarBean focus bean for this link (one half of a relationship)
  * @param  $linkDef Array Optional vardef for the link in case it can't be found in the passed in bean for the global dictionary
  * @return void
  *
  */
 function __construct($linkName, $bean, $linkDef = false)
 {
     $this->focus = $bean;
     //Try to load the link vardef from the beans field defs. Otherwise start searching
     if (empty($bean->field_defs) || empty($bean->field_defs[$linkName]) || empty($bean->field_defs[$linkName]['relationship'])) {
         if (empty($linkDef)) {
             //Assume $linkName is really relationship_name, and find the link name with the vardef manager
             $this->def = VardefManager::getLinkFieldForRelationship($bean->module_dir, $bean->object_name, $linkName);
         } else {
             $this->def = $linkDef;
         }
         //Check if multiple links were found for a given relationship
         if (is_array($this->def) && !isset($this->def['name'])) {
             //More than one link found, we need to figure out if we are currently on the LHS or RHS
             //default to lhs for now
             if (isset($this->def[0]['side']) && $this->def[0]['side'] == 'left') {
                 $this->def = $this->def[0];
             } else {
                 if (isset($this->def[1]['side']) && $this->def[1]['side'] == 'left') {
                     $this->def = $this->def[1];
                 } else {
                     $this->def = $this->def[0];
                 }
             }
         }
         if (empty($this->def['name'])) {
             $GLOBALS['log']->fatal("failed to find link for {$linkName}");
             return false;
         }
         $this->name = $this->def['name'];
     } else {
         //Linkdef was found in the bean (this is the normal expectation)
         $this->def = $bean->field_defs[$linkName];
         $this->name = $linkName;
     }
     //Instantiate the relationship for this link.
     $this->relationship = SugarRelationshipFactory::getInstance()->getRelationship($this->def['relationship']);
     // Fix to restore functionality from Link.php that needs to be rewritten but for now this will do.
     $this->relationship_fields = !empty($this->def['rel_fields']) ? $this->def['rel_fields'] : array();
     if (!$this->loadedSuccesfully()) {
         global $app_strings;
         $GLOBALS['log']->error(string_format($app_strings['ERR_DATABSE_RELATIONSHIP_QUERY'], array($this->name, $this->def['relationship'])));
     }
     //Following behavior is tied to a property(ignore_role) value in the vardef. It alters the values of 2 properties, ignore_role_filter and add_distinct.
     //the property values can be altered again before any requests are made.
     if (!empty($this->def) && is_array($this->def)) {
         if (isset($this->def['ignore_role'])) {
             if ($this->def['ignore_role']) {
                 $this->ignore_role_filter = true;
                 $this->add_distinct = true;
             }
         }
         if (!empty($this->def['primary_only'])) {
             $this->relationship->primaryOnly = true;
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:64,代码来源:Link2.php


示例8: __construct

 /**
  * The constructor
  * @param string $subpanelName
  * @param string $loadedModule - Accounts
  * @param string $client - base
  */
 public function __construct($subpanelName, $loadedModule, $client = 'base')
 {
     $GLOBALS['log']->debug(get_class($this) . "->__construct({$subpanelName} , {$loadedModule})");
     $this->mdc = new MetaDataConverter();
     $this->loadedModule = $loadedModule;
     $this->setViewClient($client);
     $linkName = $this->linkName = $this->getLinkName($subpanelName, $loadedModule);
     // get the link and the related module name as the module we need the subpanel from
     $bean = BeanFactory::getBean($loadedModule);
     // Get the linkdef, but make sure to tell VardefManager to use name instead by passing true
     $linkDef = VardefManager::getLinkFieldForRelationship($bean->module_dir, $bean->object_name, $subpanelName, true);
     if ($bean->load_relationship($linkName)) {
         $link = $bean->{$linkName};
     } else {
         $link = new Link2($linkName, $bean);
     }
     $this->_moduleName = $link->getRelatedModuleName();
     $this->bean = BeanFactory::getBean($this->_moduleName);
     $subpanelFixed = true;
     if (empty($this->bean)) {
         $subpanelFixed = $this->fixUpSubpanel();
     }
     if (empty($linkDef['name']) && (!$subpanelFixed && isModuleBWC($this->loadedModule))) {
         $GLOBALS['log']->error("Cannot find a link for {$subpanelName} on {$loadedModule}");
         return true;
     }
     // Handle validation up front that will throw exceptions
     if (empty($this->bean) && !$subpanelFixed) {
         throw new Exception("No valid parent bean found for {$this->linkName} on {$this->loadedModule}");
     }
     $this->setUpSubpanelViewDefFileInfo();
     include $this->loadedSubpanelFileName;
     // Prepare to load the history file. This will be available in cases when
     // a layout is restored.
     $this->historyPathname = 'custom/history/modules/' . $this->_moduleName . '/clients/' . $this->getViewClient() . '/views/' . $this->sidecarSubpanelName . '/' . self::HISTORYFILENAME;
     $this->_history = new History($this->historyPathname);
     if (file_exists($this->historyPathname)) {
         // load in the subpanelDefOverride from the history file
         $GLOBALS['log']->debug(get_class($this) . ": loading from history");
         require $this->historyPathname;
     }
     $this->_viewdefs = !empty($viewdefs) ? $this->getNewViewDefs($viewdefs) : array();
     $this->_fielddefs = $this->bean->field_defs;
     $this->_mergeFielddefs($this->_fielddefs, $this->_viewdefs);
     $this->_language = '';
     // don't attempt to access the template_instance property if our subpanel represents a collection, as it won't be there - the sub-sub-panels get this value instead
     if (isset($this->_viewdefs['type']) && $this->_viewdefs['type'] != 'collection') {
         $this->_language = $this->bean->module_dir;
     }
     // Make sure the paneldefs are proper if there are any
     $this->_paneldefs = isset($this->_viewdefs['panels']) ? $this->_viewdefs['panels'] : array();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:58,代码来源:DeployedSidecarSubpanelImplementation.php


示例9: testSaveUsersVardefs

 public function testSaveUsersVardefs()
 {
     global $dictionary;
     $dynamicField = new DynamicField('Users');
     VardefManager::loadVardef('Users', 'User');
     $dynamicField->saveToVardef('Users', $dictionary['User']['fields']);
     //Test that we have refreshed the Employees vardef
     $this->assertTrue(file_exists('cache/modules/Employees/Employeevardefs.php'), 'cache/modules/Employees/Emloyeevardefs.php file not created');
     //Test that status is not set to be required
     $this->assertFalse($dictionary['Employee']['fields']['status']['required'], 'status field set to required');
     //Test that the studio attribute is set to false for status field
     $this->assertFalse($dictionary['Employee']['fields']['status']['studio'], 'status field studio not set to false');
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:13,代码来源:Bug47553Test.php


示例10: __construct

 /**
  * @param  $linkName String name of a link field in the module's vardefs
  * @param  $bean SugarBean focus bean for this link (one half of a relationship)
  * @param  $linkDef Array Optional vardef for the link in case it can't be found in the passed in bean for the global dictionary
  * @return void
  *
  */
 function __construct($linkName, $bean, $linkDef = false)
 {
     $this->focus = $bean;
     //Try to load the link vardef from the beans field defs. Otherwise start searching
     if (empty($bean->field_defs) || empty($bean->field_defs[$linkName]) || empty($bean->field_defs[$linkName]['relationship'])) {
         if (empty($linkDef)) {
             //Assume $linkName is really relationship_name, and find the link name with the vardef manager
             $this->def = VardefManager::getLinkFieldForRelationship($bean->module_dir, $bean->object_name, $linkName);
         } else {
             $this->def = $linkDef;
         }
         //Check if multiple links were found for a given relationship
         if (is_array($this->def) && !isset($this->def['name'])) {
             //More than one link found, we need to figure out if we are currently on the LHS or RHS
             //default to lhs for now
             if (isset($this->def[0]['side']) && $this->def[0]['side'] == 'left') {
                 $this->def = $this->def[0];
             } else {
                 if (isset($this->def[1]['side']) && $this->def[1]['side'] == 'left') {
                     $this->def = $this->def[1];
                 } else {
                     $this->def = $this->def[0];
                 }
             }
         }
         if (empty($this->def['name'])) {
             $GLOBALS['log']->fatal("failed to find link for {$linkName}");
             return false;
         }
         $this->name = $this->def['name'];
     } else {
         //Linkdef was found in the bean (this is the normal expectation)
         $this->def = $bean->field_defs[$linkName];
         $this->name = $linkName;
     }
     //Instantiate the relationship for this link.
     $this->relationship = SugarRelationshipFactory::getInstance()->getRelationship($this->def['relationship']);
     if (!$this->loadedSuccesfully()) {
         $GLOBALS['log']->fatal("{$this->name} for {$this->def['relationship']} failed to load\n");
     }
     //Following behavior is tied to a property(ignore_role) value in the vardef. It alters the values of 2 properties, ignore_role_filter and add_distinct.
     //the property values can be altered again before any requests are made.
     if (!empty($this->def) && is_array($this->def)) {
         if (array_key_exists('ignore_role', $this->def)) {
             if ($this->def['ignore_role']) {
                 $this->ignore_role_filter = true;
                 $this->add_distinct = true;
             }
         }
     }
 }
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:58,代码来源:Link2.php


示例11: setUp

 public function setUp()
 {
     $beanList = array();
     $beanFiles = array();
     require 'include/modules.php';
     $GLOBALS['beanList'] = $beanList;
     $GLOBALS['beanFiles'] = $beanFiles;
     $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
     $GLOBALS['current_user']->status = 'Active';
     $GLOBALS['current_user']->is_admin = 1;
     $GLOBALS['current_user']->save();
     $this->field = get_widget('varchar');
     $this->field->id = 'Accountstest_custom_c';
     $this->field->name = 'test_custom_c';
     $this->field->vanme = 'LBL_TEST_CUSTOM_C';
     $this->field->comments = NULL;
     $this->field->help = NULL;
     $this->field->custom_module = 'Accounts';
     $this->field->type = 'varchar';
     $this->field->label = 'LBL_TEST_CUSTOM_C';
     $this->field->len = 255;
     $this->field->required = 0;
     $this->field->default_value = NULL;
     $this->field->date_modified = '2009-09-14 02:23:23';
     $this->field->deleted = 0;
     $this->field->audited = 0;
     $this->field->massupdate = 0;
     $this->field->duplicate_merge = 0;
     $this->field->reportable = 1;
     $this->field->importable = 'true';
     $this->field->ext1 = NULL;
     $this->field->ext2 = NULL;
     $this->field->ext3 = NULL;
     $this->field->ext4 = NULL;
     $this->df = new DynamicField('Accounts');
     $this->mod = new Account();
     $this->df->setup($this->mod);
     $this->df->addFieldObject($this->field);
     $this->df->buildCache('Accounts');
     VardefManager::clearVardef();
     VardefManager::refreshVardefs('Accounts', 'Account');
     $this->mod->field_defs = $GLOBALS['dictionary']['Account']['fields'];
     $this->_contact = SugarTestContactUtilities::createContact();
     $this->_account = SugarTestAccountUtilities::createAccount();
     $this->_contact->load_relationship('accounts');
     $this->_contact->accounts->add($this->_account->id);
     $this->_account->test_custom_c = 'Custom Field';
     $this->_account->save();
     $GLOBALS['db']->commit();
     // Making sure we commit any changes
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:51,代码来源:Bug41985Test.php


示例12: getLinkedDefForModuleByRelationship

 /**
  * Find the link entry for a particular relationship and module.
  *
  * @param $module
  * @return array|bool
  */
 public function getLinkedDefForModuleByRelationship($module)
 {
     $results = VardefManager::getLinkFieldForRelationship($module, BeanFactory::getObjectName($module), $this->name);
     //Only a single link was found
     if (isset($results['name'])) {
         return $results;
     } else {
         if (is_array($results)) {
             $GLOBALS['log']->error("Warning: Multiple links found for relationship {$this->name} within module {$module}");
             return $this->getMostAppropriateLinkedDefinition($results);
         } else {
             return FALSE;
         }
     }
 }
开发者ID:samus-aran,项目名称:SuiteCRM,代码行数:21,代码来源:M2MRelationship.php


示例13: __construct

 public function __construct($def)
 {
     global $dictionary;
     $this->def = $def;
     $this->name = $def['name'];
     $this->selfReferencing = $def['lhs_module'] == $def['rhs_module'];
     $lhsModule = $def['lhs_module'];
     $rhsModule = $def['rhs_module'];
     if ($this->selfReferencing) {
         $links = VardefManager::getLinkFieldForRelationship($lhsModule, BeanFactory::getObjectName($lhsModule), $this->name);
         if (empty($links)) {
             $GLOBALS['log']->fatal("No Links found for relationship {$this->name}");
         } else {
             if (!isset($links[0]) && !isset($links['name'])) {
                 $GLOBALS['log']->fatal("Bad link found for relationship {$this->name}");
             } else {
                 if (!isset($links[1]) && isset($links['name'])) {
                     $this->lhsLinkDef = $this->rhsLinkDef = $links;
                 } else {
                     if (!empty($links[0]) && !empty($links[1])) {
                         if (!empty($links[0]['side']) && $links[0]['side'] == "right" || !empty($links[0]['link_type']) && $links[0]['link_type'] == "one") {
                             //$links[0] is the RHS
                             $this->lhsLinkDef = $links[1];
                             $this->rhsLinkDef = $links[0];
                         } else {
                             //$links[0] is the LHS
                             $this->lhsLinkDef = $links[0];
                             $this->rhsLinkDef = $links[1];
                         }
                     }
                 }
             }
         }
     } else {
         $this->lhsLinkDef = VardefManager::getLinkFieldForRelationship($lhsModule, BeanFactory::getObjectName($lhsModule), $this->name);
         $this->rhsLinkDef = VardefManager::getLinkFieldForRelationship($rhsModule, BeanFactory::getObjectName($rhsModule), $this->name);
         if (!isset($this->lhsLinkDef['name']) && isset($this->lhsLinkDef[0])) {
             $this->lhsLinkDef = $this->lhsLinkDef[0];
         }
         if (!isset($this->rhsLinkDef['name']) && isset($this->rhsLinkDef[0])) {
             $this->rhsLinkDef = $this->rhsLinkDef[0];
         }
     }
     $this->lhsLink = $this->lhsLinkDef['name'];
     $this->rhsLink = $this->rhsLinkDef['name'];
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:46,代码来源:One2MRelationship.php


示例14: 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


示例15: tearDown

 public function tearDown()
 {
     $GLOBALS['db']->dropTableName($this->_tablename . '_cstm');
     $GLOBALS['db']->query("DELETE FROM fields_meta_data WHERE id in ('Accountsbug34993_test_c', 'Accountsbug34993_test2_c')");
     if (isset($this->_old_installing)) {
         $GLOBALS['installing'] = $this->_old_installing;
     } else {
         unset($GLOBALS['installing']);
     }
     if (file_exists('custom/Extension/modules/Accounts/Ext/Vardefs/sugarfield_bug34993_test_c.php')) {
         unlink('custom/Extension/modules/Accounts/Ext/Vardefs/sugarfield_bug34993_test_c.php');
     }
     if (file_exists('custom/Extension/modules/Accounts/Ext/Vardefs/sugarfield_bug34993_test2_c.php')) {
         unlink('custom/Extension/modules/Accounts/Ext/Vardefs/sugarfield_bug34993_test2_c.php');
     }
     VardefManager::clearVardef('Accounts', 'Account');
     VardefManager::refreshVardefs('Accounts', 'Account');
 }
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:18,代码来源:Bug34993Test.php


示例16: setUp

 public function setUp()
 {
     $this->_soapURL = $GLOBALS['sugar_config']['site_url'] . '/service/v2/soap.php';
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('beanList');
     SugarTestHelper::setUp('current_user', array(true, 1));
     $this->field = get_widget('varchar');
     $this->field->id = 'Accountstest_custom_c';
     $this->field->name = 'test_custom_c';
     $this->field->vanme = 'LBL_TEST_CUSTOM_C';
     $this->field->comments = NULL;
     $this->field->help = NULL;
     $this->field->custom_module = 'Accounts';
     $this->field->type = 'varchar';
     $this->field->label = 'LBL_TEST_CUSTOM_C';
     $this->field->len = 255;
     $this->field->required = 0;
     $this->field->default_value = NULL;
     $this->field->date_modified = '2009-09-14 02:23:23';
     $this->field->deleted = 0;
     $this->field->audited = 0;
     $this->field->massupdate = 0;
     $this->field->duplicate_merge = 0;
     $this->field->reportable = 1;
     $this->field->importable = 'true';
     $this->field->ext1 = NULL;
     $this->field->ext2 = NULL;
     $this->field->ext3 = NULL;
     $this->field->ext4 = NULL;
     $this->df = new DynamicField('Accounts');
     $this->mod = new Account();
     $this->df->setup($this->mod);
     $this->df->addFieldObject($this->field);
     $this->df->buildCache('Accounts');
     VardefManager::clearVardef();
     VardefManager::refreshVardefs('Accounts', 'Account');
     $this->mod->field_defs = $GLOBALS['dictionary']['Account']['fields'];
     $this->_account = SugarTestAccountUtilities::createAccount();
     $this->_account->test_custom_c = 'Custom Field';
     $this->_account->save();
     $GLOBALS['db']->commit();
     // Making sure we commit any changes
     parent::setUp();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:44,代码来源:Bug51617Test.php


示例17: getCompareText

 /**
  * Generates field equality comparison PHP code
  *
  * @param WorkFlowTriggerShell $shell_object
  * @param bool $is_equal
  * @return string
  */
 private function getCompareText($shell_object, $is_equal)
 {
     global $dictionary;
     $parentWorkflow = $shell_object->get_workflow_type();
     if (empty($parentWorkflow->base_module)) {
         $GLOBALS['log']->error("WorkFlowTriggerShell ({$shell_object->id}) " . "parent WorkFlow ({$parentWorkflow->id}) has no base module set.");
     }
     $useStrict = true;
     $moduleName = $parentWorkflow->base_module;
     $objectName = BeanFactory::getObjectName($moduleName);
     $field = $shell_object->field;
     VardefManager::loadVardef($moduleName, $objectName);
     if (!empty($dictionary[$objectName]) && !empty($dictionary[$objectName]['fields'][$field])) {
         $vardef = $dictionary[$objectName]['fields'][$field];
         // Don't use strict for numerical types
         if (!empty($vardef['type']) && in_array($vardef['type'], array('currency', 'double', 'int'))) {
             $useStrict = false;
         }
         // Use to_display_date for Date fields
         if (!empty($vardef['type']) && in_array($vardef['type'], array('date'))) {
             $dateTimeFunction = 'to_display_date';
         }
         // Use to_display_date_time for DateTime fields
         if (!empty($vardef['type']) && in_array($vardef['type'], array('datetime', 'datetimecombo'))) {
             $dateTimeFunction = 'to_display_date_time';
         }
     }
     $sep = $is_equal ? '==' : '!=';
     if ($useStrict) {
         $sep .= '=';
     }
     $equalityCheck = "\$focus->fetched_row['" . $field . "'] " . $sep . " \$focus->" . $field;
     if (!empty($dateTimeFunction)) {
         $equalityCheck = "\$GLOBALS['timedate']->{$dateTimeFunction}(\$focus->fetched_row['" . $field . "'])" . " {$sep} " . "\$GLOBALS['timedate']->{$dateTimeFunction}(\$focus->" . $field . ")";
     }
     // Due to sidecar pushing unchanged fields, we need a check when that happens
     if (!$is_equal) {
         $equalityCheck .= " && !(\$focus->fetched_row['" . $field . "'] === null && strlen(\$focus->" . $field . ") === 0)";
     }
     return " (isset(\$focus->" . $field . ") && " . "(empty(\$focus->fetched_row) || array_key_exists('" . $field . "', \$focus->fetched_row)) " . "&& {$equalityCheck}) ";
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:48,代码来源:glue.php


示例18: run

 /**
  * {@inheritdoc}
  */
 public function run()
 {
     global $beanList;
     foreach ($beanList as $bean => $class) {
         $this->modules[strtolower($bean)] = $bean;
     }
     $needClearCache = false;
     foreach ($beanList as $bean => $class) {
         VardefManager::refreshVardefs($bean, $class);
         $seed = BeanFactory::getBean($bean);
         if ($seed instanceof SugarBean) {
             if (!$this->checkBean($seed)) {
                 SugarRelationshipFactory::rebuildCache();
                 $needClearCache = true;
             }
         }
     }
     if ($needClearCache) {
         $this->cleanCache();
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:24,代码来源:1_ClearVarDefs.php


示例19: array

 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected].
 *
 * 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 Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 ********************************************************************************/
$dictionary['AOK_KnowledgeBase'] = array('table' => 'aok_knowledgebase', 'audited' => true, 'duplicate_merge' => true, 'fields' => array('name' => array('name' => 'name', 'vname' => 'LBL_NAME', 'type' => 'name', 'link' => true, 'dbType' => 'varchar', 'len' => '255', 'unified_search' => false, 'full_text_search' => array('boost' => 3), 'required' => true, 'importable' => 'required', 'duplicate_merge' => 'disabled', 'merge_filter' => 'disabled', 'massupdate' => 0, 'no_default' => false, 'comments' => '', 'help' => '', 'duplicate_merge_dom_value' => '0', 'audited' => false, 'reportable' => true, 'size' => '20'), 'status' => array('required' => false, 'name' => 'status', 'vname' => 'LBL_STATUS', 'type' => 'enum', 'massupdate' => 0, 'default' => 'Draft', 'no_default' => false, 'comments' => '', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => '0', 'audited' => false, 'reportable' => true, 'unified_search' => false, 'merge_filter' => 'disabled', 'len' => 100, 'size' => '20', 'options' => 'aok_status_list', 'studio' => 'visible', 'dependency' => false), 'revision' => array('required' => false, 'name' => 'revision', 'vname' => 'LBL_REVISION', 'type' => 'varchar', 'massupdate' => 0, 'no_default' => false, 'comments' => '', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => '0', 'audited' => false, 'reportable' => true, 'unified_search' => false, 'merge_filter' => 'disabled', 'len' => '255', 'size' => '20'), 'description' => array('name' => 'description', 'vname' => 'LBL_DESCRIPTION', 'type' => 'text', 'comment' => 'Full text of the note', 'rows' => '6', 'cols' => '80', 'required' => false, 'massupdate' => 0, 'no_default' => false, 'comments' => 'Full text of the note', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => '0', 'audited' => false, 'reportable' => true, 'unified_search' => false, 'merge_filter' => 'disabled', 'size' => '20', 'studio' => 'visible'), 'additional_info' => array('name' => 'additional_info', 'vname' => 'LBL_ADDITIONAL_INFO', 'type' => 'text', 'comment' => 'Full text of the note', 'rows' => '6', 'cols' => '80', 'required' => false, 'massupdate' => 0, 'no_default' => false, 'comments' => 'Full text of the note', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => '0', 'audited' => false, 'reportable' => true, 'unified_search' => false, 'merge_filter' => 'disabled', 'size' => '20', 'studio' => 'visible'), 'user_id_c' => array('required' => false, 'name' => 'user_id_c', 'vname' => 'LBL_AUTHOR_USER_ID', 'type' => 'id', 'massupdate' => 0, 'no_default' => false, 'comments' => '', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => 0, 'audited' => false, 'reportable' => false, 'unified_search' => false, 'merge_filter' => 'disabled', 'len' => 36, 'size' => '20'), 'author' => array('required' => true, 'source' => 'non-db', 'name' => 'author', 'vname' => 'LBL_AUTHOR', 'type' => 'relate', 'massupdate' => 0, 'no_default' => false, 'comments' => '', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => '0', 'audited' => false, 'reportable' => true, 'unified_search' => false, 'merge_filter' => 'disabled', 'len' => '255', 'size' => '20', 'id_name' => 'user_id_c', 'ext2' => 'Users', 'module' => 'Users', 'rname' => 'name', 'quicksearch' => 'enabled', 'studio' => 'visible'), 'user_id1_c' => array('required' => false, 'name' => 'user_id1_c', 'vname' => 'LBL_APPROVER_USER_ID', 'type' => 'id', 'massupdate' => 0, 'no_default' => false, 'comments' => '', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => 0, 'audited' => false, 'reportable' => false, 'unified_search' => false, 'merge_filter' => 'disabled', 'len' => 36, 'size' => '20'), 'approver' => array('required' => false, 'source' => 'non-db', 'name' => 'approver', 'vname' => 'LBL_APPROVER', 'type' => 'relate', 'massupdate' => 0, 'no_default' => false, 'comments' => '', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => '0', 'audited' => false, 'reportable' => true, 'unified_search' => false, 'merge_filter' => 'disabled', 'len' => '255', 'size' => '20', 'id_name' => 'user_id1_c', 'ext2' => 'Users', 'module' => 'Users', 'rname' => 'name', 'quicksearch' => 'enabled', 'studio' => 'visible'), 'aok_knowledgebase_categories' => array('name' => 'aok_knowledgebase_categories', 'type' => 'link', 'relationship' => 'aok_knowledgebase_categories', 'source' => 'non-db', 'module' => 'AOK_Knowledge_Base_Categories', 'bean_name' => false, 'vname' => 'LBL_AOK_KB_CATEGORIES_TITLE')), 'relationships' => array(), 'optimistic_locking' => true, 'unified_search' => true);
if (!class_exists('VardefManager')) {
    require_once 'include/SugarObjects/VardefManager.php';
}
VardefManager::createVardef('AOK_KnowledgeBase', 'AOK_KnowledgeBase', array('basic', 'assignable', 'security_groups'));
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:30,代码来源:vardefs.php


示例20: array

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Variable类代码示例发布时间:2022-05-23
下一篇:
PHP VanillaController类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap