public function process(Vtiger_Request $request) { if ($request->isAjax()) { $moduleModelList = Settings_PickListDependency_Module_Model::getPicklistSupportedModules(); $forModule = $request->get('formodule'); $viewer = $this->getViewer($request); $viewer->assign('PICKLIST_MODULES_LIST', $moduleModelList); $viewer->assign('FOR_MODULE', $forModule); $viewer = $this->getViewer($request); $this->initializeListViewContents($request, $viewer); $viewer->view('ListViewHeader.tpl', $request->getModule(false)); } parent::process($request); }
function getViewer(Vtiger_Request $request) { if (!$this->viewer) { $viewer = Vtiger_Viewer::getInstance(); $viewer->assign('APPTITLE', getTranslatedString('APPTITLE')); $viewer->assign('YETIFORCE_VERSION', vglobal('YetiForce_current_version')); if ($request->isAjax()) { $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); if ($request->get('parent') == 'Settings') { $viewer->assign('QUALIFIED_MODULE', $request->getModule(false)); } } $this->viewer = $viewer; } return $this->viewer; }
public static function throwNewException($message, $die = true, $tpl = 'OperationNotPermitted.tpl') { $request = new Vtiger_Request($_REQUEST); if ($request->isAjax()) { $response = new Vtiger_Response(); $response->setEmitType(Vtiger_Response::$EMIT_JSON); $response->setError($message); $response->emit(); } else { $viewer = new Vtiger_Viewer(); $viewer->assign('MESSAGE', $message); $viewer->view($tpl, 'Vtiger'); } if ($die) { exit; } }
public static function throwNoPermittedException($message, $die = true) { $request = new Vtiger_Request($_REQUEST); $db = PearDatabase::getInstance(); $currentUser = Users_Record_Model::getCurrentUserModel(); $db->insert('s_yf_accesstorecord', ['username' => $currentUser->getDisplayName(), 'date' => date('Y-m-d H:i:s'), 'ip' => self::getRemoteIP(), 'record' => $request->get('record'), 'module' => $request->get('module'), 'url' => Vtiger_Functions::getBrowserInfo()->url, 'description' => '', 'agent' => $_SERVER['HTTP_USER_AGENT']]); if ($request->isAjax()) { $response = new Vtiger_Response(); $response->setEmitType(Vtiger_Response::$EMIT_JSON); $response->setError($message); $response->emit(); } else { $viewer = new Vtiger_Viewer(); $viewer->assign('MESSAGE', $message); $viewer->view('NoPermissionsForRecord.tpl', 'Vtiger'); } if ($die) { exit; } }
static function throwNewException($message) { $request = new Vtiger_Request($_REQUEST); if ($request->isAjax()) { $response = new Vtiger_Response(); $response->setEmitType(Vtiger_Response::$EMIT_JSON); $response->setError($message); $response->emit(); } else { $viewer = new Vtiger_Viewer(); $viewer->assign('MESSAGE', $message); $text = $viewer->view('OperationNotPermitted.tpl', 'Vtiger', true); die($text); } }