public function updateAction()
 {
     // setting the url to be redirected after create record with success
     // or cancel
     if ($this->_hasParam('id') || $this->_hasParam('person')) {
         $id = $this->_hasParam('id') ? $this->_getParam('id') : $this->_getParam('person');
         $urlRedirect = array('action' => 'get', 'controller' => 'person-helped-project', 'module' => 'persons', 'id' => $id);
         $this->setRedirectActionAfterUpdateSuccess($urlRedirect);
         $this->setRedirectActionAfterUpdateCancel($urlRedirect);
     }
     parent::updateAction();
     // 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->_hasParam('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 init()
 {
     parent::init();
     $this->setDomainClass(new Organization_Domain_Organization());
     $this->setViewVarName('organization');
     $this->setFormCRUName('Organization_Form_Organization');
 }
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Busunit_Domain_Headquarters());
     $this->setViewVarName('headquarters');
     $this->setFormCRUName('Busunit_Form_Headquarters');
 }
 public function updateAction()
 {
     parent::updateAction();
     $act = $this->getDomainClass()->getById($this->getParam('id'));
     $this->view->person_recorded = $act->getPerson_recorded();
     $this->view->person_performed = $act->getPerson_performed();
     $this->view->person_helped = $act->getPerson_helped();
 }
Exemplo n.º 5
0
 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 init()
 {
     parent::init();
     $this->setDomainClass(new Location_Domain_CityRegion());
     $this->setViewVarName('region');
     $this->setViewVarListName('regions');
     $this->setViewListOrderBy('name');
     $this->setFormCRUName('Location_Form_CityRegion');
     $this->setFormDName('Location_Form_CityRegionDelete');
 }
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Staff_Domain_Jobfunction());
     $this->setViewVarName('function');
     $this->setViewVarListName('functions');
     $this->setViewListOrderBy('name');
     $this->setFormCRUName('Staff_Form_Jobfunction');
     $this->setFormDName('Staff_Form_JobfunctionDelete');
 }
Exemplo n.º 8
0
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Busunit_Domain_Branch());
     $this->setViewVarName('branch');
     $this->setViewVarListName('branches');
     $this->setViewListOrderBy('name');
     $this->setFormCRUName('Busunit_Form_Branch');
     $this->setFormDName('Busunit_Form_BranchDelete');
 }
Exemplo n.º 9
0
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Location_Domain_State());
     $this->setViewVarName('state');
     $this->setViewVarListName('states');
     $this->setViewListOrderBy('name');
     $this->setFormCRUName('Location_Form_State');
     $this->setFormDName('Location_Form_StateDelete');
 }
Exemplo n.º 10
0
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Project_Domain_Project());
     $this->setViewVarName('project');
     $this->setViewVarListName('projects');
     $this->setViewListOrderBy('name');
     $this->setFormCRUName('Project_Form_Project');
     $this->setFormDName('Project_Form_ProjectDelete');
 }
Exemplo n.º 11
0
 protected function _isUserAllowed($resource, $privilege)
 {
     if (parent::_isUserAllowed($resource, $privilege)) {
         return true;
     } else {
         $this->_helper->flashMessenger->addMessage(array('warning' => 'You don\'t have permission to access this'));
         $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper("redirector");
         $redirector->gotoUrl("/");
     }
 }
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Staff_Domain_Expertisearea());
     $this->setViewVarName('expertise');
     $this->setViewVarListName('expertises');
     $this->setViewListOrderBy('name');
     $this->setFormCRUName('Staff_Form_Expertisearea');
     $this->setFormDName('Staff_Form_ExpertiseareaDelete');
 }
Exemplo n.º 13
0
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Location_Domain_Country());
     $this->setViewVarName('country');
     $this->setViewVarListName('countries');
     $this->setViewListOrderBy('name');
     $this->setFormCRUName('Location_Form_Country');
     $this->setFormDName('Location_Form_CountryDelete');
 }
Exemplo n.º 14
0
 public function init()
 {
     parent::init();
     $this->setDomainClass(new Project_Domain_Tasktype());
     $this->setViewVarName('tasktype');
     $this->setViewVarListName('tasktypes');
     $this->setViewListOrderBy(array('parent_id', 'name'));
     $this->setFormCRUName('Project_Form_Tasktype');
     $this->setFormDName('Project_Form_TasktypeDelete');
 }
Exemplo n.º 15
0
 public function createAction()
 {
     if ($this->_request->isPost()) {
         $url = array('action' => 'getgm', 'controller' => 'person', 'module' => 'persons');
         $this->setUseIdCreatedOnUrl(TRUE);
         $this->setRedirectActionAfterCreateSuccess($url);
     }
     parent::createAction();
 }