Ejemplo n.º 1
0
 /**
  * 
  */
 public function indexAction()
 {
     $id = $this->_getParam('id');
     // Form
     $form = $this->_getForm($this->_helper->url('save'));
     if (empty($id)) {
         $stepBreadCrumb = array('label' => 'DRH - Rejistu Planu ba Formasaun', 'url' => 'fefop/drh-training-plan');
     } else {
         $stepBreadCrumb = array('label' => 'DRH - Edita Planu ba Formasaun', 'url' => 'fefop/drh-training-plan/edit/id/' . $id);
         $row = $this->_mapper->detail($id);
         if (empty($row)) {
             $this->_helper->redirector->goToSimple('index');
         }
         $data = $row->toArray();
         $data['date_start'] = $this->view->date($data['date_start']);
         $data['date_finish'] = $this->view->date($data['date_finish']);
         $data['country'] = $data['fk_id_addcountry'];
         $form->populate($data);
         // List the beneficiaries
         $this->view->beneficiaries = $this->_mapper->listBeneficiaries($id);
         // List the Expenses
         $this->view->expenses = $this->_mapper->listExpenses($id);
     }
     $this->view->id = $id;
     $this->view->form = $form;
     $this->view->breadcrumb()->addStep($stepBreadCrumb);
 }
Ejemplo n.º 2
0
 /**
  * 
  */
 public function listContractsAction()
 {
     $this->_helper->layout()->disableLayout();
     $id = $this->_getParam('id');
     // Fetch the Expenses related to the DRH module
     $mapperBudgetCategory = new Fefop_Model_Mapper_Expense();
     $this->view->expenses = $mapperBudgetCategory->expensesInItem(Fefop_Model_Mapper_Expense::CONFIG_PFPCI_DRH);
     $mapperDRHTrainingPlan = new Fefop_Model_Mapper_DRHTrainingPlan();
     $filters = array('no_contract' => true, 'training_plan' => $id);
     $this->view->beneficiaries = $mapperDRHTrainingPlan->listBeneficiariesByFilter($filters);
     $this->view->training_plan = $mapperDRHTrainingPlan->detail($id);
 }