Beispiel #1
0
 public function insertAction()
 {
     $this->_helper->viewRenderer->setRender('edit');
     if (!$this->getRequest()->isPost()) {
         return;
     }
     $this->view->roleRowData = $roleRowData = $this->_getAllParams();
     $insert = $this->aclModel->createRole($roleRowData, $this->userAuth->getRoleId());
     if (!$insert['status']) {
         $this->view->messageError = $insert['messageError'];
         return;
     }
     $this->view->roleInsertSucess = true;
     $this->_forward('index');
 }
Beispiel #2
0
 public function init()
 {
     if (!Zend_Auth::getInstance()->hasIdentity()) {
         return;
     }
     $this->_helper->getHelper('contextSwitch')->addActionContext('insert', array('json'))->addActionContext('edit', array('json'))->setAutoJsonSerialization(true)->initContext();
     // Contextos dos actions
     $this->_helper->getHelper('ajaxContext')->addActionContext('index', array('html'))->initContext();
     $this->aclModel = Zend_Registry::get('acl');
     $this->userAuth = Zend_Auth::getInstance()->getIdentity();
     $this->roleRow = $this->aclModel->getRoleById($this->userAuth->getRoleId(), false);
     $this->roleAppraiserId = Zend_Registry::get('config')->acl->roleAppraiserId;
     $this->userModel = new Model_User();
     $this->dbTable_User = new DbTable_User();
     $this->userRoleModel = new Model_UserRole();
     $this->positionModel = new Model_Position();
     $this->regionalModel = new Model_Regional();
     $this->dbTable_Regional = new DbTable_Regional();
     $this->educationModel = new Model_Education();
     $this->userLocalityModel = new Model_UserLocality();
 }