public function createAction() { // setting the url to be redirected after create record with success // or cancel if ($this->_hasParam('id') || $this->_hasParam('person')) { $id = $this->_getParam('id') ? $this->_getParam('id') : $this->_getParam('person'); $urlRedirect = array('action' => 'getgm', 'controller' => 'person', 'module' => 'persons', 'id' => $id); $this->setRedirectActionAfterCreateSuccess($urlRedirect); $this->setRedirectActionAfterCreateCancel($urlRedirect); } parent::createAction(); // fill the id and name person of the form when is calling with a person's id if (($this->_hasParam('id') || $this->_hasParam('person')) && (!$this->getRequest()->isPost() || $this->getRequest()->isPost() && $this->view->form->isErrors())) { $id = $this->_getParam('id') ? $this->_getParam('id') : $this->_getParam('person'); $f = $this->view->form; $elname = $f->getElement('person_name'); $elid = $f->getElement('id'); $personDomain = new Persons_Domain_Person(); $person = $personDomain->getById($id); if ($person) { $elname->setValue($person->name); $elid->setValue($person->id); } } }
public function createAction() { parent::createAction(); // preenche os campos com os dados da pessoa de usuário que // está usando o sistema $id = Zend_Auth::getInstance()->getIdentity()->id; $personDomain = new Persons_Domain_Person(); $person = $personDomain->getById($id); $this->view->person_recorded = $person; $this->view->person_performed = $person; $this->view->person_helped = new Persons_Model_Person(); if ($this->getRequest()->isPost()) { $phId = $this->getRequest()->getParam('person_helped_id', 0); if ($phId > 0) { $person = $personDomain->getById($phId); $this->view->person_helped = $person; } $ppId = $this->getRequest()->getParam('person_performed_id', 0); if ($ppId > 0) { $person = $personDomain->getById($ppId); $this->view->person_performed = $person; } else { $this->view->person_performed = new Persons_Model_Person(); } } }
public function createAction() { if ($this->getRequest()->isPost()) { $url = array('action' => 'create-activity', 'controller' => 'event', 'module' => 'assistance'); $this->setUseIdCreatedOnUrl(true); $this->setRedirectActionAfterCreateSuccess($url); } parent::createAction(); }
public function createAction() { if ($this->_request->isPost()) { $url = array('action' => 'getgm', 'controller' => 'person', 'module' => 'persons'); $this->setUseIdCreatedOnUrl(TRUE); $this->setRedirectActionAfterCreateSuccess($url); } parent::createAction(); }