/** * @access public * @return void */ public function init() { parent::init(); $this->getElement('path')->setValue(self::PATH); $this->getElement('title')->setValue(self::TITLE); $this->removeElement('date_start'); $this->removeElement('date_finish'); $this->removeElement('id_adddistrict'); $this->removeElement('fk_id_dec'); $elements = array(); //Tipo FEFOPFund $optTypeFEFOPFund = array(); array_unshift($optTypeFEFOPFund, ''); $optTypeFEFOPFund['D'] = 'Donor'; $optTypeFEFOPFund['G'] = 'Governo'; $elements[] = $this->createElement('select', 'type_fefopfund')->setLabel('Tipu de Fundu')->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optTypeFEFOPFund); //Tipo Despesa $rows = App_Model_DbTable_Factory::get('BudgetCategoryType')->fetchAll(); $optBudgetCategoryType = array(); array_unshift($optBudgetCategoryType, ''); foreach ($rows as $row) { $optBudgetCategoryType[$row->id_budget_category_type] = $row->description; } $elements[] = $this->createElement('select', 'id_budget_category_type')->setLabel('Komponente')->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optBudgetCategoryType); //Ano $year = date('Y'); $interval = 10; $keys = $values = range($year - $interval, $year + $interval); $optYear = array('' => ''); $optYear += array_combine($keys, $values); $elements[] = $this->createElement('select', 'year_start')->setLabel('Tinan')->setRequired(true)->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optYear); $elements[] = $this->createElement('select', 'year_finish')->setLabel('To\'o')->setRequired(true)->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optYear); $this->addElements($elements); }
/** * @access public * @return void */ public function init() { parent::init(); $this->getElement('path')->setValue(self::PATH); $this->getElement('title')->setValue(self::TITLE); $this->removeElement('fk_id_dec'); //Tipo FEFOPFund $optTypeFEFOPFund = array(); array_unshift($optTypeFEFOPFund, ''); $optTypeFEFOPFund['D'] = 'Donor'; $optTypeFEFOPFund['G'] = 'Governo'; $element = $this->createElement('select', 'type_fefopfund')->setLabel('Tipu de Fundu')->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optTypeFEFOPFund); $this->addElement($element); }
/** * @access public * @return void */ public function init() { parent::init(); $this->getElement('path')->setValue(self::PATH); $this->getElement('title')->setValue(self::TITLE); $this->removeElement('fk_id_dec'); //Tipo Despesa $rows = App_Model_DbTable_Factory::get('BudgetCategoryType')->fetchAll(); $optBudgetCategoryType = array(); array_unshift($optBudgetCategoryType, ''); foreach ($rows as $row) { $optBudgetCategoryType[$row->id_budget_category_type] = $row->description; } $element = $this->createElement('select', 'id_budget_category_type')->setLabel('Komponente')->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optBudgetCategoryType); $this->addElement($element); }
/** * @access public * @return void */ public function init() { parent::init(); $this->getElement('path')->setValue(self::PATH); $this->getElement('title')->setValue(self::TITLE); $elements = array(); $adapter = App_Model_DbTable_Abstract::getDefaultAdapter(); $mapper = new Fefop_Model_Mapper_Contract(); $rows = $adapter->fetchAll($mapper->getSelectBeneficiary()); $optUsers = array(); array_unshift($optUsers, ''); foreach ($rows as $row) { $optUsers[$row['id']] = $row['name']; } $elements[] = $this->createElement('select', 'id_beneficiary')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Benefisiariu')->addMultiOptions($optUsers); $this->addElements($elements); }
/** * @access public * @return void */ public function init() { parent::init(); $this->getElement('path')->setValue(self::PATH); $this->getElement('title')->setValue(self::TITLE); $this->removeElement('date_start'); $this->removeElement('date_finish'); $this->removeElement('fk_id_dec'); //Ano $year = date('Y'); $interval = 10; $keys = $values = range($year - $interval, $year + $interval); $optYear = array('' => ''); $optYear += array_combine($keys, $values); $elements[] = $this->createElement('select', 'year_start')->setLabel('Tinan')->setRequired(true)->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optYear); $elements[] = $this->createElement('select', 'year_finish')->setLabel('To\'o')->setRequired(true)->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optYear); $this->addElements($elements); }
/** * @access public * @return void */ public function init() { parent::init(); $this->removeElement('id_fefop_programs'); $this->removeElement('id_fefop_modules'); $this->removeElement('id_adddistrict'); $this->removeElement('id_fefop_status'); //Área de Formação $rows = App_Model_DbTable_Factory::get('ScholarityArea')->fetchAll(); $optScholarityArea = array(); array_unshift($optScholarityArea, ''); foreach ($rows as $row) { $optScholarityArea[$row->id_scholarity_area] = (empty($row->acronym) ? '' : $row->acronym . ' - ') . $row->scholarity_area; } $elements[] = $this->createElement('select', 'id_scholarity_area')->setLabel('Area Formasaun')->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optScholarityArea); //Ocupação $dbPROFOcupationTimor = App_Model_DbTable_Factory::get('PROFOcupationTimor'); $dbDRHTrainingPlan = App_Model_DbTable_Factory::get('DRHTrainingPlan'); $select = $dbPROFOcupationTimor->select()->setIntegrityCheck(false)->from($dbPROFOcupationTimor->__toString(), array('id_profocupationtimor', 'acronym', 'ocupation_name_timor'))->join($dbDRHTrainingPlan->__toString(), 'DRH_TrainingPlan.fk_id_profocupationtimor = PROFOcupationTimor.id_profocupationtimor', array()); $rows = $dbPROFOcupationTimor->fetchAll($select); $optOccupation = array(); array_unshift($optOccupation, ''); foreach ($rows as $row) { $optOccupation[$row->id_profocupationtimor] = $row->acronym . ' - ' . $row->ocupation_name_timor; } $elements[] = $this->createElement('select', 'id_profocupationtimor')->setLabel('Okupasaun')->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optOccupation); $this->addElements($elements); //Instituição $dbFefpEduInstitution = App_Model_DbTable_Factory::get('FefpEduInstitution'); $select = $dbFefpEduInstitution->select()->setIntegrityCheck(false)->from($dbFefpEduInstitution->__toString(), array('id_fefpeduinstitution', 'institution'))->join($dbDRHTrainingPlan->__toString(), 'DRH_TrainingPlan.fk_id_fefpeduinstitution = FefpEduInstitution.id_fefpeduinstitution', array()); $rows = $dbFefpEduInstitution->fetchAll($select); $optInstitution = array(); array_unshift($optInstitution, ''); foreach ($rows as $row) { $optInstitution[$row->id_fefpeduinstitution] = $row->institution; } $elements[] = $this->createElement('select', 'id_fefpeduinstitution')->setLabel('Instituisaun')->setRegisterInArrayValidator(false)->setAttrib('class', 'm-wrap span12 chosen')->setDecorators($this->getDefaultElementDecorators())->addMultiOptions($optInstitution); $this->addElements($elements); $this->getElement('path')->setValue(self::PATH); $this->getElement('title')->setValue(self::TITLE); }
/** * @access public * @return void */ public function init() { parent::init(); $this->getElement('path')->setValue(self::PATH); $this->getElement('title')->setValue(self::TITLE); }