예제 #1
0
 /**
  *
  * @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;
 }
예제 #2
0
파일: UserForm.php 프로젝트: Eximagen/sochi
 /**
  *
  */
 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;
 }
예제 #3
0
 /**
  *
  * @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();
 }
예제 #4
0
 /**
  * @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);
 }