true, 'defaultOrderBy' => 'sorter'); protected function _initAction() { $dataObj = $this->_getDataObj(); $dataObj->setApplicationUserId(intval($this->getRestAlias())); $dataObj->setUserType(App_Application_Document_Obj::USER_TYPE_APPLICANT); // 'applicant' by default if (!$dataObj->getUserData()) { $this->_doc->display404(); return $this; } return parent::_initAction(); } protected function _getTemplatePath() { if (null === $this->_templatePath) { parent::_getTemplatePath(); $path = array_shift($this->_templatePath); if ('/Admin' == substr($path, -6)) { array_unshift($this->_templatePath, substr($path, 0, -6)); } array_unshift($this->_templatePath, $path); } return $this->_templatePath; } /** * @param Qs_ViewController_List $list * * @return $this */ protected function _bindListColumns($list) { parent::_bindListColumns($list); $this->_bindReviewerListColumns($list); return $this; } protected function _doList() { $this->_addItem(array( 'tpl' => $this->getTemplate('user-data.tpl'), 'user' => $this->_getDataObj()->getUserData(), )); return parent::_doList(); } protected function _getDefaultLinks() { $links = parent::_getDefaultLinks(); $cancelUrl = BASE_URL_LANGUAGE . '/' . PARENT_PAGE_FINAL . '?action=cancel'; $links['cancel'] = array('url' => $cancelUrl, 'title' => 'Back to Applicants'); return $links; } public static function refreshDocumentsAccessFile() { $adminAuth = App_Admin_Auth::getInstance(); $userAuth = App_Application_User_Auth::getInstance(); $reviewerAuth = App_Application_Reviewer_Auth::getInstance(); if ($adminAuth->isLoggedIn()) { self::createDocumentsAccessDir(); } else { self::removeDocumentAccessDir(); } if ($userAuth->isLoggedIn()) { App_Application_Document_View::createDocumentsSymlinks($userAuth->getData('id')); } if ($reviewerAuth->isLoggedIn()) { $reviewerObj = new App_Application_Reviewer_AdminObj(); $userIds = $reviewerObj->getApplicationIds($reviewerAuth->getData('id')); App_Application_Document_View::createDocumentsSymlinks($userIds); } } static public function createDocumentsAccessDir() { file_put_contents(constant('BASE_PATH') . '/tmp/' . App_Application_Document_AdminObj::DOCUMENT_ADMIN_ACCESS_PATH . '/' . session_id(), ''); return true; } public static function removeDocumentAccessDir() { $filePath = constant('BASE_PATH') . '/tmp/' . App_Application_Document_AdminObj::DOCUMENT_ADMIN_ACCESS_PATH . '/' . session_id(); if (file_exists($filePath)) { unlink($filePath); } return true; } }