_setBackUrl(Qs_SiteMap::find(null, array('type' => 'Part_'), null, 'url')); return parent::_initAction(); } public function exec() { $this->_actions = array('cancel'); if (App_User_Auth::getInstance()->hasIdentity()) { if ($this->doc->acl->isAllowed(App_User_Auth::getInstance()->getData('id'), 'part', 'add')) { $this->_actions = array_merge($this->_actions, array('edit', 'update', 'save', 'savePositions', 'deleteElement', 'unblock')); } if ($this->_getDepartmentAccess()) { $this->_actions = array_merge($this->_actions, array('view', 'submit')); } } return parent::exec(); } protected function _getDepartmentAccess() { $process = $this->dataObj->getProcessById((int) Qs_Request::getGetValue('id')); $departmentId = $process['departmentId']; return ($departmentId && $this->doc->acl->isAllowed($this->doc->getAuthData('id'), App_Acl_Obj::DEPARTMENT_PREFIX . $departmentId, App_Acl_Obj::DEPARTMENT_PRIVILEGE)); } protected function _initFromForm(Qs_Form $form) { $data = $form->getValues(); if ($data['action'] == 'save') { $data['new'] = 'n'; } $this->dataObj->initFromForm($data); return $this; } }