Beispiel #1
0
 public function preProcess(Vtiger_Request $request, $display = true)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $viewer->assign('QUALIFIED_MODULE', $moduleName);
     Vtiger_Basic_View::preProcess($request, false);
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     if (!empty($moduleName)) {
         //$moduleModel = PDFMaker_PDFMaker_Model::getInstance($moduleName);
         $moduleModel = new PDFMaker_PDFMaker_Model('PDFMaker');
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
         $permission = $userPrivilegesModel->hasModulePermission($moduleModel->getId());
         $viewer->assign('MODULE', $moduleName);
         if (!$permission) {
             $viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
             $viewer->view('OperationNotPermitted.tpl', $moduleName);
             exit;
         }
         $linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
         $linkModels = $moduleModel->getSideBarLinks($linkParams);
         $viewer->assign('QUICK_LINKS', $linkModels);
     }
     $viewer->assign('CURRENT_USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('CURRENT_VIEW', $request->get('view'));
     if ($display) {
         $this->preProcessDisplay($request);
     }
 }