Пример #1
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form')->setName('form_information');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'id_businessplan')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'partisipants')->setDecorators(array('ViewHelper'))->setValue('S');
     $elements[] = $this->createElement('hidden', 'clients')->setIsArray(true);
     $elements[] = $this->createElement('hidden', 'module')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'fk_id_perdata')->setDecorators(array('ViewHelper'));
     $mapperIsicDivision = new Register_Model_Mapper_IsicDivision();
     $rows = $mapperIsicDivision->listAll();
     $optDivisionTimor[''] = '';
     foreach ($rows as $row) {
         $optDivisionTimor[$row->id_isicdivision] = $row->name_disivion;
     }
     $elements[] = $this->createElement('select', 'fk_id_isicdivision')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setAttrib('onchange', 'Pce.searchIsicClass(this)')->setLabel('Setor de Atividade')->addMultiOptions($optDivisionTimor)->setRequired(true);
     $elements[] = $this->createElement('select', 'fk_id_isicclasstimor')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Atividade de Negócio')->setRegisterInArrayValidator(false)->setRequired(true);
     $elements[] = $this->createElement('text', 'total_partisipants')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('disabled', true)->setLabel('Total de membros')->setAttrib('class', 'm-wrap span2')->setValue(1);
     $dbDistrict = App_Model_DbTable_Factory::get('AddDistrict');
     $districts = $dbDistrict->fetchAll();
     $optCountry[''] = '';
     foreach ($districts as $district) {
         $optCountry[$district['id_adddistrict']] = $district['District'];
     }
     $elements[] = $this->createElement('select', 'fk_id_adddistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optCountry)->setLabel('Distritu')->setRequired(true);
     $this->addElements($elements);
     $this->setDecorators($this->getDefaultFormDecorators());
 }
Пример #2
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form')->setName('search');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'minimum_amount')->setValue(0)->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'maximum_amount')->setValue(100000)->setDecorators(array('ViewHelper'));
     $mapperPceFase = new Fefop_Model_Mapper_PCEContract();
     $studentClasses = $mapperPceFase->listStudentClassContract();
     $optStudentClass[''] = '';
     foreach ($studentClasses as $class) {
         $optStudentClass[$class['id_fefpstudentclass']] = $class['class_name'];
     }
     $elements[] = $this->createElement('select', 'fk_id_fefpstudentclass')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optStudentClass)->setLabel('Formasaun Profisional');
     $elements[] = $this->createElement('text', 'beneficiary')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setLabel('Benefisiariu');
     $dbDistrict = App_Model_DbTable_Factory::get('AddDistrict');
     $districts = $dbDistrict->fetchAll();
     $optCountry[''] = '';
     foreach ($districts as $district) {
         $optCountry[$district['id_adddistrict']] = $district['District'];
     }
     $elements[] = $this->createElement('select', 'fk_id_adddistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optCountry)->setLabel('Distritu');
     $mapperIsicDivision = new Register_Model_Mapper_IsicDivision();
     $rows = $mapperIsicDivision->listAll();
     $optDivisionTimor[''] = '';
     foreach ($rows as $row) {
         $optDivisionTimor[$row->id_isicdivision] = $row->name_disivion;
     }
     $elements[] = $this->createElement('select', 'fk_id_isicdivision')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Setor de Atividade')->addMultiOptions($optDivisionTimor);
     $elements[] = $this->createElement('select', 'fk_id_isicclasstimor')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Atividade de Negócio');
     $elements[] = $this->createElement('text', 'date_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask date')->setLabel('Loron Inisiu');
     $elements[] = $this->createElement('text', 'date_finish')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask date')->setLabel('Loron Remata');
     $this->addElements($elements);
 }
Пример #3
0
 /**
  * 
  * @return int|bool
  */
 public function save()
 {
     $dbAdapter = Zend_Db_Table_Abstract::getDefaultAdapter();
     $dbAdapter->beginTransaction();
     try {
         $row = $this->_checkIsicGroup($this->_data);
         if (!empty($row)) {
             $this->_message->addMessage('Grupu Setor Industria iha tiha ona.', App_Message::ERROR);
             return false;
         }
         $mapperDivision = new Register_Model_Mapper_IsicDivision();
         $division = $mapperDivision->fetchRow($this->_data['fk_id_isicdivision']);
         $this->_data['acronym'] = $division->acronym . $this->_data['acronym'];
         if (empty($this->_data['id_isicgroup'])) {
             $history = 'REJISTRU GRUPU: %s';
         } else {
             $history = 'ALTERA GRUPU: %s';
         }
         $id = parent::_simpleSave();
         // Save the client history
         $history = sprintf($history, $this->_data['acronym']);
         $this->_sysAudit($history);
         $dbAdapter->commit();
         return $id;
     } catch (Exception $e) {
         $dbAdapter->rollBack();
         $this->_message->addMessage($this->_config->messages->error, App_Message::ERROR);
         return false;
     }
 }
Пример #4
0
 /**
  * 
  */
 public function searchDivisionAction()
 {
     $mapperDivision = new Register_Model_Mapper_IsicDivision();
     $rows = $mapperDivision->listAll($this->_getParam('id'));
     $opts = array(array('id' => '', 'name' => ''));
     foreach ($rows as $row) {
         $opts[] = array('id' => $row->id_isicdivision, 'name' => $row->name_disivion);
     }
     $this->_helper->json($opts);
 }
Пример #5
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form')->setName('search');
     $elements = array();
     $dbDistrict = App_Model_DbTable_Factory::get('AddDistrict');
     $districts = $dbDistrict->fetchAll();
     $optCountry[''] = '';
     foreach ($districts as $district) {
         $optCountry[$district['id_adddistrict']] = $district['District'];
     }
     $elements[] = $this->createElement('select', 'fk_id_adddistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optCountry)->setLabel('Distritu');
     $optModule[''] = '';
     $mapperModule = new Fefop_Model_Mapper_Module();
     $rows = $mapperModule->listModules(Fefop_Model_Mapper_Program::PCE);
     foreach ($rows as $row) {
         $optModule[$row['id_fefop_modules']] = $row['num_module'] . ' - ' . $row['module'];
     }
     $elements[] = $this->createElement('select', 'fk_id_fefop_modules')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optModule)->setLabel('Modulu');
     $mapperIsicDivision = new Register_Model_Mapper_IsicDivision();
     $rows = $mapperIsicDivision->listAll();
     $optDivisionTimor[''] = '';
     foreach ($rows as $row) {
         $optDivisionTimor[$row->id_isicdivision] = $row->name_disivion;
     }
     $elements[] = $this->createElement('select', 'fk_id_isicdivision')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Setór atividade nian')->setAttrib('onchange', 'Fefop.PceContract.searchIsicClass(this)')->addMultiOptions($optDivisionTimor);
     $elements[] = $this->createElement('select', 'fk_id_isicclasstimor')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Área negósiu nian')->setRegisterInArrayValidator(false);
     $optPartisipants[''] = '';
     $optPartisipants['S'] = 'Ema ida';
     $optPartisipants['G'] = 'Grupu';
     $elements[] = $this->createElement('select', 'partisipants')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setLabel('Grupu')->addMultiOptions($optPartisipants);
     $mapperPce = new External_Model_Mapper_Pce();
     $rows = $mapperPce->listBeneficiaries();
     $optBeneficiaries[''] = '';
     foreach ($rows as $row) {
         $optBeneficiaries[$row->id_perdata] = Client_Model_Mapper_Client::buildNumRow($row) . ' - ' . Client_Model_Mapper_Client::buildName($row);
     }
     $elements[] = $this->createElement('select', 'bussines_plan_developer')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel("Naran ema ne'ebé dezenvolve Planu Negósiu nian")->addMultiOptions($optBeneficiaries);
     $optIsSubmitted[''] = '';
     $optIsSubmitted['1'] = 'Tiha ona';
     $optIsSubmitted['0'] = 'Seidauk';
     $elements[] = $this->createElement('select', 'submitted')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setLabel('Submit')->addMultiOptions($optIsSubmitted);
     $optIsSubmitted[''] = '';
     $optIsSubmitted['1'] = 'Tiha ona';
     $optIsSubmitted['0'] = 'Seidauk';
     $elements[] = $this->createElement('select', 'contract')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setLabel('Iha Kontratu')->addMultiOptions($optIsSubmitted);
     $this->addElements($elements);
 }
Пример #6
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'id_isicclasstimor')->setDecorators(array('ViewHelper'));
     $mapperDivision = new Register_Model_Mapper_IsicDivision();
     $divisions = $mapperDivision->fetchAll();
     $optDivisions[''] = '';
     foreach ($divisions as $divisions) {
         $optDivisions[$divisions['id_isicdivision']] = $divisions['name_disivion'];
     }
     $elements[] = $this->createElement('select', 'fk_id_isicdivision')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Divisaun')->addMultiOptions($optDivisions)->setRequired(true);
     $elements[] = $this->createElement('select', 'fk_id_isicgroup')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Grupu')->setRegisterInArrayValidator(false)->setRequired(true);
     $elements[] = $this->createElement('select', 'fk_id_isicclass')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Klase')->setRegisterInArrayValidator(false)->setRequired(true);
     $elements[] = $this->createElement('text', 'name_classtimor')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->addFilter('StringToUpper')->setAttrib('maxlength', 200)->setAttrib('class', 'm-wrap span12')->setLabel('Naran Klase Index Timor')->setRequired(true);
     $elements[] = $this->createElement('text', 'acronym')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->addFilter('StringToUpper')->setAttrib('class', 'm-wrap span4')->setAttrib('readOnly', true)->setLabel('Sigla')->setRequired(true);
     $elements[] = $this->createElement('textarea', 'description')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->addFilter('StringToUpper')->setAttrib('class', 'span12')->setAttrib('cols', 100)->setAttrib('rows', 5)->setLabel('Deskrisaun');
     $this->addElements($elements);
     App_Form_Toolbar::build($this, self::ID);
 }
Пример #7
0
 public function init()
 {
     $this->setAttrib('class', 'horizontal-form');
     $elements = array();
     $elements[] = $this->createElement('hidden', 'id_pce_contract')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'fk_id_fefop_contract')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'fk_id_perdata')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'fk_id_fefpstudentclass')->setDecorators(array('ViewHelper'));
     $elements[] = $this->createElement('hidden', 'expense')->setIsArray(true);
     $elements[] = $this->createElement('hidden', 'detailed_expense')->setIsArray(true);
     $elements[] = $this->createElement('text', 'beneficiary')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Benefisiariu');
     $elements[] = $this->createElement('text', 'class_name')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Formasaun téknika');
     $dbDistrict = App_Model_DbTable_Factory::get('AddDistrict');
     $districts = $dbDistrict->fetchAll();
     $optCountry[''] = '';
     foreach ($districts as $district) {
         $optCountry[$district['id_adddistrict']] = $district['District'];
     }
     $elements[] = $this->createElement('select', 'fk_id_adddistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optCountry)->setValue(Admin_Model_Mapper_SysUser::userCeopToDistrict())->setLabel('Distritu')->setRequired(true);
     $optModule[''] = '';
     $optModule[Fefop_Model_Mapper_Module::CEC] = 'CEC';
     $optModule[Fefop_Model_Mapper_Module::CED] = 'CED';
     $elements[] = $this->createElement('select', 'fk_id_fefop_modules')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->addMultiOptions($optModule)->setLabel('Modulu')->setRequired(true);
     $mapperIsicDivision = new Register_Model_Mapper_IsicDivision();
     $rows = $mapperIsicDivision->listAll();
     $optDivisionTimor[''] = '';
     foreach ($rows as $row) {
         $optDivisionTimor[$row->id_isicdivision] = $row->name_disivion;
     }
     $elements[] = $this->createElement('select', 'fk_id_isicdivision')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Setór atividade nian')->addMultiOptions($optDivisionTimor)->setRequired(true);
     $elements[] = $this->createElement('select', 'fk_id_isicclasstimor')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Área negósiu nian')->setRegisterInArrayValidator(false)->setRequired(true);
     $elements[] = $this->createElement('text', 'amount')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span12 money-mask')->removeDecorator('Label');
     $elements[] = $this->createElement('text', 'date_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readonly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 date-mask')->setLabel('Data hahú');
     $elements[] = $this->createElement('text', 'date_finish')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readonly', true)->setAttrib('class', 'm-wrap span12 date-mask')->setRequired(true)->setLabel('Data Finalizasaun');
     $elements[] = $this->createElement('text', 'duration')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readonly', true)->setAttrib('class', 'm-wrap span12')->setRequired(true)->setLabel('Durasaun');
     $this->addElements($elements);
     App_Form_Toolbar::build($this, self::ID);
     $this->setDecorators($this->getDefaultFormDecorators());
 }