public function init() { $this->setAttrib('class', 'horizontal-form')->setName('search'); $elements = array(); $dbFefopPrograms = App_Model_DbTable_Factory::get('FEFOPPrograms'); $programs = $dbFefopPrograms->fetchAll(); $optPrograms[''] = ''; foreach ($programs as $program) { $optPrograms[$program['id_fefop_programs']] = $program['acronym'] . ' - ' . $program['description']; } $elements[] = $this->createElement('select', 'id_fefop_programs')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Programa FEFOP')->addMultiOptions($optPrograms); $elements[] = $this->createElement('select', 'fk_id_fefop_modules')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Modulu FEFOP')->setRegisterInArrayValidator(false); $elements[] = $this->createElement('text', 'date_registration_ini')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask date')->setLabel('Data Rejistu Inisiu'); $elements[] = $this->createElement('text', 'date_registration_fim')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask date')->setLabel('Data Rejistu Final'); $elements[] = $this->createElement('text', 'beneficiary_name')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setLabel('Naran Benefisiraiu'); $optStatus[''] = ''; $optStatus['1'] = 'Loos'; $optStatus['0'] = 'Lae'; $elements[] = $this->createElement('select', 'status')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setLabel('Ativu?')->addMultiOptions($optStatus); $mapperSysUser = new Admin_Model_Mapper_SysUser(); $users = $mapperSysUser->listAll(); $optUsers[''] = ''; foreach ($users as $user) { $optUsers[$user['id_sysuser']] = $user['name']; } $elements[] = $this->createElement('select', 'fk_id_user_inserted')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Usuariu Rejistu')->addMultiOptions($optUsers); $elements[] = $this->createElement('select', 'fk_id_user_removed')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Usuariu Libera')->addMultiOptions($optUsers); $optTypeBeneficiary[''] = ''; $optTypeBeneficiary['fk_id_perdata'] = 'Kliente'; $optTypeBeneficiary['fk_id_staff'] = 'Empreza Staff'; $optTypeBeneficiary['fk_id_fefpeduinstitution'] = 'Inst. Ensinu'; $optTypeBeneficiary['fk_id_fefpenterprise'] = 'Empreza'; $elements[] = $this->createElement('select', 'type_beneficiary')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Tipu Benefisiariu')->addMultiOptions($optTypeBeneficiary); $this->addElements($elements); }
/** * * @return \ArrayObject */ public function userReport() { $mapperUser = new Admin_Model_Mapper_SysUser(); $users = $mapperUser->listAll($this->_data['fk_id_dec']); $data = array('rows' => $users); return $data; }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('text', 'start_date')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('readonly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12')->setLabel('Data Iniciu'); $elements[] = $this->createElement('text', 'finish_date')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('readonly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12')->setLabel('Data Fim'); $mapperSysUser = new Admin_Model_Mapper_SysUser(); $users = $mapperSysUser->listAll(); $optUsers[''] = ''; foreach ($users as $user) { $optUsers[$user['id_sysuser']] = $user['name']; } $elements[] = $this->createElement('select', 'fk_id_sysuser')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Usuariu')->addMultiOptions($optUsers)->setRequired(true); $elements[] = $this->createElement('text', 'description')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->addFilter('StringToUpper')->setAttrib('maxlength', 200)->setAttrib('class', 'm-wrap span12')->setLabel('Deskrisaun'); $dbModule = App_Model_DbTable_Factory::get('SysModule'); $modules = $dbModule->fetchAll(array(), array('module')); $optModule[''] = ''; foreach ($modules as $module) { $optModule[$module['id_sysmodule']] = $module['module']; } $elements[] = $this->createElement('select', 'fk_id_sysmodule')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Modulu')->addMultiOptions($optModule); $elements[] = $this->createElement('select', 'fk_id_sysform')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setRegisterInArrayValidator(false)->setLabel('Formulariu'); $this->addElements($elements); App_Form_Toolbar::build($this, self::ID); }
/** * */ public function loadUsersAction() { $mapperSysUser = new Admin_Model_Mapper_SysUser(); $users = $mapperSysUser->listAll($this->_getParam('id')); $opts = array(array('id' => '', 'name' => '')); foreach ($users as $user) { $opts[] = array('id' => $user->id_sysuser, 'name' => $user->name); } $this->_helper->json($opts); }
/** * */ public function seekSourceUserAction() { $mapperSysUser = new Admin_Model_Mapper_SysUser(); $users = $mapperSysUser->listAll(); $id = $this->_getParam('id'); $opt = array(array('id' => '', 'name' => '')); foreach ($users as $user) { if ($id == $user->id_sysuser) { continue; } $opt[] = array('id' => $user->id_sysuser, 'name' => $user->name); } $this->_helper->json($opt); }
public function init() { $this->setAttrib('class', 'form-horizontal'); $elements = array(); $mapperSysUser = new Admin_Model_Mapper_SysUser(); $users = $mapperSysUser->listAll(); $optUsers[''] = ''; foreach ($users as $user) { $optUsers[$user['id_sysuser']] = $user['name']; } $elements[] = $this->createElement('select', 'fk_id_sysuser')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Usuariu')->addMultiOptions($optUsers)->setRequired(true); $elements[] = $this->createElement('select', 'user_source')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Kopia husi'); $this->addElements($elements); $this->setDecorators($this->getDefaultFormDecorators()); }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('hidden', 'id_per_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefop_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefop_modules')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefpenterprise')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'expense')->setIsArray(true); $elements[] = $this->createElement('hidden', 'item_expense')->setIsArray(true); $elements[] = $this->createElement('hidden', 'employment_expense')->setIsArray(true); $elements[] = $this->createElement('hidden', 'formation_expense')->setIsArray(true); $elements[] = $this->createElement('text', 'enterprise')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'span12 focused')->setLabel('Instituisaun responsavel ba implementasaun'); $elements[] = $this->createElement('select', 'fk_id_per_area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'span12 chosen')->setLabel('Area projetu nian')->setRequired(true); $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', 'span12')->setValue(Admin_Model_Mapper_SysUser::userCeopToDistrict())->addMultiOptions($optCountry)->setLabel('Distritu')->setRequired(true); $elements[] = $this->createElement('select', 'fk_id_addsubdistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'span12')->setRegisterInArrayValidator(false)->setLabel('Sub-Distritu')->setRequired(true); $elements[] = $this->createElement('select', 'fk_id_addsucu')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'span12')->setRegisterInArrayValidator(false)->setLabel('Suku')->setRequired(true); $elements[] = $this->createElement('text', 'date_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setRequired(true)->setAttrib('class', 'span12 date-mask')->setLabel('Loron Inisiu'); $elements[] = $this->createElement('text', 'date_finish')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'span12 date-mask')->setRequired(true)->setLabel('Loron Remata'); $elements[] = $this->createElement('textarea', 'description')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->addFilter('StringToUpper')->setAttrib('class', 'span12')->setAttrib('cols', 100)->setAttrib('rows', 3)->setLabel('Deskrisaun Projetu nian'); $elements[] = $this->createElement('text', 'amount')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->removeDecorator('Label')->setAttrib('class', 'span12 money-mask required')->setLabel('Total')->setRequired(true); $this->addElements($elements); }
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')); $mapperEnterprise = new Register_Model_Mapper_Enterprise(); $rows = $mapperEnterprise->listByFilters(); $optEnteprises[''] = ''; foreach ($rows as $row) { $optEnteprises[$row['id_fefpenterprise']] = $row['enterprise_name']; } $elements[] = $this->createElement('select', 'fk_id_fefpenterprise')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->addMultiOptions($optEnteprises)->setLabel('Instituisaun responsavel ba implementasaun'); $elements[] = $this->createElement('select', 'fk_id_per_area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'span12')->setLabel('Area projetu nian'); $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', 'span12')->setValue(Admin_Model_Mapper_SysUser::userCeopToDistrict())->addMultiOptions($optCountry)->setLabel('Distritu'); $elements[] = $this->createElement('select', 'fk_id_addsubdistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'span12')->setRegisterInArrayValidator(false)->setLabel('Sub-Distritu'); $elements[] = $this->createElement('select', 'fk_id_addsucu')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'span12')->setRegisterInArrayValidator(false)->setLabel('Suku'); $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'); $elements[] = $this->createElement('select', 'fk_id_per_area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'span12')->setLabel('Area projetu nian'); $this->addElements($elements); }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('hidden', 'id_drh_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_drh_trainingplan')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefop_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_drh_beneficiary')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_perdata')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'expense')->setIsArray(true); $elements[] = $this->createElement('text', 'num_training_plan')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12')->setLabel('Plano ba Formasaun'); $elements[] = $this->createElement('text', 'modality')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12')->setLabel('Modalidade'); $elements[] = $this->createElement('text', 'scholarity_area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12')->setLabel('Área'); $elements[] = $this->createElement('text', 'ocupation_name_timor')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12')->setLabel('Dezignasaun'); $elements[] = $this->createElement('text', 'country')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12')->setLabel('Nasaun'); $elements[] = $this->createElement('text', 'city')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setAttrib('class', 'm-wrap span12')->setAttrib('readonly', true)->setLabel('Sidade'); $elements[] = $this->createElement('text', 'entity')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setAttrib('class', 'm-wrap span12')->setAttrib('readonly', true)->setLabel('Sentru Formasaun'); $elements[] = $this->createElement('text', 'training_provider')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setAttrib('class', 'm-wrap span12')->setAttrib('readonly', true)->setLabel('Entidade responsável ba formasaun'); $elements[] = $this->createElement('text', 'beneficiary')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setAttrib('class', 'm-wrap span12')->setAttrib('readonly', true)->setLabel('Benefisiáriu ikus'); $elements[] = $this->createElement('text', 'date_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setRequired(true)->setAttrib('class', 'm-wrap span12 date-mask')->setLabel('Data hahú'); $elements[] = $this->createElement('text', 'date_finish')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask')->setRequired(true)->setLabel('Data finalizasaun'); $elements[] = $this->createElement('text', 'duration_days')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setAttrib('class', 'm-wrap span12')->setAttrib('readonly', true)->setLabel('Durasaun'); $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); $this->addElements($elements); App_Form_Toolbar::build($this, self::ID); $this->setDecorators($this->getDefaultFormDecorators()); }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('hidden', 'id_fp_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_annual_planning')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_perscholarity')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_planning_course')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefop_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_unit_cost')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefpstudentclass')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefpeduinstitution')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'id_budget_category')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'cost_client')->setIsArray(true); $elements[] = $this->createElement('hidden', 'client_handicapped')->setIsArray(true); $elements[] = $this->createElement('text', 'institute')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span12')->setLabel('Sentru ba formasaun ne\'ebé akreditadu')->setRequired(true); $elements[] = $this->createElement('text', 'class_name')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span12')->setLabel('Turma')->setRequired(true); $elements[] = $this->createElement('text', 'scholarity')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span12')->setLabel('Kursu')->setRequired(true); $elements[] = $this->createElement('text', 'amount')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span6 money-mask')->setLabel('Total')->setRequired(true); $elements[] = $this->createElement('text', 'unit_cost')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setAttrib('class', 'm-wrap span6 money-mask')->setLabel('Kustu Unitariu')->setRequired(true); $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); $elements[] = $this->createElement('text', 'start_date')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 date')->setLabel('Loron Inisiu'); $elements[] = $this->createElement('text', 'finish_date')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date')->setAttrib('readOnly', true)->setRequired(true)->setLabel('Loron Remata'); $this->addElements($elements); App_Form_Toolbar::build($this, self::ID); $this->setDecorators($this->getDefaultFormDecorators()); }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('hidden', 'id_ri_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefop_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefpeduinstitution')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'cost_expense')->setIsArray(true); $elements[] = $this->createElement('hidden', 'item_expense')->setIsArray(true); $elements[] = $this->createElement('hidden', 'quantity')->setIsArray(true); $elements[] = $this->createElement('hidden', 'amount_unit')->setIsArray(true); $elements[] = $this->createElement('hidden', 'amount_total')->setIsArray(true); $elements[] = $this->createElement('hidden', 'comments')->setIsArray(true); $elements[] = $this->createElement('text', 'institute')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Sentru Formasaun'); $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')->setValue(Admin_Model_Mapper_SysUser::userCeopToDistrict())->addMultiOptions($optCountry)->setLabel('Distritu')->setRequired(true); $elements[] = $this->createElement('select', 'fk_id_addsubdistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setRegisterInArrayValidator(false)->setLabel('Sub-Distritu')->setRequired(true); $elements[] = $this->createElement('text', 'date_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setRequired(true)->setAttrib('class', 'm-wrap span12 date-mask')->setLabel('Loron Inisiu'); $elements[] = $this->createElement('text', 'date_finish')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask')->setRequired(true)->setLabel('Loron Remata'); $elements[] = $this->createElement('text', 'amount')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->removeDecorator('Label')->setAttrib('class', 'm-wrap span12 money-mask required')->setLabel('Total')->setRequired(true); $this->addElements($elements); App_Form_Toolbar::build($this, self::ID); $this->setDecorators($this->getDefaultFormDecorators()); }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('hidden', 'id_department')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('text', 'name')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->addFilter('StringToUpper')->setAttrib('maxlength', 200)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Naran Departamentu')->setRequired(true); $mapperSysUser = new Admin_Model_Mapper_SysUser(); $users = $mapperSysUser->listAll(); $optUsers[''] = ''; foreach ($users as $user) { $optUsers[$user['id_sysuser']] = $user['name']; } $elements[] = $this->createElement('select', 'fk_id_sysuser')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Responsavel')->addMultiOptions($optUsers)->setRequired(true); $this->addElements($elements); App_Form_Toolbar::build($this, self::ID); $this->setDecorators($this->getDefaultFormDecorators()); }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('hidden', 'id_fefpeduinstitution')->setAttrib('class', 'no-clear')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'step')->setDecorators(array('ViewHelper'))->setAttrib('class', 'no-clear')->setValue('information'); $elements[] = $this->createElement('text', 'institution')->setDecorators($this->getDefaultElementDecorators())->addFilter('StringTrim')->addFilter('StringToUpper')->setAttrib('maxlength', 200)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Naran Instituisaun Ensinu'); $elements[] = $this->createElement('text', 'date_visit')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setRequired(true)->setAttrib('class', 'm-wrap span12 date-mask date')->setLabel('Data Visita'); $elements[] = $this->createElement('text', 'num_register')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12')->setLabel('Numeru Rejistu'); $elements[] = $this->createElement('text', 'year_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span6 year-mask')->setLabel('Tinan Iniciu'); $elements[] = $this->createElement('text', 'date_registration')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setRequired(true)->setAttrib('class', 'm-wrap span12 date-mask date')->setLabel('Data Rejistu'); $dbDec = App_Model_DbTable_Factory::get('Dec'); $rows = $dbDec->fetchAll(array(), array('name_dec')); $optCeop[''] = ''; foreach ($rows as $row) { $optCeop[$row->id_dec] = $row->name_dec; } $elements[] = $this->createElement('select', 'fk_id_dec')->setDecorators($this->getDefaultElementDecorators())->setLabel('CEOP')->addMultiOptions($optCeop)->setRequired(true)->setAttrib('class', 'm-wrap span12'); $dbTypeInstitution = App_Model_DbTable_Factory::get('TypeInstitution'); $rows = $dbTypeInstitution->fetchAll(array(), array('type_institution')); $optType[''] = ''; foreach ($rows as $row) { $optType[$row->id_typeinstitution] = $row->type_institution; } $elements[] = $this->createElement('select', 'fk_typeinstitution')->setDecorators($this->getDefaultElementDecorators())->setLabel('Tipu Instituisaun')->addMultiOptions($optType)->setRequired(true)->setAttrib('class', 'm-wrap span12'); $optRegister[''] = ''; $optRegister['1'] = 'Sim'; $optRegister['0'] = 'Lae'; $elements[] = $this->createElement('select', 'register')->setDecorators($this->getDefaultElementDecorators())->setLabel('Rejistu ?')->addMultiOptions($optRegister)->setRequired(true)->setAttrib('class', 'm-wrap span6'); $mapperSysUser = new Admin_Model_Mapper_SysUser(); $users = $mapperSysUser->listAll(); $optUsers[''] = ''; foreach ($users as $user) { $optUsers[$user['id_sysuser']] = $user['name']; } $elements[] = $this->createElement('select', 'fk_id_sysuser')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Usuariu')->addMultiOptions($optUsers); App_Form_Toolbar::build($this, self::ID); $this->addElements($elements); }
public function init() { $this->setAttrib('class', 'horizontal-form'); $elements = array(); $elements[] = $this->createElement('hidden', 'id_fe_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefop_contract')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefpeduinstitution')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fefpenterprise')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_perdata')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_trainee')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'fk_id_fe_registration')->setDecorators(array('ViewHelper')); $elements[] = $this->createElement('hidden', 'cost_expense')->setIsArray(true); $elements[] = $this->createElement('text', 'entity')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Entidade promotora'); $elements[] = $this->createElement('text', 'beneficiary')->setDecorators($this->getDefaultElementDecorators())->setAttrib('readOnly', true)->setRequired(true)->setAttrib('class', 'm-wrap span12 focused')->setLabel('Benefisiariu'); $mapperScholarityArea = new Register_Model_Mapper_ScholarityArea(); $sections = $mapperScholarityArea->fetchAll(); $optScholarityArea[''] = ''; foreach ($sections as $section) { $optScholarityArea[$section['id_scholarity_area']] = $section['scholarity_area']; } $elements[] = $this->createElement('select', 'fk_id_scholarity_area')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen focused')->setLabel('Area Kursu')->addMultiOptions($optScholarityArea)->setRequired(true); $dbOccupationTimor = App_Model_DbTable_Factory::get('PROFOcupationTimor'); $occupations = $dbOccupationTimor->fetchAll(); $optOccupations[''] = ''; foreach ($occupations as $occupation) { $optOccupations[$occupation['id_profocupationtimor']] = $occupation['acronym'] . ' ' . $occupation['ocupation_name_timor']; } $elements[] = $this->createElement('select', 'fk_id_profocupationtimor')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12 chosen')->setLabel('Dezignasaun')->addMultiOptions($optOccupations)->setRequired(true); $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); $elements[] = $this->createElement('select', 'fk_id_addsubdistrict')->setDecorators($this->getDefaultElementDecorators())->setAttrib('class', 'm-wrap span12')->setRegisterInArrayValidator(false)->setLabel('Sub-Distritu')->setRequired(true); $elements[] = $this->createElement('text', 'date_start')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setRequired(true)->setAttrib('class', 'm-wrap span12 date-mask')->setLabel('Data hahú'); $elements[] = $this->createElement('text', 'date_finish')->setDecorators($this->getDefaultElementDecorators())->setAttrib('maxlength', 10)->setAttrib('class', 'm-wrap span12 date-mask')->setRequired(true)->setLabel('Data finalizasaun'); /* $elements[] = $this->createElement( 'text', 'date_formation' ) ->setDecorators( $this->getDefaultElementDecorators() ) ->setRequired( true ) ->setAttrib( 'class', 'm-wrap span12' ) ->setAttrib( 'readonly', true ) ->setLabel( 'Data limite formasaun' ); */ $elements[] = $this->createElement('text', 'duration_month')->setDecorators($this->getDefaultElementDecorators())->setRequired(true)->setAttrib('class', 'm-wrap span12')->setAttrib('readonly', true)->setLabel('Durasaun'); $this->addElements($elements); App_Form_Toolbar::build($this, self::ID); $this->setDecorators($this->getDefaultFormDecorators()); }
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()); }
/** * */ public function getFilters() { $filters = $this->_data; if (!empty($this->_data['fk_id_dec'])) { $dbDec = App_Model_DbTable_Factory::get('Dec'); $select = $dbDec->select()->from($dbDec, array('name_dec'))->where('id_dec IN(?)', $this->_data['fk_id_dec']); $rows = $dbDec->fetchAll($select); $filters['ceop'] = ''; foreach ($rows as $key => $row) { $filters['ceop'] .= $row->name_dec; if ($rows->count() != ++$key) { $filters['ceop'] .= ', '; } } } if (!empty($this->_data['fk_id_counselor'])) { $dbSysUser = App_Model_DbTable_Factory::get('SysUser'); $select = $dbSysUser->select()->from($dbSysUser, array('name'))->where('id_sysuser IN(?)', $this->_data['fk_id_counselor']); $rows = $dbSysUser->fetchAll($select); $filters['fk_id_counselor'] = ''; foreach ($rows as $key => $row) { $filters['fk_id_counselor'] .= $row->name; if ($rows->count() != ++$key) { $filters['fk_id_counselor'] .= ', '; } } } if (!empty($this->_data['fk_id_addcountry'])) { $mapperCountry = new Register_Model_Mapper_AddCountry(); $contry = $mapperCountry->fetchRow($this->_data['fk_id_addcountry']); $filters['country'] = $contry->country; } if (!empty($this->_data['fk_id_adddistrict'])) { $mapperDistrict = new Register_Model_Mapper_AddDistrict(); $district = $mapperDistrict->fetchRow($this->_data['fk_id_adddistrict']); $filters['district'] = $district->District; } if (!empty($this->_data['fk_id_fefpenterprise'])) { $mapperEnterprise = new Register_Model_Mapper_Enterprise(); $enterprise = $mapperEnterprise->fetchRow($this->_data['fk_id_fefpenterprise']); $filters['enterprise'] = $enterprise->enterprise_name; } if (!empty($this->_data['fk_id_fefpeduinstitution'])) { $mapperEducationInstititue = new Register_Model_Mapper_EducationInstitute(); $educationInstititute = $mapperEducationInstititue->fetchRow($this->_data['fk_id_fefpeduinstitution']); $filters['institute'] = $educationInstititute->institution; } if (!empty($this->_data['fk_id_profocupation'])) { $mapperOccupation = new Register_Model_Mapper_ProfOcupationTimor(); $occupation = $mapperOccupation->fetchRow($this->_data['fk_id_profocupation']); $filters['occupation'] = $occupation['acronym'] . ' ' . $occupation['ocupation_name_timor']; } if (!empty($this->_data['fk_id_scholarity_area'])) { $mapperScholarityArea = new Register_Model_Mapper_ScholarityArea(); $area = $mapperScholarityArea->fetchRow($this->_data['fk_id_scholarity_area']); $filters['area'] = $area['scholarity_area']; } if (!empty($this->_data['fk_id_pertypescholarity'])) { $mapperTypeScholarity = new Register_Model_Mapper_PerTypeScholarity(); $typeScholarity = $mapperTypeScholarity->fetchRow($this->_data['fk_id_pertypescholarity']); $filters['type_scholarity'] = $typeScholarity['type_scholarity']; } if (!empty($this->_data['fk_typeinstitution'])) { $mapperTypeInstitution = App_Model_DbTable_Factory::get('TypeInstitution'); $typeInstitution = $mapperTypeInstitution->fetchRow(array('id_typeinstitution = ?' => $this->_data['fk_typeinstitution'])); $filters['type_institution'] = $typeInstitution['type_institution']; } if (!empty($this->_data['fk_id_sectorindustry'])) { $mapperIsicClass = App_Model_DbTable_Factory::get('ISICClassTimor'); $sectorIndustry = $mapperIsicClass->fetchRow(array('id_isicclasstimor = ?' => $this->_data['fk_id_sectorindustry'])); $filters['sector_industry'] = $sectorIndustry['name_classtimor']; } if (!empty($this->_data['fk_fefptypeenterprite'])) { $mapperTypeEnterprise = App_Model_DbTable_Factory::get('FEFPTypeEnterprise'); $typeEnterprise = $mapperTypeEnterprise->fetchRow(array('id_fefptypeenterprise = ?' => $this->_data['fk_fefptypeenterprite'])); $filters['type_enterprise'] = $typeEnterprise['type_enterprise']; } if (!empty($this->_data['fk_id_perlevelscholarity'])) { $dbLevelScholarity = App_Model_DbTable_Factory::get('PerLevelScholarity'); $levelScholarity = $dbLevelScholarity->fetchRow(array('id_perlevelscholarity = ?' => $this->_data['fk_id_perlevelscholarity'])); $filters['level_scholarity'] = $levelScholarity['level_scholarity']; } if (!empty($this->_data['fk_id_perscholarity'])) { $mapperScholarity = new Register_Model_Mapper_PerScholarity(); $course = $mapperScholarity->fetchRow($this->_data['fk_id_perscholarity']); $filters['course'] = (empty($course['external_code']) ? '' : $course['external_code'] . ' - ') . $course['scholarity']; } if (!empty($this->_data['fk_id_sysuser'])) { $mapperSysUser = new Admin_Model_Mapper_SysUser(); $user = $mapperSysUser->fetchRow($this->_data['fk_id_sysuser']); $filters['user'] = $user['name'] . ' (' . $user['login'] . ')'; } if (!empty($this->_data['fk_id_department'])) { $mapperDepartment = new Admin_Model_Mapper_Department(); $department = $mapperDepartment->fetchRow($this->_data['fk_id_department']); $filters['department'] = $department['name']; } if (!empty($this->_data['fk_id_campaign_type'])) { $mapperCampaignType = new Sms_Model_Mapper_CampaignType(); $campaignType = $mapperCampaignType->fetchRow($this->_data['fk_id_campaign_type']); $filters['campaign_type'] = $campaignType['campaign_type']; } if (!empty($this->_data['status_campaign'])) { $view = Zend_Layout::getMvcInstance()->getView(); $optStatuses = $view->campaign()->getStatuses(); $filters['status_campaign'] = $optStatuses[$this->_data['status_campaign']]; } if (!empty($this->_data['fk_id_campaign'])) { $mapperCampaign = new Sms_Model_Mapper_Campaign(); $campaign = $mapperCampaign->fetchRow($this->_data['fk_id_campaign']); $filters['campaign_title'] = $campaign['campaign_title']; } if (!empty($this->_data['id_fefop_programs']) || !empty($this->_data['fk_id_fefop_programs'])) { $dbFEFOPPrograms = App_Model_DbTable_Factory::get('FEFOPPrograms'); if (!empty($this->_data['id_fefop_programs'])) { if (!is_array($this->_data['id_fefop_programs'])) { $row = $dbFEFOPPrograms->find($this->_data['id_fefop_programs'])->current(); $filters['fefop_program'] = $row->acronym . ' - ' . $row->description; } else { $select = $dbFEFOPPrograms->select()->from($dbFEFOPPrograms, array('description', 'acronym'))->where('id_fefop_programs IN(?)', $this->_data['id_fefop_programs']); $rows = $dbFEFOPPrograms->fetchAll($select); $filters['fefop_program'] = ''; foreach ($rows as $key => $row) { $filters['fefop_program'] .= $row->acronym . ' - ' . $row->description; if ($rows->count() != ++$key) { $filters['fefop_program'] .= ', '; } } } } else { if (!empty($this->_data['fk_id_fefop_programs'])) { $row = $dbFEFOPPrograms->find($this->_data['fk_id_fefop_programs'])->current(); $filters['fefop_program'] = $row->acronym . ' - ' . $row->description; } } } if (!empty($this->_data['id_fefop_modules']) || !empty($this->_data['fk_id_fefop_modules'])) { $dbFEFOPModules = App_Model_DbTable_Factory::get('FEFOPModules'); if (!empty($this->_data['id_fefop_modules'])) { if (!is_array($this->_data['id_fefop_modules'])) { $row = $dbFEFOPModules->find($this->_data['id_fefop_modules'])->current(); $filters['fefop_module'] = $row->acronym . ' - ' . $row->description; } else { $select = $dbFEFOPModules->select()->from($dbFEFOPModules, array('description', 'acronym'))->where('id_fefop_modules IN(?)', $this->_data['id_fefop_modules']); $rows = $dbFEFOPModules->fetchAll($select); $filters['fefop_module'] = ''; foreach ($rows as $key => $row) { $filters['fefop_module'] .= $row->acronym . ' - ' . $row->description; if ($rows->count() != ++$key) { $filters['fefop_module'] .= ', '; } } } } else { if (!empty($this->_data['fk_id_fefop_modules'])) { $row = $dbFEFOPModules->find($this->_data['fk_id_fefop_modules'])->current(); $filters['fefop_module'] = $row->acronym . ' - ' . $row->description; } } } if (!empty($this->_data['id_adddistrict'])) { $dbAddDistrict = App_Model_DbTable_Factory::get('AddDistrict'); if (is_array($this->_data['id_adddistrict'])) { $select = $dbAddDistrict->select()->from($dbAddDistrict, array('District'))->where('id_adddistrict IN(?)', $this->_data['id_adddistrict']); $rows = $dbAddDistrict->fetchAll($select); $filters['district'] = ''; foreach ($rows as $key => $row) { $filters['district'] .= $row->District; if ($rows->count() != ++$key) { $filters['district'] .= ', '; } } } else { $row = $dbAddDistrict->find($this->_data['id_adddistrict'])->current(); $filters['district'] = $row->District; } } if (!empty($this->_data['num_district'])) { $row = App_Model_DbTable_Factory::get('AddDistrict')->fetchRow(array('acronym = ?' => $this->_data['num_district'])); $filters['district'] = $row->District; } if (!empty($this->_data['id_scholarity_area'])) { $row = App_Model_DbTable_Factory::get('ScholarityArea')->find($this->_data['id_scholarity_area'])->current(); $filters['scholarity_area'] = (empty($row->acronym) ? '' : $row->acronym . ' - ') . $row->scholarity_area; } if (!empty($this->_data['id_profocupationtimor'])) { $row = App_Model_DbTable_Factory::get('PROFOcupationTimor')->find($this->_data['id_profocupationtimor'])->current(); $filters['ocupationtimor'] = $row->acronym . ' - ' . $row->ocupation_name_timor; } if (!empty($this->_data['id_fefpeduinstitution'])) { $row = App_Model_DbTable_Factory::get('FefpEduInstitution')->find($this->_data['id_fefpeduinstitution'])->current(); $filters['institution'] = $row->institution; } if (!empty($this->_data['fk_id_user_inserted'])) { $row = App_Model_DbTable_Factory::get('SysUser')->find($this->_data['fk_id_user_inserted'])->current(); $filters['user_inserted'] = $row->name; } if (!empty($this->_data['fk_id_user_removed'])) { $row = App_Model_DbTable_Factory::get('SysUser')->find($this->_data['fk_id_user_removed'])->current(); $filters['user_removed'] = $row->name; } if (array_key_exists('status', $this->_data) && is_numeric($this->_data['status'])) { $filters['status_description'] = $this->_data['status'] ? 'Loos' : 'Lae'; } if (!empty($this->_data['date_registration_ini'])) { $filters['date_registration_ini'] = $this->_data['date_registration_ini']; } if (!empty($this->_data['date_registration_fim'])) { $filters['date_registration_fim'] = $this->_data['date_registration_fim']; } if (!empty($this->_data['num_year'])) { $filters['num_year'] = $this->_data['num_year']; } if (!empty($this->_data['num_sequence'])) { $filters['num_sequence'] = $this->_data['num_sequence']; } if (array_key_exists('minimum_amount', $this->_data) && array_key_exists('maximum_amount', $this->_data)) { $min = new Zend_Currency('en_US'); $min->setValue($this->_data['minimum_amount']); $max = new Zend_Currency('en_US'); $max->setValue($this->_data['maximum_amount']); $filters['minmaxamount'] = $min . ' - ' . $max; } if (!empty($this->_data['id_fefop_status']) || !empty($this->_data['fk_id_fefop_status'])) { $dbFEFOPStatus = App_Model_DbTable_Factory::get('FEFOPStatus'); if (!empty($this->_data['id_fefop_status'])) { if (!is_array($this->_data['id_fefop_status'])) { $row = $dbFEFOPStatus->find($this->_data['id_fefop_status'])->current(); $filters['fefop_status'] = $row->status_description; } else { $select = $dbFEFOPStatus->select()->from($dbFEFOPStatus, array('status_description'))->where('id_fefop_status IN(?)', $this->_data['id_fefop_status']); $rows = $dbFEFOPStatus->fetchAll($select); $filters['fefop_status'] = ''; foreach ($rows as $key => $row) { $filters['fefop_status'] .= $row->status_description; if ($rows->count() != ++$key) { $filters['fefop_status'] .= ', '; } } } } else { $row = $dbFEFOPStatus->find($this->_data['fk_id_fefop_status'])->current(); $filters['fefop_status'] = $row->status_description; } } if (!empty($this->_data['id_budget_category_type'])) { $row = App_Model_DbTable_Factory::get('BudgetCategoryType')->find($this->_data['id_budget_category_type'])->current(); $filters['budget_category_type'] = $row->description; } if (!empty($this->_data['type_fefopfund'])) { if ('G' == $this->_data['type_fefopfund']) { $filters['description_type_fefopfund'] = 'Governo'; } else { $filters['description_type_fefopfund'] = 'Donor'; } } if (!empty($this->_data['id_beneficiary'])) { $mapper = new Fefop_Model_Mapper_Contract(); $adapter = App_Model_DbTable_Abstract::getDefaultAdapter(); $select = $adapter->select()->from(array('b' => new Zend_Db_Expr('(' . $mapper->getSelectBeneficiary() . ')')), array('name'))->where('b.id = ?', $this->_data['id_beneficiary']); $row = $adapter->fetchRow($select); $filters['beneficiary'] = $row['name']; } if (!empty($this->_data['type_beneficiary'])) { switch ($this->_data['type_beneficiary']) { case 'fk_id_staff': $type_beneficiary = 'Empreza Staff'; break; case 'fk_id_fefpenterprise': $type_beneficiary = 'Empreza'; break; case 'fk_id_fefpeduinstitution': $type_beneficiary = 'Inst Ensinu'; break; case 'fk_id_perdata': $type_beneficiary = 'Kliente'; break; default: $type_beneficiary = 'N/A'; } $filters['type_beneficiary'] = $type_beneficiary; } return $filters; }
/** * */ public function listAction() { $this->_helper->layout()->disableLayout(); $this->view->rows = $this->_mapper->listAll(); }
/** * @access public * @return void */ public function editProfileAction() { $form = new Default_Form_Profile(); $mapperUser = new Admin_Model_Mapper_SysUser(); if ($this->getRequest()->isPost()) { if ($form->isValid($this->getRequest()->getPost())) { $mapperUser->setData($form->getValues()); $return = $mapperUser->editProfile(); $message = $mapperUser->getMessage()->toArray(); $result = array('status' => (bool) $return, 'id' => $return, 'description' => $message, 'data' => $form->getValues()); } else { $config = Zend_Registry::get('config'); $message = new App_Message(); $message->addMessage($config->messages->warning, App_Message::WARNING); $result = array('status' => false, 'description' => $message->toArray(), 'errors' => $form->getMessages()); } } else { $this->_helper->redirector->goToSimple('index', 'index'); } $this->_helper->json($result); }
/** * */ public function notifyAppointmentExpired() { $dbAdapter = Zend_Db_Table_Abstract::getDefaultAdapter(); $dbAdapter->beginTransaction(); try { // List the appointments expired $rows = $this->_listAppointmentsExpired(); // Search the user who must receive notes when appointment is expired $noteTypeMapper = new Admin_Model_Mapper_NoteType(); $users = $noteTypeMapper->getUsersByNoteType(Admin_Model_Mapper_NoteType::APPOINTMENT_EXPIRED); $noteModelMapper = new Default_Model_Mapper_NoteModel(); $noteMapper = new Default_Model_Mapper_Note(); $userMapper = new Admin_Model_Mapper_SysUser(); $ceopsUser = array(); foreach ($rows as $row) { $usersWarning = $users; $usersWarning[] = $row->fk_id_counselor; if (empty($ceopsUser[$row->fk_id_dec])) { // Search all the users from the same CEOP $usersCeop = $userMapper->listAll($row->fk_id_dec); foreach ($usersCeop as $userCeop) { $ceopsUser[$row->fk_id_dec][] = $userCeop->id_sysuser; } $usersWarning += $ceopsUser[$row->fk_id_dec]; } else { $usersWarning += $ceopsUser[$row->fk_id_dec]; } $dataNote = array('title' => 'AUDIENSIA KAZU LIU TIHA ONA', 'level' => 0, 'message' => $noteModelMapper->getAppointmentExpired($row), 'users' => $usersWarning); $noteMapper->setData($dataNote)->saveNote(); } $dbAdapter->commit(); return true; } catch (Exception $e) { $dbAdapter->rollBack(); echo "Error sending appointment expired notifications: " . $e->getMessage() . "\n"; return false; } }