public function settingsAction() { $this->view->headTitle()->append('Edit user settings'); $this->__getCrumbs()->add('Edit user settings', [], 'admin-user-settings'); /** @var Application_Model_User_Profile $user */ $user = $this->_getItemById($this->getParam('id')); if (!$this->_user->getRole()->isSubordinate($user->getUser()->getRole())) { $this->redirect(RM_View_Top::getInstance()->getBreadcrumbs()->getBack()); } $this->view->email = $user->getEmail(); if ($this->getRequest()->isPost()) { try { $data = (object) $this->getRequest()->getPost(); $user->setStatus($data->user_status); $role = RM_User_Role::getById($data->user_type); if (!$this->_user->getRole()->isSubordinate($role)) { throw new Exception('Permission denied'); } $user->getUser()->setRole($role); $user->save(); $this->__goBack(); } catch (Exception $e) { $this->view->showMessage($e); } } else { $_POST['user_status'] = $user->getStatus(); $_POST['user_type'] = $user->getUser()->getRole()->getId(); } $this->_entity = $user; }
public function listAction() { parent::listAction(); $limit = new RM_Query_Limits(20); $limit->setPage((int) $this->getParam('page')); $this->view->assign(array('cities' => (new Application_Model_City_Search_Repository())->findCities($this->getParam('search'), $limit))); RM_View_Top::getInstance()->addSearch($this->_ajaxUrl); }
public function editAction() { $this->view->headTitle('View error'); $errorCategory = RM_Error_Category::getById($this->_getParam('idLog')); RM_View_Top::getInstance()->getBreadcrumbs()->add($errorCategory->getName() . ' errors', array(), 'admin-error-list')->add('View error', array(), 'admin-error-edit'); $this->view->error = RM_Error::getById($this->_getParam('id')); $this->view->error->read(); }
public function photosAction() { $this->__getCrumbs()->clear(); RM_Head::getInstance()->getJS()->add('upload'); $this->view->headTitle('Фото'); RM_View_Top::getInstance()->setTitle('Фотографии'); $this->view->gallery = RM_Gallery::getById($this->_getParam('id')); $this->view->menu = 'medical-advices'; }