public function __construct($minimumDeposit, $ID, $codenum) { parent::__construct($minimumDeposit, $ID, $codenum); //$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value $formfield = new App_Form_Field(); $amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum Amount To open a savings account =' . $minimumDeposit))))); $date = new ZendX_JQuery_Form_Element_DatePicker('date'); $date->setAttrib('class', 'txt_put'); $date->setJQueryParam('dateFormat', 'yy-mm-dd'); $date->setRequired(true); $date->setAttrib('size', 12); //hidden feilds $code = $formfield->field('Hidden', 'code', '', '', '', '', false, '', '', '', '', '', 0, $codenum); $Id = $formfield->field('Hidden', 'Id', '', '', '', '', false, '', '', '', '', '', 0, $ID); $submit = $formfield->field('Submit', 'Submit', '', '', '', '', false, '', '', '', '', '', 0, 0); $Yes = $formfield->field('Submit', 'Yes', '', '', '', '', false, '', '', '', '', '', 0, 0); $back = $formfield->field('Submit', 'Back', '', '', '', '', false, '', '', '', '', '', 0, 0); $this->addElements(array($submit, $amount, $code, $Id, $date, $back, $Yes)); if (substr(base64_decode($codenum), 4, 1) == 2 or substr(base64_decode($codenum), 4, 1) == 3) { $group = new Zend_Form_Element_MultiCheckbox('group'); $this->addElements(array($group)); } else { $group = 0; } }
public function init() { // метод передачи POST $this->setMethod('post'); // формируем массив тем из БД $themes = new Application_Model_Themes(); //подключаем модель тем $themes->fillList(); $options = $themes->getList(); // id новости $this->addElement('hidden', 'id'); // заголовок новости $this->addElement('text', 'title', array('label' => 'Заголовок:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true)))); // текст $this->addElement('textarea', 'text', array('label' => 'Текст новости:', 'required' => true, 'validators' => array(array('NotEmpty', true)))); // выпадающий список тем (массив данных для опций сформирован выше) $this->addElement('select', 'theme_id', array('label' => 'Тема:', 'required' => true, 'multiOptions' => $options, 'validators' => array(array('NotEmpty', true)))); // поле ввода даты, используется JQueryUI (библиотека ZendX) $datePicker = new ZendX_JQuery_Form_Element_DatePicker('date', array('jQueryParams' => array('dateFormat' => 'dd.mm.yy'))); $datePicker->setLabel('Дата:'); $datePicker->addValidator('NotEmpty'); $this->addElement($datePicker); // кнопка "сохранить" $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Сохранить')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'businessunitsreport'); $this->setAttrib('action', BASE_URL . 'reports/businessunits'); $bunitname = new Zend_Form_Element_Text('bunitname'); $bunitname->setLabel('Business Unit'); $bunitname->setAttrib('onblur', 'clearbuname(this)'); $bunitcode = new Zend_Form_Element_Text('bunitcode'); $bunitcode->setLabel('Code'); $bunitcode->setAttrib('onblur', 'clearbuname(this)'); $bunitcode->setAttrib('class', 'selectoption'); $startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate'); $startdate->setLabel('Started On'); $startdate->setAttrib('readonly', 'true'); $startdate->setOptions(array('class' => 'brdr_none')); $start_date = new ZendX_JQuery_Form_Element_DatePicker('start_date'); $start_date->setAttrib('readonly', 'true'); $start_date->setAttrib('onfocus', 'this.blur()'); $start_date->setOptions(array('class' => 'brdr_none')); $country = new Zend_Form_Element_Select('country'); $country->setLabel('Country'); $this->addElements(array($bunitname, $bunitcode, $startdate, $country)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('startdate')); }
public function init() { $holidayname = new Zend_Form_Element_Text('holidayname'); $holidayname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_holidayupdates', 'holidayname')); $holidayname->setAttrib('class', 'txt_put'); $holidayname->setRequired(true)->addValidators(array(array('NotEmpty'))); $office_id = new Zend_Form_Element_Select('office_id'); $office_id->addMultiOption('', 'Select...'); $office_id->addMultiOption('All', 'All'); $office_id->setAttrib('class', 'txt_put'); $office_id->setRequired(true)->addValidators(array(array('NotEmpty'))); $holidayupdate_id = new Zend_Form_Element_Hidden('holidayupdate_id'); $holidayfrom = new ZendX_JQuery_Form_Element_DatePicker('holidayfrom'); $holidayfrom->setAttrib('class', 'txt_put'); $holidayfrom->setJQueryParam('dateFormat', 'yy-mm-dd'); $holidayfrom->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'))); $holidayupto = new ZendX_JQuery_Form_Element_DatePicker('holidayupto'); $holidayupto->setAttrib('class', 'txt_put'); $holidayupto->setJQueryParam('dateFormat', 'yy-mm-dd'); $holidayupto->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'))); $repayment_date = new ZendX_JQuery_Form_Element_DatePicker('repayment_date'); $repayment_date->setAttrib('class', 'txt_put'); $repayment_date->setJQueryParam('dateFormat', 'yy-mm-dd'); $repayment_date->setRequired(true)->addValidators(array(array('NotEmpty'))); array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')); $submit = new Zend_Form_Element_Submit('Submit'); $submit->removeDecorator('DtDdWrapper'); $this->addElements(array($holidayname, $office_id, $holidayfrom, $holidayupto, $repayment_date, $holidayupdate_id, $submit)); }
public function __construct($loanamount) { Zend_Dojo::enableForm($this); parent::__construct($loanamount); //$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value $formfield = new App_Form_Field(); $date = new ZendX_JQuery_Form_Element_DatePicker('date'); $date->setAttrib('class', 'txt_put'); $date->setJQueryParam('dateFormat', 'yy-mm-dd'); $date->setRequired(true); $Amount = new Zend_Form_Element_Text('Amount'); $Amount->setAttrib('class', 'textfield'); $lessthan = new Zend_Validate_LessThan(array('max' => $loanamount + 1, 'inclusive' => false)); $Amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array($lessthan, true))); $transactionMode = $formfield->field('Select', 'transactionMode', '', '', 'tmode', '', true, '', '', '', '', '', 0, ''); $etransfer = $formfield->field('Select', 'etransfer', '', '', 'etran', '', false, '', '', '', '', '', 0, ''); $etransfer->setRegisterInArrayValidator(false); $memberid = $formfield->field('Hidden', 'memberid', '', '', 'memberclass', '', false, '', '', '', '', '', 0, ''); $membertypeid = $formfield->field('Hidden', 'membertypeid', '', '', 'membertypeclass', '', false, '', '', '', '', '', 0, ''); $pathhidden = $formfield->field('Hidden', 'pathhidden', '', '', 'pathclass', '', false, '', '', '', '', '', 0, ''); $othrtext = new Zend_Form_Element_Text('othertext'); $othrtext->setAttrib('size', 12); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('rows', '2'); $description->setAttrib('cols', '20'); $description->setRequired(true); $sms = new Zend_Form_Element_Checkbox('sms'); $back = new Zend_Form_Element_Submit('Back'); $back->setAttrib('id', 'button2'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('id', 'button'); $this->addElements(array($date, $Amount, $transactionMode, $etransfer, $othrtext, $description, $sms, $memberid, $pathhidden, $membertypeid, $submit, $back)); }
public function __construct($options = null) { $staff = new Contacts(); $flos = $staff->getAttending(); parent::__construct($options); ZendX_JQuery::enableForm($this); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('addFlo'); $flo = new Zend_Form_Element_Select('staffID'); $flo->setLabel('Finds officer present: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose attending officer', 'Our staff members' => $flos)); $dateFrom = new ZendX_JQuery_Form_Element_DatePicker('dateFrom'); $dateFrom->setLabel('Attended from: ')->setRequired(true)->addValidator('Date')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper'); $dateTo = new ZendX_JQuery_Form_Element_DatePicker('dateTo'); $dateTo->setLabel('Attended to: ')->setRequired(true)->addValidator('Date')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); $this->addElements(array($flo, $dateFrom, $dateTo, $submit)); $this->addDisplayGroup(array('staffID', 'dateFrom', 'dateTo'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); $this->details->setLegend('Attending Finds Officers'); $this->addDisplayGroup(array('submit'), 'submit'); $this->submit->removeDecorator('DtDdWrapper'); $this->submit->removeDecorator('HtmlTag'); }
public function __construct($accNum) { parent::__construct($accNum); $date = new ZendX_JQuery_Form_Element_DatePicker('date'); $date->setAttrib('class', ''); $date->setRequired(true); //$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value $formfield = new App_Form_Field(); $amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, ''); $graterthan = new Zend_Validate_GreaterThan(0); $amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true))); $transactionMode = $formfield->field('Select', 'transactionMode', '', '', 'txt_put', '', true, '', '', '', '', '', 0, ''); // $transactionMode->setAttrib('onchange','toggleField();'); $transactionMode->setAttrib('class', 'paymenttype'); $transactionMode->setAttrib('id', 'paymenttype'); $othertext = $formfield->field('Text', 'othertext', '', '', 'txt_put', '', false, '', '', '', '', '', 0, ''); $transactionModeDetails = $formfield->field('Textarea', 'paymenttype_details', '', '', 'txt_put', '', false, '', '', '', 1, 20, '', 0, ''); $transactionModeDetails->setAttrib('style', 'display:none'); $description = $formfield->field('Textarea', 'description', '', '', 'txt_put', '', true, '', '', '', 2, 20, '', 0, ''); // $p = $formfield->field('Text','p','','','txt_put','','','','','','','',0,$p); // $p->setAttrib('disable','true'); // $int = $formfield->field('Text','int','','','txt_put','','','','','','','',0,$int); // $int->setAttrib('disable','true'); // $totalAmt = $formfield->field('Text','totalAmt','','','txt_put','','','','','','','',0,$totalAmt); // $totalAmt->setAttrib('disable','true'); // hidden feilds $totalamount = $formfield->field('Hidden', 'totalamount', '', '', 'total', '', false, '', '', '', '', '', 0, $accNum); $accNum = $formfield->field('Hidden', 'accNum', '', '', 'txt_put', '', true, '', '', '', '', '', 0, $accNum); $sms = new Zend_Form_Element_Checkbox('sms'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('id', 'button'); $back = new Zend_Form_Element_Submit('Back'); $back->setAttrib('id', 'button2'); $this->addElements(array($date, $othertext, $amount, $description, $transactionMode, $transactionModeDetails, $submit, $accNum, $totalamount, $back, $sms)); }
public function __construct($options = null) { $curators = new Peoples(); $assigned = $curators->getCurators(); ZendX_JQuery::enableForm($this); parent::__construct($options); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('actionsForTreasure'); $curatorID = new Zend_Form_Element_Select('curatorID'); $curatorID->setLabel('Curator assigned: ')->setRequired(true)->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators); $chaseDate = new ZendX_JQuery_Form_Element_DatePicker('chaseDate'); $chaseDate->setLabel('Chase date assigned: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $this->addElements(array($curatorID, $chaseDate, $submit, $hash)); $this->addDisplayGroup(array('curatorID', 'chaseDate'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); $this->addDisplayGroup(array('submit'), 'submit'); $this->submit->removeDecorator('DtDdWrapper'); $this->submit->removeDecorator('HtmlTag'); }
public function init() { $this->setMethod('post'); $this->setAttrib('action', DOMAIN . 'employee/add'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'empskills'); $id = new Zend_Form_Element_Hidden('id'); $userid = new Zend_Form_Element_Hidden('user_id'); $skillname = new Zend_Form_Element_Text('skillname'); $skillname->setRequired(true); $skillname->setAttrib('maxLength', 50); $skillname->addFilter('StripTags'); $skillname->addFilter('StringTrim'); $skillname->addValidator('NotEmpty', false, array('messages' => 'Please enter skill.')); $yearsofexp = new Zend_Form_Element_Text('yearsofexp'); $yearsofexp->setAttrib('maxLength', 5); $yearsofexp->addFilter(new Zend_Filter_StringTrim()); $yearsofexp->setRequired(true); $yearsofexp->addValidator('NotEmpty', false, array('messages' => 'Please enter years of experience.')); $yearsofexp->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9]\\d{0,1}(\\.\\d*)?$/', 'messages' => array('regexNotMatch' => 'Please enter numbers less than 100.'))))); $competencylevelid = new Zend_Form_Element_Select('competencylevelid'); $competencylevelid->setRequired(true)->addErrorMessage('Please select competency level.'); $competencylevelid->addValidator('NotEmpty', false, array('messages' => 'Please select competency level.')); $competencylevelid->setRegisterInArrayValidator(false); $year_skill = new ZendX_JQuery_Form_Element_DatePicker('year_skill_last_used'); $year_skill->setOptions(array('class' => 'brdr_none')); $year_skill->setAttrib('readonly', 'true'); $year_skill->setAttrib('onfocus', 'this.blur()'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $userid, $skillname, $yearsofexp, $competencylevelid, $year_skill, $submit)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('year_skill_last_used')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'departmentsreport'); $this->setAttrib('action', BASE_URL . 'reports/departments'); $deptname = new Zend_Form_Element_Text('deptname'); $deptname->setLabel('Department'); $deptname->setAttrib('onblur', 'clearautocompletenames(this)'); $dcode = new Zend_Form_Element_Text('dcode'); $dcode->setLabel('Code'); $dcode->setAttrib('class', 'selectoption'); $dcode->addValidator("regex", true, array('pattern' => '/^([a-zA-Z0-9.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alpha numeric characters.'))); $dcode->setAttrib('onblur', 'clearautocompletenames(this)'); $bname = new Zend_Form_Element_Text('bname'); $bname->setLabel('Business Unit'); $bname->addValidator("regex", true, array('pattern' => '/^([a-zA-Z.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.'))); $bname->setAttrib('onblur', 'clearautocompletenames(this)'); $startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate'); $startdate->setLabel('Started On'); $startdate->setAttrib('readonly', 'true'); $startdate->setOptions(array('class' => 'brdr_none')); $country = new Zend_Form_Element_Select('country'); $country->setLabel('Country'); $this->addElements(array($deptname, $dcode, $bname, $startdate, $country)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('startdate')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'leavereport'); $id = new Zend_Form_Element_Hidden('id'); $employeename = new Zend_Form_Element_Text('employeename'); $employeename->setLabel('Leave Applied By'); $employeename->setAttrib('onblur', 'clearautocompletename(this)'); $department = new Zend_Form_Element_Select('department'); $department->setLabel('Department'); $department->addMultiOption('', 'Select Department'); $department->setAttrib('class', 'selectoption'); $department->setRegisterInArrayValidator(false); $leavestatus = new Zend_Form_Element_Select('leavestatus'); $leavestatus->setLabel('Leave Status'); $leavestatus->setMultiOptions(array('' => 'Select Leave Status', '1' => 'Pending for approval', '2' => 'Approved', '3' => 'Rejected', '4' => 'Cancel')); $leavestatus->setRegisterInArrayValidator(false); $from_date = new ZendX_JQuery_Form_Element_DatePicker('from_date'); $from_date->setLabel('Applied Date'); $from_date->setAttrib('readonly', 'true'); $from_date->setAttrib('onfocus', 'this.blur()'); $from_date->setOptions(array('class' => 'brdr_none')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $employeename, $department, $leavestatus, $from_date, $submit)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('from_date')); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $staffregions = new StaffRegions(); $staffregions_options = $staffregions->getOptions(); ZendX_JQuery::enableForm($this); parent::__construct($options); $this->setName('vacancies'); $title = new Zend_Form_Element_Text('title'); $title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60); $salary = new Zend_Form_Element_Text('salary'); $salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addErrorMessage('You must enter a salary.'); $specification = new Pas_Form_Element_CKEditor('specification'); $specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->addErrorMessage('You must enter a job description.'); $regionID = new Zend_Form_Element_Select('regionID'); $regionID->setLabel('Location of role: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Choose region', 'Available regions' => $staffregions_options))->addErrorMessage('You must choose a region'); $live = new ZendX_JQuery_Form_Element_DatePicker('live'); $live->setLabel('Date for advert to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20); $expire = new ZendX_JQuery_Form_Element_DatePicker('expire'); $expire->setLabel('Date for advert to expire: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20); $status = new Zend_Form_Element_Select('status'); $status->SetLabel('Publish status: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a status', 2 => 'Publish', 1 => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose a status'); $submit = new Zend_Form_Element_Submit('submit'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); $this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $submit, $hash)); $this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details'); $this->details->setLegend('Vacancy details'); $this->addDisplayGroup(array('live', 'expire', 'status'), 'dates'); $this->dates->setLegend('Publication details'); $this->setLegend('Vacancy details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
public function __construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app) { parent::__construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app); $startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate'); $startdate->setAttrib('id', 'startdate'); $startdate->setAttrib('size', '8'); $startdate->setAttrib('class', ''); $startdate->setRequired(true)->addValidators(array(array('Date', true), array('Between', false, array($recurringBeginDate, $recurringClosedDate, 'messages' => array('notBetween' => 'date should be between ' . $recurringBeginDate . ' to (Closed date) ' . $recurringClosedDate))))); $recurringamount = new Zend_Form_Element_Text('recurringamount'); $recurringamount->setRequired(true)->addValidators(array(array('Digits'), array('GreaterThan', false, array($recurringMinAmount)), array('LessThan', false, array($recurringMaxAmount)), array('NotEmpty'))); $recurringamount->setAttrib('size', '8'); $recurringperiod = new Zend_Form_Element_Text('recurringperiod'); $recurringperiod->setAttrib('id', 'recurringperiod'); $recurringperiod->setAttrib('class', 'NormalBtn'); $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname'); $memberfirstname->setAttrib('class', 'textfield'); $freequencyofdeposit = new Zend_Form_Element_Select('frequencyofdeposit'); $freequencyofdeposit->addMultiOption('', 'Select...'); $freequencyofdeposit->setAttrib('class', 'NormalBtn'); $freequencyofdeposit->setAttrib('id', 'freequencyofdeposit'); $perioddescription = new Zend_Form_Element_Select('perioddescription'); $perioddescription->addMultiOption('', 'Select..'); $perioddescription->setAttrib('class', 'NormalBtn'); $perioddescription->setAttrib('id', 'perioddescription'); $perioddescription->setRequired(true); $perioddescription->setAttrib('onchange', 'getInterests(this.value,"' . $app . '")'); $periodinterest = new Zend_Form_Element_Select('periodinterest'); $periodinterest->addMultiOption('', 'Select...'); $periodinterest->setAttrib('class', 'NormalBtn'); $periodinterest->setAttrib('id', 'periodinterest'); $periodinterest->setAttrib('size', '5'); $accountId = new Zend_Form_Element_Hidden('accountId'); $productIdss = new Zend_Form_Element_Hidden('productId'); $recurringindex = new Zend_Form_Element_Text('recurringinterest'); $recurringindex->setAttrib('id', 'recurringinterest'); $recurringindex->setAttrib('size', '8'); $recurringindex->setAttrib('class', 'NormalBtn'); $recurringindex->setAttrib('readonly', 'true'); $recurringindex->setAttrib('class', 'NormalBtn'); $recurringindex->setAttrib('readonly', 'true'); $memberTypeId = new Zend_Form_Element_Hidden('memberTypeId'); $memberId = new Zend_Form_Element_Hidden('member_id'); $productId = new Zend_Form_Element_Hidden('product_id'); $offerproductId = new Zend_Form_Element_Hidden('offerproduct_id'); $groupId = new Zend_Form_Element_Hidden('groupId'); $this->addElements(array($memberfirstname, $recurringindex, $freequencyofdeposit, $recurringperiod, $recurringamount, $startdate, $perioddescription, $periodinterest, $memberId, $productId, $offerproductId, $groupId, $memberTypeId, $accountId, $productIdss)); $period_id = new Zend_Form_Element_Hidden('period_id'); $period_id->setAttrib('id', 'period_id'); $startdate1 = new Zend_Form_Element_Hidden('startdate1'); $recurringamount1 = new Zend_Form_Element_Hidden('recurringamount1'); $perioddescription1 = new Zend_Form_Element_Hidden('perioddescription1'); $interest1 = new Zend_Form_Element_Hidden('interest1'); $Confirm = new Zend_Form_Element_Submit('Confirm'); $Confirm->setLabel('Confirm'); $Confirm->setAttrib('class', 'recurring'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setLabel('submit'); $submit->setAttrib('class', 'recurring'); $this->addElements(array($submit, $period_id, $Confirm, $startdate1, $recurringamount1, $perioddescription1, $interest1)); }
public function __construct($minimumDeposit) { parent::__construct($minimumDeposit); $savings_amount = new Zend_Form_Element_Text('savings_amount'); $savings_amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum Amount To open a savings account =' . $minimumDeposit))))); $savings_amount->setAttrib('class', 'txt_put'); $savings_amount->setAttrib('id', 'amount'); $savings_amount->setRequired(true); $savings_amount->setAttrib('onchange', 'calculateTotalAmount(this.value)'); $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname'); $memberfirstname->setAttrib('class', 'textfield'); $memberfirstname->setAttrib('id', 'selector'); // $memberfirstname->setRequired(true); $date1 = new ZendX_JQuery_Form_Element_DatePicker('date1', array('label' => 'Date:')); $date1->setAttrib('class', 'txt_put'); $date1->setJQueryParam('dateFormat', 'yy-mm-dd'); $date1->setRequired(true); $memberId = new Zend_Form_Element_Hidden('memberId'); $Type = new Zend_Form_Element_Hidden('Type'); $productId = new Zend_Form_Element_Hidden('productId'); $typeId = new Zend_Form_Element_Hidden('typeId'); $memberTypeIdv = new Zend_Form_Element_Hidden('memberTypeIdv'); $submit = new Zend_Form_Element_Submit('Submit'); $Yes = new Zend_Form_Element_Submit('Yes'); $back = new Zend_Form_Element_Submit('Back'); $this->addElements(array($submit, $savings_amount, $memberfirstname, $memberId, $date1, $productId, $typeId, $Type, $memberTypeIdv, $back, $Yes)); }
public function __construct($options = null) { $projecttypes = new ProjectTypes(); $projectype_list = $projecttypes->getTypes(); ZendX_JQuery::enableForm($this); parent::__construct($options); $this->setName('research'); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $investigator = new Zend_Form_Element_Text('investigator'); $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $level = new Zend_Form_Element_Select('level'); $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)))->setDecorators($decorators); $title = new Zend_Form_Element_Text('title'); $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $description = $this->addElement('RTE', 'description', array('label' => 'Short description of project: ')); $description = $this->getElement('description')->setRequired(false)->addFilter('stringTrim')->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'))->addDecorator('HtmlTag', array('tag' => 'li')); $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate'); $startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->addValidator('Date')->setRequired(false)->addErrorMessage('You must enter a start date for this project')->setDecorators($decorators); $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate'); $endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addValidator('Date')->addErrorMessage('You must enter an end date for this project')->setDecorators($decorators); $valid = new Zend_Form_Element_Checkbox('valid'); $valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit')->removeDecorator('label')->setAttrib('class', 'large')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); $this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit, $hash)); $this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->addDisplayGroup(array('submit'), 'submit'); }
public function __construct($accNum) { parent::__construct($accNum); $date = new ZendX_JQuery_Form_Element_DatePicker('date'); $date->setAttrib('class', 'txt_put'); $date->setJQueryParam('dateFormat', 'yy-mm-dd'); $date->setRequired(true); $date->setAttrib('size', 12); $date1 = new ZendX_JQuery_Form_Element_DatePicker('date1'); $date1->setAttrib('class', 'txt_put'); $date1->setJQueryParam('dateFormat', 'yy-mm-dd'); $date1->setRequired(true); $date1->setAttrib('size', 12); //$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value $formfield = new App_Form_Field(); $amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, ''); $graterthan = new Zend_Validate_GreaterThan(0); $amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true))); $amount->setAttrib('size', 12); $description = $formfield->field('Textarea', 'description', '', '', 'txt_put', '', true, '', '', '', 2, 15, '', 0, ''); $transactionMode = $formfield->field('Select', 'transactionMode', '', '', 'txt_put', '', true, '', '', '', '', '', 0, ''); // hidden feilds $accNum = $formfield->field('Hidden', 'accNum', '', '', 'txt_put', '', true, '', '', '', '', '', 0, $accNum); $sms = new Zend_Form_Element_Checkbox('sms'); $back = new Zend_Form_Element_Submit('Back'); $submit = new Zend_Form_Element_Submit('Submit'); $this->addElements(array($date, $amount, $transactionMode, $description, $submit, $accNum, $back, $sms, $date1)); }
public function init() { $formfield = new App_Form_Field(); $field1 = new Zend_Form_Element_Select('field1'); $field1->addMultiOption('', 'Select'); $field1->setAttrib('size', '12'); $field2 = new Zend_Form_Element_Text('field2'); $field2->setAttrib('size', '12'); $field3 = new Zend_Form_Element_Text('field3'); $field3->setAttrib('size', '12'); $field4 = $formfield->field('Text', '$field4', '', '', 'mand digits', '', false, '', '', '', '', '', 0, 0); // $field4 = new Zend_Form_Element_Text('field4'); $field4->setAttrib('size', '12'); $field5 = new Zend_Form_Element_Select('field5'); $field5->addMultiOption('', 'Select'); $field6 = new Zend_Form_Element_Text('field6'); $field6->setAttrib('size', '12'); $field7 = new ZendX_JQuery_Form_Element_DatePicker('field7'); $field7->setAttrib('size', '12'); $field8 = new ZendX_JQuery_Form_Element_DatePicker('field8'); $field8->setAttrib('size', '12'); $field9 = new Zend_Form_Element_Select('field9'); $field9->addMultiOption('', 'Select'); $field10 = new Zend_Form_Element_Select('field10'); $field10->addMultiOption('', 'Select'); $submit = new Zend_Form_Element_Submit('Search'); $this->addElements(array($field1, $field2, $field3, $field4, $field5, $field6, $field7, $field8, $submit, $field9, $field10)); }
public function __construct($minimumDeposit, $ID, $code, $app) { parent::__construct($minimumDeposit, $ID, $code, $app); //$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value $formfield = new App_Form_Field(); $amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum Amount To open a savings account =' . $minimumDeposit))))); $date = new ZendX_JQuery_Form_Element_DatePicker('date'); $date->setAttrib('class', 'txt_put'); $date->setJQueryParam('dateFormat', 'yy-mm-dd'); $date->setRequired(true); $installments = $formfield->field('Select', 'installments', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $installments->setAttrib('onchange', 'getInterests(this.value,"' . $app . '",' . base64_decode($ID) . ')'); $interest = $formfield->field('Text', 'interest', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $interest->setAttrib('size', '6'); $interest->setAttrib('readonly', 'true'); $interesttype = $formfield->field('Select', 'interesttype_id', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $savingAccount = $formfield->field('Select', 'savingAccount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $fundings = $formfield->field('Select', 'fundings', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $fundings->addMultiOption('', 'Select...'); $fundings->addMultiOption('1', 'funders'); $fundings->addMultiOption('2', 'group'); $fundings->setAttrib('onchange', 'displayRow(this.value)'); $funders = $formfield->field('Radio', 'funders', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0); $funders->setAttrib('size', '8'); //hidden feilds $code = $formfield->field('Hidden', 'code', '', '', '', '', false, '', '', '', '', '', 0, $code); $Id = $formfield->field('Hidden', 'Id', '', '', '', '', false, '', '', '', '', '', 0, $ID); $submit = $formfield->field('Submit', 'Submit', '', '', '', '', false, '', '', '', '', '', 0, 0); $Yes = $formfield->field('Submit', 'Yes', '', '', '', '', false, '', '', '', '', '', 0, 0); $back = $formfield->field('Submit', 'Back', '', '', '', '', false, '', '', '', '', '', 0, 0); $this->addElements(array($submit, $amount, $installments, $interest, $interesttype, $savingAccount, $fundings, $funders, $code, $Id, $date, $back, $Yes)); }
public function __construct($options = null) { parent::__construct($options); $levels = new ProjectTypes(); $levelsListed = $levels->getDegrees(); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('education'); ZendX_JQuery::enableForm($this); $school = new Zend_Form_Element_Text('school'); $school->setLabel('Institution name: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 30)->addErrorMessage('Please enter a valid institutional name!')->setDecorators($decorators); $schoolUrl = new Zend_Form_Element_Text('schoolUrl'); $schoolUrl->setLabel('Institution web address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('Uri')->setAttrib('size', 30)->addErrorMessage('Please enter a valid url!')->setDecorators($decorators); $subject = new Zend_Form_Element_Text('subject'); $subject->setLabel('Subject studied: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 30)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators); $level = new Zend_Form_Element_Select('level'); $level->setLabel('Adademic level of study: ')->addMultiOptions(array(NULL => 'Choose an academic level', 'Valid levels' => $levelsListed))->setDecorators($decorators); $dateFrom = new ZendX_JQuery_Form_Element_DatePicker('dateFrom'); $dateFrom->setLabel('Commenced programme: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Date')->addValidator('NotEmpty')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->setJQueryParams(array('yearRange' => '-20:+10')); $dateTo = new ZendX_JQuery_Form_Element_DatePicker('dateTo'); $dateTo->setLabel('Finished programme: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper')->setJQueryParams(array('yearRange' => '-20:+10')); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $this->addElements(array($school, $schoolUrl, $subject, $level, $dateFrom, $dateTo, $submit)); $this->addDisplayGroup(array('school', 'schoolUrl', 'subject', 'level', 'dateFrom', 'dateTo'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); $this->details->setLegend('Educational background'); $this->addDisplayGroup(array('submit'), 'submit'); $this->submit->removeDecorator('DtDdWrapper'); $this->submit->removeDecorator('HtmlTag'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $projecttypes = new ProjectTypes(); $projectype_list = $projecttypes->getTypes(); ZendX_JQuery::enableForm($this); parent::__construct($options); $this->setName('research'); $investigator = new Zend_Form_Element_Text('investigator'); $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.'); $level = new Zend_Form_Element_Select('level'); $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => null, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list))); $title = new Zend_Form_Element_Text('title'); $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.'); $description = new Pas_Form_Element_CKEditor('description'); $description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph')); $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate'); $startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter a start date for this project'); $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate'); $endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter an end date for this project'); $valid = new Zend_Form_Element_Checkbox('valid'); $valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit)); $this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
public function __construct($options = null) { $curators = new Peoples(); $assigned = $curators->getValuers(); ZendX_JQuery::enableForm($this); parent::__construct($options); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('provisionalvaluations'); $valuerID = new Zend_Form_Element_Select('valuerID'); $valuerID->setLabel('Valuation provided by: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 25))->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators); $value = new Zend_Form_Element_Text('value'); $value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float')->setDecorators($decorators); $comments = new Pas_Form_Element_RTE('comments'); $comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); $dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation'); $dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addValidator('Date')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $this->addElements(array($valuerID, $value, $dateOfValuation, $comments, $submit)); $this->addDisplayGroup(array('valuerID', 'value', 'dateOfValuation', 'comments'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); $this->addDisplayGroup(array('submit'), 'submit'); $this->submit->removeDecorator('DtDdWrapper'); $this->submit->removeDecorator('HtmlTag'); }
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')); }
public function init() { $date1 = new ZendX_JQuery_Form_Element_DatePicker('field1'); $date1->setJQueryParams(array("changeMonth" => "true", "changeYear" => "true")); $date2 = new ZendX_JQuery_Form_Element_DatePicker('field2'); $date2->setJQueryParams(array("changeMonth" => "true", "changeYear" => "true")); $this->addElements(array($date1, $date2)); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'empsalarydetails'); $id = new Zend_Form_Element_Hidden('id'); $userid = new Zend_Form_Element_Hidden('user_id'); $currencyid = new Zend_Form_Element_Select('currencyid'); $currencyid->setLabel('Salary Currency'); $currencyid->setRegisterInArrayValidator(false); $salarytype = new Zend_Form_Element_Select('salarytype'); $salarytype->setLabel("Pay Frequency"); $salarytype->setAttrib('id', 'jobpayfrequency'); //$salarytype->setAttrib('onchange', 'changesalarytext(this)'); $salarytype->setRegisterInArrayValidator(false); /* $salarytype->setMultiOptions(array( '' => 'Select Salary Type', '1'=>'Yearly' , '2'=>'Hourly', )); */ $salary = new Zend_Form_Element_Text('salary'); $salary->setLabel("Salary"); $salary->setAttrib('maxLength', 8); $salary->addFilter(new Zend_Filter_StringTrim()); $salary->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9\\.]*$/', 'messages' => array('regexNotMatch' => 'Please enter only numbers.'))))); $bankname = new Zend_Form_Element_Text('bankname'); $bankname->setAttrib('maxlength', 40); $bankname->setLabel('Bank Name'); $bankname->addFilters(array('StringTrim')); $bankname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z][a-zA-Z0-9\\-\\. ]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid bank name.'))); $accountholder_name = new Zend_Form_Element_Text('accountholder_name'); $accountholder_name->setAttrib('maxlength', 40); $accountholder_name->setLabel('Account Holder Name'); $accountholder_name->addFilters(array('StringTrim')); $accountholder_name->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.'))))); $accountholding = new ZendX_JQuery_Form_Element_DatePicker('accountholding'); $accountholding->setLabel('Account Holding Since'); $accountholding->setAttrib('readonly', 'true'); $accountholding->setAttrib('onfocus', 'this.blur()'); $accountholding->setOptions(array('class' => 'brdr_none')); $accountclasstypeid = new Zend_Form_Element_Select('accountclasstypeid'); $accountclasstypeid->setLabel('Account Class Type'); $accountclasstypeid->setRegisterInArrayValidator(false); $bankaccountid = new Zend_Form_Element_Select('bankaccountid'); $bankaccountid->setLabel('Account Type'); $bankaccountid->setRegisterInArrayValidator(false); $accountnumber = new Zend_Form_Element_Text('accountnumber'); $accountnumber->setAttrib('maxlength', 20); $accountnumber->setLabel('Account Number'); $accountnumber->addFilters(array('StringTrim')); $accountnumber->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9 ]*$/', 'messages' => array('regexNotMatch' => 'Please enter only alphanumeric characters.'))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $userid, $currencyid, $salarytype, $salary, $bankname, $accountholder_name, $accountholding, $accountclasstypeid, $bankaccountid, $accountnumber, $submit)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('accountholding')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'empjobhistory'); $id = new Zend_Form_Element_Hidden('id'); $userid = new Zend_Form_Element_Hidden('user_id'); $positionheld = new Zend_Form_Element_Select('positionheld'); $positionheld->setLabel('Position'); $positionheld->setRegisterInArrayValidator(false); // $positionheld->setRequired(true); // $positionheld->addValidator('NotEmpty', false, array('messages' => 'Please select position.')); $department = new Zend_Form_Element_Select('department'); $department->setLabel('Department'); $department->setRegisterInArrayValidator(false); // $department->setRequired(true); // $department->addValidator('NotEmpty', false, array('messages' => 'Please select department.')); $jobtitleid = new Zend_Form_Element_Select('jobtitleid'); $jobtitleid->setLabel('Job Title'); $jobtitleid->setRegisterInArrayValidator(false); // $jobtitleid->setRequired(true); // $jobtitleid->addValidator('NotEmpty', false, array('messages' => 'Please select job title.')); $start_date = new ZendX_JQuery_Form_Element_DatePicker('start_date'); $start_date->setLabel('From'); $start_date->setOptions(array('class' => 'brdr_none')); $start_date->setAttrib('readonly', 'true'); $start_date->setAttrib('onfocus', 'this.blur()'); $start_date->setRequired(true); $start_date->addValidator('NotEmpty', false, array('messages' => 'Please enter start date.')); $end_date = new ZendX_JQuery_Form_Element_DatePicker('end_date'); $end_date->setLabel('To'); $end_date->setOptions(array('class' => 'brdr_none')); $end_date->setAttrib('readonly', 'true'); $end_date->setAttrib('onfocus', 'this.blur()'); $received_amount = new Zend_Form_Element_Text("received_amount"); $received_amount->setLabel("Amount Received"); $received_amount->setAttrib('maxLength', 10); $received_amount->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9\\.]*$/', 'messages' => array('regexNotMatch' => 'Please enter only numbers.'))))); $paid_amount = new Zend_Form_Element_Text("paid_amount"); $paid_amount->setLabel("Amount Paid"); $paid_amount->setAttrib('maxLength', 10); $paid_amount->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9\\.]*$/', 'messages' => array('regexNotMatch' => 'Please enter only numbers.'))))); $client = new Zend_Form_Element_Select('client'); $client->setLabel('Client'); $client->setRegisterInArrayValidator(false); $client->setRequired(true); $client->addValidator('NotEmpty', false, array('messages' => 'Please select a client.')); $vendor = new Zend_Form_Element_Text("vendor"); $vendor->setLabel("Vendor"); $vendor->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.&\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter a valid vendor name.'))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $userid, $positionheld, $jobtitleid, $department, $start_date, $end_date, $received_amount, $paid_amount, $client, $vendor, $submit)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('start_date', 'end_date')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'workeligibilitydetails'); $id = new Zend_Form_Element_Hidden('id'); $userid = new Zend_Form_Element_Hidden('user_id'); $emptyflag = new Zend_Form_Element_Hidden('emptyFlag'); $issuingauthflag = new Zend_Form_Element_Hidden('issuingauthflag'); //Document type Id.... $docType = new Zend_Form_Element_Select('documenttype_id'); $docType->setRegisterInArrayValidator(false); $docType->setAttrib('onchange', 'checkissuingauthority(this)'); $docType->addMultiOption('', 'Select Document Type'); //Document Issue Date... $doc_issue_date = new ZendX_JQuery_Form_Element_DatePicker('doc_issue_date'); $doc_issue_date->setOptions(array('class' => 'brdr_none')); $doc_issue_date->setAttrib('readonly', 'true'); $doc_issue_date->setAttrib('onfocus', 'this.blur()'); // Document Expiry Date... $doc_expiry_date = new ZendX_JQuery_Form_Element_DatePicker('doc_expiry_date'); $doc_expiry_date->setAttrib('readonly', 'true'); $doc_expiry_date->setAttrib('onfocus', 'this.blur()'); $doc_expiry_date->setOptions(array('class' => 'brdr_none')); // Expiration Date should be greater than today's date... // issuing authority name... $issueAuth_name = new Zend_Form_Element_Text('issuingauth_name'); $issueAuth_name->setAttrib('maxLength', 50); $issueAuth_name->addFilter(new Zend_Filter_StringTrim()); $issueAuth_name->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z][a-zA-Z0-9\\-\\&\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid name.'))))); //issuing authority country..... $country = new Zend_Form_Element_Select('issuingauth_country'); $country->setAttrib('onchange', 'displayParticularState(this,"","issuingauth_state","")'); $country->setRegisterInArrayValidator(false); //issuing authority state..... $state = new Zend_Form_Element_Select('issuingauth_state'); $state->setAttrib('onchange', 'displayParticularCity(this,"","issuingauth_city","")'); $state->setRegisterInArrayValidator(false); $state->addMultiOption('', 'Select State'); //issuing authority city..... $city = new Zend_Form_Element_Select('issuingauth_city'); $city->setRegisterInArrayValidator(false); $city->addMultiOption('', 'Select City'); //issuing authority postal code ..... $issuingAuth_pcode = new Zend_Form_Element_Text('issuingauth_postalcode'); $issuingAuth_pcode->addFilter(new Zend_Filter_StringTrim()); $issuingAuth_pcode->setAttrib("maxlength", 10); $issuingAuth_pcode->addValidators(array(array('StringLength', false, array('min' => 3, 'max' => 10, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Issuing authority postal code must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Issuing authority postal code must contain at least %min% characters.'))))); $issuingAuth_pcode->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^(?!0{3})[0-9a-zA-Z]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid postal code.'))))); // Form Submit ......... $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $userid, $issuingauthflag, $docType, $doc_issue_date, $doc_expiry_date, $issueAuth_name, $country, $state, $city, $issuingAuth_pcode, $emptyflag, $submit)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('doc_issue_date', 'doc_expiry_date')); }
public function __construct($options = null) { Zend_Dojo::enableForm($this); parent::__construct($options); $creditline_id = new Zend_Form_Element_Text('creditline_id'); $institution_id = new Zend_Form_Element_Text('institution_id'); $institutionName = new Zend_Form_Element_Select('institutionname'); $institutionName->setAttrib('class', 'txt_put'); $institutionName->setAttrib('id', 'institutionname'); $institutionName->setLabel('institutionname')->setRequired(true); $institutionName->addMultiOption('', 'Select...'); $institutionName->setAttrib('onchange', 'getState(this.value)'); $institutionNames = new Zend_Form_Element_Text('institutionnames'); $institutionNames->setAttrib('class', 'txt_put'); $institutionNames->setAttrib('readonly', 'true'); $instituteamount = new Zend_Form_Element_Text('instituteamount'); $instituteamount->setAttrib('class', 'txt_put'); $instituteamount->setAttrib('readonly', 'true'); $institutionamount = new Zend_Form_Element_Text('institutionamount'); $institutionamount->setAttrib('class', 'txt_put'); $institutionamount->setAttrib('readonly', 'true'); $maxcreditlinelimit = new Zend_Form_Element_Text('maxcreditlinelimit'); $maxcreditlinelimit->setAttrib('class', 'txt_put'); $maxcreditlinelimit->setAttrib('readonly', 'true'); $creditlinename = new Zend_Form_Element_Text('creditlinename'); $creditlinename->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_creditlineinformation', 'creditlinename')); $creditlinename->setAttrib('class', 'txt_put'); $creditlinename->setAttrib('id', 'creditlinename'); $creditlinename->setLabel('creditlinename')->setRequired(true)->addValidators(array(array('NotEmpty'))); $creditlineshortname = new Zend_Form_Element_Text('creditline_shortname'); $creditlineshortname->setAttrib('class', 'txt_put'); $creditlineshortname->setAttrib('id', 'creditline_shortname'); $creditlineshortname->setLabel('creditline_shortname')->setRequired(true)->addValidators(array('NotEmpty')); $creditlineamount = new Zend_Form_Element_Text('creditlineamount'); $creditlineamount->setAttrib('class', 'txt_put'); $creditlineamount->setAttrib('id', 'creditlineamount'); $creditlineamount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'))); $creditlineinterest = new Zend_Form_Element_Text('creditlineinterest'); $creditlineinterest->setAttrib('class', 'txt_put'); $creditlineinterest->setAttrib('id', 'creditlineinterest'); $creditlineinterest->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(1, 3)), array('Digits'))); $creditlinefrom = new ZendX_JQuery_Form_Element_DatePicker('creditline_beginingdate'); $creditlinefrom->setJQueryParam('dateFormat', 'yy-mm-dd'); $creditlinefrom->setRequired(true)->addValidators(array(array('Date'))); $creditlinefrom->setAttrib('class', 'txt_put'); $creditlinefrom->setAttrib('id', 'creditline_beginingdate'); $creditlineto = new ZendX_JQuery_Form_Element_DatePicker('creditline_closingdate'); $creditlineto->setJQueryParam('dateFormat', 'yy-mm-dd'); $creditlineto->setRequired(true)->addValidators(array(array('Date'))); $creditlineto->setAttrib('class', 'txt_put'); $creditlineto->setAttrib('id', 'creditline_closingdate'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('class', 'officesubmit'); $submit->setlabel('Submit'); $this->addElements(array($creditline_id, $institutionName, $creditlinename, $creditlineshortname, $creditlineamount, $creditlineinterest, $creditlinefrom, $creditlineto, $submit, $institutionamount, $instituteamount, $institutionNames, $institution_id, $maxcreditlinelimit)); }
public function __construct($options = null) { Zend_Dojo::enableForm($this); parent::__construct($options); $field1 = new ZendX_JQuery_Form_Element_DatePicker('field1'); $field1->setAttrib('class', 'txt_put'); $submit = new Zend_Form_Element_Submit('Search'); $pdf = new Zend_Form_Element_Submit('PDF'); $this->addElements(array($field1, $submit, $pdf)); }
public function __construct($options = null) { $counties = new Counties(); $county_options = $counties->getCountyName2(); $crimes = new CrimeTypes(); $crimeoptions = $crimes->getTypes(); ZendX_JQuery::enableForm($this); parent::__construct($options); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('rally'); $crimeType = new Zend_Form_Element_Select('crimeType'); $crimeType->setLabel('Crime type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set crime type or no point entering it!')->addMultiOptions(array(NULL => 'Choose a crime type', 'Valid types' => $crimeoptions))->addValidator('inArray', false, array(array_keys($crimeoptions)))->setDecorators($decorators); $subject = new Zend_Form_Element_Text('subject'); $subject->setLabel('Title: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setAttrib('size', 50)->addErrorMessage('You must enter a subject for this crime'); $reporterID = new Zend_Form_Element_Hidden('reporterID'); $reporterID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You do not appear to have chosen a reporter'); $reporter = new Zend_Form_Element_Text('reporter'); $reporter->setLabel('Source: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name and address of person providing intelligence.')->addErrorMessage('You must enter a reporter name'); $reportingPerson = new Zend_Form_Element_Text('reportingPerson'); $reportingPerson->setLabel('Person making the report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name of person providing intelligence.')->addErrorMessage('You must enter a reporter name'); $reportSubject = new Zend_Form_Element_Text('reportSubject'); $reportSubject->setLabel('Subject of report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setDescription('Name of suspect if known.')->addErrorMessage('You must enter a reporter name'); $county = new Zend_Form_Element_Select('county'); $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators); $district = new Zend_Form_Element_Select('district'); $district->setLabel('District: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose district after county')); $reliability = new Zend_Form_Element_Select('reliability'); $reliability->setLabel('Source Evaluation: ')->addMultiOptions(array('1' => 'Always reliable', '2' => 'Mostly reliable', '3' => 'Sometimes reliable', '4' => 'Unreliable', '5' => 'Don\'t know'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->setDecorators($decorators); $intellEvaluation = new Zend_Form_Element_Select('intellEvaluation'); $intellEvaluation->setLabel('Intelligence Evaluation: ')->addMultiOptions(array('1' => 'Known to be true', '2' => 'Known to be true by the source, but not by the person making the report', '3' => 'Not known, but is corroborated', '4' => 'Cannot be judged', '5' => 'Suspected to be false!'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setDescription('What you know about the intelligence itself.')->setOptions(array('separator' => ''))->setDecorators($decorators); $parish = new Zend_Form_Element_Select('parish'); $parish->setLabel('Parish: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose parish after district'))->addFilters(array('StripTags', 'StringTrim')); $gridref = new Zend_Form_Element_Text('gridref'); $gridref->setLabel('Associated NGR: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setAttrib('maxlength', 16)->setDecorators($decorators); $description = new Pas_Form_Element_RTE('description'); $description->setLabel('Description of crime - Main report: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); $subjectDetails = new Pas_Form_Element_RTE('subjectDetails'); $subjectDetails->setLabel('Subject details: ')->setRequired(false)->setDescription('DOB,address,description,etc if known.')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); $evaluation = new Pas_Form_Element_RTE('evaluation'); $evaluation->setLabel('Offences: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); $incidentDate = new ZendX_JQuery_Form_Element_DatePicker('incidentDate'); $incidentDate->setLabel('Date of incident: ')->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Date'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper'); $sam = new Zend_Form_Element_Text('sam'); $sam->setLabel('Associated with scheduled monument: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setAttrib('size', 35); $samID = new Zend_Form_Element_Hidden('samID'); $samID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $this->addElements(array($crimeType, $incidentDate, $samID, $sam, $reporter, $reporterID, $county, $district, $parish, $gridref, $description, $reliability, $evaluation, $subject, $reliability, $intellEvaluation, $subjectDetails, $reportSubject, $reportingPerson, $submit)); $this->addDisplayGroup(array('subject', 'crimeType', 'description', 'incidentDate', 'evaluation', 'reportingPerson', 'reporter', 'reporterID', 'reliability', 'intellEvaluation', 'reportSubject', 'subjectDetails', 'sam', 'samID', 'gridref', 'county', 'district', 'parish'), 'details'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->setLegend('Crime details: '); $this->addDisplayGroup(array('submit'), 'submit'); }
public function __construct($options = null) { parent::__construct($options); $roles = new Roles(); $role_options = $roles->getRoles(); $inst = new Institutions(); $inst_options = $inst->getInsts(); $projecttypes = new ProjectTypes(); $projectype_list = $projecttypes->getTypes(); $this->setName('acceptupgrades'); ZendX_JQuery::enableForm($this); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $level = new Zend_Form_Element_Select('level'); $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(NULL => NULL, 'Choose type of research' => $projectype_list))->setDecorators($decorators)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('You must set the level of research'); $title = new Zend_Form_Element_Text('title'); $title->setLabel('Project title: ')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('size', 60)->addErrorMessage('This project needs a title.')->setDecorators($decorators); $researchOutline = new Pas_Form_Element_RTE('researchOutline'); $researchOutline->setLabel('Research outline: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('Outline must be present.'); $reference = new Zend_Form_Element_Text('reference'); $reference->setLabel('Referee\'s name: ')->setAttrib('size', 30)->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators); $referenceEmail = new Zend_Form_Element_Text('referenceEmail'); $referenceEmail->setLabel('Referee\'s email address: ')->setAttrib('size', 30)->addValidator('EmailAddress')->addFilter('StringToLower')->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators); $message = new Pas_Form_Element_RTE('message'); $message->setLabel('Message to user: '******'rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('You must enter a message for the user to know they have been approved.'); $fullname = new Zend_Form_Element_Text('fullname'); $fullname->setLabel('Fullname: ')->setAttrib('size', 30)->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators); $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution; $institution->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options)); $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role; $role->setDecorators($decorators); $role->addMultiOptions(array(NULL => NULL, 'Choose role' => $role_options)); $role->removeMultiOption('admin'); $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate'); $startDate->setLabel('Start date of project: ')->setAttrib('size', 12)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilter('StringTrim')->addFilter('StripTags')->addValidator('Date')->setRequired(false)->addErrorMessage('You must enter a valid start date for this project'); $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate'); $endDate->setLabel('End date of project: ')->addValidator('Date')->addFilter('StringTrim')->addFilter('StripTags')->setJQueryParam('dateFormat', 'yy-mm-dd')->setAttrib('size', 12)->setRequired(false)->addErrorMessage('You must enter a valid end date for this project'); $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email; $email->addValidator('emailAddress')->setRequired(true)->addFilter('StringToLower')->addErrorMessage('Please enter a valid address!')->setDecorators($decorators); $already = new Zend_Form_Element_Radio('already'); $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it isn\'t'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators); $insert = new Zend_Form_Element_Checkbox('insert'); $insert->setLabel('Insert details into research register: ')->setCheckedValue(1)->setDecorators($decorators); $valid = new Zend_Form_Element_Radio('higherLevel'); $valid->setLabel('Approve?: ')->addMultiOptions(array(1 => 'Unauthorised', 0 => 'Authorised'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $this->addElements(array($reference, $referenceEmail, $researchOutline, $startDate, $endDate, $fullname, $valid, $level, $title, $submit, $already, $insert, $message)); $this->addDisplayGroup(array('fullname', 'username', 'email', 'institution', 'level', 'role', 'reference', 'referenceEmail', 'message', 'researchOutline', 'title', 'startDate', 'endDate', 'already', 'higherLevel', 'insert'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); $this->details->setLegend('Details: '); $this->addDisplayGroup(array('submit'), 'submit'); }