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'));
 }
 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'));
 }
Beispiel #3
0
 public function init()
 {
     $media_library_model = new Cms_Model_MediaLibraries();
     $media_library = $media_library_model->getByPath($this->_attribs['media_library_path']);
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title');
     $title->setRequired(true);
     $title->addFilter('StringTrim');
     $title->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $this->addElement($title);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description');
     $description->addFilter('StringTrim');
     $description->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $this->addElement($description);
     $original = new Zend_Form_Element_File('original');
     $original->addValidator('Count', false, 1);
     $original->addValidator('Extension', false, 'jpeg,jpg,png');
     $original->addFilter('Rename', $this->_attribs['file_name']);
     $original->setDestination(My_Utilities::getUploadMediaPathDiffSizes($this->_attribs['file_name'], $this->_attribs['media_library_path'], 'original'));
     $original->setLabel('Image:');
     $this->addElement($original);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Potvrdi');
     $this->setAction('')->setMethod('post')->addElement($submit);
     $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+'/cms/medias/index/library_id/" . $media_library->id . "'");
     $this->addElement($cancel);
 }
Beispiel #4
0
 public function init()
 {
     $country_code = new Zend_Form_Element_Text('country_code');
     $country_code->setLabel('Country code');
     $country_code->setDescription('List of codes you can see here: http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html');
     $country_code->setRequired(true);
     $this->addElement($country_code);
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $this->addElement($name);
     $is_active = new Zend_Form_Element_Checkbox('is_active');
     $is_active->setLabel('Active');
     $is_active->setRequired(true);
     $this->addElement($is_active);
     $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+'/locale/languages/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
Beispiel #5
0
 public function init()
 {
     $model_countries = new Locale_Model_Languages();
     $model_t_keys = new Locale_Model_TranslateKeys();
     $key_id = new Zend_Form_Element_Select('key_id');
     $key_id->addValidator(new Zend_Validate_Digits(), true);
     $key_id->setLabel('Key');
     $key_id->setRequired(true);
     $key_id->setMultiOptions($model_t_keys->getIdAndKeyArray(true));
     $this->addElement($key_id);
     $country_id = new Zend_Form_Element_Select('language_id');
     $country_id->addValidator(new Zend_Validate_Digits(), true);
     $country_id->setLabel('Language');
     $country_id->setRequired(true);
     $country_id->setMultiOptions($model_countries->getIdAndNameArray());
     $this->addElement($country_id);
     $value = new My_Form_Element_CKEditor('value');
     $value->setLabel('Translation');
     $value->setDescription('Tags for dynamic values: {1}, {2}, {3}...Double quotes (")are not allowed');
     $this->addElement($value);
     $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+'/locale/translate-messages/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
Beispiel #6
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);
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'emppersonaldetails');
     $id = new Zend_Form_Element_Hidden('id');
     $userid = new Zend_Form_Element_Hidden('user_id');
     $genderid = new Zend_Form_Element_Select('genderid');
     $genderid->addMultiOption('', 'Select Gender');
     $genderid->setRegisterInArrayValidator(false);
     $genderid->setRequired(true);
     $genderid->addValidator('NotEmpty', false, array('messages' => 'Please select gender.'));
     $maritalstatusid = new Zend_Form_Element_Select('maritalstatusid');
     $maritalstatusid->addMultiOption('', 'Select Marital Status');
     $maritalstatusid->setRegisterInArrayValidator(false);
     $maritalstatusid->setRequired(true);
     $maritalstatusid->addValidator('NotEmpty', false, array('messages' => 'Please select marital status.'));
     $ethniccodeid = new Zend_Form_Element_Select('ethniccodeid');
     $ethniccodeid->addMultiOption('', 'Select Ethnic Code');
     $ethniccodeid->setLabel('Ethnic Code');
     $ethniccodeid->setRegisterInArrayValidator(false);
     $racecodeid = new Zend_Form_Element_Select('racecodeid');
     $racecodeid->addMultiOption('', 'Select Race Code');
     $racecodeid->setLabel('Race Code');
     $racecodeid->setRegisterInArrayValidator(false);
     $languageid = new Zend_Form_Element_Select('languageid');
     $languageid->addMultiOption('', 'Select Language');
     $languageid->setLabel('Language');
     $languageid->setRegisterInArrayValidator(false);
     $nationalityid = new Zend_Form_Element_Select('nationalityid');
     $nationalityid->addMultiOption('', 'Select Nationality');
     $nationalityid->setRegisterInArrayValidator(false);
     $nationalityid->setRequired(true);
     $nationalityid->addValidator('NotEmpty', false, array('messages' => 'Please select nationality.'));
     $dob = new ZendX_JQuery_Form_Element_DatePicker('dob');
     $dob->setOptions(array('class' => 'brdr_none'));
     $dob->setRequired(true);
     $dob->setAttrib('readonly', 'true');
     $dob->setAttrib('onfocus', 'this.blur()');
     $dob->addValidator('NotEmpty', false, array('messages' => 'Please select date of birth.'));
     //DOB should not be current date....
     $celebrated_dob = new ZendX_JQuery_Form_Element_DatePicker('celebrated_dob');
     $celebrated_dob->setOptions(array('class' => 'brdr_none'));
     $celebrated_dob->setAttrib('readonly', 'true');
     $celebrated_dob->setAttrib('onfocus', 'this.blur()');
     $bloodgroup = new Zend_Form_Element_Text('bloodgroup');
     $bloodgroup->setAttrib('size', 5);
     $bloodgroup->setAttrib('maxlength', 10);
     /*$submit = new Zend_Form_Element_Submit('submit');
     		$submit->setAttrib('id', 'submitbutton');
     		$submit->setLabel('Save');*/
     $submitadd = new Zend_Form_Element_Button('submitbutton');
     $submitadd->setAttrib('id', 'submitbuttons');
     $submitadd->setAttrib('onclick', 'validatedocumentonsubmit(this)');
     $submitadd->setLabel('Save');
     $this->addElements(array($id, $userid, $genderid, $maritalstatusid, $nationalityid, $ethniccodeid, $racecodeid, $languageid, $dob, $celebrated_dob, $bloodgroup, $submitadd));
     $this->setElementDecorators(array('ViewHelper'));
     $this->setElementDecorators(array('UiWidgetElement'), array('dob', 'celebrated_dob'));
 }
Beispiel #8
0
 public function init()
 {
     $file = new Zend_Form_Element_File('file');
     $file->setRequired(true)->addValidator('Extension', false, 'csv')->addValidator('Size', false, 1048576 * 2)->addValidator('Count', false, 1);
     $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+'/locale/translate-messages/'");
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Upload CSV file');
     $this->setAttrib('enctype', 'multipart/form-data')->setMethod('post')->addElement($file)->addElement($cancel)->addElement($submit);
 }
Beispiel #9
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'empleaves');
     $id = new Zend_Form_Element_Hidden('id');
     $userid = new Zend_Form_Element_Hidden('user_id');
     $emp_leave_limit = new Zend_Form_Element_Text('leave_limit');
     $emp_leave_limit->setAttrib('maxLength', 3);
     $emp_leave_limit->addFilter(new Zend_Filter_StringTrim());
     $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.')));
     $used_leaves = new Zend_Form_Element_Text('used_leaves');
     $used_leaves->setAttrib('maxLength', 3);
     $used_leaves->setAttrib('readonly', 'true');
     $used_leaves->setAttrib('onfocus', 'this.blur()');
     $alloted_year = new Zend_Form_Element_Text('alloted_year');
     $alloted_year->setAttrib('maxLength', 4);
     $alloted_year->setAttrib('readonly', 'true');
     $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->setLabel('Save');
     $this->addElements(array($id, $userid, $emp_leave_limit, $used_leaves, $alloted_year, $submit, $submitbutton));
     $this->setElementDecorators(array('ViewHelper'));
 }
Beispiel #10
0
 public function init()
 {
     $this->setMethod('post');
     //        $this->setAction('/index/login');
     $this->setAttrib('id', 'msform');
     $email = new Zend_Form_Element_Text('email');
     $email->setAttrib('placeholder', 'E-mail');
     $email->setAttrib('autocomplete', 'off');
     $email->addFilter('StripTags');
     $email->addFilter('HtmlEntities');
     $email->addFilter('StringTrim');
     $email->setRequired(true)->addErrorMessage('Username Required');
     $email->addValidator('EmailAddress')->addErrorMessage('Invalid Email used');
     $email->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $password = new Zend_Form_Element_Password('password');
     $password->setAttrib('placeholder', 'Password');
     $password->setAttrib('autocomplete', 'off');
     $password->addFilter('StripTags');
     $password->addFilter('HtmlEntities');
     $password->addFilter('StringTrim');
     $password->setRequired(true)->addErrorMessage('Password Required');
     $password->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $link = new Zend_Form_Element_Note('forgot_password', array('value' => '<a href="#" id="link">Forgot your password ?</a>'));
     $submit = new Zend_Form_Element_Submit('SignIn');
     $submit->setLabel('Sign In');
     $submit->setAttrib('class', 'btn btn-info');
     $register = new Zend_Form_Element_Button('register');
     $register->setLabel('Register');
     $register->setAttrib('class', 'btn btn-warning');
     $this->addElements(array($email, $password, $submit, $register, $link));
     $this->setElementDecorators(array('ViewHelper'));
     $submit->setDecorators(array('ViewHelper'));
     $register->setDecorators(array('ViewHelper'));
     $this->setDecorators(array('FormElements', 'Form'));
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_interview_rpt');
     $interview_date = new Zend_Form_Element_Text("interview_date");
     $interview_date->setLabel("Interview Date");
     $interview_date->setAttrib('readonly', 'readonly');
     $req_id = new Zend_Form_Element_Select("req_id");
     $req_id->setRegisterInArrayValidator(false);
     $req_id->setLabel("Requisition Code")->addMultiOptions(array('' => 'Select Requisition Code'));
     $department_id = new Zend_Form_Element_Select("department_id");
     $department_id->setLabel("Department");
     $department_id->setRegisterInArrayValidator(false);
     $department_id->addMultiOptions(array('' => 'Select Department'));
     $interviewer_id = new Zend_Form_Element_Text("interviewer_id");
     $interviewer_id->setLabel("Interviewer");
     $interviewer_id->setAttrib('name', '');
     $interviewer_id->setAttrib('id', 'idinterviewer_id');
     $createdby = new Zend_Form_Element_Text("createdby");
     $createdby->setLabel("Interview Planned By");
     $createdby->setAttrib('name', '');
     $createdby->setAttrib('id', 'idcreatedby');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($submit, $interview_date, $req_id, $department_id, $interviewer_id, $createdby));
     $this->setElementDecorators(array('ViewHelper'));
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_requisition_report');
     $raised_by = new Zend_Form_Element_Text("raised_by");
     $raised_by->setLabel("Raised By");
     $raised_by->setAttrib('name', '');
     $raised_by->setAttrib('id', 'idraised_by');
     $raised_by->setAttrib('title', 'Raised By');
     $requisition_status = new Zend_Form_Element_Select("req_status");
     $requisition_status->setLabel("Requisition Status");
     $requisition_status->addMultiOptions(array('' => 'Select Requisition Status', 'Initiated' => 'Initiated', 'Approved' => 'Approved', 'Rejected' => 'Rejected', 'Closed' => 'Closed', 'On hold' => 'On hold', 'Complete' => 'Complete', 'In process' => 'In process'));
     $requisition_status->setAttrib('title', 'Requisition Status');
     $raised_in = new Zend_Form_Element_Select('createdon');
     $raised_in->setLabel('Raised In');
     $raised_in->setAttrib('id', 'createdon');
     $reporting_manager = new Zend_Form_Element_Text("reporting_manager");
     $reporting_manager->setLabel("Reporting Manager");
     $reporting_manager->setAttrib('name', '');
     $reporting_manager->setAttrib('id', 'idreporting_manager');
     $job_title = new Zend_Form_Element_Select("jobtitle");
     $job_title->setLabel("Job Title");
     $job_title->setAttrib("onchange", "getpositions_req('department','business_unit','position_id','jobtitle');");
     $job_title->setAttrib('title', 'Job Title.');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($raised_by, $requisition_status, $raised_in, $reporting_manager, $job_title, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_servicedesk_report');
     $raised_by = new Zend_Form_Element_Text("raised_by");
     $raised_by->setLabel("Raised by");
     $raised_by->setAttrib('name', '');
     $raised_by->setAttrib('id', 'idraised_by');
     $service_desk_type = new Zend_Form_Element_Select('service_desk_id');
     $service_desk_type->setLabel("Category");
     $service_desk_type->addMultiOptions(array('' => 'Select category'));
     $service_request_id = new Zend_Form_Element_Select('service_request_id');
     $service_request_id->setLabel("Request Type");
     $service_request_id->addMultiOptions(array('' => 'Select request'));
     $priority = new Zend_Form_Element_Select('priority');
     $priority->setLabel("Priority");
     $priority->addMultiOptions(array('' => 'Select priority', '1' => 'Low', '2' => 'Medium', '3' => 'High'));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel("Status");
     $status->addMultiOptions(array('' => 'Select status', 'Open' => 'Open', 'Cancelled' => 'Cancelled', 'To management approve' => 'To management approve', 'To manager approve' => 'To manager approve', 'Manager approved' => 'Manager approved', 'Management approved' => 'Management approved', 'Management rejected' => 'Management rejected', 'Manager rejected' => 'Manager rejected', 'Closed' => 'Closed', 'Rejected' => 'Rejected'));
     $raised_date = new Zend_Form_Element_Text("raised_date");
     $raised_date->setLabel("Raised On");
     $raised_date->setAttrib('readonly', 'readonly');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($raised_by, $service_desk_type, $service_request_id, $priority, $status, $raised_date, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
Beispiel #14
0
 public function init()
 {
     $this->setName('shipping_address');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $customerid = new Zend_Form_Element_Hidden('customerid');
     $customerid->addFilter('Int');
     $address1 = new Zend_Form_Element_Text('shipping_address1');
     $address1->setLabel('Street Address')->setAttrib('id', 'address1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $address2 = new Zend_Form_Element_Text('shipping_address2');
     $address2->setLabel('')->setAttrib('id', 'address2')->addFilter('StripTags')->addFilter('StringTrim');
     $address3 = new Zend_Form_Element_Text('shipping_address3');
     $address3->setLabel('')->setAttrib('id', 'address3')->addFilter('StripTags')->addFilter('StringTrim');
     $postcode = new Zend_Form_Element_Text('shipping_postcode');
     $postcode->setLabel('Postcode')->setAttrib('id', 'postcode')->addFilter('StripTags')->addFilter('StringTrim');
     $country = new Zend_Form_Element_Text('shipping_country');
     $country->setLabel('Country')->setAttrib('id', 'country')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $city = new Zend_Form_Element_Text('shipping_city');
     $city->setLabel('City')->setAttrib('id', 'city')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $phone = new Zend_Form_Element_Text('shipping_phone');
     $phone->setLabel('Phone')->setAttrib('id', 'phone')->addFilter('StripTags')->addFilter('StringTrim');
     $fax = new Zend_Form_Element_Text('shipping_fax');
     $fax->setLabel('Fax')->setAttrib('id', 'fax')->addFilter('StripTags')->addFilter('StringTrim');
     $email = new Zend_Form_Element_Text('shipping_email');
     $email->setLabel('E-Mail')->setAttrib('id', 'email')->addFilter('StripTags')->addFilter('StringTrim');
     $internet = new Zend_Form_Element_Text('shipping_internet');
     $internet->setLabel('Internet')->setAttrib('id', 'internet')->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Button('shipping_submit');
     $submit->setAttrib('onclick', 'addAddress()');
     $this->addElements(array($id, $customerid, $address1, $address2, $address3, $postcode, $city, $country, $phone, $fax, $email, $internet, $submit));
 }
 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');
     $servicedeskdepartment = new Zend_Form_Element_Select('service_desk_id');
     $servicedeskdepartment->setLabel("Category");
     $servicedeskdepartment->setAttrib('class', 'selectoption');
     $servicedeskdepartment->addMultiOption('', 'Select category');
     $servicedeskdepartment->setRegisterInArrayValidator(false);
     $servicedeskdepartment->setRequired(true);
     $servicedeskdepartment->addValidator('NotEmpty', false, array('messages' => 'Please select category.'));
     $postid = Zend_Controller_Front::getInstance()->getRequest()->getParam('id');
     if ($postid != '') {
         $servicedeskrequest = new Zend_Form_Element_Text("service_request_name");
         $servicedeskrequest->setLabel("Request Type");
         $servicedeskrequest->setAttrib('maxLength', 30);
         $servicedeskrequest->addFilter(new Zend_Filter_StringTrim());
         $servicedeskrequest->setRequired(true);
         $servicedeskrequest->addValidator('NotEmpty', false, array('messages' => 'Please enter request type.'));
         $servicedeskrequest->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9\\- ]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid request type.')));
         $servicedeskrequest->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_sd_reqtypes', 'field' => 'service_request_name', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" AND service_desk_id="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('service_desk_id') . '" AND isactive=1')));
         $servicedeskrequest->getValidator('Db_NoRecordExists')->setMessage('Request type already exists for the category.');
         $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('submitbutton');
         $submit->setAttrib('id', 'submitbutton');
         $submit->setLabel('Update');
     }
     $submitadd = new Zend_Form_Element_Button('submitbutton');
     $submitadd->setAttrib('id', 'submitbuttons');
     $submitadd->setAttrib('onclick', 'validaterequestsonsubmit(this)');
     $submitadd->setLabel('Save');
     if ($postid != '') {
         $this->addElements(array($id, $servicedeskdepartment, $servicedeskrequest, $description, $submit));
     } else {
         $this->addElements(array($id, $servicedeskdepartment, $submitadd));
     }
     $this->setElementDecorators(array('ViewHelper'));
 }
Beispiel #16
0
 public function init()
 {
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $name->addFilter('StringTrim');
     $name->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $this->addElement($name);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Potvrdi');
     $this->setAction('')->setMethod('post')->addElement($submit);
     $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+'/cms/media-libraries/'");
     $this->addElement($cancel);
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'appraisalquestions');
     $id = new Zend_Form_Element_Hidden('id');
     $category = new Zend_Form_Element_Select('pa_category_id');
     $category->setLabel("Parameter");
     $category->setAttrib('class', 'selectoption');
     $category->addMultiOption('', 'Select parameter');
     $category->setRegisterInArrayValidator(false);
     $category->setRequired(true);
     $category->addValidator('NotEmpty', false, array('messages' => 'Please select parameter.'));
     $postid = Zend_Controller_Front::getInstance()->getRequest()->getParam('id');
     if ($postid != '') {
         $question = new Zend_Form_Element_Text("question");
         $question->setLabel('Question');
         $question->setAttrib('maxLength', 100);
         $question->addFilter(new Zend_Filter_StringTrim());
         $question->setRequired(true);
         $question->addValidator('NotEmpty', false, array('messages' => 'Please enter question.'));
         $question->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?\',\\/#@$&*()!]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid question.')));
         $question->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_pa_questions', 'field' => 'question', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" AND pa_category_id="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('pa_category_id') . '" AND isactive=1')));
         $question->getValidator('Db_NoRecordExists')->setMessage('Question already exists for the parameter.');
         $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');
     $submitadd = new Zend_Form_Element_Button('submitbutton');
     $submitadd->setAttrib('id', 'submitbuttons');
     $submitadd->setAttrib('onclick', 'validatequestiononsubmit(this)');
     $submitadd->setLabel('Save');
     if ($postid != '') {
         $this->addElements(array($id, $category, $question, $description, $submit));
     } else {
         $this->addElements(array($id, $category, $submitadd));
     }
     $this->setElementDecorators(array('ViewHelper'));
 }
Beispiel #18
0
 public function init()
 {
     parent::init();
     $this->setName('newBranchForm');
     $this->setMethod('post');
     $this->setAction('ajax/newbranch/');
     $name = new Zend_Form_Element_Text('name_branch');
     $name->setLabel('Enter new branch name');
     $name->addValidator('StringLength', true, array(1, 128));
     $name->addValidator('Regex', true, array('pattern' => self::pattern));
     $cancel = new Zend_Form_Element_Button('cancel_branch');
     $cancel->setLabel('Cancel');
     $cancel->setAttrib('onclick', 'hideNewBranch()');
     $cancel->setAttrib('class', 'button');
     $submit = new Zend_Form_Element_Submit('new_branch');
     $submit->setLabel('New');
     $submit->setAttrib('class', 'button');
     $this->setElements(array($name, $cancel, $submit));
 }
Beispiel #19
0
 public function init()
 {
     $key = new Zend_Form_Element_Text('key');
     $key->setLabel('Key');
     $key->setRequired(true);
     $key->setDescription('Key must contain small letters. Blank space replace with _');
     $this->addElement($key);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Description');
     $description->setRequired(true);
     $this->addElement($description);
     $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+'/locale/translate-keys/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
Beispiel #20
0
 public function init()
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $href = $request->getBaseUrl() . '/' . $request->getModuleName() . '/' . $request->getControllerName() . '/' . $request->getActionName();
     $id = new Zend_Form_Element_Text('id');
     $email = new Zend_Form_Element_Text('email');
     $submit = new Zend_Form_Element_Button('Search');
     $reset = new Zend_Form_Element_Button('Reset');
     $submit->setAttrib('type', 'submit');
     $reset->setAttrib('type', 'reset');
     $reset->setAttrib('href', $href);
     $this->setAction($href)->setMethod('post')->addElement($id)->addElement($email)->addElement($submit)->addElement($reset);
 }
Beispiel #21
0
 public function init()
 {
     $key_id = new Zend_Form_Element_Note('key_id');
     $key_id->setLabel('Key');
     $this->addElement($key_id);
     $country_id = new Zend_Form_Element_Note('language_id');
     $country_id->setLabel('Language');
     $this->addElement($country_id);
     $value = new My_Form_Element_CKEditor('value');
     $value->setLabel('Translation');
     $value->setDescription('Tags for dynamic values: {1}, {2}, {3}...Double quotes (")are not allowed');
     $this->addElement($value);
     $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+'/locale/translate-messages/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
Beispiel #22
0
 public function init()
 {
     $user = Zend_Auth::getInstance()->getIdentity();
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->setRequired(true)->addValidator('EmailAddress')->setAttrib("class", "form-control")->setAttrib("style", "width:200px")->addErrorMessage('Email address not valid');
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel('Password')->setAttrib("class", "form-control")->setAttrib("style", "width:200px")->setAttrib('autocomplete', 'off')->setRequired(true);
     $name = new Zend_Form_Element_Text('first_name');
     $name->setLabel('First name')->setAttrib("class", "form-control")->setAttrib("style", "width:200px")->setRequired(true);
     $lastname = new Zend_Form_Element_Text('last_name');
     $lastname->setLabel('Last name')->setAttrib("class", "form-control")->setAttrib("style", "width:200px")->setRequired(true);
     $role_name = new Zend_Form_Element_Select('role_id');
     $role_name->setLabel('Account type')->setRequired(true)->setRegisterInArrayValidator(false);
     $role_name->setAttrib("class", "select2")->setAttrib("style", "width:200px");
     $roles_table = new Admin_Model_Roles();
     foreach ($roles_table->getAll() as $v) {
         $role_name->addMultiOption($v->id, $v->name);
     }
     $img = new Zend_Form_Element_File('image');
     $img->setDestination(WEB_PATH . Zend_Registry::get('upload_profile_img_path'));
     $img->addValidator('Count', false, 1);
     $img->addValidator('Extension', false, 'jpeg,jpg,png,gif');
     if ($img->getFileName()) {
         $new_name = md5(rand(1000, 10000) . time() . $img->getFileName()) . "." . preg_replace('/^.*\\.([^.]+)$/D', '$1', $img->getFileName());
         $img->addFilter('Rename', $new_name);
     }
     $img->setLabel('Image');
     $is_active = new Zend_Form_Element_Checkbox("is_active");
     $is_active->setLabel('Active')->setAttrib("class", "icheckbox_square");
     $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-users/'");
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($email)->addElement($password)->addElement($name)->addElement($lastname)->addElement($role_name)->addElement($img)->addElement($is_active)->addElement($cancel)->addElement($submit);
 }
Beispiel #23
0
 public function init()
 {
     $model_t_countries = new Locale_Model_Languages();
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $this->addElement($name);
     $country_code = new Zend_Form_Element_Text('country_code');
     $country_code->setLabel('Country code');
     $country_code->setDescription('List of codes you can see here: http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html');
     $country_code->setRequired(true);
     $this->addElement($country_code);
     $calling_code = new Zend_Form_Element_Text('calling_code');
     $calling_code->setLabel('Calling code');
     $calling_code->setRequired(true);
     $calling_code->addValidator('Digits', true);
     $this->addElement($calling_code);
     $t_country_id = new Zend_Form_Element_Select('language_id');
     $t_country_id->addValidator(new Zend_Validate_Digits(), true);
     $t_country_id->setLabel('Language');
     $t_country_id->setAttrib("data-placeholder", "Choose language...");
     $t_country_id->setMultiOptions(array('0' => 'none') + $model_t_countries->getIdAndNameArray());
     $this->addElement($t_country_id);
     $is_active = new Zend_Form_Element_Checkbox('is_active');
     $is_active->setLabel('Active');
     $is_active->setRequired(true);
     $this->addElement($is_active);
     $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+'/locale/countries/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'empprobationreview');
     $id = new Zend_Form_Element_Hidden('id');
     $userid = new Zend_Form_Element_Hidden('user_id');
     $reviewdate = new ZendX_JQuery_Form_Element_DatePicker('reviewdate');
     $reviewdate->setOptions(array('class' => 'brdr_none'));
     $reviewdate->setAttrib('readonly', 'false');
     $reviewdate->setRequired(true);
     $reviewdate->addValidator('NotEmpty', false, array('messages' => 'Please select review date.'));
     $next_reviewdate = new ZendX_JQuery_Form_Element_DatePicker('next_reviewdate');
     $next_reviewdate->setOptions(array('class' => 'brdr_none'));
     $next_reviewdate->setAttrib('readonly', 'false');
     $next_reviewdate->setRequired(true);
     $next_reviewdate->addValidator('NotEmpty', false, array('messages' => 'Please select next review date.'));
     $feedback = new Zend_Form_Element_Textarea('feedback');
     $feedback->setAttrib('rows', 10);
     $feedback->setAttrib('cols', 50);
     $feedback->setAttrib('maxlength', '2000');
     $feedback->setRequired(true);
     $feedback->addValidator('NotEmpty', false, array('messages' => 'Please enter feedback or comments.'));
     $probationstatus = new Zend_Form_Element_Select("probationstatus");
     $probationstatus->setRegisterInArrayValidator(true);
     $probationstatus->setAttrib("class", "formDataElement");
     $probationstatus->addMultiOptions(array('' => 'Select Probation Status', 'Performance Review' => 'Performance Review', 'Probation Complete' => 'Probation Complete', 'Extended' => 'Extended'));
     $probationstatus->setAttrib('title', 'Probation Status');
     $probationstatus->setRequired(true);
     $probationstatus->addValidator('NotEmpty', false, array('messages' => 'Please select status.'));
     $submitadd = new Zend_Form_Element_Button('submitbutton');
     $submitadd->setAttrib('id', 'submitbuttons');
     $submitadd->setAttrib('onclick', 'validatedocumentonsubmit(this)');
     $submitadd->setLabel('Save');
     $this->addElements(array($id, $userid, $reviewdate, $feedback, $probationstatus, $next_reviewdate, $submitadd));
 }
Beispiel #25
0
 protected function setButton()
 {
     $submit = new Zend_Form_Element_Submit("submit", array("label" => "Salvar"));
     $submit->removeDecorator('DtDdWrapper');
     $submit->addDecorator(array("opentd" => 'HtmlTag'), array('class' => 'form_control_left', 'tag' => 'td'));
     $submit->addDecorator(array("opentr" => 'HtmlTag'), array('tag' => 'tr', 'openOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::PREPEND));
     $submit->setOrder(100);
     $this->addElement($submit);
     $back = new Zend_Form_Element_Button("cancel", array("label" => "Cancelar"));
     $back->setAttrib("onclick", "location.href='javascript:history.back();'");
     $back->removeDecorator('DtDdWrapper');
     $back->addDecorator(array("closetd" => 'HtmlTag'), array('class' => 'form_control_right', 'tag' => 'td'));
     $back->addDecorator(array("closetr" => 'HtmlTag'), array('tag' => 'tr', 'closeOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::APPEND));
     $back->setOrder(101);
     $this->addElement($back);
 }
Beispiel #26
0
 public function init()
 {
     $this->setName('address');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $customerid = new Zend_Form_Element_Hidden('customerid');
     $customerid->addFilter('Int');
     $street = new Zend_Form_Element_Textarea('street');
     $street->setLabel('Street Address')->setAttrib('id', 'street')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('cols', '23')->setAttrib('rows', '2');
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->setLabel('Postcode')->addFilter('StripTags')->addFilter('StringTrim');
     $city = new Zend_Form_Element_Text('city');
     $city->setLabel('City')->addFilter('StripTags')->addFilter('StringTrim');
     $country = new Zend_Form_Element_Text('country');
     $country->setLabel('Country')->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('onclick', 'addAddress()');
     $this->addElements(array($id, $customerid, $street, $postcode, $city, $country, $submit));
 }
Beispiel #27
0
 public function add($defaultFields = '', $state = 'add')
 {
     $form = array();
     $form['first_name'] = new Zend_Form_Element_Text('first_name');
     $form['first_name']->setLabel('First Name')->setRequired();
     $form['middle_name'] = new Zend_Form_Element_Text('middle_name');
     $form['middle_name']->setLabel('Middle Name');
     $form['last_name'] = new Zend_Form_Element_Text('last_name');
     $form['last_name']->setLabel('Last Name')->setRequired();
     $form['user_name'] = new Zend_Form_Element_Text('user_name');
     $form['user_name']->setLabel('User Name')->addValidator('Db_NoRecordExists', false, array('table' => 'user', 'field' => 'user_name'))->setRequired();
     $passwordConfirmation = new App_PasswordConfirmation();
     $form['password'] = new Zend_Form_Element_Password('password');
     $form['password']->setLabel('Password')->setRequired()->addValidator($passwordConfirmation);
     $form['confirmpassword'] = new Zend_Form_Element_Password('confirmpassword');
     $form['confirmpassword']->setLabel('Confirm Password')->setAttrib('class', 'input_box confirmpassword');
     $form['confirmpassword']->setRequired()->addValidator($passwordConfirmation);
     $form['email'] = new Zend_Form_Element_Text('email');
     $form['email']->setLabel('Email')->addValidator('emailAddress', false)->addValidator('Db_NoRecordExists', false, array('table' => 'user', 'field' => 'email'))->addFilter('stringTrim')->setRequired();
     $signup = new Zend_Form_Element_Submit('Signup');
     $signup->setValue('signup')->setAttrib('id', 'Submit');
     $button = new Zend_Form_Element_Button('button');
     $button->setLabel('Check All');
     $button->setAttrib('class', 'check-uncheck');
     $this->addElements($form);
     // add clearfix div for all form items
     foreach ($form as $element) {
         $element->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'clearfix form-item'))));
     }
     $this->addDisplayGroup(array('first_name', 'middle_name', 'last_name', 'user_name', 'password', 'confirmpassword', 'email'), 'field1', array('legend' => 'User Information'));
     // add wrapper class for the group
     $group = $this->getDisplayGroup('field1');
     $group->setDecorators(array('FormElements', 'Fieldset', array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'default-activity-list'))));
     // add permission form
     $permissionForm = new Form_Admin_Editpermission();
     $permissionForm->edit($defaultFields);
     $permissionForm->removeDecorator('form');
     $permissionForm->removeElement('submit');
     $this->addSubForm($permissionForm, 'test');
     $this->addElement($signup);
     $this->setMethod('post');
 }
 public function getForm()
 {
     $elementDecorators = array(array('Label'), array('ViewHelper'), array('Errors'));
     $form = new Zend_Form();
     $form->setAction('/student/profile/feedback/')->setMethod('post');
     $improvement = new Zend_Form_Element_Radio('improvement', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'Yes', 'No' => 'No')));
     $improvement->setDecorators($elementDecorators);
     $level = new Zend_Form_Element_Radio('level', array('label' => '', 'separator' => '', 'multiOptions' => array('Hard' => 'Hard', 'Suitable' => 'Suitable', 'Easy' => 'Easy')));
     $level->setAttrib('class', 'radio_new');
     $level->setDecorators($elementDecorators);
     $difficult = new Zend_Form_Element_Text('difficult', array('id' => 'difficult', 'maxLength' => '50'));
     $difficult->setDecorators($elementDecorators);
     $difficult->setAttrib('class', 'sub_text_input');
     $suggestions = new Zend_Form_Element_Textarea('suggestions', array('label' => '?האם חווית בעיה בתרגול', 'id' => 'suggestions'));
     $suggestions->setAttrib('class', 'sub_textarea');
     $sendFeedback = new Zend_Form_Element_Button('sendfeedback', array('id' => 'sendfeedback', 'label' => 'ds'));
     $sendFeedback->setAttrib('class', 'sub_button_input');
     $sendFeedback->setDecorators($elementDecorators);
     $form->addElements(array($improvement, $level, $difficult, $suggestions));
     return $form;
 }
Beispiel #29
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_requisition_report');
     $requisition_code = new Zend_Form_Element_Text("requisition_code");
     $requisition_code->setLabel("Requisition Code");
     $requisition_code->setAttrib('name', '');
     $requisition_code->setAttrib('id', 'idrequisition_code');
     $cand_status = new Zend_Form_Element_Select("cand_status");
     $cand_status->setRegisterInArrayValidator(false);
     $cand_status->addMultiOptions(array('' => 'Select Candidate Status', 'Shortlisted' => 'Shortlisted', 'Selected' => 'Selected', 'Rejected' => 'Rejected', 'On hold' => 'On hold', 'Disqualified' => 'Disqualified', 'Scheduled' => 'Scheduled', 'Not Scheduled' => 'Not Scheduled', 'Recruited' => 'Recruited', 'Requisition Closed/Completed' => 'Requisition Closed/Completed'));
     $cand_status->setLabel("Candidate Status");
     $cand_status->setAttrib('title', 'Candidate Status');
     $cand_status->setAttrib('id', 'idcand_status');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($requisition_code, $cand_status, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
Beispiel #30
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setName('class');
     $this->setIsArray(true);
     $classname = new Zend_Form_Element_Text(Model_ClassGenerator_FormToClass::$nameKey);
     $classname->setLabel('Class name')->setRequired(true)->addValidator('NotEmpty', true);
     $classComment = new Zend_Form_Element_Textarea(Model_ClassGenerator_FormToClass::$commentKey);
     $classComment->setLabel('Class comment/description');
     $classComment->setAttrib('cols', '50')->setAttrib('rows', '4');
     $persistenceOn = new Zend_Form_Element_Checkbox(Model_ClassGenerator_FormToClass::$withPersistenceKey);
     $persistenceOn->setLabel('Persistence ON');
     $table = new Zend_Form_Element_Text(Model_ClassGenerator_FormToClass::$tableKey);
     $table->setLabel('Database Table');
     $addFieldDynId = new Zend_Form_Element_Hidden('addFieldDynId');
     $addFieldDynId->setAttrib('id', 'addFieldDynId');
     $addFieldDynId->setValue(1);
     $attributesSf = self::getAttributeSubform();
     $this->addSubForm($attributesSf, 'attributes', 1);
     /*Use table decorator!
             require_once('../application/forms/Decorators/Table.php');
             $this->setDecorators(array(
     			'FormElements',
     			array('Table', array('doNotSetDecorators' => false)),
     			'Form'
     		));
             */
     $add = new Zend_Form_Element_Button('addAttribute');
     $add->setAttrib('id', 'addAttribute');
     $add->setLabel('Add Attribute');
     $remove = new Zend_Form_Element_Button('removeAttribute');
     $remove->setAttrib('id', 'removeAttribute');
     $remove->setLabel('Remove Attribute');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Play!')->setOrder(5);
     $this->addElements(array($classname, $classComment, $persistenceOn, $table));
     $this->addDisplayGroup(array($classname->getName(), $classComment->getName(), $persistenceOn->getName(), $table->getName()), 'Class properties')->setOrder(0);
     $this->addElements(array($add, $remove, $submit, $addFieldDynId));
     $this->addElement('hash', 'no_csrf_foo', array('salt' => 'unique'));
 }