本文整理汇总了PHP中Vtiger_Index_View::preProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Index_View::preProcess方法的具体用法?PHP Vtiger_Index_View::preProcess怎么用?PHP Vtiger_Index_View::preProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Index_View
的用法示例。
在下文中一共展示了Vtiger_Index_View::preProcess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
global $current_user;
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$listViewModel = Vtiger_ListView_Model::getInstance($moduleName);
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($moduleName));
$this->viewName = $request->get('viewname');
if (empty($this->viewName)) {
//If not view name exits then get it from custom view
//This can return default view id or view id present in session
$customView = new CustomView();
$this->viewName = $customView->getViewId($moduleName);
}
$quickLinkModels = $listViewModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $quickLinkModels);
$this->initializeListViewContents($request, $viewer);
$viewer->assign('VIEWID', $this->viewName);
//Modified by jmangarret 16jun2015
$viewer->assign('ROLEID', $current_user->roleid);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例2: 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);
}
示例3: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request);
$viewer = $this->getViewer($request);
$this->initializeListViewContents($request, $viewer);
$viewer->view('ListViewHeader.tpl', $request->getModule(false));
}
示例4: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$recordId = $request->get('record');
$moduleName = $request->getModule();
if (!$this->record) {
$this->record = EmailTemplates_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
$detailViewLinks = $this->record->getDetailViewLinks($detailViewLinkParams);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_MODEL', $this->record->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('IS_EDITABLE', $this->record->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $this->record->getRecord()->isDeletable($moduleName));
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $this->record->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$viewer->assign('DEFAULT_RECORD_VIEW', $currentUserModel->get('default_record_view'));
$viewer->assign('NO_PAGINATION', true);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例5: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$dashBoardModel = Vtiger_DashBoard_Model::getInstance($moduleName);
//check profile permissions for Dashboards
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$permission = $userPrivilegesModel->hasModulePermission($moduleModel->getId());
if ($permission) {
$dashBoardModel->verifyDashboard($moduleName);
$widgets = $dashBoardModel->getDashboards('Header');
} else {
$widgets = array();
}
$viewer->assign('USER_PRIVILEGES_MODEL', $userPrivilegesModel);
$viewer->assign('MODULE_PERMISSION', $permission);
$viewer->assign('WIDGETS', $widgets);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('MODULE_MODEL', $moduleModel);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例6: preProcess
public function preProcess(Vtiger_Request $request, $display = true)
{
if ($this->getOperationArg($request) === 'attachment_dld') {
return true;
} else {
parent::preProcess($request, $display);
}
}
示例7: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$folders = $moduleModel->getFolders();
$listViewModel = new Reports_ListView_Model();
$listViewModel->set('module', $moduleModel);
$folderId = $request->get('viewname');
if (empty($folderId) || $folderId == 'undefined') {
$folderId = 'All';
}
$sortBy = $request->get('sortorder');
$orderBy = $request->get('orderby');
$listViewModel->set('folderid', $folderId);
$listViewModel->set('orderby', $orderBy);
$listViewModel->set('sortorder', $sortBy);
$linkModels = $listViewModel->getListViewLinks();
$pageNumber = $request->get('page');
$listViewMassActionModels = $listViewModel->getListViewMassActions();
if (empty($pageNumber)) {
$pageNumber = '1';
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$viewer->assign('PAGING_MODEL', $pagingModel);
if (!$this->listViewHeaders) {
$this->listViewHeaders = $listViewModel->getListViewHeaders();
}
if (!$this->listViewEntries) {
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
}
$noOfEntries = count($this->listViewEntries);
$viewer->assign('LISTVIEW_LINKS', $linkModels);
$viewer->assign('FOLDERS', $folders);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('VIEWNAME', $folderId);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('LISTVIEW_MASSACTIONS', $listViewMassActionModels);
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false)) {
if (!$this->listViewCount) {
$this->listViewCount = $listViewModel->getListViewCount();
}
$totalCount = $this->listViewCount;
$pageLimit = $pagingModel->getPageLimit();
$pageCount = ceil((int) $totalCount / (int) $pageLimit);
if ($pageCount == 0) {
$pageCount = 1;
}
$viewer->assign('PAGE_COUNT', $pageCount);
$viewer->assign('LISTVIEW_COUNT', $totalCount);
}
if ($display) {
$this->preProcessDisplay($request);
}
}
示例8: preProcess
public function preProcess(Vtiger_Request $request, $display = true)
{
$viewer = $this->getViewer($request);
$viewer->assign('MODULE_NAME', $request->getModule());
parent::preProcess($request, false);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例9: 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);
}
示例10: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$moduleModel = RecycleBin_Module_Model::getInstance($moduleName);
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$quickLinkModels = $moduleModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $quickLinkModels);
$this->initializeListViewContents($request, $viewer);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例11: preProcess
public function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request);
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$treeViewModel = Vtiger_TreeView_Model::getInstance($moduleModel);
$treeList = $treeViewModel->getTreeList();
$viewer = $this->getViewer($request);
$viewer->assign('TREE_LIST', Zend_Json::encode($treeList));
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$listViewModel = Vtiger_ListView_Model::getInstance($moduleName);
$quickLinkModels = $listViewModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $quickLinkModels);
$viewer->assign('SELECTABLE_CATEGORY', 0);
$viewer->view('TreeRecordsPreProcess.tpl', $moduleName);
}
示例12: preProcess
public function preProcess(Vtiger_Request $request, $display = true)
{
$config = Settings_Mail_Config_Model::getConfig('autologin');
if ($config['autologinActive'] == 'true') {
$account = OSSMail_Autologin_Model::getAutologinUsers();
if ($account) {
$rcUser = isset($_SESSION['AutoLoginUser']) && array_key_exists($_SESSION['AutoLoginUser'], $account) ? $account[$_SESSION['AutoLoginUser']] : reset($account);
require_once 'modules/OSSMail/RoundcubeLogin.class.php';
$rcl = new RoundcubeLogin(self::$mainUrl, false);
try {
if ($rcl->isLoggedIn()) {
if ($rcl->getUsername() != $rcUser['username']) {
$rcl->logout();
$rcl->login($rcUser['username'], $rcUser['password']);
}
} else {
$rcl->login($rcUser['username'], $rcUser['password']);
}
} catch (RoundcubeLoginException $ex) {
$log = vglobal('log');
$log->error('OSSMail_index_View|RoundcubeLoginException: ' . $ex->getMessage());
}
}
}
$config = OSSMail_Module_Model::getComposeParameters();
$param = OSSMail_Module_Model::getComposeUrlParam($request->get('crmModule'), $request->get('crmRecord'), $request->get('crmView'));
if ($request->get('id') != '' && $request->get('type') != '') {
$param .= '&crmid=' . (int) $request->get('id') . '&type=' . $request->get('type');
}
$this->mainUrl = $this->mainUrl . $param;
if ($config['popup'] && $request->get('popup') == 1) {
header('Location: ' . $this->mainUrl . '&_extwin=1');
exit;
}
parent::preProcess($request, true);
}
示例13: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
global $log;
$log->debug("Entering ./views/DashBoard.php::preProcess");
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$dashBoardModel = Vtiger_DashBoard_Model::getInstance($moduleName);
//check profile permissions for Dashboards
$moduleModel = Vtiger_Module_Model::getInstance('Dashboard');
$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$permission = $userPrivilegesModel->hasModulePermission($moduleModel->getId());
if ($permission) {
$widgets = $dashBoardModel->getSelectableDashboard();
} else {
$widgets = array();
}
$viewer->assign('MODULE_PERMISSION', $permission);
$viewer->assign('WIDGETS', $widgets);
$viewer->assign('MODULE_NAME', $moduleName);
if ($display) {
$this->preProcessDisplay($request);
}
}
示例14: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$recordId = $request->get('record');
$moduleName = $request->getModule();
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$recordStrucure = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_DETAIL);
$summaryInfo = array();
// Take first block information as summary information
$stucturedValues = $recordStrucure->getStructure();
foreach ($stucturedValues as $blockLabel => $fieldList) {
$summaryInfo[$blockLabel] = $fieldList;
break;
}
$detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
$detailViewLinks = $this->record->getDetailViewLinks($detailViewLinkParams);
$this->record->getWidgets($detailViewLinkParams);
$navigationInfo = ListViewSession::getListViewNavigation($recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('NAVIGATION', $navigationInfo);
$viewer->assign('COLORLISTHANDLERS', Settings_DataAccess_Module_Model::executeColorListHandlers($moduleName, $recordId, false));
//Intially make the prev and next records as null
$prevRecordId = null;
$nextRecordId = null;
$found = false;
if ($navigationInfo) {
foreach ($navigationInfo as $page => $pageInfo) {
foreach ($pageInfo as $index => $record) {
//If record found then next record in the interation
//will be next record
if ($found) {
$nextRecordId = $record;
break;
}
if ($record == $recordId) {
$found = true;
}
//If record not found then we are assiging previousRecordId
//assuming next record will get matched
if (!$found) {
$prevRecordId = $record;
}
}
//if record is found and next record is not calculated we need to perform iteration
if ($found && !empty($nextRecordId)) {
break;
}
}
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if (!empty($prevRecordId)) {
$viewer->assign('PREVIOUS_RECORD_URL', $moduleModel->getDetailViewUrl($prevRecordId));
}
if (!empty($nextRecordId)) {
$viewer->assign('NEXT_RECORD_URL', $moduleModel->getDetailViewUrl($nextRecordId));
}
$viewer->assign('MODULE_MODEL', $this->record->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('DETAILVIEW_WIDGETS', $this->record->widgets);
$viewer->assign('IS_EDITABLE', $this->record->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $this->record->getRecord()->isDeletable($moduleName));
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $this->record->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
$viewer->assign('MODULE_NAME', $moduleName);
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$viewer->assign('DEFAULT_RECORD_VIEW', $currentUserModel->get('default_record_view'));
$picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
$viewer->assign('PICKLIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
if ($display) {
$this->preProcessDisplay($request);
}
}
示例15: preProcess
public function preProcess(Vtiger_Request $request)
{
parent::preProcess($request, false);
}