本文整理汇总了PHP中Zend_Form_Element_Button::setAttrib方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Button::setAttrib方法的具体用法?PHP Zend_Form_Element_Button::setAttrib怎么用?PHP Zend_Form_Element_Button::setAttrib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Button
的用法示例。
在下文中一共展示了Zend_Form_Element_Button::setAttrib方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
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'));
}
示例2: init
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'));
}
示例3: init
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);
}
示例4: init
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);
}
示例5: init
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);
}
示例6: init
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);
}
示例7: init
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'));
}
示例8: init
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);
}
示例9: init
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'));
}
示例10: init
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'));
}
示例11: init
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'));
}
示例12: init
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'));
}
示例13: init
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'));
}
示例14: init
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));
}
示例15: init
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'));
}