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

PHP BeanFactory类代码示例

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

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



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

示例1: process

 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'ProjectTask');
     parent::process();
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"projectTaskQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"projecttask\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_projecttask\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('projectTaskQuickCreate');
     $focus = BeanFactory::getBean('ProjectTask');
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
     $json = getJSONobj();
     ///////////////////////////////////////
     ///
     /// SETUP PARENT POPUP
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'projectTypeQuickCreate', 'field_to_name_array' => array('id' => 'parent_id', 'name' => 'parent_name'));
     $encoded_parent_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_parent_popup_request_data', $encoded_parent_popup_request_data);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'projectTaskQuickCreate', 'field_to_name_array' => array('id' => 'account_id', 'name' => 'account_name'));
     $encoded_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'projectTaskQuickCreate', 'field_to_name_array' => array('id' => 'team_id', 'name' => 'team_name'));
     $this->ss->assign('encoded_team_popup_request_data', $json->encode($popup_request_data));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:30,代码来源:ProjectTaskQuickCreate.php


示例2: process

 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'Contracts');
     parent::process();
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"contractsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"contracts\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_contracts\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('contractsQuickCreate');
     $focus = BeanFactory::getBean('Contracts');
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $status_options = isset($focus->status) ? get_select_options_with_id($app_list_strings['contract_status_dom'], $focus->status) : get_select_options_with_id($app_list_strings['contract_status_dom'], '');
     $this->ss->assign('STATUS_OPTIONS', $status_options);
     $json = getJSONobj();
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'contractsQuickCreate', 'field_to_name_array' => array('id' => 'account_id', 'name' => 'account_name'));
     $encoded_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'contractsQuickCreate', 'field_to_name_array' => array('id' => 'team_id', 'name' => 'team_name'));
     $this->ss->assign('encoded_team_popup_request_data', $json->encode($popup_request_data));
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:ContractsQuickCreate.php


示例3: setUp

 public function setUp()
 {
     SugarTestHelper::setUp('beanList');
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('current_user');
     $this->case = BeanFactory::getBean('Cases');
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:7,代码来源:Bug63989Test.php


示例4: testGetLinkedBeans

 public function testGetLinkedBeans()
 {
     //Test the accounts_leads relationship
     $account = BeanFactory::newBean("Accounts");
     $account->name = "GetLinkedBeans Test Account";
     $account->save();
     $this->createdBeans[] = $account;
     $case = BeanFactory::newBean("Cases");
     $case->name = "GetLinkedBeans Test Cases";
     $case->save();
     $this->createdBeans[] = $case;
     $this->assertTrue($account->load_relationship("cases"));
     $this->assertInstanceOf("Link2", $account->cases);
     $this->assertTrue($account->cases->loadedSuccesfully());
     $account->cases->add($case);
     $account->save();
     $where = array('lhs_field' => 'id', 'operator' => ' LIKE ', 'rhs_value' => "{$case->id}");
     $cases = $account->get_linked_beans('cases', 'Case', array(), 0, 10, 0, $where);
     $this->assertEquals(1, count($cases), 'Assert that we have found the test case linked to the test account');
     $contact = BeanFactory::newBean("Contacts");
     $contact->first_name = "First Name GetLinkedBeans Test Contacts";
     $contact->last_name = "First Name GetLinkedBeans Test Contacts";
     $contact->save();
     $this->createdBeans[] = $contact;
     $this->assertTrue($account->load_relationship("contacts"));
     $this->assertInstanceOf("Link2", $account->contacts);
     $this->assertTrue($account->contacts->loadedSuccesfully());
     $account->contacts->add($contact);
     $where = array('lhs_field' => 'id', 'operator' => ' LIKE ', 'rhs_value' => "{$contact->id}");
     $contacts = $account->get_linked_beans('contacts', 'Contact', array(), 0, -1, 0, $where);
     $this->assertEquals(1, count($contacts), 'Assert that we have found the test contact linked to the test account');
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:32,代码来源:GetLinkedBeansTest.php


示例5: run

 public function run()
 {
     // this always needs to be ran
     // get the get_widget helper and the StandardField Helper
     require_once 'modules/DynamicFields/FieldCases.php';
     require_once 'modules/ModuleBuilder/parsers/StandardField.php';
     // we are working with opportunities
     $bean = BeanFactory::getBean('Opportunities');
     // get the field defs
     $field_defs = $bean->getFieldDefinition('sales_stage');
     // load the field type up
     $f = get_widget($field_defs['type']);
     // populate the row from the vardefs that were loaded
     $f->populateFromRow($field_defs);
     $this->log('Current Sales Stage Default is: ' . var_export($f->default, true));
     // lets always make sure that the default is in the list of options
     if (isset($f->options) && isset($GLOBALS['app_list_strings'][$f->options])) {
         if (!in_array($f->default, array_keys($GLOBALS['app_list_strings'][$f->options]))) {
             $this->log(var_export($f->default, true) . ' Is Not In The List Of Options');
             $f->default = array_shift(array_keys($GLOBALS['app_list_strings'][$f->options]));
             $f->default_value = array_shift(array_keys($GLOBALS['app_list_strings'][$f->options]));
             $this->log('New Sales Stage Default Is: ' . var_export($f->default, true));
             // save the changes to the field
             $df = new StandardField($bean->module_name);
             $df->setup($bean);
             $f->module = $bean;
             $f->save($df);
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:30,代码来源:6_OpportunityFixSalesStageDefault.php


示例6: save_lines

 function save_lines(array $post, AOR_Report $bean, $postKey)
 {
     $seenIds = array();
     if (isset($post[$postKey . 'id'])) {
         foreach ($post[$postKey . 'id'] as $key => $id) {
             if ($id) {
                 $aorChart = BeanFactory::getBean('AOR_Charts', $id);
             } else {
                 $aorChart = BeanFactory::newBean('AOR_Charts');
             }
             $aorChart->name = $post[$postKey . 'title'][$key];
             $aorChart->type = $post[$postKey . 'type'][$key];
             $aorChart->x_field = $post[$postKey . 'x_field'][$key];
             $aorChart->y_field = $post[$postKey . 'y_field'][$key];
             $aorChart->aor_report_id = $bean->id;
             $aorChart->save();
             $seenIds[] = $aorChart->id;
         }
     }
     //Any beans that exist but aren't in $seenIds must have been removed.
     foreach ($bean->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) {
         if (!in_array($chart->id, $seenIds)) {
             $chart->mark_deleted($chart->id);
         }
     }
 }
开发者ID:switcode,项目名称:SuiteCRM,代码行数:26,代码来源:AOR_Chart.php


示例7: process

 public function process()
 {
     // fetch the data from the filter end point
     $file = 'modules/ForecastWorksheets/clients/base/api/ForecastWorksheetsFilterApi.php';
     $klass = 'ForecastWorksheetsFilterApi';
     SugarAutoLoader::requireWithCustom('include/api/RestService.php');
     SugarAutoLoader::requireWithCustom($file);
     $klass = SugarAutoLoader::customClass($klass);
     /* @var $obj ForecastWorksheetsFilterApi */
     $obj = new $klass();
     $api = new RestService();
     $api->user = $GLOBALS['current_user'];
     $data = $obj->forecastWorksheetsGet($api, array('module' => 'ForecastWorksheets', 'timeperiod_id' => $this->getArg('timeperiod_id'), 'user_id' => $this->getArg('user_id')));
     $fields_array = array('date_closed' => 'date_closed', 'sales_stage' => 'sales_stage', 'name' => 'name', 'commit_stage' => 'commit_stage', 'probability' => 'probability');
     $admin = BeanFactory::getBean('Administration');
     $settings = $admin->getConfigForModule('Forecasts');
     if ($settings['show_worksheet_best']) {
         $fields_array['best_case'] = 'best_case';
     }
     if ($settings['show_worksheet_likely']) {
         $fields_array['likely_case'] = 'likely_case';
     }
     if ($settings['show_worksheet_worst']) {
         $fields_array['worst_case'] = 'worst_case';
     }
     $seed = BeanFactory::getBean('ForecastWorksheets');
     return $this->getContent($data['records'], $seed, $fields_array, 'commit_stage', $this->getArg('filters'));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:28,代码来源:Individual.php


示例8: init

 function init($module_name, $subPanelName)
 {
     $GLOBALS['log']->debug("in ParserModifySubPanel: module_name={$module_name} child_module={$subPanelName}");
     $this->moduleName = $module_name;
     $this->subPanelName = $subPanelName;
     global $beanList;
     // Sometimes we receive a module name which is not in the correct CamelCase, so shift to lower case for all beanList lookups
     $beanListLower = array_change_key_case($beanList);
     // Retrieve the definitions for all the available subpanels for this module
     $module = BeanFactory::newBeanByName($beanListLower[strtolower($this->moduleName)]);
     require_once 'include/SubPanel/SubPanelDefinitions.php';
     $spd = new SubPanelDefinitions($module);
     // Get the lists of fields already in the subpanel and those that can be added in
     // Get the fields lists from an aSubPanel object describing this subpanel from the SubPanelDefinitions object
     $this->originalListViewDefs = array();
     if (array_key_exists(strtolower($this->subPanelName), $spd->layout_defs['subpanel_setup'])) {
         $originalPanel = $spd->load_subpanel($this->subPanelName, true);
         $this->originalListViewDefs = $originalPanel->get_list_fields();
         $this->panel = $spd->load_subpanel($subPanelName, false);
         $this->listViewDefs = $this->panel->get_list_fields();
         // Retrieve a copy of the bean for the parent module of this subpanel - so we can find additional fields for the layout
         $subPanelParentModuleName = $this->panel->get_module_name();
         $this->subPanelParentModule = null;
         if (!empty($subPanelParentModuleName) && isset($beanListLower[strtolower($subPanelParentModuleName)])) {
             $this->subPanelParentModule = BeanFactory::newBeanByName($beanListLower[strtolower($subPanelParentModuleName)]);
         }
     }
     $this->language_module = $this->panel->template_instance->module_dir;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:29,代码来源:parser.modifysubpanel.php


示例9: displayList

 function displayList($layout_def)
 {
     global $app_strings;
     global $subpanel_item_count;
     $unique_id = $layout_def['subpanel_id'] . "_edit_" . $subpanel_item_count;
     //bug 51512
     if ($layout_def['EditView']) {
         // @see SugarWidgetSubPanelTopButtonQuickCreate::get_subpanel_relationship_name()
         $relationship_name = '';
         if (!empty($layout_def['linked_field'])) {
             $relationship_name = $layout_def['linked_field'];
             $bean = BeanFactory::getBean($layout_def['module']);
             if (!empty($bean->field_defs[$relationship_name]['relationship'])) {
                 $relationship_name = $bean->field_defs[$relationship_name]['relationship'];
             }
         }
         $handler = 'subp_nav(\'' . $layout_def['module'] . '\', \'' . $layout_def['fields']['ID'] . '\', \'e\', this';
         if (!empty($relationship_name)) {
             $handler .= ', \'' . $relationship_name . '\'';
         }
         $handler .= ');';
         return '<a href="#" onmouseover="' . $handler . '" onfocus="' . $handler . '" class="listViewTdToolsS1" id="' . $unique_id . '">' . $app_strings['LNK_EDIT'] . '</a>';
     }
     return '';
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:25,代码来源:SugarWidgetSubPanelEditButton.php


示例10: display

    /**
     * @see SugarView::display()
     */
    public function display()
    {
        $ss = new Sugar_Smarty();
        $ss->assign("MOD", $GLOBALS['mod_strings']);
        $ss->assign("INSTRUCTION", "<h1>Retrieve seller list from ebay</h1>");
        $bean = BeanFactory::getBean('xeBayAccounts');
        $resp = $bean->get_list("", "ebay_auth_token<>''", 0, -1, -1, 0, false, array('name'));
        if ($resp['row_count'] > 0) {
            $ebay_account_options = "<select name='ebay_account_name' id='ebay_account_name' title=''>";
            if ($resp['row_count'] > 1) {
                $ebay_account_options .= "<option value='All'>All</option>";
            }
            foreach ($resp['list'] as &$account) {
                $name = $account->name;
                $ebay_account_options .= "<option value='{$name}'>{$name}</option>";
            }
            $ebay_account_options .= "</select>";
            $ss->assign("EBAY_ACCOUNT_OPTIONS", $ebay_account_options);
        }
        $javascript = <<<EOQ
function ImportConfirm()
{
\t\treturn confirm("Do you want to retrieve seller list now ?");
}
EOQ;
        $ss->assign("JAVASCRIPT", $javascript);
        echo $ss->fetch("modules/xeBaySellerLists/tpls/import.tpl");
    }
开发者ID:sunmo,项目名称:snowlotus,代码行数:31,代码来源:view.import.php


示例11: __construct

 /**
  *
  * @global type $locale
  * @codeCoverageIgnore
  */
 public function __construct()
 {
     global $locale;
     $this->locale = $locale;
     $this->eventDefinitionBean = BeanFactory::getBean('pmse_BpmEventDefinition');
     parent::__construct();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:12,代码来源:PMSESendMessageEvent.php


示例12: addRecordsToProspectList

 /**
  * Add records to a specific prospect list
  *
  * @param $moduleName         the module name for the records that will be associated to the prospect list
  * @param $prospectListId the id of the prospect list
  * @param $recordIds      Array of record ids to be added to the prospect list
  * @return $results       Associative array containing status for each record.
  */
 public function addRecordsToProspectList($moduleName, $prospectListId, $recordIds)
 {
     $prospectList = BeanFactory::getBean("ProspectLists", $prospectListId, array('strict_retrieve' => true));
     if (empty($prospectList)) {
         return false;
     }
     $bean = BeanFactory::newBean($moduleName);
     $results = array();
     $relationship = '';
     foreach ($bean->get_linked_fields() as $field => $def) {
         if ($bean->load_relationship($field)) {
             if ($bean->{$field}->getRelatedModuleName() == 'ProspectLists') {
                 $relationship = $field;
                 break;
             }
         }
     }
     if ($relationship != '') {
         foreach ($recordIds as $id) {
             $retrieveResult = $bean->retrieve($id);
             if ($retrieveResult === null) {
                 $results[$id] = false;
             } else {
                 $bean->load_relationship($relationship);
                 $bean->prospect_lists->add($prospectListId);
                 $results[$id] = true;
             }
         }
     }
     return $results;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:39,代码来源:ProspectListsService.php


示例13: process

 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'Opportunities');
     $json = getJSONobj();
     parent::process();
     list($num_grp_sep, $dec_sep) = get_number_seperators();
     $this->ss->assign('NUM_GRP_SEP', $num_grp_sep);
     $this->ss->assign('DEC_SEP', $dec_sep);
     $this->ss->assign('CURRENCY_ID', $current_user->getPreference('currency'));
     $this->ss->assign("SALES_STAGE_OPTIONS", get_select_options_with_id($app_list_strings['sales_stage_dom'], ''));
     $this->ss->assign("LEAD_SOURCE_OPTIONS", get_select_options_with_id($app_list_strings['lead_source_dom'], ''));
     $this->ss->assign('prob_array', $json->encode($app_list_strings['sales_probability_dom']));
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"opportunitiesQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"opportunities\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_opportunities\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('opportunitiesQuickCreate');
     $focus = BeanFactory::getBean('Opportunities');
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:OpportunitiesQuickCreate.php


示例14: run

 public function run()
 {
     if (!($this->from_flavor == 'ce' && $this->toFlavor('pro'))) {
         return;
     }
     $result = $this->db->query("SELECT id, contents, assigned_user_id FROM user_preferences WHERE deleted = 0 AND category = 'Home'");
     if (empty($result)) {
         return $this->fail("Unable to upgrade dashlets");
     }
     while ($row = $this->db->fetchByAssoc($result)) {
         $content = unserialize(base64_decode($row['contents']));
         $assigned_user_id = $row['assigned_user_id'];
         $record_id = $row['id'];
         $current_user = BeanFactory::getBean('Users', $row['assigned_user_id']);
         if (!empty($content['dashlets']) && !empty($content['pages'])) {
             $originalDashlets = $content['dashlets'];
             foreach ($originalDashlets as $key => $ds) {
                 if (!empty($ds['options']['url']) && stristr($ds['options']['url'], 'http://www.sugarcrm.com/crm/product/gopro')) {
                     unset($originalDashlets[$key]);
                 }
             }
             $current_user->setPreference('dashlets', $originalDashlets, 0, 'Home');
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:25,代码来源:4_RemoveGopro.php


示例15: saveProjectData

 /**
  * Method to save record in database
  * @param $projectData
  * @return bool
  */
 public function saveProjectData($projectData)
 {
     $source_definition = json_decode($projectData['rst_source_definition']);
     if (isset($projectData[$this->suffix . 'name']) && !empty($projectData[$this->suffix . 'name'])) {
         $name = $this->getNameWithSuffix($projectData[$this->suffix . 'name']);
     } else {
         $name = $this->getNameWithSuffix($projectData[$this->name]);
     }
     $projectData['rst_uid'] = PMSEEngineUtils::generateUniqueID();
     $source_definition->name = $name;
     $source_definition->id = $projectData['rst_uid'];
     $projectData['rst_source_definition'] = json_encode($source_definition);
     unset($projectData[$this->id]);
     unset($projectData['rst_uid']);
     $new_uid = parent::saveProjectData($projectData);
     if ($new_uid) {
         // Update new id into 'rst_source_definition' field
         $br_bean = BeanFactory::getBean('pmse_Business_Rules', $new_uid);
         $def = json_decode($br_bean->rst_source_definition);
         $def->id = $new_uid;
         $br_bean->rst_source_definition = json_encode($def);
         $br_bean->save();
         return $new_uid;
     } else {
         return false;
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:32,代码来源:PMSEBusinessRuleImporter.php


示例16: run

 public function run()
 {
     if (!$this->toFlavor('ent') && !$this->toFlavor('ult') || !version_compare($this->from_version, '7.0', '<')) {
         return;
     }
     $settings = Opportunity::getSettings();
     if ($settings['opps_view_by'] !== 'RevenueLineItems') {
         $this->log('Not using Revenue Line Items; Skipping Upgrade Script');
         return;
     }
     // get the get_widget helper and the StandardField Helper
     require_once 'modules/DynamicFields/FieldCases.php';
     require_once 'modules/ModuleBuilder/parsers/StandardField.php';
     // we are working with opportunities
     $module = 'Opportunities';
     $bean = BeanFactory::getBean('Opportunities');
     // the field set we need
     $fields = array('best_case', 'amount', 'worst_case', 'date_closed');
     // loop over each field
     foreach ($fields as $field) {
         // get the field defs
         $field_defs = $bean->getFieldDefinition($field);
         // load the field type up
         $f = get_widget($field_defs['type']);
         // populate the row from the vardefs that were loaded
         $f->populateFromRow($field_defs);
         // lets make sure that the calculated is true
         $f->calculated = true;
         // now lets save, since these are OOB field, we use StandardField
         $df = new StandardField($module);
         $df->setup($bean);
         $f->module = $bean;
         $f->save($df);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:35,代码来源:7_OpportunityFixCalculatedFields.php


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


示例18: action_getInviteesPersonName

 public function action_getInviteesPersonName()
 {
     $personModules = array('Users', 'Contacts', 'Leads');
     $ret = array();
     $invitees = $_REQUEST['invitees'];
     foreach ($invitees as $invitee) {
         if (!isset($invitee['personName']) || !$invitee['personName']) {
             $person = BeanFactory::getBean($invitee['personModule'], $invitee['personModuleId']);
             $invitee['personName'] = $person->name;
         }
         if (isset($invitee['personModule']) && $invitee['personModule'] && in_array($invitee['personModule'], $personModules) && isset($invitee['personModuleId']) && $invitee['personModuleId'] && isset($invitee['personName']) && $invitee['personName']) {
             $ret[] = $invitee;
         }
     }
     //        $personModules = array('Users', 'Contacts', 'Leads');
     //        $retInvitees = array();
     //        foreach($invitees as $invitee) {
     //            if(isset($invitee['personModule']) && $invitee['personModule'] && in_array($invitee['personModule'], $personModules) && isset($invitee['personId']) && $invitee['personId'] && isset($invitee['personName']) && $invitee['personName']) {
     //                $retInvitees[] = $invitee;
     //            }
     //        }
     $inviteeJson = json_encode($ret);
     echo $inviteeJson;
     die;
 }
开发者ID:switcode,项目名称:SuiteCRM,代码行数:25,代码来源:controller.php


示例19: run

 /**
  * This method implements the run function of RunnableSchedulerJob and handles processing a SchedulersJob
  *
  * @param Mixed $data parameter passed in from the job_queue.data column when a SchedulerJob is run
  * @return bool true on success, false on error
  */
 public function run($data)
 {
     global $app_strings, $language;
     $app_strings = return_application_language($language);
     $admin = BeanFactory::getBean('Administration');
     $config = $admin->getConfigForModule('Forecasts', 'base');
     $timeperiodInterval = $config['timeperiod_interval'];
     $timeperiodLeafInterval = $config['timeperiod_leaf_interval'];
     $parentTimePeriod = TimePeriod::getLatest($timeperiodInterval);
     $latestTimePeriod = TimePeriod::getLatest($timeperiodLeafInterval);
     $currentTimePeriod = TimePeriod::getCurrentTimePeriod($timeperiodLeafInterval);
     if (empty($latestTimePeriod)) {
         $GLOBALS['log']->error(string_format($app_strings['ERR_TIMEPERIOD_TYPE_DOES_NOT_EXIST'], array($timeperiodLeafInterval)) . '[latest]');
         return false;
     } else {
         if (empty($currentTimePeriod)) {
             $GLOBALS['log']->error(string_format($app_strings['ERR_TIMEPERIOD_TYPE_DOES_NOT_EXIST'], array($timeperiodLeafInterval)) . ' [current]');
             return false;
         } else {
             if (empty($parentTimePeriod)) {
                 $GLOBALS['log']->error(string_format($app_strings['ERR_TIMEPERIOD_TYPE_DOES_NOT_EXIST'], array($timeperiodLeafInterval)) . ' [parent]');
                 return false;
             }
         }
     }
     $timedate = TimeDate::getInstance();
     //We run the rebuild command if the latest TimePeriod is less than the specified configuration interval
     //from the current TimePeriod
     $correctStartDate = $timedate->fromDbDate($currentTimePeriod->start_date);
     $latestStartDate = $timedate->fromDbDate($latestTimePeriod->start_date);
     $shownForward = $config['timeperiod_shown_forward'];
     //Move the current start date forward by the leaf period amounts
     for ($x = 0; $x < $shownForward; $x++) {
         $correctStartDate->modify($parentTimePeriod->next_date_modifier);
     }
     $leafCycle = $latestTimePeriod->leaf_cycle;
     //If the current start data that was modified according to the shown forward period is past the latest
     //leaf period we need to build more timeperiods
     while ($correctStartDate > $latestStartDate) {
         //We need to keep creating leaf periods until we are in sync.
         //If the leaf period we need to create is the start of the leaf cycle
         //then we should also create the parent TimePeriod record.
         $startDate = $latestStartDate->modify($latestTimePeriod->next_date_modifier);
         $leafCycle = $leafCycle == $parentTimePeriod->leaf_periods ? 1 : $leafCycle + 1;
         if ($leafCycle == 1) {
             $parentTimePeriod = TimePeriod::getByType($timeperiodInterval);
             $parentTimePeriod->setStartDate($startDate->asDbDate());
             $parentTimePeriod->name = $parentTimePeriod->getTimePeriodName($leafCycle);
             $parentTimePeriod->save();
         }
         $leafTimePeriod = TimePeriod::getByType($timeperiodLeafInterval);
         $leafTimePeriod->setStartDate($startDate->asDbDate());
         $leafTimePeriod->name = $leafTimePeriod->getTimePeriodName($leafCycle, $parentTimePeriod);
         $leafTimePeriod->leaf_cycle = $leafCycle;
         $leafTimePeriod->parent_id = $parentTimePeriod->id;
         $leafTimePeriod->save();
     }
     $this->job->succeedJob();
     return true;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:66,代码来源:SugarJobCreateNextTimePeriod.php


示例20: export

 public function export(ServiceBase $api, $args = array())
 {
     ob_start();
     // Load up a seed bean
     $seed = BeanFactory::getBean('ForecastWorksheets');
     if (!$seed->ACLAccess('list')) {
         throw new SugarApiExceptionNotAuthorized('No access to view records for module: ' . $seed->object_name);
     }
     $args['timeperiod_id'] = isset($args['timeperiod_id']) ? $args['timeperiod_id'] : TimePeriod::getCurrentId();
     $args['user_id'] = isset($args['user_id']) ? $args['user_id'] : $api->user->id;
     if (!isset($args['filters'])) {
         $args['filters'] = array();
     } elseif (!is_array($args['filters'])) {
         $args['filters'] = array($args['filters']);
     }
     // don't allow encoding to html for data used in export
     $args['encode_to_html'] = false;
     // base file and class name
     $file = 'include/SugarForecasting/Export/Individual.php';
     $klass = 'SugarForecasting_Export_Individual';
     // check for a custom file exists
     SugarAutoLoader::requireWithCustom($file);
     $klass = SugarAutoLoader::customClass($klass);
     // create the class
     /* @var $obj SugarForecasting_Export_AbstractExport */
     $obj = new $klass($args);
     $content = $obj->process($api);
     ob_end_clean();
     return $this->doExport($api, $obj->getFilename(), $content);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:30,代码来源:ForecastWorksheetsExportApi.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BeanFinder类代码示例发布时间:2022-05-23
下一篇:
PHP Batches类代码示例发布时间: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