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


PHP Vtiger_Field_Model::getAdvancedFilterOptions方法代码示例

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


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

示例1: preProcess

 function preProcess(Vtiger_Request $request)
 {
     parent::preProcess($request);
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $recordId = $request->get('record');
     $page = $request->get('page');
     $detailViewModel = Reports_DetailView_Model::getInstance($moduleName, $recordId);
     $reportModel = $detailViewModel->getRecord();
     $reportModel->setModule('Reports');
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $page);
     $pagingModel->set('limit', self::REPORT_LIMIT);
     $this->reportData = $reportModel->getReportData($pagingModel);
     $this->calculationFields = $reportModel->getReportCalulationData();
     $primaryModule = $reportModel->getPrimaryModule();
     $secondaryModules = $reportModel->getSecondaryModules();
     $primaryModuleModel = Vtiger_Module_Model::getInstance($primaryModule);
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
     $permission = $userPrivilegesModel->hasModulePermission($primaryModuleModel->getId());
     if (!$permission) {
         $viewer->assign('MODULE', $primaryModule);
         $viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
         $viewer->view('OperationNotPermitted.tpl', $primaryModule);
         exit;
     }
     $detailViewLinks = $detailViewModel->getDetailViewLinks();
     // Advanced filter conditions
     $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
     $viewer->assign('PRIMARY_MODULE', $primaryModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
     $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
     $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
     $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
     $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
     $secondaryModuleIsCalendar = strpos($secondaryModules, 'Calendar');
     if ($primaryModule == 'Calendar' || $secondaryModuleIsCalendar !== FALSE) {
         $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('LINEITEM_FIELD_IN_CALCULATION', $reportModel->showLineItemFieldsInFilter(false));
     $viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
     $viewer->assign('REPORT_MODEL', $reportModel);
     $viewer->assign('RECORD_ID', $recordId);
     $viewer->assign('COUNT', count($this->reportData));
     $viewer->assign('MODULE', $moduleName);
     $viewer->view('ReportHeader.tpl', $moduleName);
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:60,代码来源:Detail.php

示例2: preProcess

 function preProcess(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $recordId = $request->get('record');
     $this->record = $detailViewModel = Reports_DetailView_Model::getInstance($moduleName, $recordId);
     parent::preProcess($request);
     $reportModel = $detailViewModel->getRecord();
     $reportModel->setModule('Reports');
     $primaryModule = $reportModel->getPrimaryModule();
     $secondaryModules = $reportModel->getSecondaryModules();
     $primaryModuleModel = Vtiger_Module_Model::getInstance($primaryModule);
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
     $permission = $userPrivilegesModel->hasModulePermission($primaryModuleModel->getId());
     if (!$permission) {
         $viewer->assign('MODULE', $primaryModule);
         $viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
         $viewer->view('OperationNotPermitted.tpl', $primaryModule);
         exit;
     }
     $isAdmin = $currentUser->isAdminUser();
     $viewer->assign('isAdmin', $isAdmin);
     // Advanced filter conditions
     $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
     $viewer->assign('PRIMARY_MODULE', $primaryModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
     $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
     $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
     $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
     $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
     $secondaryModuleIsCalendar = strpos($secondaryModules, 'Calendar');
     if ($primaryModule == 'Calendar' || $secondaryModuleIsCalendar !== FALSE) {
         $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'], $moduleName);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $reportChartModel = Reports_Chart_Model::getInstanceById($reportModel);
     $viewer->assign('PRIMARY_MODULE_FIELDS', $reportModel->getPrimaryModuleFieldsForAdvancedReporting());
     $viewer->assign('SECONDARY_MODULE_FIELDS', $reportModel->getSecondaryModuleFieldsForAdvancedReporting());
     $viewer->assign('CALCULATION_FIELDS', $reportModel->getModuleCalculationFieldsForReport());
     $viewer->assign('DATE_FILTERS', $dateFilters);
     $viewer->assign('REPORT_MODEL', $reportModel);
     $viewer->assign('RECORD', $recordId);
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('CHART_MODEL', $reportChartModel);
     $viewer->view('ChartReportHeader.tpl', $moduleName);
 }
开发者ID:wsLapshin,项目名称:charter_crm,代码行数:57,代码来源:ChartDetail.php

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

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

示例5: process

 public function process(Vtiger_Request $request)
 {
     $primaryModule = $request->get('primodule');
     $secondaryModules = $request->get('secmodule');
     $record = $request->get('record');
     $reportModel = Reports_Record_Model::getCleanInstance($record);
     /*if (!empty($record)) {
               $viewer->assign('SELECTED_STANDARD_FILTER_FIELDS', $reportModel->getSelectedStandardFilter());
               $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
       }*/
     $reportModel->setPrimaryModule($primaryModule);
     if (!empty($secondaryModules)) {
         $reportModel->setSecondaryModule($secondaryModules);
     }
     $viewer = $this->getViewer($request);
     $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
     $viewer->assign('PRIMARY_MODULE', $primaryModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
     $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
     $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
     $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
     $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
     //$viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $reportModel->getPrimaryModuleRecordStructure());
     //$viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $reportModel->getSecondaryModuleRecordStructure());
     $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
     $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', Vtiger_Field_Model::getAdvancedFilterOpsByFieldType());
     $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);
     echo $viewer->view('BlockFilters.tpl', 'PDFMaker', true);
     /*
     $content = $viewer->view('BlockFilters.tpl', 'PDFMaker',true);
     echo "aaaaaaaaa"; 
     
     /*
     $response = new Vtiger_Response();
     $response->setResult($content);
     $response->emit();
     */
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:45,代码来源:GetRelatedBlockFilters.php

示例6: step2

 function step2(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $reportModel = Reports_Record_Model::getCleanInstance($record);
     if (!empty($record) && !$request->get('isDuplicate')) {
         $viewer->assign('SELECTED_STANDARD_FILTER_FIELDS', $reportModel->getSelectedStandardFilter());
         $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
     }
     $data = $request->getAll();
     foreach ($data as $name => $value) {
         $reportModel->set($name, $value);
     }
     $primaryModule = $request->get('primary_module');
     $secondaryModules = $request->get('secondary_modules');
     $reportModel->setPrimaryModule($primaryModule);
     if (!empty($secondaryModules)) {
         $secondaryModules = implode(':', $secondaryModules);
         $reportModel->setSecondaryModule($secondaryModules);
         $secondaryModules = explode(':', $secondaryModules);
     } else {
         $secondaryModules = array();
     }
     $viewer->assign('RECORD_ID', $record);
     $viewer->assign('REPORT_MODEL', $reportModel);
     $viewer->assign('PRIMARY_MODULE', $primaryModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
     $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
     $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
     $viewer->assign('SECONDARY_MODULES', $secondaryModules);
     $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
     $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
     $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'], $moduleName);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     if ($primaryModule == 'Calendar' || in_array('Calendar', $secondaryModules)) {
         $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);
     $viewer->assign('MODULE', $moduleName);
     $calculationFields = $reportModel->get('calculation_fields');
     if ($calculationFields) {
         $calculationFields = Zend_Json::decode($calculationFields);
         $viewer->assign('LINEITEM_FIELD_IN_CALCULATION', $reportModel->showLineItemFieldsInFilter($calculationFields));
     }
     if ($request->get('isDuplicate')) {
         $viewer->assign('IS_DUPLICATE', true);
     }
     $viewer->view('ChartEditStep2.tpl', $moduleName);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:59,代码来源:ChartEdit.php

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

示例8: step3

 function step3(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $reportModel = Reports_Record_Model::getCleanInstance($record);
     if (!empty($record)) {
         $viewer->assign('SELECTED_STANDARD_FILTER_FIELDS', $reportModel->getSelectedStandardFilter());
         $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
     }
     $data = $request->getAll();
     foreach ($data as $name => $value) {
         if ($name == 'schdayoftheweek' || $name == 'schdayofthemonth' || $name == 'schannualdates' || $name == 'recipients') {
             $value = Zend_Json::decode($value);
             if (!is_array($value)) {
                 // need to save these as json data
                 $value = array($value);
             }
         }
         $reportModel->set($name, $value);
     }
     $primaryModule = $request->get('primary_module');
     $secondaryModules = $request->get('secondary_modules');
     $reportModel->setPrimaryModule($primaryModule);
     if (!empty($secondaryModules)) {
         $secondaryModules = implode(':', $secondaryModules);
         $reportModel->setSecondaryModule($secondaryModules);
         $secondaryModules = explode(':', $secondaryModules);
     } else {
         $secondaryModules = array();
     }
     $viewer->assign('RECORD_ID', $record);
     $viewer->assign('REPORT_MODEL', $reportModel);
     $viewer->assign('PRIMARY_MODULE', $primaryModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
     $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
     $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
     //TODO : We need to remove "update_log" field from "HelpDesk" module in New Look
     // after removing old look we need to remove this field from crm
     if ($primaryModule == 'HelpDesk') {
         foreach ($primaryModuleRecordStructure as $blockLabel => $blockFields) {
             foreach ($blockFields as $field => $object) {
                 if ($field == 'update_log') {
                     unset($primaryModuleRecordStructure[$blockLabel][$field]);
                 }
             }
         }
     }
     if (!empty($secondaryModuleRecordStructures)) {
         foreach ($secondaryModuleRecordStructures as $module => $structure) {
             if ($module == 'HelpDesk') {
                 foreach ($structure as $blockLabel => $blockFields) {
                     foreach ($blockFields as $field => $object) {
                         if ($field == 'update_log') {
                             unset($secondaryModuleRecordStructures[$module][$blockLabel][$field]);
                         }
                     }
                 }
             }
         }
     }
     // End
     $viewer->assign('SECONDARY_MODULES', $secondaryModules);
     $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
     $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
     $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'], $moduleName);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     if ($primaryModule == 'Calendar' || in_array('Calendar', $secondaryModules)) {
         $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);
     $viewer->assign('MODULE', $moduleName);
     $calculationFields = $reportModel->get('calculation_fields');
     if ($calculationFields) {
         $calculationFields = Zend_Json::decode($calculationFields);
         $viewer->assign('LINEITEM_FIELD_IN_CALCULATION', $reportModel->showLineItemFieldsInFilter($calculationFields));
     }
     if ($request->get('isDuplicate')) {
         $viewer->assign('IS_DUPLICATE', true);
     }
     $viewer->view('step3.tpl', $moduleName);
 }
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:91,代码来源:Edit.php

示例9: preProcess

 function preProcess(Vtiger_Request $request)
 {
     parent::preProcess($request);
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $recordId = $request->get('record');
     $page = $request->get('page');
     $detailViewModel = Reports_DetailView_Model::getInstance($moduleName, $recordId);
     $reportModel = $detailViewModel->getRecord();
     $reportModel->setModule('Reports');
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $page);
     $pagingModel->set('limit', self::REPORT_LIMIT);
     $reportData = $reportModel->getReportData($pagingModel);
     $this->reportData = $reportData['data'];
     $this->calculationFields = $reportModel->getReportCalulationData();
     $count = $reportData['count'];
     if ($count < 1000) {
         $this->count = $count;
     } else {
         $query = $reportModel->getReportSQL(false, 'PDF');
         $countQuery = $reportModel->generateCountQuery($query);
         $this->count = $reportModel->getReportsCount($countQuery);
     }
     $primaryModule = $reportModel->getPrimaryModule();
     $secondaryModules = $reportModel->getSecondaryModules();
     $primaryModuleModel = Vtiger_Module_Model::getInstance($primaryModule);
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
     $permission = $userPrivilegesModel->hasModulePermission($primaryModuleModel->getId());
     if (!$permission) {
         $viewer->assign('MODULE', $primaryModule);
         $viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
         $viewer->view('OperationNotPermitted.tpl', $primaryModule);
         exit;
     }
     $detailViewLinks = $detailViewModel->getDetailViewLinks();
     // Advanced filter conditions
     $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
     $viewer->assign('PRIMARY_MODULE', $primaryModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
     $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
     $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
     //TODO : We need to remove "update_log" field from "HelpDesk" module in New Look
     // after removing old look we need to remove this field from crm
     if ($primaryModule == 'HelpDesk') {
         foreach ($primaryModuleRecordStructure as $blockLabel => $blockFields) {
             foreach ($blockFields as $field => $object) {
                 if ($field == 'update_log') {
                     unset($primaryModuleRecordStructure[$blockLabel][$field]);
                 }
             }
         }
     }
     if (!empty($secondaryModuleRecordStructures)) {
         foreach ($secondaryModuleRecordStructures as $module => $structure) {
             if ($module == 'HelpDesk') {
                 foreach ($structure as $blockLabel => $blockFields) {
                     foreach ($blockFields as $field => $object) {
                         if ($field == 'update_log') {
                             unset($secondaryModuleRecordStructures[$module][$blockLabel][$field]);
                         }
                     }
                 }
             }
         }
     }
     // End
     $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
     $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
     $secondaryModuleIsCalendar = strpos($secondaryModules, 'Calendar');
     if ($primaryModule == 'Calendar' || $secondaryModuleIsCalendar !== FALSE) {
         $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('LINEITEM_FIELD_IN_CALCULATION', $reportModel->showLineItemFieldsInFilter(false));
     $viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
     $viewer->assign('REPORT_MODEL', $reportModel);
     $viewer->assign('RECORD_ID', $recordId);
     $viewer->assign('COUNT', $this->count);
     $viewer->assign('MODULE', $moduleName);
     // SalesPlatform.ru begin
     // If it is a custom report
     if (in_array($reportModel->getReportType(), getCustomReportsList())) {
         // Only equals filter
         $customAdvanceFilterOpsByFieldType = array('V' => array('e'), 'N' => array('e'), 'T' => array('e'), 'I' => array('e'), 'C' => array('e'), 'D' => array('e'), 'DT' => array('e'), 'I' => array('e'), 'NN' => array('e'), 'E' => array('e'));
         $spPaymentsRecordStructure = $recordStructureInstance->getStructure('SPPayments');
         foreach ($spPaymentsRecordStructure as $blockLabel => $blockFields) {
             foreach ($blockFields as $field => $object) {
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:101,代码来源:Detail.php

示例10: process


//.........这里部分代码省略.........
         $result2 = $adb->pquery($sql2, array($record));
         $num_rows2 = $adb->num_rows($result2);
         if ($num_rows2 > 0) {
             $datecolumnname = $adb->query_result($result2, 0, "datecolumnname");
             $stdselectedfilter = $adb->query_result($result2, 0, "datefilter");
             $startdate = $adb->query_result($result2, 0, "startdate");
             $enddate = $adb->query_result($result2, 0, "enddate");
             if ($startdate != "" && $startdate != "0000-00-00") {
                 $viewer->assign("STARTDATE_STD", getValidDisplayDate($startdate));
             }
             if ($enddate != "" && $startdate != "0000-00-00") {
                 $viewer->assign("ENDDATE_STD", getValidDisplayDate($enddate));
             }
         }
         $module_list = $RelatedBlock->getModuleList($sec_module);
         $options1 = $RelatedBlock->getStdCriteriaByModule($sec_module, $module_list, $current_user);
         if (count($options1) > 0) {
             foreach ($options1 as $value => $label) {
                 if ($value == $datecolumnname) {
                     $sel = "selected";
                 } else {
                     $sel = "";
                 }
                 $columns1 .= "<option value='" . $value . "' " . $sel . ">" . $label . "</option>";
             }
         }
         $columns2 = "";
         foreach ($module_list as $blockid => $optgroup) {
             $options2 = $RelatedBlock->getColumnsListbyBlock($sec_module, $blockid, $rel_module, $current_user);
             if (count($options2) > 0) {
                 $columns2 .= "<optgroup label='" . $optgroup . "'>";
                 foreach ($options2 as $value => $label) {
                     $columns2 .= "<option value='" . $value . "'>" . $label . "</option>";
                 }
                 $columns2 .= "</optgroup>";
             }
         }
         $selected_columns = $this->getSelectedColumnsList($rel_module, $sec_module, $record, $current_user);
         list($sortCols, $sortOrder) = $this->getSortColumns($record, $selected_columns);
         $step = 3;
         $mode = 'edit';
         $RelatedBlock->setId($record);
         $reportModel = Reports_Record_Model::getCleanInstance('');
         $reportModel->setPrimaryModule($rel_module);
         $RelatedBlock->setPrimaryModule($rel_module);
         if (!empty($sec_module)) {
             $RelatedBlock->setSecondaryModule($sec_module);
             $reportModel->setSecondaryModule($sec_module);
         }
         $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $RelatedBlock->transformToNewAdvancedFilter());
         $viewer->assign('PRIMARY_MODULE', $primaryModule);
         $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
         $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
         $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
         $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
         $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
         $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
         $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', Vtiger_Field_Model::getAdvancedFilterOpsByFieldType());
         $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('PRIMARY_MODULE_FIELDS', $reportModel->getPrimaryModuleFields());
         $viewer->assign('SECONDARY_MODULE_FIELDS', $reportModel->getSecondaryModuleFields());
         $viewer->assign('SELECTED_SORT_FIELDS', $RelatedBlock->getSelectedSortFields());
     } else {
         $primaryModule = $request->get('primarymodule');
         $secondaryModules = $request->get('secondarymodule');
         $rel_module = $_REQUEST["pdfmodule"];
         $block = "";
         $record = "";
         $blockname = "";
         $columns = "";
         $columns2 = "";
         $selected_columns = "";
         $sortCols = "";
         $sortOrder = "";
         $stdselectedfilter = "";
         $mode = 'create';
     }
     $viewer->assign("MODE", $mode);
     $viewer->assign("RECORD", $record);
     $viewer->assign("BLOCKNAME", $blockname);
     $Related_Modules = PDFMaker_RelatedBlock_Model::getRelatedModulesList($rel_module);
     if ($record == "") {
         $sec_module = $Related_Modules[0];
     }
     $viewer->assign("SEC_MODULE", $sec_module);
     $viewer->assign("RELATED_MODULES", $Related_Modules);
     $version = PDFMaker_Version_Helper::$version;
     $viewer->assign("VERSION", $version);
     $viewer->assign("REL_MODULE", $rel_module);
     $viewer->assign("RELATEDBLOCK", $block);
     $viewer->assign("STEP", $step);
     $viewer->view('EditRelatedBlock.tpl', 'PDFMaker');
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:101,代码来源:EditRelatedBlock.php


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