Ejemplo n.º 1
1
 public function init()
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $href = $request->getBaseUrl() . '/' . $request->getModuleName() . '/' . $request->getControllerName() . '/' . $request->getActionName();
     //get models
     $users_model = new Admin_Model_AdminUsers();
     $roles_model = new Admin_Model_Roles();
     $users = new Zend_Form_Element_Multiselect('users');
     $users->setLabel('Users:')->setAttrib("class", "select2")->setAttrib("data-placeholder", "Choose user...")->setAttrib("style", "width:200px")->addMultiOptions($users_model->getForDropdown());
     $roles = new Zend_Form_Element_Multiselect('roles');
     $roles->setLabel('Usergroup:')->setAttrib("class", "select2")->setAttrib("data-placeholder", "Choose usergroup...")->setAttrib("style", "width:200px")->addMultiOptions($roles_model->getForDropdown());
     $actions = new Zend_Form_Element_Multiselect('actions');
     $actions->setLabel('Actions:')->setAttrib("class", "select2")->setAttrib("data-placeholder", "Choose action...")->setAttrib("style", "width:200px");
     $actions->addMultiOption('INSERT', 'INSERT')->addMultiOption('UPDATE', 'UPDATE')->addMultiOption('DELETE', 'DELETE');
     $affected_table = new Zend_Form_Element_Text('affected_table');
     $affected_table->setLabel("Tabela")->setAttrib("class", "form-control")->setAttrib("style", "width:200px");
     $start_date = new Zend_Form_Element_Text('start_date');
     $start_date->setLabel("Date from")->setAttrib('class', 'datepicker');
     $end_date = new Zend_Form_Element_Text('end_date');
     $end_date->setLabel("Date to")->setAttrib('class', 'datepicker');
     $submit = new Zend_Form_Element_Submit('filter_submit');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Filter');
     $this->setAction($href)->setMethod('post')->addElement($users)->addElement($roles)->addElement($actions)->addElement($affected_table)->addElement($start_date)->addElement($end_date)->addElement($submit);
 }
Ejemplo n.º 2
1
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'agencylistreport');
     $this->setAttrib('name', 'agencylistreport');
     $this->setAttrib('action', DOMAIN . 'reports/agencylistreport');
     $agencyname = new Zend_Form_Element_Text('agencynamef');
     $agencyname->setLabel('Agency');
     $agencyname->setAttrib('onblur', 'clearagencyname(this)');
     $agencyname->setAttrib('maxLength', 50);
     $primaryphone = new Zend_Form_Element_Text('primaryphonef');
     $primaryphone->setLabel('Primary Phone');
     $primaryphone->setAttrib('onblur', 'blurelement(this)');
     $primaryphone->setAttrib('maxLength', 15);
     $primaryphone->addFilter(new Zend_Filter_StringTrim());
     $primaryphone->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Primary phone number must contain at most %max% characters', Zend_Validate_StringLength::TOO_SHORT => 'Primary phone number must contain at least %min% characters.')))));
     $primaryphone->addValidator("regex", true, array('pattern' => '/^(?!0{10})[0-9]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')));
     $checktype = new Zend_Form_Element_Multiselect('bg_checktypef');
     $checktype->setLabel('Screening Type');
     $checktypeModal = new Default_Model_Bgscreeningtype();
     $typesData = $checktypeModal->fetchAll('isactive=1', 'type');
     foreach ($typesData->toArray() as $data) {
         $checktype->addMultiOption($data['id'], $data['type']);
     }
     $checktype->setRegisterInArrayValidator(false);
     $checktype->setAttrib('onchange', 'changeelement(this)');
     $website = new Zend_Form_Element_Text('website_urlf');
     $website->setLabel('Website Url');
     $website->setAttrib('maxLength', 50);
     $website->addFilter(new Zend_Filter_StringTrim());
     $website->setAttrib('onblur', 'clearagencyname(this)');
     $this->addElements(array($agencyname, $primaryphone, $checktype, $website));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 3
1
 public function init()
 {
     parent::init();
     $this->addElement('hidden', 'idECD');
     $vm = new Zend_Form_Element_Multiselect('idVM');
     $vm->setLabel('Value Meaning:')->addMultiOptions($this->_getDependentSelect('Default_Model_ValueMeaning'))->setDecorators($this->decorators);
     $this->addElement($vm);
     $this->addDisplayGroup(array('idVM'), 'group1', array("legend" => "Enumerated Conceptual Domain specific values"));
 }
Ejemplo n.º 4
1
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'empscreeningreport');
     $this->setAttrib('action', BASE_URL . 'reports/empscreening');
     $specimen = new Zend_Form_Element_Select('specimen');
     $specimen->setLabel('Select Employee/Candidate');
     $specimen->addMultiOption('', 'Select Employee/Candidate');
     $specimen->addMultiOption('1', 'Employee');
     $specimen->addMultiOption('2', 'Candidate');
     $empname = new Zend_Form_Element_Text('empname');
     $empname->setLabel('Employee / Candidate Name');
     $empname->addValidator("regex", true, array('pattern' => '/^([a-zA-Z.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
     $empname->setAttrib('onblur', 'clearEmpScreeningAutoCompleteNames(this)');
     $agencyname = new Zend_Form_Element_Text('agencyname');
     $agencyname->setLabel('Agency Name');
     $agencyname->setAttrib('class', 'selectoption');
     $agencyname->addValidator("regex", true, array('pattern' => '/^([a-zA-Z.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
     $agencyname->setAttrib('onblur', 'clearEmpScreeningAutoCompleteNames(this)');
     $screeningtype = new Zend_Form_Element_Multiselect('screeningtype');
     $screeningtype->setLabel('Screening Type');
     $checktypeModal = new Default_Model_Bgscreeningtype();
     $typesData = $checktypeModal->fetchAll('isactive=1', 'type');
     foreach ($typesData->toArray() as $data) {
         $screeningtype->addMultiOption($data['id'], $data['type']);
     }
     $screeningtype->setRegisterInArrayValidator(false);
     $process_status = new Zend_Form_Element_Select('process_status');
     $process_status->setLabel('Select Status');
     $process_status->addMultiOption('', 'Select Status');
     $process_status->addMultiOption('In process', 'In process');
     $process_status->addMultiOption('Complete', 'Complete');
     $process_status->addMultiOption('On hold', 'On hold');
     $month = new Zend_Form_Element_Select('month');
     $month->setLabel('Select Month');
     $month->addMultiOption('', 'Select Month');
     $monthnamesarray = array('1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
     for ($i = 1; $i <= sizeof($monthnamesarray); $i++) {
         $month->addMultiOption($i, $monthnamesarray[$i]);
     }
     $year = new Zend_Form_Element_Select('year');
     $year->setLabel('Select Year');
     $curYear = date("Y");
     $preYear = $curYear - 10;
     $year->addMultiOption('', 'Select Year');
     for ($i = $preYear; $i <= $curYear; $i++) {
         $year->addMultiOption($i, $i);
     }
     $this->addElements(array($specimen, $empname, $agencyname, $screeningtype, $process_status, $month, $year));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 5
1
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_emp_report');
     $reporting_manager = new Zend_Form_Element_Text("reporting_manager");
     $reporting_manager->setLabel("Reporting Manager");
     $reporting_manager->setAttrib('name', '');
     $reporting_manager->setAttrib('id', 'idreporting_manager');
     $joined_date = new Zend_Form_Element_Text("date_of_joining");
     $joined_date->setLabel("Joined Date");
     $joined_date->setAttrib('readonly', 'readonly');
     $modeofentry = new Zend_Form_Element_Select("modeofentry");
     $modeofentry->setLabel("Mode of Employment")->addMultiOptions(array('' => 'Select mode of employment', 'Direct' => 'Direct', 'Interview' => 'Interview', 'Reference' => 'Reference', 'Other' => 'Other'));
     // Form elelment name 'emailaddress' has to be DB table field name
     $email_id = new Zend_Form_Element_Text("emailaddress");
     $email_id->setLabel("Email ID");
     $email_id->setAttrib('name', '');
     $email_id->setAttrib('id', 'idemailaddress');
     // Form elelment name 'userfullname' has to be DB table field name
     $emp_name = new Zend_Form_Element_Text("userfullname");
     $emp_name->setLabel("Employee Name");
     $emp_name->setAttrib('name', '');
     $emp_name->setAttrib('id', 'iduserfullname');
     $employeeid = new Zend_Form_Element_Text("hidempId");
     $employeeid->setLabel("Employee ID");
     $employeeid->setAttrib('name', '');
     $jobtitle = new Zend_Form_Element_Select("jobtitle_id");
     $jobtitle->setLabel("Job Title");
     $jobtitle->setAttrib("onchange", "getpositions_req('department','business_unit','position_id','jobtitle_id');");
     $position_id = new Zend_Form_Element_Select("position_id");
     $position_id->setLabel("Position");
     $position_id->addMultiOptions(array('' => 'Select Position'));
     $emp_type = new Zend_Form_Element_Select("emp_status_id");
     $emp_type->setLabel("Employment Status");
     $emp_type->addMultiOptions(array('' => 'Select Employment Status'));
     $emprole = new Zend_Form_Element_Select("emprole");
     $emprole->setLabel("Role");
     $emprole->addMultiOptions(array('' => 'Select Role'));
     $department_id = new Zend_Form_Element_Multiselect("department_id");
     $department_id->setLabel("Department");
     $businessunit_id = new Zend_Form_Element_Multiselect("businessunit_id");
     $businessunit_id->setLabel("Business Unit");
     $isactive = new Zend_Form_Element_Select("isactive");
     $isactive->setLabel("User Status")->addMultiOptions(array('' => 'Select User Status', '0' => 'Inactive', '1' => 'Active', '2' => 'Resigned', '3' => 'Left', '4' => 'Suspended'));
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($reporting_manager, $submit, $joined_date, $modeofentry, $email_id, $emp_name, $jobtitle, $position_id, $emp_type, $emprole, $department_id, $businessunit_id, $employeeid, $isactive));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 6
1
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('action', DOMAIN . 'heirarchy/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'heirarchy');
     $id = new Zend_Form_Element_Hidden('id');
     $level_1 = new Zend_Form_Element_Multiselect('level_1');
     $level_1->setLabel('Level one');
     $level_1->setRequired(true);
     $level_1->addValidator('NotEmpty', false, array('messages' => 'Please select level one employees.'));
     $level_1->setRegisterInArrayValidator(false);
     $level_2 = new Zend_Form_Element_Multiselect('level_2');
     $level_2->setLabel('Level two');
     $level_2->setRequired(true);
     $level_2->addValidator('NotEmpty', false, array('messages' => 'Please select level two employees.'));
     $level_2->setRegisterInArrayValidator(false);
     $level_3 = new Zend_Form_Element_Multiselect('level_3');
     $level_3->setLabel('Level three');
     $level_3->setRequired(true);
     $level_3->addValidator('NotEmpty', false, array('messages' => 'Please select level three employees.'));
     $level_3->setRegisterInArrayValidator(false);
     $level_4 = new Zend_Form_Element_Multiselect('level_4');
     $level_4->setLabel('Level four');
     $level_4->setRegisterInArrayValidator(false);
     $level_5 = new Zend_Form_Element_Multiselect('level_5');
     $level_5->setLabel('Level five');
     $level_5->setRegisterInArrayValidator(false);
     $level_6 = new Zend_Form_Element_Multiselect('level_6');
     $level_6->setLabel('Level six');
     $level_6->setRegisterInArrayValidator(false);
     $level_7 = new Zend_Form_Element_Multiselect('level_7');
     $level_7->setLabel('Level seven');
     $level_7->setRegisterInArrayValidator(false);
     $level_8 = new Zend_Form_Element_Multiselect('level_8');
     $level_8->setLabel('Level eight');
     $level_8->setRegisterInArrayValidator(false);
     $level_9 = new Zend_Form_Element_Multiselect('level_9');
     $level_9->setLabel('Level nine');
     $level_9->setRegisterInArrayValidator(false);
     $level_10 = new Zend_Form_Element_Multiselect('level_10');
     $level_10->setLabel('Level ten');
     $level_10->setRegisterInArrayValidator(false);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $level_1, $level_2, $level_3, $level_4, $level_5, $level_6, $level_7, $level_8, $level_9, $level_10, $submit));
     $this->setElementDecorators(array('ViewHelper'));
     $this->setElementDecorators(array('UiWidgetElement'), array('start_date'));
 }
Ejemplo n.º 7
1
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'addempleaves');
     $id = new Zend_Form_Element_Hidden('id');
     $id_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('id', null);
     $emp_leave_limit = new Zend_Form_Element_Text('leave_limit');
     $emp_leave_limit->setLabel("Allot Leave Limit");
     $emp_leave_limit->setAttrib('maxLength', 3);
     $emp_leave_limit->addFilter(new Zend_Filter_StringTrim());
     if ($id_val == '') {
         $businessunit_id = new Zend_Form_Element_Multiselect("businessunit_id");
         $businessunit_id->setLabel("Business Units");
         $businessunit_id->setRegisterInArrayValidator(false);
         $businessunit_id->setRequired(true);
         $businessunit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.'));
         $department_id = new Zend_Form_Element_Multiselect("department_id");
         $department_id->setLabel("Departments");
         $department_id->setRegisterInArrayValidator(false);
         $department_id->setRequired(true);
         $department_id->addValidator('NotEmpty', false, array('messages' => 'Please select department.'));
         $user_id = new Zend_Form_Element_Multiselect("user_id");
         $user_id->setLabel("Employees");
         $user_id->setRegisterInArrayValidator(false);
         $user_id->setRequired(true);
         $user_id->addValidator('NotEmpty', false, array('messages' => 'Please select employees.'));
     } else {
         $businessunit_id = new Zend_Form_Element_Hidden('businessunit_id');
         $department_id = new Zend_Form_Element_Hidden('department_id');
         $user_id = new Zend_Form_Element_Hidden('user_id');
         $emp_leave_limit->setRequired(true);
         $emp_leave_limit->addValidator('NotEmpty', false, array('messages' => 'Please enter leave limit for current year.'));
     }
     $emp_leave_limit->addValidator("regex", true, array('pattern' => '/^(\\-?[1-9]|\\-?[1-9][0-9])$/', 'messages' => array('regexNotMatch' => 'Leave limit must be in the range of 0 to 100.')));
     $alloted_year = new Zend_Form_Element_Text('alloted_year');
     $alloted_year->setLabel("Year");
     $alloted_year->setAttrib('maxLength', 4);
     $alloted_year->setAttrib('disabled', 'disabled');
     $alloted_year->setAttrib('onfocus', 'this.blur()');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $submitbutton = new Zend_Form_Element_Button('submitbutton');
     $submitbutton->setAttrib('id', 'submitbuttons');
     $submitbutton->setAttrib('onclick', 'validateEmployeLeaves()');
     $submitbutton->setLabel('Save');
     $this->addElements(array($id, $user_id, $businessunit_id, $department_id, $emp_leave_limit, $alloted_year, $submit, $submitbutton));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 8
0
 public function init()
 {
     $menu_items_model = new Admin_Model_MenuItems();
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Usergroup name')->setRequired(true)->setAttrib("class", "form-control")->setAttrib("style", "width:200px");
     $menu_items = new Zend_Form_Element_Multiselect('admin_menu_item_id');
     $menu_items->addValidator(new Zend_Validate_Digits(), true);
     $menu_items->setLabel('Menu Items: ');
     $menu_items->setAttrib("class", "select2");
     $menu_items->setAttrib("data-placeholder", "Choose...");
     $menu_items->setAttrib("style", "width:200px");
     $menu_items->addMultiOptions($menu_items_model->getForDropDown());
     $permit = new Zend_Form_Element_MultiCheckbox('permit');
     $permit->setLabel('Available resources ');
     $resources_table = new Admin_Model_Resources();
     foreach ($resources_table->getAll() as $resource) {
         $permit->addMultiOption((string) $resource->id, ' ' . $resource->name);
     }
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Cancel');
     $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black');
     $cancel->setAttrib("onClick", "window.location = window.location.origin+'/admin/admin-usersgroups/'");
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($name)->addElement($menu_items)->addElement($permit)->addElement($cancel)->addElement($submit);
 }
Ejemplo n.º 9
0
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oTableName = new Zend_Form_Element_Multiselect("table_name");
     $oTableName->addMultiOptions($this->_aTableName);
     $oTableName->addValidator(new Zend_Validate_InArray(array_keys($this->_aTableName)));
     $oTableName->setRequired(FALSE);
     $oTableName->setLabel("Nazwa tabeli:");
     $oTableName->setAttrib("class", "multiselect");
     $this->addElement($oTableName);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Zapisz");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/_defaultform.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
Ejemplo n.º 10
0
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oRobots = new Zend_Form_Element_Select("site_seo_robots_id");
     $oRobots->setLabel("Tryb indeksowania przez roboty:");
     $oRobots->setRequired(FALSE);
     $oRobots->addMultiOptions($this->_aAllSiteSeoRobots);
     $oRobots->setValue(1);
     $this->addElement($oRobots);
     $oSeoTagTitle = new Zend_Form_Element_Textarea("head_title");
     $oSeoTagTitle->setLabel("Tytuł strony (meta titile):")->setFilters($this->_aFilters);
     $oSeoTagTitle->setRequired(FALSE);
     $this->addElement($oSeoTagTitle);
     $oAdditionalSeoTagKeywords = new Zend_Form_Element_Text("additional_seo_tag_keywords");
     $oAdditionalSeoTagKeywords->setLabel("Dodaj nowe słowo kluczowe:");
     $oAdditionalSeoTagKeywords->setRequired(FALSE);
     $oAdditionalSeoTagKeywords->addValidator(new Zend_Validate_StringLength(array("min" => 1, "max" => 45)));
     $oAdditionalSeoTagKeywords->setAttrib("class", "valid");
     $this->addElement($oAdditionalSeoTagKeywords);
     $oAddAdditionalSeoTagKeywords = new Zend_Form_Element_Button("add_additional_seo_tag_keywords");
     $oAddAdditionalSeoTagKeywords->setLabel("Dodaj");
     $oAddAdditionalSeoTagKeywords->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oAddAdditionalSeoTagKeywords);
     $oSeoTagKeywords = new Zend_Form_Element_Multiselect("keywords");
     $oSeoTagKeywords->addMultiOptions($this->_aAllSiteSeoKeywords);
     $oSeoTagKeywords->setRequired(FALSE);
     $oSeoTagKeywords->setLabel("Słowa kluczowe (meta keywords):");
     $oSeoTagKeywords->setAttrib("class", "chosen");
     $this->addElement($oSeoTagKeywords);
     $oSeoTagDescription = new Zend_Form_Element_Textarea("description");
     $oSeoTagDescription->setLabel("Opis strony (meta description):")->setFilters($this->_aFilters);
     $oSeoTagDescription->setRequired(FALSE);
     $this->addElement($oSeoTagDescription);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Zapisz");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/siteseo.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
Ejemplo n.º 11
0
 public function init()
 {
     $this->setName('usuario')->setAttrib('class', 'form-horizontal');
     $usu_id_usuario = new Zend_Form_Element_Hidden('usu_id_usuario');
     $usu_id_usuario->addFilter('Int');
     $usu_nombre = new Zend_Form_Element_Text('usu_nombre');
     $usu_nombre->setAttrib('placeholder', 'Nombres')->setLabel('Nombres:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_apellido_1 = new Zend_Form_Element_Text('usu_apellido_1');
     $usu_apellido_1->setAttrib('placeholder', 'Apellido Paterno')->setLabel('Apellido Paterno:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_apellido_2 = new Zend_Form_Element_Text('usu_apellido_2');
     $usu_apellido_2->setAttrib('placeholder', 'Apellido Materno')->setLabel('Apellido Materno:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_rut = new Zend_Form_Element_Text('usu_rut');
     $usu_rut->setAttrib('placeholder', 'RUT')->setLabel('RUT:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_fono_1 = new Zend_Form_Element_Text('usu_fono_1');
     $usu_fono_1->setAttrib('placeholder', 'Teléfono Móvil')->setLabel('Teléfono Móvil:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_fono_2 = new Zend_Form_Element_Text('usu_fono_2');
     $usu_fono_2->setAttrib('placeholder', 'Teléfono Fijo')->setLabel('Teléfono Fijo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_direccion = new Zend_Form_Element_Text('usu_direccion');
     $usu_direccion->setAttrib('placeholder', 'Dirección')->setLabel('Dirección:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_ciudad = new Zend_Form_Element_Text('usu_ciudad');
     $usu_ciudad->setAttrib('placeholder', 'Ciudad')->setLabel('Ciudad:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_porcentaje_comision = new Zend_Form_Element_Select('usu_porcentaje_comision');
     $usu_porcentaje_comision->setLabel('Pctje. de comisión:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_porcentaje_comision->addMultiOption("0", "0%");
     $usu_porcentaje_comision->addMultiOption("3", "3%");
     $usu_porcentaje_comision->addMultiOption("5", "5%");
     $per_id_perfil = new Zend_Form_Element_Multiselect('per_id_perfil');
     $per_id_perfil->setLabel('Perfil(es) de usuario:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('multiple', 'multiple');
     $filaPerfil = new Application_Model_DbTable_Perfil();
     foreach ($filaPerfil->fetchAll() as $per) {
         $per_id_perfil->addMultiOption($per->per_id_perfil, $per->per_nombre);
     }
     $usu_password = new Zend_Form_Element_Password('usu_password');
     $usu_password->setAttrib('placeholder', 'Password')->setLabel('Password:'******'StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_password_2 = new Zend_Form_Element_Password('usu_password_2');
     $usu_password_2->setAttrib('placeholder', 'Reingrese el Password')->setLabel('Password (2):')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $usu_password_2->addValidator('Identical', false, array('token' => 'usu_password'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $this->addElements(array($usu_id_usuario, $usu_rut, $usu_nombre, $usu_apellido_1, $usu_apellido_2, $usu_fono_1, $usu_fono_2, $usu_direccion, $usu_ciudad, $usu_password, $usu_password_2, $per_id_perfil, $usu_porcentaje_comision, $submit));
     //************* contacto
     $this->addDisplayGroup(array('usu_nombre', 'usu_apellido_1', 'usu_apellido_2', 'usu_fono_1', 'usu_fono_2', 'usu_direccion', 'usu_ciudad'), 'personal');
     $personal = $this->getDisplayGroup('personal');
     $personal->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'class' => 'span4'))));
     //************* sistema
     $this->addDisplayGroup(array('usu_rut', 'usu_password', 'usu_password_2', 'per_id_perfil', 'usu_porcentaje_comision'), 'sistema');
     $sistema = $this->getDisplayGroup('sistema');
     $sistema->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'class' => 'span4'))));
 }
Ejemplo n.º 12
0
 public function init()
 {
     $this->setName('supplier');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $id->removeDecorator('label');
     $companies_id = new Zend_Form_Element_Hidden('companies_id');
     $companies_id->addFilter('Int');
     $companies_id->removeDecorator('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     //
     //        $supplier_types_id = new Zend_Form_Element_Select('supplier_types_id');
     //        $supplier_types_id->setLabel('supplier types')
     //                ->addValidator('NotEmpty', true)
     //                ->setmultiOptions($this->_selectOptions_types())
     //                ->setAttrib('maxlength', 200)
     //                ->setAttrib('size', 1)
     //                ->setAttrib("class", "toolboxdrop")
     //                ->setDecorators(array(array('ViewScript', array(
     //                            'viewScript' => 'forms/_element_select.phtml'))))
     //        ;
     $activity_types_id = new Zend_Form_Element_Multiselect('$activity_types_id');
     $activity_types_id->setLabel('Activity types')->setmultiOptions($this->_selectOptions_types())->setAttrib('maxlength', 200)->setAttrib('size', 5)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))))->setAttrib("class", "toolboxdrop");
     $fiscal_name = new Zend_Form_Element_Text('fiscal_name');
     $fiscal_name->setLabel('Fiscal name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $company_types_id = new Zend_Form_Element_Select('company_types_id');
     $company_types_id->setLabel('Type')->setRequired(true)->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsCompanyTypes())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('emailAddress', TRUE)->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $telephone = new Zend_Form_Element_Text('telephone');
     $telephone->setLabel('Telephone')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $fax = new Zend_Form_Element_Text('fax');
     $fax->setLabel('fax')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $direction = new Zend_Form_Element_Text('direction');
     $direction->setLabel('Direction')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $city = new Zend_Form_Element_Text('city');
     $city->setLabel('City')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $country = new Zend_Form_Element_Text('country');
     $country->setLabel('Country')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $postal_code = new Zend_Form_Element_Text('postal_code');
     $postal_code->setLabel('Postal code')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $observation = new Zend_Form_Element_Text('observation');
     $observation->setLabel('Observation')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label');
     $this->addElements(array($id, $companies_id, $name, $activity_types_id, $fiscal_name, $company_types_id, $email, $telephone, $fax, $direction, $city, $country, $postal_code, $observation, $submit));
 }
Ejemplo n.º 13
0
 public function init()
 {
     $this->setName('role');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $id->removeDecorator('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib("class", "inputbox");
     $role_parent = new Zend_Form_Element_Multiselect('role_parent');
     $role_parent->setLabel('Role Parent')->setmultiOptions($this->_selectOptionsRoles())->setAttrib('maxlength', 200)->setAttrib('size', 5)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))))->setAttrib("class", "toolboxdrop");
     $prefered_uri = new Zend_Form_Element_Text('prefered_uri');
     $prefered_uri->setLabel('Prefered Uri')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib("class", "inputbox");
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label');
     $this->addElements(array($id, $name, $role_parent, $prefered_uri, $submit));
 }
Ejemplo n.º 14
0
 /**
  * Inserts two selections and buttons to control the elements between them.
  *
  * @param string $name - Define elements id. Important to javascript interaction
  * @param string $label
  * @param array $start_itens
  * @param array $end_itens
  */
 public function setSelectBox($name, $label, $start_itens, $end_itens = false)
 {
     $i18n = Zend_Registry::get("i18n");
     $header = new Zend_Form_Element_Hidden('elementHeader');
     $header->removeDecorator("DtDdWrapper")->addDecorator('HtmlTag', array('tag' => 'div', 'id' => 'selects', 'openOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::PREPEND));
     $start_box = new Zend_Form_Element_Multiselect("box");
     $start_box->setLabel($i18n->translate($label))->setMultiOptions($start_itens)->removeDecorator('DtDdWrapper')->setAttrib('id', $name . '_box')->setRegisterInArrayValidator(false);
     $end_box = new Zend_Form_Element_Multiselect("box_add");
     if ($end_itens) {
         $end_box->setMultiOptions($end_itens);
         $end_box->setValue(array_keys($end_itens));
     }
     $end_box->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setAttrib('id', $name . '_box_add')->addDecorator('HtmlTag', array('tag' => 'div', 'id' => 'selects', 'closeOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::APPEND))->setRegisterInArrayValidator(false);
     $add_action = new Zend_Form_Element_Button($i18n->translate('Add'));
     $add_action->removeDecorator("DtDdWrapper")->addDecorator('HtmlTag', array('tag' => 'li'))->setAttrib('id', $name . '_add_bt')->setAttrib('class', 'add_item')->addDecorator('HtmlTag', array('tag' => 'div', 'id' => 'selectActions', 'openOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::PREPEND));
     $remove_action = new Zend_Form_Element_Button($i18n->translate('Remove'));
     $remove_action->removeDecorator("DtDdWrapper")->addDecorator('HtmlTag', array('tag' => 'li'))->setAttrib('id', $name . '_remove_bt')->setAttrib('class', 'remove_item')->addDecorator('HtmlTag', array('tag' => 'div', 'id' => 'selectActions', 'closeOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::APPEND));
     $this->addElements(array($header, $start_box, $add_action, $remove_action, $end_box));
 }
Ejemplo n.º 15
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'announcements');
     $this->setAttrib('name', 'announcements');
     $id = new Zend_Form_Element_Hidden('id');
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     if ($loginuserGroup == HR_GROUP) {
         $businessunit_id = new Zend_Form_Element_Select("businessunit_id");
     } else {
         $businessunit_id = new Zend_Form_Element_Multiselect("businessunit_id");
     }
     $businessunit_id->setLabel("Business Units");
     $businessunit_id->setRegisterInArrayValidator(false);
     $businessunit_id->setRequired(true);
     $businessunit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.'));
     $department_id = new Zend_Form_Element_Multiselect("department_id");
     $department_id->setLabel("Departments");
     $department_id->setRegisterInArrayValidator(false);
     $department_id->setRequired(true);
     $department_id->addValidator('NotEmpty', false, array('messages' => 'Please select department.'));
     $title = new Zend_Form_Element_Text("title");
     $title->setLabel("Title");
     $title->setAttrib('maxLength', 100);
     $title->addFilter(new Zend_Filter_StringTrim());
     $title->setRequired(true);
     $title->addValidator('NotEmpty', false, array('messages' => 'Please enter title.'));
     $title->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid title.')));
     $title->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_announcements', 'field' => 'title', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" AND isactive=1')));
     // Validation for duplicate name is not required
     $title->getValidator('Db_NoRecordExists')->setMessage('Title name already exists.');
     $description = new Zend_Form_Element_Textarea('post_description');
     $description->setLabel("Description");
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setRequired(true);
     $description->addValidator('NotEmpty', false, array('messages' => 'Please enter post.'));
     $this->addElements(array($id, $businessunit_id, $department_id, $title, $description));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 16
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'performance');
     $startyear = date('Y', strtotime('-2 year'));
     $endyear = date('Y', strtotime('+2 year'));
     $employeename = new Zend_Form_Element_Text('employeename');
     $employeename->setLabel('Employee Name');
     // $employeename->setAttrib('onblur', 'clearautocompletename(this)');
     $reporting_manager = new Zend_Form_Element_Text("reporting_manager");
     $reporting_manager->setLabel("Line Manager");
     $reporting_manager->setAttrib('name', '');
     $reporting_manager->setAttrib('id', 'idreporting_manager');
     $fromyear = new Zend_Form_Element_Select('fromyear');
     $fromyear->setLabel('From Year');
     $fromyear->addMultiOption('', 'From Year');
     for ($i = $startyear; $i <= $endyear; $i++) {
         $fromyear->addMultiOption($i, $i);
     }
     $fromyear->setAttrib('class', 'selectoption');
     $fromyear->setRegisterInArrayValidator(false);
     $toyear = new Zend_Form_Element_Select('toyear');
     $toyear->setLabel('To Year');
     $toyear->addMultiOption('', 'To Year');
     $toyear->setAttrib('class', 'selectoption');
     $toyear->setRegisterInArrayValidator(false);
     /*for($i=$startyear;$i<=$endyear;$i++)
     		{
     			$toyear->addMultiOption($i,$i);
     		}*/
     $department_id = new Zend_Form_Element_Multiselect("department_id");
     $department_id->setLabel("Department");
     $businessunit_id = new Zend_Form_Element_Multiselect("businessunit_id");
     $businessunit_id->setLabel("Business Unit");
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($employeename, $reporting_manager, $department_id, $businessunit_id, $fromyear, $toyear, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 17
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_emp_report');
     $reporting_manager = new Zend_Form_Element_Text("reporting_manager");
     $reporting_manager->setLabel("Reporting Manager");
     $reporting_manager->setAttrib('name', '');
     $reporting_manager->setAttrib('id', 'idreporting_manager');
     $joined_date = new Zend_Form_Element_Text("date_of_joining");
     $joined_date->setLabel("Joined Date");
     $joined_date->setAttrib('readonly', 'readonly');
     $modeofentry = new Zend_Form_Element_Select("modeofentry");
     $modeofentry->setLabel("Mode of Employment")->addMultiOptions(array('' => 'Select mode of employment', 'Direct' => 'Direct', 'Interview' => 'Interview', 'Reference' => 'Reference', 'Other' => 'Other'));
     $jobtitle = new Zend_Form_Element_Select("jobtitle_id");
     $jobtitle->setLabel("Job Title");
     $jobtitle->setAttrib("onchange", "getpositions_req('department','business_unit','position_id','jobtitle_id');");
     $position_id = new Zend_Form_Element_Select("position_id");
     $position_id->setLabel("Position");
     $position_id->addMultiOptions(array('' => 'Select Position'));
     $emp_type = new Zend_Form_Element_Select("emp_status_id");
     $emp_type->setLabel("Employment Status");
     $emp_type->addMultiOptions(array('' => 'Select Employment Status'));
     $emprole = new Zend_Form_Element_Select("emprole");
     $emprole->setLabel("Role");
     $emprole->addMultiOptions(array('' => 'Select Role'));
     $department_id = new Zend_Form_Element_Multiselect("department_id");
     $department_id->setLabel("Department");
     $businessunit_id = new Zend_Form_Element_Multiselect("businessunit_id");
     $businessunit_id->setLabel("Business Unit");
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($reporting_manager, $submit, $joined_date, $modeofentry, $jobtitle, $position_id, $emp_type, $emprole, $department_id, $businessunit_id));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 18
0
 public function init()
 {
     $this->setMethod('post');
     //$this->setAttrib('action',DOMAIN.'language/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'servicedeskrequests');
     $id = new Zend_Form_Element_Hidden('id');
     $postid = Zend_Controller_Front::getInstance()->getRequest()->getParam('id');
     $businessunit_id = new Zend_Form_Element_Select('businessunit_id');
     $businessunit_id->setLabel("Business Unit");
     $businessunit_id->setAttrib('class', 'selectoption');
     if ($postid == '') {
         $businessunit_id->setAttrib('onchange', 'displayemployees(this)');
         $bunitModel = new Default_Model_Businessunits();
         $bunitdata = $bunitModel->fetchAll('isactive=1', 'unitname');
         $businessunit_id->addMultiOptions(array('' => 'Select Business unit', '0' => 'No Business Unit'));
         foreach ($bunitdata->toArray() as $data) {
             $businessunit_id->addMultiOption($data['id'], $data['unitname']);
         }
     } else {
         $businessunit_id->addMultiOptions(array('' => 'Select Business unit'));
     }
     $businessunit_id->setRegisterInArrayValidator(false);
     $businessunit_id->setRequired(true);
     $businessunit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.'));
     $department_id = new Zend_Form_Element_Select('department_id');
     $department_id->setLabel("Department");
     $department_id->setAttrib('class', 'selectoption');
     $department_id->addMultiOption('', 'Select Department');
     if ($postid == '') {
         $department_id->setAttrib('onchange', 'displayemployees(this)');
     }
     $department_id->setRegisterInArrayValidator(false);
     $service_desk_flag = new Zend_Form_Element_Radio('service_desk_flag');
     $service_desk_flag->setLabel("Applicability");
     $service_desk_flag->setAttrib('onclick', 'changeimplementation(this)');
     $service_desk_flag->addMultiOptions(array('1' => 'Business unit wise', '0' => 'Department wise'));
     $service_desk_flag->setSeparator('');
     $service_desk_flag->setValue(1);
     $service_desk_flag->setRegisterInArrayValidator(false);
     $service_desk_flag->setRequired(true);
     $service_desk_flag->addValidator('NotEmpty', false, array('messages' => 'Please select applicability.'));
     $service_desk_id = new Zend_Form_Element_Select('service_desk_id');
     $service_desk_id->setLabel("Category");
     $service_desk_id->setAttrib('class', 'selectoption');
     $service_desk_id->addMultiOption('', 'Select category');
     $service_desk_id->setRegisterInArrayValidator(false);
     $service_desk_id->setRequired(true);
     $service_desk_id->addValidator('NotEmpty', false, array('messages' => 'Please select category.'));
     $request_recievers = new Zend_Form_Element_Multiselect('request_recievers');
     $request_recievers->setLabel("Executors");
     $request_recievers->setAttrib('class', 'selectoption');
     $request_recievers->setRegisterInArrayValidator(false);
     $request_recievers->setRequired(true);
     $request_recievers->addValidator('NotEmpty', false, array('messages' => 'Please select executor.'));
     $approvingauthority = new Zend_Form_Element_Select('approvingauthority');
     $approvingauthority->setLabel("No. of Approvers");
     $approvingauthority->setAttrib('class', 'selectoption');
     $approvingauthority->setAttrib('onchange', 'displayapprovingauthority(this)');
     $approvingauthority->addMultiOptions(array('' => 'Select no. of approvers', '1' => '1', '2' => '2', '3' => '3'));
     $approvingauthority->setRegisterInArrayValidator(false);
     $approvingauthority->setRequired(true);
     $approvingauthority->addValidator('NotEmpty', false, array('messages' => 'Please select no. of approvers.'));
     $approver_1 = new Zend_Form_Element_Select('approver_1');
     $approver_1->setLabel("Approver 1");
     $approver_1->setAttrib('class', 'selectoption');
     $approver_1->addMultiOption('', 'Select Approver 1');
     $approver_1->setAttrib('onchange', 'displayapprovingauthority(this)');
     $approver_1->setRegisterInArrayValidator(false);
     $approver_2 = new Zend_Form_Element_Select('approver_2');
     $approver_2->setLabel("Approver 2");
     $approver_2->setAttrib('class', 'selectoption');
     $approver_2->addMultiOption('', 'Select Approver 2');
     $approver_2->setAttrib('onchange', 'displayapprovingauthority(this)');
     $approver_2->setRegisterInArrayValidator(false);
     $approver_3 = new Zend_Form_Element_Select('approver_3');
     $approver_3->setLabel("Approver 3");
     $approver_3->setAttrib('class', 'selectoption');
     $approver_3->addMultiOption('', 'Select Approver 3');
     $approver_3->setRegisterInArrayValidator(false);
     $cc_mail_recievers = new Zend_Form_Element_Multiselect('cc_mail_recievers');
     $cc_mail_recievers->setLabel("Request Viewers");
     $cc_mail_recievers->setAttrib('class', 'selectoption');
     $cc_mail_recievers->setRegisterInArrayValidator(false);
     $attachment = new Zend_Form_Element_Radio('attachment');
     $attachment->setLabel("Attachment");
     $attachment->addMultiOptions(array('1' => 'Yes', '0' => 'No'));
     $attachment->setSeparator('');
     $attachment->setValue(0);
     $attachment->setRegisterInArrayValidator(false);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel("Description");
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $businessunit_id, $department_id, $description, $service_desk_flag, $service_desk_id, $request_recievers, $approvingauthority, $approver_1, $approver_2, $approver_3, $cc_mail_recievers, $attachment, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 19
0
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oLayoutName = new Zend_Form_Element_Hidden("layout_name");
     $oLayoutName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oLayoutName);
     $oLabel = new Zend_Form_Element_Text("label");
     $oLabel->setLabel("Etykieta:")->setFilters($this->_aFilters);
     $oLabel->setRequired(TRUE);
     $this->addElement($oLabel);
     $oDesc = new Zend_Form_Element_Text("desc");
     $oDesc->setLabel("Opis:")->setFilters($this->_aFilters);
     $oDesc->setRequired(FALSE);
     $this->addElement($oDesc);
     $oImageId = new Zend_Form_Element_Select("image_id");
     $oImageId->setLabel("Ikona menu:")->setFilters($this->_aFilters);
     $oImageId->setRequired(FALSE);
     $oImageId->addMultiOptions($this->_aAllImage);
     $this->addElement($oImageId);
     $oModuleId = new Zend_Form_Element_Select("navigation_module_id");
     $oModuleId->setLabel("Moduł:");
     $oModuleId->setRequired(TRUE)->setAttrib("class", "valid");
     $oModuleId->addMultiOptions($this->_aAllModule);
     $this->addElement($oModuleId);
     $oSiteLayout = new Zend_Form_Element_Select("site_layout_id");
     $oSiteLayout->setLabel("Szablon:");
     $oSiteLayout->setRequired(TRUE)->setAttrib("class", "valid");
     $oSiteLayout->addMultiOptions($this->_aAllSiteLayout);
     $this->addElement($oSiteLayout);
     $oControllerId = new Zend_Form_Element_Select("navigation_controller_id");
     $oControllerId->setLabel("Kontroler:");
     $oControllerId->setRequired(TRUE)->setAttrib("class", "valid");
     $oControllerId->addMultiOptions($this->_aAllController);
     $this->addElement($oControllerId);
     $oActionId = new Zend_Form_Element_Select("navigation_action_id");
     $oActionId->setLabel("Akcja:");
     $oActionId->setRequired(TRUE)->setAttrib("class", "valid");
     $oActionId->addMultiOptions($this->_aAllAction);
     $this->addElement($oActionId);
     $oResourceId = new Zend_Form_Element_Select("navigation_resource_id");
     $oResourceId->setLabel("Kwalifikator zasobu:");
     $oResourceId->setRequired(TRUE);
     $oResourceId->addMultiOptions($this->_aAllResource);
     //$this->addElement($oResourceId);
     $oPrivilegeId = new Zend_Form_Element_Select("navigation_privilege_id");
     $oPrivilegeId->setLabel("Kwalifikator dostępu:");
     $oPrivilegeId->setRequired(TRUE)->setAttrib("class", "valid");
     $oPrivilegeId->addMultiOptions($this->_aAllPrivilege);
     $this->addElement($oPrivilegeId);
     $oVisible = new Zend_Form_Element_Select("visible");
     $oVisible->setLabel("Widoczne w menu:");
     $oVisible->setRequired(TRUE)->setAttrib("class", "valid");
     $oVisible->addMultiOptions(array(1 => "Tak", 0 => "Nie"));
     $this->addElement($oVisible);
     $oPrivilege = new Zend_Form_Element_Multiselect("user_role");
     $oPrivilege->addMultiOptions($this->_aAllUserRole);
     $oPrivilege->setRequired(FALSE);
     $oPrivilege->setLabel("Dostęp do zasobu dla grupy użytkowników:");
     $oPrivilege->setAttrib("class", "multiselect");
     $this->addElement($oPrivilege);
     $oNavigationMenuCopy = new Zend_Form_Element_Hidden("navigation_menu_edit_id");
     $oNavigationMenuCopy->setValue(0);
     $oNavigationMenuCopy->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oNavigationMenuCopy);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Zapisz");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/navigationmenu.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
Ejemplo n.º 20
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     ## GET OPTIONS TO POPULATE MENUS ##
     //Get periods for select menu
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     $periodword_options = $periods->getPeriodFromWords();
     //Get terminal reasons for select menu
     $terminalreasons = new TerminalReasons();
     $terminalreason_options = $terminalreasons->getReasons();
     //Get coin data quality ratings for select menu
     $qualityrating = new DataQuality();
     $qualityrating_options = $qualityrating->getRatings();
     //Get Find of note reason options for select menu
     $reasons = new Findofnotereasons();
     $reason_options = $reasons->getReasons();
     //Get primary materials for multiselect
     $primarymaterials = new Materials();
     $materials_options = $primarymaterials->getPrimaries();
     //Get discovery methods for select menu
     $discs = new DiscoMethods();
     $disc_options = $discs->getOptions();
     //Get Rally data for select menu
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     //Get Subsequent actions for select menu
     $actions = new SubsequentActions();
     $actionsDD = $actions->getSubActionsDD();
     //Get the reece periods for inclusion
     $reece = new Reeces();
     $reeces = $reece->getReeces();
     //End of select options construction
     $this->addElementPrefixPath('Pas_Filter', 'Pas/Filter/', 'filter');
     parent::__construct($options);
     $this->setName('hoards');
     ## UNIQUE ID FIELDS ##
     $secuid = new Zend_Form_Element_Hidden('secuid');
     $secuid->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum');
     $old_hoardID = new Zend_Form_Element_Hidden('hoardID');
     $old_hoardID->addFilters(array('StripTags', 'StringTrim'));
     ## HOARD DATING ##
     //Broadperiod:
     $broadperiod = new Zend_Form_Element_Select('broadperiod');
     $broadperiod->setLabel('Broad period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose broadperiod', 'Available periods' => $periodword_options))->addErrorMessage('You must enter a broad period.')->addValidator('InArray', false, array(array_keys($periodword_options)))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(1);
     //Sub period from: Assigned via dropdown
     $hoardsubperiod1 = new Zend_Form_Element_Select('subperiod1');
     $hoardsubperiod1->setLabel('Sub period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(2);
     //Period from: Assigned via dropdown
     $hoardperiod1 = new Zend_Form_Element_Select('period1');
     $hoardperiod1->setLabel('Period from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a period from', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(3);
     //Sub period to: Assigned via dropdown
     $hoardsubperiod2 = new Zend_Form_Element_Select('subperiod2');
     $hoardsubperiod2->setLabel('Sub period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a subperiod', 'Valid sub periods' => array('1' => 'Early', '2' => 'Middle', '3' => 'Late')))->addValidator('Digits')->setAttribs(array('class' => 'selectpicker show-menu-arrow'))->setOrder(4);
     //Period to: Assigned via dropdown
     $hoardperiod2 = new Zend_Form_Element_Select('period2');
     $hoardperiod2->setLabel('Period to: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(5);
     //Date from: Free text Integer +ve or -ve
     $numdate1 = new Zend_Form_Element_Text('numdate1');
     $numdate1->setLabel('Date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(6);
     //Date to: Free text Integer +ve or -ve
     $numdate2 = new Zend_Form_Element_Text('numdate2');
     $numdate2->setLabel('Date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(7);
     ## COIN DATING ##
     //Ruler of latest coins in hoard:
     $lastruler = new Zend_Form_Element_Select('lastrulerID');
     $lastruler->setLabel('Last ruler: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose ruler after broad period'))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(8);
     //Ruler of latest coins in hoard:
     $lastreeceperiod = new Zend_Form_Element_Select('reeceID');
     $lastreeceperiod->setLabel('Last Reece period: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose Reece period', 'Available periods' => $reeces))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(9);
     //Date from: Free text Integer +ve or -ve
     $terminaldate1 = new Zend_Form_Element_Text('terminalyear1');
     $terminaldate1->setLabel('Terminal date from: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(10);
     //Date to: Free text Integer +ve or -ve
     $terminaldate2 = new Zend_Form_Element_Text('terminalyear2');
     $terminaldate2->setLabel('Terminal date to: ')->setAttrib('size', 10)->setAttribs(array('placeholder' => 'Year in format YYYY'))->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(11);
     //Reason for terminal coin dating
     $terminalreason = new Zend_Form_Element_Select('terminalreason');
     $terminalreason->setLabel('Terminal reason: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $terminalreason_options))->addValidator('InArray', false, array(array_keys($terminalreason_options)))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(12);
     ## HOARD DETAILS ##
     //Hoard description
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Hoard description: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(13);
     //Object notes
     $notes = new Pas_Form_Element_CKEditor('notes');
     $notes->setLabel('Notes: ')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setOrder(14);
     //Coin data quality rating
     $coindataquality = new Zend_Form_Element_Select('qualityrating');
     $coindataquality->setLabel('Coin data quality rating: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a rating', 'Available ratings' => $qualityrating_options))->addValidator('InArray', false, array(array_keys($qualityrating_options)))->setAttrib('class', 'input-large selectpicker show-menu-arrow')->setDescription('This data quality field can only be completed by hoards project staff')->addValidator('Int')->setOrder(15);
     //Find of note
     $findofnote = new Zend_Form_Element_Checkbox('findofnote');
     $findofnote->setLabel('Find of Note: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('NotEmpty', 'Int')->setOrder(16);
     //Reason for find of note
     $findofnotereason = new Zend_Form_Element_Select('findofnotereason');
     $findofnotereason->setLabel('Why this find is considered noteworthy: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose a reasoning', 'Available reasons' => $reason_options))->addValidator('InArray', false, array(array_keys($reason_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->setOrder(17);
     //Treasure: enumerator 1/0
     $treasure = new Zend_Form_Element_Checkbox('treasure');
     $treasure->setLabel('Treasure: ')->setRequired(false)->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(18);
     //Treasure ID
     $treasureID = new Zend_Form_Element_Text('treasureID');
     $treasureID->setLabel('Treasure number: ')->setRequired(false)->setAttribs(array('placeholder' => 'T numbers are in the format of YYYYT1234', 'class' => 'span6'))->addValidator('Alnum', false, array('allowWhiteSpace' => false))->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->setOrder(19);
     ## QUANTITIES ##
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setOrder(20);
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setOrder(21);
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setOrder(22);
     ## MATERIALS ##
     //Materials
     $materials = new Zend_Form_Element_Multiselect('materials');
     $materials->setLabel('Primary materials: ')->addMultiOptions($materials_options)->setAttrib('class', 'multiselect')->setDescription('Primary materials of coins and artefacts in the hoard')->addFilters(array('Null'))->setOrder(23);
     ## RECORDING DETAILS ##
     //Recorder
     $recorderID = new Zend_Form_Element_Hidden('recorderID');
     $recorderID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(24);
     $recordername = new Zend_Form_Element_Text('recordername');
     $recordername->setLabel('Recorded by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(25);
     //Primary Identifier
     $idBy = new Zend_Form_Element_Text('idBy');
     $idBy->setLabel('Primary identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(26);
     $identifier1ID = new Zend_Form_Element_Hidden('identifier1ID');
     $identifier1ID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(27);
     $id2by = new Zend_Form_Element_Text('id2by');
     $id2by->setLabel('Secondary Identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(28);
     //Secondary Identifier
     $identifier2ID = new Zend_Form_Element_Hidden('identifier2ID');
     $identifier2ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(29);
     ## DISCOVERER DETAILS ##
     //Finder
     $finder1ID = new Zend_Form_Element_Hidden('finder1ID');
     $finder1ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(30);
     $hiddenfield = new Zend_Form_Element_Hidden('hiddenfield');
     $hiddenfield->setValue(2)->setOrder(31);
     $finder1 = new Zend_Form_Element_Text('finder1');
     $finder1->setLabel('Found by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setDescription('To make a new finder/identifier appear, you ' . 'first need to create them from the people menu on ' . 'the left hand side')->setOrder(32);
     $addFinderButton = new Zend_Form_Element_Button('addFinder');
     $addFinderButton->setLabel('Add Additional Finder')->setAttribs(array('class' => 'btn btn-info'));
     $addFinderButton->setOrder(50);
     $removeFinderButton = new Zend_Form_Element_Button('removeFinder');
     $removeFinderButton->setLabel('Remove Last Finder')->setAttribs(array('class' => 'btn btn-warning hidden'));
     $removeFinderButton->setOrder(51);
     ## DISCOVERY INFORMATION ##
     //Discovery method
     $discmethod = new Zend_Form_Element_Select('discmethod');
     $discmethod->setLabel('Discovery method: ')->setRequired(false)->setValue(1)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($disc_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $disc_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(52);
     //Discovery circumstances
     $disccircum = new Zend_Form_Element_Text('disccircum');
     $disccircum->setLabel('Discovery circumstances: ')->setAttrib('size', 50)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(53);
     //Date found from
     $datefound1 = new Zend_Form_Element_Text('datefound1');
     $datefound1->setLabel('First discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(54);
     //Date found to
     $datefound2 = new Zend_Form_Element_Text('datefound2');
     $datefound2->setLabel('Second discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(55);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(56);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addValidator('Int')->setOrder(57);
     ## OTHER REFERENCE NUMBERS ##
     //Legacy hoard ID
     $legacy_ref = new Zend_Form_Element_Text('legacyID');
     $legacy_ref->setLabel('Legacy hoard ID: ')->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(58)->disabled = true;
     //Other reference number
     $other_ref = new Zend_Form_Element_Text('other_ref');
     $other_ref->setLabel('Other reference: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(59);
     //HER reference number
     $smrrefno = new Zend_Form_Element_Text('smrrefno');
     $smrrefno->setLabel('Historic Environment Record number: ')->setAttrib('size', 30)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(60);
     //Museum accession number
     $musaccno = new Zend_Form_Element_Text('musaccno');
     $musaccno->setLabel('Museum accession number: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(61);
     //Current location of object
     $curr_loc = new Zend_Form_Element_Text('curr_loc');
     $curr_loc->setLabel('Current location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(62);
     //Current location of object
     $subs_action = new Zend_Form_Element_Select('subs_action');
     $subs_action->setLabel('Subsequent action: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setAttrib('class', 'span6')->addMultiOptions(array(null => 'Choose a subsequent action', 'Available options' => $actionsDD))->setValue(1)->addValidator('InArray', false, array(array_keys($actionsDD)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(63);
     ## Quantities ##
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setValue(null);
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setValue(null);
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setValue(null);
     ## SUBMIT BUTTON ##
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOrder(67);
     $this->addElements(array($secuid, $old_hoardID, $broadperiod, $hoardperiod1, $hoardperiod2, $hoardsubperiod1, $hoardsubperiod2, $numdate1, $numdate2, $lastruler, $lastreeceperiod, $terminaldate1, $terminaldate2, $terminalreason, $description, $notes, $coindataquality, $findofnote, $findofnotereason, $treasure, $treasureID, $quantityArtefacts, $quantityCoins, $quantityContainers, $materials, $recorderID, $recordername, $idBy, $id2by, $identifier1ID, $identifier2ID, $finder1, $finder1ID, $hiddenfield, $addFinderButton, $removeFinderButton, $discmethod, $disccircum, $datefound1, $datefound2, $rally, $rallyID, $legacy_ref, $other_ref, $smrrefno, $musaccno, $curr_loc, $subs_action, $submit));
     $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'numdate1', 'numdate2'), 'hoarddating');
     $this->hoarddating->setLegend('Hoard dating');
     $this->addDisplayGroup(array('lastrulerID', 'reeceID', 'terminalyear1', 'terminalyear2', 'terminalreason'), 'coindating');
     $this->coindating->setLegend('Coin dating');
     $this->addDisplayGroup(array('description', 'notes', 'qualityrating', 'findofnote', 'findofnotereason', 'treasure', 'treasureID'), 'hoarddetails');
     $this->hoarddetails->setLegend('Hoard details');
     $this->addDisplayGroup(array('quantityCoins', 'quantityArtefacts', 'quantityContainers'), 'quantities');
     $this->quantities->setLegend('Quantities');
     $this->addDisplayGroup(array('materials'), 'primarymaterials');
     $this->primarymaterials->setLegend('Materials');
     $this->addDisplayGroup(array('recordername', 'recorderID', 'idBy', 'identifier1ID', 'id2by', 'identifier2ID'), 'recorders');
     $this->recorders->setLegend('Recording details');
     $this->addDisplayGroup(array('finder1', 'finder1ID', 'hiddenfield', 'addFinder', 'removeFinder'), 'discoverers');
     $this->discoverers->setLegend('Discoverer details');
     $this->addDisplayGroup(array('disccircum', 'discmethod', 'datefound1', 'datefound2', 'rally', 'rallyID'), 'discovery');
     $this->discovery->setLegend('Discovery details');
     $this->addDisplayGroup(array('legacyID', 'other_ref', 'smrrefno', 'musaccno', 'curr_loc', 'subs_action'), 'references');
     $this->references->setLegend('Reference numbers');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
     $addFinderButton->removeDecorator('Label');
     $addFinderButtonDecorator = $addFinderButton->getDecorator('HtmlTag');
     $addFinderButtonDecorator->setOption('id', 'addFinderDiv');
     $removeFinderButton->removeDecorator('Label');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $coindataquality->disabled = true;
     }
 }
Ejemplo n.º 21
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'appraisalinit');
     $id = new Zend_Form_Element_Hidden('id');
     $businessunit_id = new Zend_Form_Element_Hidden('businessunit_id');
     $department_id = new Zend_Form_Element_Hidden('department_id');
     $businessunit_name = new Zend_Form_Element_Text('businessunit_name');
     $businessunit_name->setLabel("Business Unit");
     $businessunit_name->setAttrib('readonly', 'true');
     $businessunit_name->setAttrib('onfocus', 'this.blur()');
     $businessunit_name->setOptions(array('class' => 'brdr_none'));
     $department_name = new Zend_Form_Element_Text('department_name');
     $department_name->setLabel("Department");
     $department_name->setAttrib('readonly', 'true');
     $department_name->setAttrib('onfocus', 'this.blur()');
     $department_name->setOptions(array('class' => 'brdr_none'));
     $appraisal_mode = new Zend_Form_Element_Text('appraisal_mode');
     $appraisal_mode->setLabel("Mode");
     $appraisal_mode->setAttrib('readonly', 'readonly');
     $appraisal_mode->setAttrib('onfocus', 'this.blur()');
     $appraisal_mode->setOptions(array('class' => 'brdr_none'));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel("Status");
     $status->setAttrib('class', 'selectoption');
     $status->setMultiOptions(array('1' => 'Open'));
     $status->setRegisterInArrayValidator(false);
     $status->setRequired(true);
     $status->addValidator('NotEmpty', false, array('messages' => 'Please select status.'));
     $from_year = new Zend_Form_Element_Select('from_year');
     $from_year->setAttrib('class', 'selectoption');
     $from_year->setRegisterInArrayValidator(false);
     $from_year->setRequired(true);
     $from_year->setLabel("From Year");
     $from_year->addMultiOption("", "Select from year");
     $from_year->addValidator('NotEmpty', false, array('messages' => 'Please select starting year.'));
     for ($i = date('Y'); $i <= date('Y') + 5; $i++) {
         $from_year->addMultiOption($i, $i);
     }
     $to_year = new Zend_Form_Element_Select('to_year');
     $to_year->setAttrib('class', 'selectoption');
     $to_year->setRegisterInArrayValidator(false);
     $to_year->setRequired(true);
     $to_year->setLabel("To Year");
     $to_year->addMultiOption("", "Select to year");
     $to_year->addValidator('NotEmpty', false, array('messages' => 'Please select ending year.'));
     for ($i = date('Y'); $i <= date('Y') + 5; $i++) {
         $to_year->addMultiOption($i, $i);
     }
     $appraisal_period = new Zend_Form_Element_Text('appraisal_period');
     $appraisal_period->setLabel("Period");
     $appraisal_period->setAttrib('readonly', 'readonly');
     $eligibility = new Zend_Form_Element_Multiselect('eligibility');
     $eligibility->setLabel("Eligibility");
     $eligibility->setAttrib('class', 'selectoption');
     $eligibility->setMultiOptions(array('' => 'Select Eligibility'));
     $eligibility->setRegisterInArrayValidator(false);
     $eligibility->setRequired(true);
     $eligibility->addValidator('NotEmpty', false, array('messages' => 'Please select eliblity.'));
     $enable = new Zend_Form_Element_Select('enable_step');
     $enable->setLabel("Enable To");
     $enable->setAttrib('class', 'selectoption');
     $enable->setMultiOptions(array('' => 'Select Enable To', '1' => 'Managers', '2' => 'Employees'));
     $enable->setRegisterInArrayValidator(false);
     $enable->setRequired(true);
     $enable->addValidator('NotEmpty', false, array('messages' => 'Please select enable to.'));
     $mgr_due_date = new Zend_Form_Element_Text('manager_due_date');
     $mgr_due_date->setLabel("Due Date");
     $mgr_due_date->setAttrib('readonly', 'true');
     $mgr_due_date->setAttrib('onfocus', 'this.blur()');
     $mgr_due_date->setOptions(array('class' => 'brdr_none'));
     $mgr_due_date->addValidator('NotEmpty', false, array('messages' => 'Please select due date.'));
     $emp_due_date = new Zend_Form_Element_Text('employee_due_date');
     $emp_due_date->setLabel("Due Date");
     $emp_due_date->setAttrib('readonly', 'true');
     $emp_due_date->setAttrib('onfocus', 'this.blur()');
     $emp_due_date->setOptions(array('class' => 'brdr_none'));
     $emp_due_date->addValidator('NotEmpty', false, array('messages' => 'Please select due date.'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $appraisal_period, $from_year, $to_year, $businessunit_id, $department_id, $businessunit_name, $department_name, $appraisal_mode, $status, $eligibility, $enable, $mgr_due_date, $emp_due_date, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
Ejemplo n.º 22
0
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oNewsEditId = new Zend_Form_Element_Hidden("news_edit_id");
     $oNewsEditId->setValue(0);
     $oNewsEditId->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oNewsEditId);
     $oTranslation = new Zend_Form_Element_Select("translation");
     $oTranslation->setLabel("Tłumaczenie:");
     $oTranslation->setRequired(TRUE)->setAttrib("class", "valid");
     $oTranslation->addMultiOptions($this->_aAllLang);
     $this->addElement($oTranslation);
     $oImagePreview = new Zend_Form_Element_Hidden("image_preview");
     $oImagePreview->setValue(0);
     $oImagePreview->setRequired(FALSE)->removeDecorator("Label");
     $this->addElement($oImagePreview);
     $oImageId = new Zend_Form_Element_Select("image_id");
     $oImageId->setLabel("Zdjęcie:")->setFilters($this->_aFilters);
     $oImageId->setRequired(FALSE);
     $oImageId->addMultiOptions($this->_aAllImage);
     $this->addElement($oImageId);
     $oCreatedDate = new Zend_Form_Element_Text("created_date");
     $oCreatedDate->setLabel("Data utworzenia:");
     $oCreatedDate->setRequired(TRUE);
     $oCreatedDate->setAttrib("class", "valid");
     $this->addElement($oCreatedDate);
     $oName = new Zend_Form_Element_Text("news_title");
     $oName->setLabel("Tytuł:");
     $oName->addValidator(new Zend_Validate_StringLength(array("min" => 3, "max" => 255)));
     $oName->setRequired(TRUE)->setAttrib("class", "valid");
     $this->addElement($oName);
     $oContent = new Zend_Form_Element_Textarea("news_content");
     $oContent->setLabel("Treść:");
     $oContent->setRequired(FALSE);
     $oContent->setAttrib("class", "ckeditor");
     $this->addElement($oContent);
     $oAdditionalCategoryTag = new Zend_Form_Element_Text("additional_category_tag");
     $oAdditionalCategoryTag->setLabel("Dodaj nowe tagi:");
     $oAdditionalCategoryTag->setRequired(FALSE);
     $oAdditionalCategoryTag->addValidator(new Zend_Validate_StringLength(array("min" => 1, "max" => 45)));
     $oAdditionalCategoryTag->setAttrib("class", "valid");
     $this->addElement($oAdditionalCategoryTag);
     $oAddAdditionalCategoryTag = new Zend_Form_Element_Button("add_additional_category_tag");
     $oAddAdditionalCategoryTag->setLabel("Dodaj");
     $oAddAdditionalCategoryTag->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oAddAdditionalCategoryTag);
     $oCategoryTag = new Zend_Form_Element_Multiselect("category_tag");
     $oCategoryTag->addMultiOptions(array());
     $oCategoryTag->setRequired(FALSE);
     $oCategoryTag->setLabel("Tagi:");
     $oCategoryTag->setAttrib("class", "chosen");
     $this->addElement($oCategoryTag);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Zapisz");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/_defaultform.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
Ejemplo n.º 23
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setAttrib('name', 'organisationinfo');
     $this->setAttrib('action', DOMAIN . 'organisationinfo/edit');
     $id = new Zend_Form_Element_Hidden('id');
     $orgname = new Zend_Form_Element_Text('organisationname');
     $orgname->setAttrib('maxLength', 50);
     $orgname->addFilter(new Zend_Filter_StringTrim());
     $orgname->setRequired(true);
     $orgname->addValidator('NotEmpty', false, array('messages' => 'Please enter organization name.'));
     $orgname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid organization name.')));
     $domain = new Zend_Form_Element_Multiselect('domain');
     $domain->setRequired(true);
     $domain->addValidator('NotEmpty', false, array('messages' => 'Please select domain.'));
     $domain->setLabel('domain')->setMultiOptions(array('1' => 'Admin/Secretarial', '2' => 'Customer Service/ Call Centre/ BPO', '3' => 'Finance & Accounts', '4' => 'Human Resources', '5' => 'IT', '6' => 'Legal', '7' => 'Marketing & Communications', '8' => 'Purchase/ Logistics/ Supply Chain', '9' => 'Sales/ Business Development', '10' => 'Sales & Marketing & Advertisement'));
     $org_image_value = new Zend_Form_Element_Hidden('org_image_value');
     $imgerr = new Zend_Form_Element_Hidden('imgerr');
     $imgerrmsg = new Zend_Form_Element_Hidden('imgerrmsg');
     $orgdescription = new Zend_Form_Element_Textarea('orgdescription');
     $orgdescription->setAttrib('rows', 10);
     $orgdescription->setAttrib('cols', 50);
     $orgdescription->setRequired(true);
     $orgdescription->addValidator('NotEmpty', false, array('messages' => 'Please enter organization description.'));
     $website = new Zend_Form_Element_Text('website');
     $website->setAttrib('maxLength', 50);
     $website->addFilter(new Zend_Filter_StringTrim());
     $website->setRequired(true);
     $website->addValidator('NotEmpty', false, array('messages' => 'Please enter website.'));
     $website->addValidator(new Zend_Validate_Uri());
     $totalemployees = new Zend_Form_Element_Select('totalemployees');
     $totalemployees->setRegisterInArrayValidator(false);
     $totalemployees->setMultiOptions(array('1' => '20-50', '2' => '51-100', '3' => '101-500', '4' => '501 -1000', '5' => '> 1000'));
     $totalemployees->setRequired(true);
     $totalemployees->addValidator('NotEmpty', false, array('messages' => 'Please enter total employees.'));
     $org_startdate = new ZendX_JQuery_Form_Element_DatePicker('org_startdate');
     $org_startdate->setAttrib('readonly', 'true');
     $org_startdate->setAttrib('onfocus', 'this.blur()');
     $org_startdate->setOptions(array('class' => 'brdr_none'));
     $phonenumber = new Zend_Form_Element_Text('phonenumber');
     $phonenumber->addFilter(new Zend_Filter_StringTrim());
     $phonenumber->setRequired(true);
     $phonenumber->setAttrib('maxLength', 15);
     $phonenumber->addValidator('NotEmpty', false, array('messages' => 'Please enter phone number.'));
     $phonenumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Phone number must contain at least %min% characters.')))));
     $phonenumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
     $secondaryphone = new Zend_Form_Element_Text('secondaryphone');
     $secondaryphone->setAttrib('maxLength', 15);
     $secondaryphone->addFilter(new Zend_Filter_StringTrim());
     $secondaryphone->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Secondary phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Secondary phone number must contain at least %min% characters.')))));
     $secondaryphone->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
     $faxnumber = new Zend_Form_Element_Text('faxnumber');
     $faxnumber->setAttrib('maxLength', 15);
     $faxnumber->addFilter(new Zend_Filter_StringTrim());
     $faxnumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Fax number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Fax number must contain at least %min% characters.')))));
     $faxnumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid fax number.')))));
     $country = new Zend_Form_Element_Select('country');
     $country->setLabel('country');
     $country->setRequired(true);
     $country->addValidator('NotEmpty', false, array('messages' => 'Please select country.'));
     $country->setAttrib('onchange', 'displayParticularState(this,"state","state","")');
     $countryModal = new Default_Model_Countries();
     $countriesData = $countryModal->fetchAll('isactive=1', 'country');
     $country->addMultiOption('', 'Select country');
     foreach ($countriesData->toArray() as $data) {
         $country->addMultiOption($data['country_id_org'], $data['country']);
     }
     $country->setRegisterInArrayValidator(false);
     $state = new Zend_Form_Element_Select('state');
     $state->setAttrib('class', 'selectoption');
     $state->setAttrib('onchange', 'displayParticularCity(this,"city","city","")');
     $state->setRegisterInArrayValidator(false);
     $state->addMultiOption('', 'Select State');
     $state->setRequired(true);
     $state->addValidator('NotEmpty', false, array('messages' => 'Please select state.'));
     $city = new Zend_Form_Element_Select('city');
     $city->setAttrib('class', 'selectoption');
     $city->setAttrib('onchange', 'displayCityCode(this)');
     $city->setRegisterInArrayValidator(false);
     $city->addMultiOption('', 'Select City');
     $city->setRequired(true);
     $city->addValidator('NotEmpty', false, array('messages' => 'Please select city.'));
     $address1 = new Zend_Form_Element_Textarea('address1');
     $address1->setAttrib('rows', 10);
     $address1->setAttrib('cols', 50);
     $address1->setRequired(true);
     $address1->addValidator('NotEmpty', false, array('messages' => 'Please enter main branch address.'));
     $address2 = new Zend_Form_Element_Textarea('address2');
     $address2->setAttrib('rows', 10);
     $address2->setAttrib('cols', 50);
     $address3 = new Zend_Form_Element_Textarea('address3');
     $address3->setAttrib('rows', 10);
     $address3->setAttrib('cols', 50);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $orghead = new Zend_Form_Element_Select('orghead');
     $orghead->setLabel('orghead');
     $orghead->setRequired(true);
     $orghead->addValidator('NotEmpty', false, array('messages' => 'Please select organization head.'));
     $orghead->setAttrib('onchange', 'getdetailsoforghead(this)');
     $orghead->setRegisterInArrayValidator(false);
     $prevorgheadrm = new Zend_Form_Element_Select('prevorgheadrm');
     $prevorgheadrm->setLabel('orghead');
     $prevorgheadrm->setRegisterInArrayValidator(false);
     $rmflag = Zend_Controller_Front::getInstance()->getRequest()->getParam('rmflag', null);
     if ($rmflag == '1') {
         $prevorgheadrm->setRequired(true);
         $prevorgheadrm->addValidator('NotEmpty', false, array('messages' => 'Please select reporting manager for current organization head.'));
     }
     $designation = new Zend_Form_Element_Text('designation');
     $designation->setAttrib('maxLength', 50);
     $designation->addFilter(new Zend_Filter_StringTrim());
     $designation->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid designation.')));
     $employeeId = new Zend_Form_Element_Text("employeeId");
     $employeeId->setRequired("true");
     $employeeId->setLabel("Employee ID");
     $employeeId->setAttrib("class", "formDataElement");
     $employeeId->setAttrib("readonly", "readonly");
     $employeeId->setAttrib('onfocus', 'this.blur()');
     $employeeId->addValidator('NotEmpty', false, array('messages' => 'Identity codes are not configured yet.'));
     $prefix_id = new Zend_Form_Element_Select('prefix_id');
     $prefix_id->setLabel("Prefix");
     $prefix_id->setRegisterInArrayValidator(false);
     $emprole = new Zend_Form_Element_Select("emprole");
     $emprole->setRegisterInArrayValidator(false);
     $emprole->setRequired(true);
     $emprole->setLabel("Role");
     $emprole->setAttrib("class", "formDataElement");
     $emprole->addValidator('NotEmpty', false, array('messages' => 'Please select role.'));
     $emailaddress = new Zend_Form_Element_Text("emailaddress");
     $emailaddress->setRequired(true);
     $emailaddress->addValidator('NotEmpty', false, array('messages' => 'Please enter email.'));
     $emailaddress->addValidator("regex", true, array('pattern' => '/^(?!.*\\.{2})[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid email.')));
     $emailaddress->setLabel("Email");
     $emailaddress->setAttrib("class", "formDataElement");
     $emailaddress->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_users', 'field' => 'emailaddress', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('orghead', 0) . '" and isactive!=0')));
     $emailaddress->getValidator('Db_NoRecordExists')->setMessage('Email already exists.');
     $jobtitle = new Zend_Form_Element_Select('jobtitle_id');
     $jobtitle->setLabel("Job Title");
     $jobtitle->addMultiOption('', 'Select Job Title');
     $jobtitle->setAttrib('onchange', 'displayPositions(this,"position_id","")');
     $jobtitle->setRegisterInArrayValidator(false);
     $position = new Zend_Form_Element_Select('position_id');
     $position->setLabel("Position");
     $position->addMultiOption('', 'Select Position');
     $position->setRegisterInArrayValidator(false);
     $date_of_joining = new ZendX_JQuery_Form_Element_DatePicker('date_of_joining');
     $date_of_joining->setLabel("Date Of Joining");
     $date_of_joining->setOptions(array('class' => 'brdr_none'));
     $date_of_joining->setRequired(true);
     $date_of_joining->setAttrib('readonly', 'true');
     $date_of_joining->setAttrib('onfocus', 'this.blur()');
     $date_of_joining->addValidator('NotEmpty', false, array('messages' => 'Please select date of joining.'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $prevorgheadrm, $orgname, $imgerrmsg, $imgerr, $org_image_value, $domain, $orgdescription, $website, $totalemployees, $org_startdate, $phonenumber, $secondaryphone, $faxnumber, $country, $state, $city, $address1, $address2, $address3, $description, $orghead, $designation, $employeeId, $prefix_id, $emprole, $emailaddress, $jobtitle, $position, $date_of_joining, $submit));
     //$email,$secondaryemail,
     $this->setElementDecorators(array('ViewHelper'));
     $this->setElementDecorators(array('File'), array('org_image'));
     $this->setElementDecorators(array('UiWidgetElement'), array('org_startdate', 'date_of_joining'));
 }
Ejemplo n.º 24
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setAttrib('name', 'organisationinfo');
     $this->setAttrib('action', DOMAIN . 'organisationinfo/edit');
     $id = new Zend_Form_Element_Hidden('id');
     $orgname = new Zend_Form_Element_Text('organisationname');
     $orgname->setAttrib('maxLength', 50);
     $orgname->addFilter(new Zend_Filter_StringTrim());
     $orgname->setRequired(true);
     $orgname->addValidator('NotEmpty', false, array('messages' => 'Please enter organization name.'));
     $orgname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid organization name.')));
     $domain = new Zend_Form_Element_Multiselect('domain');
     $domain->setLabel('domain')->setMultiOptions(array('1' => 'Admin/Secretarial', '2' => 'Customer Service/ Call Centre/ BPO', '3' => 'Finance & Accounts', '4' => 'Human Resources', '5' => 'IT', '6' => 'Legal', '7' => 'Marketing & Communications', '8' => 'Purchase/ Logistics/ Supply Chain', '9' => 'Sales/ Business Development', '10' => 'Sales & Marketing & Advertisement'));
     $org_image_value = new Zend_Form_Element_Hidden('org_image_value');
     $imgerr = new Zend_Form_Element_Hidden('imgerr');
     $imgerrmsg = new Zend_Form_Element_Hidden('imgerrmsg');
     $orgdescription = new Zend_Form_Element_Textarea('orgdescription');
     $orgdescription->setAttrib('rows', 10);
     $orgdescription->setAttrib('cols', 50);
     $website = new Zend_Form_Element_Text('website');
     $website->setAttrib('maxLength', 50);
     $website->addFilter(new Zend_Filter_StringTrim());
     $website->setRequired(true);
     $website->addValidator('NotEmpty', false, array('messages' => 'Please enter website.'));
     $website->addValidator(new Zend_Validate_Uri());
     $totalemployees = new Zend_Form_Element_Select('totalemployees');
     $totalemployees->setRegisterInArrayValidator(false);
     $totalemployees->setMultiOptions(array('1' => '20-50', '2' => '51-100', '3' => '101-500', '4' => '501 -1000', '5' => '> 1000'));
     $totalemployees->setRequired(true);
     $totalemployees->addValidator('NotEmpty', false, array('messages' => 'Please enter total employees.'));
     $org_startdate = new ZendX_JQuery_Form_Element_DatePicker('org_startdate');
     $org_startdate->setAttrib('readonly', 'true');
     $org_startdate->setAttrib('onfocus', 'this.blur()');
     $org_startdate->setOptions(array('class' => 'brdr_none'));
     $phonenumber = new Zend_Form_Element_Text('phonenumber');
     $phonenumber->addFilter(new Zend_Filter_StringTrim());
     $phonenumber->setAttrib('maxLength', 15);
     $phonenumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Phone number must contain at least %min% characters.')))));
     $phonenumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
     $secondaryphone = new Zend_Form_Element_Text('secondaryphone');
     $secondaryphone->setAttrib('maxLength', 15);
     $secondaryphone->addFilter(new Zend_Filter_StringTrim());
     $secondaryphone->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Secondary phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Secondary phone number must contain at least %min% characters.')))));
     $secondaryphone->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
     $faxnumber = new Zend_Form_Element_Text('faxnumber');
     $faxnumber->setAttrib('maxLength', 15);
     $faxnumber->addFilter(new Zend_Filter_StringTrim());
     $faxnumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Fax number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Fax number must contain at least %min% characters.')))));
     $faxnumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid fax number.')))));
     $country = new Zend_Form_Element_Select('country');
     $country->setLabel('country');
     $country->setRequired(true);
     $country->addValidator('NotEmpty', false, array('messages' => 'Please select country.'));
     $country->setAttrib('onchange', 'displayParticularState(this,"state","state","")');
     $countryModal = new Default_Model_Countries();
     $countriesData = $countryModal->fetchAll('isactive=1', 'country');
     $country->addMultiOption('', 'Select country');
     foreach ($countriesData->toArray() as $data) {
         $country->addMultiOption($data['country_id_org'], $data['country']);
     }
     $country->setRegisterInArrayValidator(false);
     $state = new Zend_Form_Element_Select('state');
     $state->setAttrib('class', 'selectoption');
     $state->setAttrib('onchange', 'displayParticularCity(this,"city","city","")');
     $state->setRegisterInArrayValidator(false);
     $state->addMultiOption('', 'Select State');
     $state->setRequired(true);
     $state->addValidator('NotEmpty', false, array('messages' => 'Please select state.'));
     $city = new Zend_Form_Element_Select('city');
     $city->setAttrib('class', 'selectoption');
     $city->setAttrib('onchange', 'displayCityCode(this)');
     $city->setRegisterInArrayValidator(false);
     $city->addMultiOption('', 'Select City');
     $city->setRequired(true);
     $city->addValidator('NotEmpty', false, array('messages' => 'Please select city.'));
     $address1 = new Zend_Form_Element_Textarea('address1');
     $address1->setAttrib('rows', 10);
     $address1->setAttrib('cols', 50);
     $address2 = new Zend_Form_Element_Textarea('address2');
     $address2->setAttrib('rows', 10);
     $address2->setAttrib('cols', 50);
     $address3 = new Zend_Form_Element_Textarea('address3');
     $address3->setAttrib('rows', 10);
     $address3->setAttrib('cols', 50);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $designation = new Zend_Form_Element_Text('designation');
     $designation->setAttrib('maxLength', 50);
     $designation->addFilter(new Zend_Filter_StringTrim());
     $designation->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid designation.')));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $orgname, $imgerrmsg, $imgerr, $org_image_value, $domain, $orgdescription, $website, $totalemployees, $org_startdate, $phonenumber, $secondaryphone, $faxnumber, $country, $state, $city, $address1, $address2, $address3, $description, $designation, $submit));
     //$email,$secondaryemail,
     $this->setElementDecorators(array('ViewHelper'));
     $this->setElementDecorators(array('File'), array('org_image'));
     $this->setElementDecorators(array('UiWidgetElement'), array('org_startdate', 'date_of_joining'));
 }
Ejemplo n.º 25
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'appraisalinit');
     $id = new Zend_Form_Element_Hidden('id');
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $businessunit_id = $auth->getStorage()->read()->businessunit_id;
         $department_id = $auth->getStorage()->read()->department_id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     if ($loginuserRole != SUPERADMINROLE && $loginuserGroup != MANAGEMENT_GROUP) {
         $businessunit_id = new Zend_Form_Element_Hidden('businessunit_id');
         $department_id = new Zend_Form_Element_Hidden('department_id');
         $businessunit_name = new Zend_Form_Element_Text('businessunit_name');
         $businessunit_name->setLabel("Business Unit");
         $businessunit_name->setAttrib('readonly', 'true');
         $businessunit_name->setAttrib('onfocus', 'this.blur()');
         $businessunit_name->setOptions(array('class' => 'brdr_none'));
         $department_name = new Zend_Form_Element_Text('department_name');
         $department_name->setLabel("Department");
         $department_name->setAttrib('readonly', 'true');
         $department_name->setAttrib('onfocus', 'this.blur()');
         $department_name->setOptions(array('class' => 'brdr_none'));
     } else {
         $businessunit_id = new Zend_Form_Element_Select('businessunit_id');
         $businessunit_id->setLabel("Business Unit");
         $businessunit_id->setRegisterInArrayValidator(false);
         $businessunit_id->setRequired(true);
         $businessunit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit'));
         $department_id = new Zend_Form_Element_Select('department_id');
         $department_id->setLabel("Department");
         $department_id->setRegisterInArrayValidator(false);
         $department_id->addMultiOptions(array('' => 'Select Department'));
         $performance_app_flag = Zend_Controller_Front::getInstance()->getRequest()->getParam('performance_app_flag', null);
         if ($performance_app_flag != '' && $performance_app_flag == 0) {
             $department_id->setRequired(true);
             $department_id->addValidator('NotEmpty', false, array('messages' => 'Please select department'));
         }
     }
     // $appraisal_mode = new Zend_Form_Element_Text('appraisal_mode');
     // $appraisal_mode->setLabel("Appraisal Mode");
     // $appraisal_mode->setAttrib('readonly', 'readonly');
     // $appraisal_mode->setAttrib('onfocus', 'this.blur()');
     // $appraisal_mode->setOptions(array('class' => 'brdr_none'));
     $appraisal_mode = new Zend_Form_Element_Select('appraisal_mode');
     $appraisal_mode->setLabel("Appraisal Mode");
     $appraisal_mode->setAttrib('class', 'selectoption');
     $appraisal_mode->addMultiOptions(array('' => 'Select appraisal mode', 'Quarterly' => 'Quarterly', 'Half-yearly' => 'Half-yearly', 'Yearly' => 'Yearly'));
     $appraisal_mode->setRegisterInArrayValidator(false);
     $appraisal_mode->setRequired(true);
     $appraisal_mode->addValidator('NotEmpty', false, array('messages' => 'Please select appraisal mode'));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel("Appraisal Status");
     $status->setAttrib('class', 'selectoption');
     $status->setMultiOptions(array('1' => 'Open'));
     $status->setRegisterInArrayValidator(false);
     $status->setRequired(true);
     $status->addValidator('NotEmpty', false, array('messages' => 'Please select appraisal status.'));
     $from_year = new Zend_Form_Element_Select('from_year');
     $from_year->setAttrib('class', 'selectoption');
     $from_year->setRegisterInArrayValidator(false);
     $from_year->setRequired(true);
     $from_year->setLabel("From Year");
     $from_year->addMultiOption("", "From Year");
     $from_year->addValidator('NotEmpty', false, array('messages' => 'Please select from year'));
     $current_date = date('Y-m-d');
     $previous_year = date('Y', strtotime("{$current_date} -1 year"));
     for ($i = $previous_year; $i <= $previous_year + 5; $i++) {
         $from_year->addMultiOption($i, $i);
     }
     $to_year = new Zend_Form_Element_Select('to_year');
     $to_year->setAttrib('class', 'selectoption');
     $to_year->setRegisterInArrayValidator(false);
     $to_year->setRequired(true);
     $to_year->setLabel("To Year");
     $to_year->addMultiOption("", "To Year");
     $to_year->addValidator('NotEmpty', false, array('messages' => 'Please select to year'));
     /* Limit 'To Year' field years 
      * upto following year of 'From Year'
      * upto 5 years from current last year i.e.$previous_year
      */
     $post_from_year = Zend_Controller_Front::getInstance()->getRequest()->getParam('from_year', null);
     if (!empty($post_from_year)) {
         for ($i = $post_from_year; $i <= $post_from_year + 1 && $i <= $previous_year + 5; $i++) {
             $to_year->addMultiOption($i, $i);
         }
     }
     $appraisal_period = new Zend_Form_Element_Text('appraisal_period');
     $appraisal_period->setLabel("Period");
     $appraisal_period->setAttrib('readonly', 'readonly');
     $appraisal_period->setAttrib('onfocus', 'this.blur()');
     $appraisal_period->setOptions(array('class' => 'brdr_none'));
     // $appraisal_period->setRequired(true);
     // $appraisal_period->addValidator('NotEmpty', false, array('messages' => 'Please enter period'));
     $eligibility = new Zend_Form_Element_Multiselect('eligibility');
     $eligibility->setLabel("Eligibility");
     $eligibility->setAttrib('class', 'selectoption');
     $eligibility->setMultiOptions(array('' => 'Select Eligibility'));
     /*$eligibility->setRegisterInArrayValidator(false);
       $eligibility->setRequired(true);
       $eligibility->addValidator('NotEmpty', false, array('messages' => 'Please select eligiblity'));*/
     $eligibility_hidden = new Zend_Form_Element_Multiselect('eligibility_hidden');
     $eligibility_hidden->setLabel("Eligibility");
     $eligibility_hidden->setAttrib('class', 'selectoption');
     $eligibility_hidden->setRegisterInArrayValidator(false);
     $eligibilityflag = new Zend_Form_Element_Hidden('eligibilityflag');
     $eligibility_value = new Zend_Form_Element_Hidden('eligibility_value');
     $category_id = new Zend_Form_Element_Multiselect('category_id');
     $category_id->setLabel("Parameters");
     $category_id->setMultiOptions(array('' => 'Select Parameters'));
     $category_id->setRegisterInArrayValidator(false);
     $category_id->setRequired(true);
     $category_id->addValidator('NotEmpty', false, array('messages' => 'Please select parameters'));
     $enable = new Zend_Form_Element_Select('enable_step');
     $enable->setLabel("Enable To");
     $enable->setAttrib('onchange', 'changeduedatetext(this.value)');
     $enable->setMultiOptions(array('1' => 'Managers', '2' => 'Employees'));
     $enable->setRegisterInArrayValidator(false);
     $enable->setRequired(true);
     $enable->addValidator('NotEmpty', false, array('messages' => 'Please select enable to'));
     $enable_to_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('enable_step', null);
     $mgr_due_date = new Zend_Form_Element_Text('managers_due_date');
     $mgr_due_date->setLabel("Managers Due Date");
     $emp_due_date = new Zend_Form_Element_Text('employee_due_date');
     $emp_due_date->setLabel("Employees Due Date");
     if ($enable_to_val == '' || $enable_to_val == 1) {
         $mgr_due_date->setRequired(true);
         $mgr_due_date->addValidator('NotEmpty', false, array('messages' => 'Please select managers due date'));
     } else {
         $emp_due_date->setRequired(true);
         $emp_due_date->addValidator('NotEmpty', false, array('messages' => 'Please select employees due date'));
     }
     $management_appraisal = new Zend_Form_Element_Checkbox('management_appraisal');
     $management_appraisal->setLabel("Consider management");
     // $appraisal_ratings = new Zend_Form_Element_Text('appraisal_ratings');
     // $appraisal_ratings->setAttrib('readonly', 'readonly');
     // $appraisal_ratings->setAttrib('onfocus', 'this.blur()');
     // $appraisal_ratings->setLabel("Ratings");
     $appraisal_ratings = new Zend_Form_Element_Select('appraisal_ratings');
     $appraisal_ratings->setLabel("Appraisal Ratings");
     $appraisal_ratings->setAttrib('class', 'selectoption');
     $appraisal_ratings->addMultiOptions(array('' => 'Select ratings', '1' => '1-5', '2' => '1-10'));
     $appraisal_ratings->setRegisterInArrayValidator(false);
     $appraisal_ratings->setRequired(true);
     $appraisal_ratings->addValidator('NotEmpty', false, array('messages' => 'Please select appraisal ratings'));
     $app_period_hid = new Zend_Form_Element_Hidden('app_period_hid');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     if ($loginuserRole != SUPERADMINROLE && $loginuserGroup != MANAGEMENT_GROUP) {
         $this->addElements(array($appraisal_ratings, $management_appraisal, $id, $appraisal_period, $from_year, $to_year, $businessunit_id, $department_id, $businessunit_name, $department_name, $appraisal_mode, $category_id, $status, $eligibility, $eligibility_hidden, $eligibility_value, $eligibilityflag, $enable, $mgr_due_date, $emp_due_date, $app_period_hid, $submit));
     } else {
         $this->addElements(array($appraisal_ratings, $management_appraisal, $id, $appraisal_period, $from_year, $to_year, $businessunit_id, $department_id, $appraisal_mode, $category_id, $status, $eligibility, $eligibility_hidden, $eligibility_value, $eligibilityflag, $enable, $mgr_due_date, $emp_due_date, $app_period_hid, $submit));
     }
     $this->setElementDecorators(array('ViewHelper'));
 }