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 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 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_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 listAction() { $this->_helper->layout()->disableLayout(); $this->view->rows = $this->_mapper->listAll(); }
/** * */ 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; } }