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


PHP CustomView_Record_Model::setModule方法代码示例

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


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

示例1: showAdvancedSearch

 /**
  * Function to display the UI for advance search on any of the module
  * @param Vtiger_Request $request
  */
 function showAdvancedSearch(Vtiger_Request $request)
 {
     //Modules for which search is excluded
     $excludedModuleForSearch = array('Vtiger', 'Reports');
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     if ($request->get('source_module')) {
         $moduleName = $request->get('source_module');
     }
     $saveFilterPermitted = true;
     $saveFilterexcludedModules = array('ModComments', 'RSS', 'Portal', 'Integration', 'PBXManager', 'DashBoard');
     if (in_array($moduleName, $saveFilterexcludedModules)) {
         $saveFilterPermitted = false;
     }
     //See if it is an excluded module, If so search in home module
     if (in_array($moduleName, $excludedModuleForSearch)) {
         $moduleName = 'Home';
     }
     $module = $request->getModule();
     $customViewModel = new CustomView_Record_Model();
     $customViewModel->setModule($moduleName);
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     $viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
     $viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
     if ($moduleName == 'Calendar') {
         $advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
     } else {
         $advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
     }
     $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
     $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
     $dateFilters = Vtiger_Field_Model::getDateFilterTypes();
     foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
         $comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
         $comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
         $comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('SOURCE_MODULE', $moduleName);
     $viewer->assign('SOURCE_MODULE_MODEL', $moduleModel);
     $viewer->assign('MODULE', $module);
     $viewer->assign('SAVE_FILTER_PERMITTED', $saveFilterPermitted);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     echo $viewer->view('AdvanceSearch.tpl', $moduleName, true);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:52,代码来源:BasicAjax.php

示例2: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->get('source_module');
     $module = $request->getModule();
     $record = $request->get('record');
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     if (!empty($record)) {
         $customViewModel = CustomView_Record_Model::getInstanceById($record);
         $viewer->assign('MODE', 'edit');
     } else {
         $customViewModel = new CustomView_Record_Model();
         $customViewModel->setModule($moduleName);
         $viewer->assign('MODE', '');
     }
     $viewer->assign('ADVANCE_CRITERIA', $customViewModel->transformToNewAdvancedFilter());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('DATE_FILTERS', Vtiger_Field_Model::getDateFilterTypes());
     if ($moduleName == 'Calendar') {
         $advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
     } else {
         $advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
     }
     $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
     $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
     $dateFilters = Vtiger_Field_Model::getDateFilterTypes();
     foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
         $comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
         $comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
         $comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
     $viewer->assign('RECORD_ID', $record);
     $viewer->assign('MODULE', $module);
     $viewer->assign('SOURCE_MODULE', $moduleName);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('CV_PRIVATE_VALUE', CustomView_Record_Model::CV_STATUS_PRIVATE);
     $viewer->assign('CV_PENDING_VALUE', CustomView_Record_Model::CV_STATUS_PENDING);
     $viewer->assign('CV_PUBLIC_VALUE', CustomView_Record_Model::CV_STATUS_PUBLIC);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     echo $viewer->view('EditView.tpl', $module, true);
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:47,代码来源:EditAjax.php

示例3: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->get('source_module');
     $module = $request->getModule();
     $record = $request->get('record');
     $duplicate = $request->get('duplicate');
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($moduleModel);
     if (!empty($record)) {
         $customViewModel = CustomView_Record_Model::getInstanceById($record);
         $viewer->assign('MODE', 'edit');
     } else {
         $customViewModel = new CustomView_Record_Model();
         $customViewModel->setModule($moduleName);
         $viewer->assign('MODE', '');
     }
     $viewer->assign('ADVANCE_CRITERIA', $customViewModel->transformToNewAdvancedFilter());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('DATE_FILTERS', Vtiger_Field_Model::getDateFilterTypes());
     if ($moduleName == 'Calendar') {
         $advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
     } else {
         $advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
     }
     $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
     $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
     $dateFilters = Vtiger_Field_Model::getDateFilterTypes();
     foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
         $comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
         $comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
         $comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $recordStructure = $recordStructureInstance->getStructure();
     // for Inventory module we should now allow item details block
     if (in_array($moduleName, getInventoryModules())) {
         $itemsBlock = "LBL_ITEM_DETAILS";
         unset($recordStructure[$itemsBlock]);
     }
     $viewer->assign('RECORD_STRUCTURE', $recordStructure);
     // Added to show event module custom fields
     if ($moduleName == 'Calendar') {
         $relatedModuleName = 'Events';
         $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModuleName);
         $relatedRecordStructureInstance = Vtiger_RecordStructure_Model::getInstanceForModule($relatedModuleModel);
         $eventBlocksFields = $relatedRecordStructureInstance->getStructure();
         $viewer->assign('EVENT_RECORD_STRUCTURE_MODEL', $relatedRecordStructureInstance);
         $viewer->assign('EVENT_RECORD_STRUCTURE', $eventBlocksFields);
     }
     $viewer->assign('CUSTOMVIEW_MODEL', $customViewModel);
     if ($duplicate != '1') {
         $viewer->assign('RECORD_ID', $record);
     }
     $viewer->assign('MODULE', $module);
     $viewer->assign('SOURCE_MODULE', $moduleName);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     if ($customViewModel->get('viewname') == 'All') {
         $viewer->assign('CV_PRIVATE_VALUE', CustomView_Record_Model::CV_STATUS_DEFAULT);
     } else {
         $viewer->assign('CV_PRIVATE_VALUE', CustomView_Record_Model::CV_STATUS_PRIVATE);
     }
     $viewer->assign('CV_PENDING_VALUE', CustomView_Record_Model::CV_STATUS_PENDING);
     $viewer->assign('CV_PUBLIC_VALUE', CustomView_Record_Model::CV_STATUS_PUBLIC);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     echo $viewer->view('EditView.tpl', $module, true);
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:69,代码来源:EditAjax.php


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