本文整理汇总了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);
}
示例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);
}
示例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);
}