/** * * @return array */ public function editAction() { $id = $this->getRequest()->getParam('id'); $inspector = InspectorQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Inspector with id {$id}")); $person = PersonQuery::create()->findByPK($inspector->getIdPerson()); $this->view->viewAction = 'update'; $this->view->setTpl("Form"); $this->view->inspector = $inspector; $this->view->person = $person; }
/** * */ protected function initIdPersonElement() { $element = new \Zend_Form_Element_Select('id_person'); $options = \Application\Query\PersonQuery::create()->find()->toCombo(); $element->addMultiOptions($options); $element->setLabel($this->getTranslator()->_('IdPerson')); $element->addValidator($this->validator->getFor('id_person')); $element->addFilter($this->filter->getFor('id_person')); $element->setRequired(true); $this->addElement($element); $this->elements['id_person'] = $element; }
/** * * @return array */ public function listAction() { $this->view->page = $page = $this->getRequest()->getParam('page') ?: 1; if ($this->getRequest()->isPost()) { $this->view->post = $post = $this->getRequest()->getParams(); } $total = ContactQuery::create()->filter($post)->count(); $this->view->contacts = $contacts = ContactQuery::create()->filter($post)->page($page, $this->getMaxPerPage())->find(); $this->view->paginator = $this->createPaginator($total, $page); $this->view->people = \Application\Query\PersonQuery::create()->find()->toCombo(); $this->view->companies = \Application\Query\CompanyQuery::create()->find()->toCombo(); }
/** * @module User * @action List * @return array */ public function listAction() { $this->view->page = $page = $this->getRequest()->getParam('page') ?: 1; $this->view->form = $form = $this->getFilterForm(); $this->view->post = $post = $this->getRequest()->getParams(); $this->view->filter = $this->createFilterForUrl($post); if (!empty($post['username'])) { $post['username'] = '******' . $post['username'] . '%'; } $total = UserQuery::create()->filter($post)->count(); $this->view->users = $users = UserQuery::create()->filter($post)->page($page, $this->getMaxPerPage())->find(); $this->view->contentTitle = 'Users List'; $this->view->paginator = $this->createPaginator($total, $page); $this->view->accessRoles = array('' => $this->i18n->_('All')) + \Application\Query\AccessRoleQuery::create()->find()->toCombo(); $this->view->people = \Application\Query\PersonQuery::create()->find()->toCombo(); $this->view->statuses = array('' => $this->i18n->_('All')) + ($statuses = User::$StatusCombo); }