public function init() { $this->setName('client'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $id->removeDecorator('label'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $fiscal_name = new Zend_Form_Element_Text('fiscal_name'); $fiscal_name->setLabel('Fiscal name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $company_types_id = new Zend_Form_Element_Select('company_types_id'); $company_types_id->setLabel('Type')->setRequired(true)->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsCompanyTypes())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('emailAddress', TRUE)->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $telephone = new Zend_Form_Element_Text('telephone'); $telephone->setLabel('Telephone')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $fax = new Zend_Form_Element_Text('fax'); $fax->setLabel('fax')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $direction = new Zend_Form_Element_Text('direction'); $direction->setLabel('Direction')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $city = new Zend_Form_Element_Text('city'); $city->setLabel('City')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $country = new Zend_Form_Element_Text('country'); $country->setLabel('Country')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $postal_code = new Zend_Form_Element_Text('postal_code'); $postal_code->setLabel('Postal code')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $observation = new Zend_Form_Element_Text('observation'); $observation->setLabel('Observation')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($id, $name, $fiscal_name, $company_types_id, $email, $telephone, $fax, $direction, $city, $country, $postal_code, $observation, $submit)); }
public function init() { $form = array(); $this->setName('changeusername'); $auth = Zend_Auth::getInstance()->getIdentity(); // For Admin if ($auth->role == 'admin') { $account_identifier = new Zend_Form_Element_Text('account_identifier'); $account_identifier->setLabel('Organisation User Identifier')->setRequired()->addValidator('Db_NoRecordExists', false, array('table' => 'account', 'field' => 'username'))->addErrorMessage('This Organisation User Identifier is already used.')->setDescription("Your organisation user identifier will be used as a prefix for all the \n AidStream users in your organisation. We recommend that you use a short \n abbreviation that uniquely identifies your organisation. If your organisation \n is 'Acme Bellus Foundation', your organisation user identifier should be \n 'abf', depending upon it's availability.")->setAttrib('class', 'form-text'); $user_name = new Zend_Form_Element_Text('user_name'); $user_name->setLabel('New Username')->setRequired()->setAttrib('class', 'form-text')->setAttrib('readonly', true)->setDescription("This will be your new username with Organisation User \n Identifier as a prefix. You will not be able to change '_admin' part of the \n username."); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setValue('change')->setAttrib('class', 'form-submit')->setAttrib('id', 'change-username'); } // For Groupadmin if ($auth->role == 'groupadmin') { $group_identifier = new Zend_Form_Element_Text('group_identifier'); $group_identifier->setLabel('Group Identifier')->setRequired()->addValidator('Db_NoRecordExists', false, array('table' => 'user_group', 'field' => 'username'))->addErrorMessage('This group identifier is already used')->setDescription("Your group identifier will be used as a prefix for your username. \n We recommend that you use a short abbreviation that uniquely identifies your organisation \n group. If your group identifier is 'abc' the username will be 'abc_group'.")->setAttrib('class', 'form-text'); $user_name = new Zend_Form_Element_Text('user_name'); $user_name->setLabel('New Username')->setRequired()->setAttrib('class', 'form-text')->setValue('_group')->setAttrib('readonly', true); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setValue('change')->setAttrib('class', 'form-submit')->setAttrib('id', 'change-group-username'); } $this->addElements(array($user_name, $account_identifier, $group_identifier)); $this->addDisplayGroup(array('account_identifier', 'group_identifier', 'user_name'), 'field1', array('legend' => 'Change Username')); $this->addElement($submit); $this->setMethod('post'); $displayGroup = $this->getDisplayGroup('field1'); $displayGroup->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'default-activity-list')))); foreach ($this->getElements() as $element) { $element->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-item')))); } }
public function init() { $this->setName('resource'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $id->removeDecorator('label'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $suppliers_id = new Zend_Form_Element_Select('suppliers_id'); $suppliers_id->setLabel('suppliers')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsSuppliers())->setOptions(array('onChange' => 'javascript:getAjaxResponse("http://globalpms.es/production/resource/getdataresource/id/"+this.value,"resource_id");javascript:getAjaxResponse("http://globalpms.es/production/resource/getdata/id/"+this.value,"contacts_id");'))->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $contacts_id = new Zend_Form_Element_Select('contacts_id'); $contacts_id->setLabel('supplier contact ')->setmultiOptions($this->_selectOptionsContactSuppliers())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $resource_id = new Zend_Form_Element_Select('resource_id'); $resource_id->setLabel('resource')->setmultiOptions($this->_selectOptionsResources())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $unbilled_hours = new Zend_Form_Element_Text('unbilled_hours'); $unbilled_hours->setLabel('Unbilled hours')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $facturation_types_id = new Zend_Form_Element_Select('facturation_types_id'); $facturation_types_id->setLabel('Facturation type')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsFacturation_types())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $price = new Zend_Form_Element_Text('price'); $price->setLabel('Price')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $observation = new Zend_Form_Element_Text('observation'); $observation->setLabel('observation')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($id, $name, $suppliers_id, $resource_id, $contacts_id, $unbilled_hours, $facturation_types_id, $price, $observation, $submit)); }
public function init() { $this->setName('user'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $id->removeDecorator('label'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $password = new Zend_Form_Element_Password('password'); $password->setLabel('Password')->addValidator('NotEmpty', true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('StringLength', false, array(3, 20))->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $date = new Zend_Form_Element_Text('date'); $date->setLabel('Date')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('emailAddress', TRUE)->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $status = new Zend_Form_Element_Text('status'); $status->setLabel('status')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $person_id = new Zend_Form_Element_Text('person_id'); $person_id->setLabel('person_id')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $validation_code = new Zend_Form_Element_Text('validation_code'); $validation_code->setLabel('validation')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $phone = new Zend_Form_Element_Text('phone'); $phone->setLabel('Phone')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $role_id = new Zend_Form_Element_Select('role_id'); $role_id->setLabel('Role')->setRequired(true)->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsRole())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $company_id = new Zend_Form_Element_Select('company_id'); $company_id->setLabel('company')->setRequired(true)->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsCompany())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $add_contact = new Zend_Form_Element_Checkbox('add_contact'); $add_contact->setLabel('add contact')->setRequired(true); $this->addElements(array($id, $name, $password, $date, $email, $status, $validation_code, $person_id, $phone, $role_id, $company_id, $add_contact, $submit)); }
public function init() { $this->setName('activity'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $id->removeDecorator('label'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name')->setRequired(true)->addFilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $activity_types_id = new Zend_Form_Element_Select('activity_types_id'); $activity_types_id->setLabel('activity type')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsActivity_types())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $contact_own_company_id = new Zend_Form_Element_Select('contact_own_company_id'); $contact_own_company_id->setLabel('contact own company')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsContactOwnCompanies())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); // $contact_client_company_id = new Zend_Form_Element_Select('contact_client_company_id'); $contact_client_company_id->setLabel('contact client company')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsContactClientCompanies())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $status_id = new Zend_Form_Element_Select('status_id'); $status_id->setLabel('Status')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsStatus())->setAttrib('maxlength', 300)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); $date_start = new Zend_Form_Element_Text('date_start'); $date_start->setLabel('date start')->setRequired(true)->addFilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib('id', 'f_date_start'); $date_end = new Zend_Form_Element_Text('date_end'); $date_end->setLabel('date end')->setRequired(true)->addFilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib('id', 'f_date_end'); $observation = new Zend_Form_Element_Text('observation'); $observation->setLabel('Observation')->setRequired(true)->addfilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($id, $name, $activity_types_id, $contact_own_company_id, $contact_client_company_id, $status_id, $date_start, $date_end, $observation, $submit)); }
public function edit($account_id = '') { $form = array(); $model = new Model_Wep(); $language = $model->getCodeArray('Language', null, '1'); $currency = $model->getCodeArray('Currency', null, '1'); $form['xml_lang'] = new Zend_Form_Element_Select('xml_lang'); $form['xml_lang']->setLabel('Language')->setAttrib('class', 'form-select')->addMultiOption('', 'Select anyone')->setRequired(); foreach ($language as $key => $eachLanguage) { $form['xml_lang']->addMultiOption($key, $eachLanguage); } $form['default_currency'] = new Zend_Form_Element_Select('default_currency'); $form['default_currency']->setAttrib('class', 'form-select')->setLabel('Default Currency')->setRequired()->addMultiOption('', 'Select anyone'); foreach ($currency as $key => $eachCurrency) { $form['default_currency']->addMultiOption($key, $eachCurrency); } $form['hierarchy'] = new Zend_Form_Element_Text('hierarchy'); $form['hierarchy']->setAttrib('class', 'form-text')->setLabel('Hierarchy'); //This code is used to append a <div> with help class for all form elements, used for displaying help foreach ($form as $item_name => $element) { $form[$item_name]->setDecorators(array('ViewHelper', 'Errors', 'Label', array('HtmlTag', array('tag' => '<div>', 'placement' => 'PREPEND', 'class' => 'help activity-' . $item_name)), array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'clearfix form-item')))); } $this->addElements($form); $this->addDisplayGroup(array('xml_lang', 'default_currency', 'hierarchy'), 'field1', array('legend' => 'Activity')); $group = $this->getDisplayGroup('field1'); $group->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'default-activity-list')))); $save = new Zend_Form_Element_Submit('save'); $save->setValue('Save')->setAttrib('class', 'form-submit'); $this->addElement($save); $this->setMethod('post'); $this->setAttrib('id', 'activity-edit-form'); }
public function edit($defaults = '', $account_id = '') { $form = array(); $model = new Model_Wep(); // Reporting organisation form $repOrg = new Form_Wep_ReportingOrganisation(); $repOrg->load($defaults); $repOrg->removeDecorator('form'); $this->addSubForm($repOrg, 'reporting_organisation'); // Registry Info and Publishing Type form $registryInfoForm = new Form_General_RegistryInfo(); $registryInfoForm->removeDecorator("form"); $this->addSubForm($registryInfoForm, 'registry_info'); // Default Field Values form $defValues = new Form_Wep_DefaultFieldValues(); $defValues->load($defaults); $defValues->removeDecorator('form'); $this->addSubForm($defValues, 'default_field_values'); //Default Field Groups form $disGroup = new Form_Wep_DefaultFieldGroups(); $disGroup->load($defaults); $disGroup->removeDecorator('form'); $this->addSubForm($disGroup, 'default_field_groups'); $signup = new Zend_Form_Element_Submit('Save'); $signup->setValue('save')->setAttrib('class', 'form-submit'); $this->addElement($signup); $this->setMethod('post'); }
public function init() { // $name = new Zend_Form_Element_Text('name'); // $name->setLabel('name') // ->setRequired(true) // ->addFilter('StripTags') // ->addFilter('StringTrim') // ->addValidator('NotEmpty') // ->setAttrib('size', 30) // ->setAttrib('maxlength', 80) // ->setAttrib("class","inputbox") // ->setDecorators(array(array('ViewScript', array( // 'viewScript' => 'forms/_element_text.phtml')))) // ; // $suppliers_id = new Zend_Form_Element_Select('suppliers_id'); $suppliers_id->setLabel('Supplier')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptions_types())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml')))); // // $productionssupplier_types_id = new Zend_Form_Element_Multiselect('$productionssupplier_types_id'); // $productionssupplier_types_id->setLabel('productionssupplier types') // ->setmultiOptions($this->_selectOptions_types()) // ->setAttrib('maxlength', 200) // ->setAttrib('size', 5) // ->setDecorators(array(array('ViewScript', array( // 'viewScript' => 'forms/_element_select.phtml')))) // ->setAttrib("class","toolboxdrop") // ; // $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('ADD')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($suppliers_id, $submit)); }
function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->addAttribs(array('id' => 'addGroup', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); $control = new Zend_Form_Element_Hidden('control'); $control->setValue('addGroup'); $this->addElement($control); // begin inputs $name = new Zend_Form_Element_Text('name'); $name->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_category_name'))); $name->setRequired(true); $this->addElement($name); // begin inputs $color = new Zend_Form_Element_Text('color'); $color->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_color_for_charts'))); $color->setRequired(true); $this->addElement($color); // begin inputs $type = new Zend_Form_Element_Select('type'); $options = array('' => Zend_Registry::get('translate')->_('admin_category_select_type'), '0' => Zend_Registry::get('translate')->_('admin_expenses'), '1' => Zend_Registry::get('translate')->_('admin_income')); $type->setMultiOptions($options); $type->addValidator(new Zend_Validate_InArray(array_keys($options))); $type->setAttribs(array('class' => 'select', 'id' => 'type')); $type->setRequired(true); $this->addElement($type); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue(Zend_Registry::get('translate')->_('admin_add')); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
public function init() { $this->setName('transfer_target'); $this->setAttrib('class', 'form-inline'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $host2 = new Zend_Form_Element_Text('host2'); $host2->setAttrib('class', 'form-control')->setLabel('host2'); $host2->setDecorators(array('ViewHelper', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3')))); $user2 = new Zend_Form_Element_Text('user2'); $user2->setLabel('user2'); $user2->setAttrib('class', 'form-control'); $user2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3')))); $password2 = new Zend_Form_Element_Text('password2'); $password2->setLabel('pass2'); $password2->setAttrib('class', 'form-control'); $password2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3')))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Submit'); $submit->setAttrib('class', 'btn btn-default'); $submit->setValue('transfer_target'); $submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'colspan' => 2, 'align' => 'center')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group')))); $this->addElements(array($host2, $user2, $password2, $submit)); $this->setDecorators(array('FormElements', 'Form')); }
function editUserPassword() { $this->setMethod('post'); $this->addAttribs(array('id' => 'formAccountEditPassword', 'class' => '')); $filters = array(new Zend_Filter_StringTrim(), new Zend_Filter_StripTags()); $control = new Zend_Form_Element_Hidden('control'); $control->setValue('editPassword'); $this->addElement($control); $oldPassword = new Zend_Form_Element_Password('oldPassword'); $oldPassword->setLabel('Old password'); $oldPassword->addValidator(new Zend_Validate_StringLength(6, 32)); $oldPassword->setAttribs(array('class' => 'text validate[required,minSize[6],maxSize[32]] rightAdd', 'minlenght' => '6', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'data-prompt-position' => 'topLeft:0')); $oldPassword->setRequired(true); $this->addElement($oldPassword); $password = new Zend_Form_Element_Password('password'); $password->setLabel(Zend_Registry::get('translate')->_('admin_administrators_new_password')); $password->addValidator(new Zend_Validate_StringLength(6, 32)); $password->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false')); $password->setRequired(true); $this->addElement($password); $retypePassword = new Zend_Form_Element_Password('retypePassword'); $retypePassword->setLabel(Zend_Registry::get('translate')->_('admin_administrators_retype_new_password')); $retypePassword->addValidator(new Zend_Validate_Identical('password')); $retypePassword->addValidator(new Zend_Validate_StringLength(6, 32)); $retypePassword->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false')); $retypePassword->setRequired(true); $retypePassword->setIgnore(true); $this->addElement($retypePassword); $submit = new Zend_Form_Element_Submit('savePassword'); $submit->setValue(Zend_Registry::get('translate')->_('apply_password')); $submit->setAttribs(array('class' => 'submit tsSubmitLogin fL')); $submit->setIgnore(true); $this->addElement($submit); $this->setElementFilters($filters); }
public function init() { $this->setName('resource_activity_has_receipt'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $id->removeDecorator('label'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); // // $resource_activity_has_receipt_types_id = new Zend_Form_Element_Select('resource_activity_has_receipt_types_id'); // $resource_activity_has_receipt_types_id->setLabel('resource_activity_has_receipt types') // ->addValidator('NotEmpty', true) // ->setmultiOptions($this->_selectOptions_types()) // ->setAttrib('maxlength', 200) // ->setAttrib('size', 1) // ->setAttrib("class", "toolboxdrop") // ->setDecorators(array(array('ViewScript', array( // 'viewScript' => 'forms/_element_select.phtml')))) // ; // // $resource_activity_has_receipt_types_id = new Zend_Form_Element_Multiselect('$resource_activity_has_receipt_types_id'); // $resource_activity_has_receipt_types_id->setLabel('resource_activity_has_receipt types') // ->setmultiOptions($this->_selectOptions_types()) // ->setAttrib('maxlength', 200) // ->setAttrib('size', 5) // ->setDecorators(array(array('ViewScript', array( // 'viewScript' => 'forms/_element_select.phtml')))) // ->setAttrib("class","toolboxdrop") // ; // $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($id, $name, $submit)); }
public function init() { $this->setMethod('POST'); $this->setName('guestForm'); $element = new Zend_Form_Element_Text('name'); $element->setLabel('怎么称呼您'); $element->setDescription('必填,中英文都可,2到30个字'); $element->setRequired(true); $this->addElement($element); $element = new Zend_Form_Element_Text('email'); $element->setLabel('您的Email'); $element->setRequired(true); $element->addValidator(new Zend_Validate_EmailAddress()); $element->addValidator('NotEmpty'); $element->setDescription('必填'); $this->addElement($element); $element = new Zend_Form_Element_Textarea('body'); $element->setLabel('您的留言'); $element->setAttrib('rows', 4); $element->addValidator('NotEmpty'); $this->addElement($element); $element = new Elements(); $element->addReCaptcha($this); $element = new Zend_Form_Element_Submit('post'); $element->setValue('提交')->removeDecorator('Label'); $this->addElement($element); }
public function init() { $this->setName('contact'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $id->removeDecorator('label'); // // $company_id = new Zend_Form_Element_Hidden('company_id'); // $company_id->addFilter('Int'); // $company_id->removeDecorator('label'); // $name = new Zend_Form_Element_Text('name'); $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('emailAddress', TRUE)->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $telephone = new Zend_Form_Element_Text('telephone'); $telephone->setLabel('Telephone')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $status = new Zend_Form_Element_Text('status'); $status->setLabel('Status')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $direction = new Zend_Form_Element_Text('direction'); $direction->setLabel('Direction')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml')))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($id, $name, $email, $telephone, $direction, $status, $submit)); }
public function init() { $this->setAction('/api'); $file = new Zend_Form_Element_File('uploadFile'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Upload'); $this->addElements(array($file, $submit)); }
public function init() { $submit = new Zend_Form_Element_Submit('submit'); $submit->class = 'formsubmit'; $submit->setValue('Submit')->setDecorators(array(array('ViewHelper', array('helper' => 'formSubmit')))); $this->addElements(array($submit)); $this->setDecorators(array('FormElements', 'Fieldset', 'Form')); }
public function init() { $this->setName('upload module'); $file = new Zend_Form_Element_File('file'); $file->setLabel('File')->setDestination(APPLICATION_PATH . '/modules/')->setRequired(true)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_file.phtml')), array('File'))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Upload')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($file, $submit)); }
public function init() { parent::init(); $element = new Zend_Form_Element_Submit(self::ELEMENT_SAVE); $element->setValue('save'); $element->removeDecorator('DtDdWrapper'); $this->addElement($element); $element = new Zend_Form_Element_Submit(self::ELEMENT_CANCEL); $element->setValue('cancel'); $element->removeDecorator('DtDdWrapper'); $this->addElement($element); }
public function init() { $this->addPrefixPath('ZC_Form_Decorator', 'ZC/Form/Decorator', 'decorator'); $this->setMethod('post'); $fname = new Zend_Form_Element_Text('fname'); $fname->setLabel('First Name:')->setRequired(true); $lname = new Zend_Form_Element_Text('lname'); $lname->setLabel('Last Name:')->setRequired(true); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Submit'); $this->addElements(array($fname, $lname, $submit)); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')), array('MoreInformation', array('placement' => 'PREPEND', 'text' => 'Please provide your first and last name:')), 'Form')); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'addUser', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); $action = new Zend_Form_Element_Hidden('action'); $action->setValue('add'); $this->addElement($action); // BEGIN: Name $name = new Zend_Form_Element_Text('name'); $name->setAttribs(array('class' => 'text large rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_full_name'), 'id' => 'name')); $name->setRequired(true); $this->addElement($name); // END: Name // BEGIN: Account Name $accountName = new Zend_Form_Element_Text('accountName'); $accountName->setAttribs(array('class' => 'text large rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_account_name'), 'id' => 'accountName')); $accountName->setRequired(true); $this->addElement($accountName); // END: Account Name // BEGIN: Email $email = new Zend_Form_Element_Text('email'); $email->setAttribs(array('class' => 'text large rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_email_address'), 'id' => 'email')); $validatorEmail = new Zend_Validate_Db_NoRecordExists('users', 'email'); $email->addValidator($validatorEmail); $email->setRequired(true); $this->addElement($email); // END: Email //BEGIN:Level $idLevel = new Zend_Form_Element_Select('idRole'); $options = array('' => Zend_Registry::get('translate')->_('admin_select_user_level')); $levels = new Default_Model_Role(); $select = $levels->getMapper()->getDbTable()->select()->where('id != ?', 1)->where('NOT deleted')->order('id DESC'); $result = $levels->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idLevel->addMultiOptions($options); $idLevel->addValidator(new Zend_Validate_InArray(array_keys($options))); $idLevel->setAttribs(array('class' => 'rightAdd', 'id' => 'idRole')); $idLevel->setRequired(false); $this->addElement($idLevel); //END:Level $add = new Zend_Form_Element_Submit('add'); $add->setValue(Zend_Registry::get('translate')->_('admin_add_user')); $add->setAttribs(array('class' => 'submit', 'id' => '')); $add->setIgnore(true); $this->addElement($add); }
public function init() { $this->setMethod('post'); $fname = new Zend_Form_Element_Text('fname'); $fname->setLabel('First Name:')->setRequired(true); $lname = new Zend_Form_Element_Text('lname'); $lname->setLabel('Last Name:')->setRequired(true); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Submit'); $this->addElements(array($fname, $lname, $submit)); $this->setElementDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array(array('emptyrow' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element', 'placement' => 'PREPEND')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'create-folder-form'); $this->setAttrib('accept-charset', 'UTF-8'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name')->setAttrib('placeholder', 'New Folder')->setRequired(true)->addValidators(array(new Zend_Validate_StringLength(array('min' => 1, 'max' => 255)), new EasyCMS_Validate_Filepathname())); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Create folder')->setLabel(''); $this->addElements(array($name, $submit)); $this->addElementPrefixPath('EasyCMS_Form_Decorator', 'EasyCMS/Form/Decorator', 'decorator'); $this->addDisplayGroupPrefixPath('EasyCMS_Form_Decorator', 'EasyCMS/Form/Decorator'); $this->setElementDecorators(array('Composite')); }
public function init() { $username = new Zend_Form_Element_Text('username'); $username->class = 'formtext'; $username->setLabel('Username:'******'ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label')))); $password = new Zend_Form_Element_Password('password'); $password->class = 'formtext'; $password->setLabel('Password:'******'ViewHelper', array('helper' => 'formPassword')), array('Label', array('class' => 'label')))); $submit = new Zend_Form_Element_Submit('login'); $submit->class = 'formsubmit'; $submit->setValue('Login')->setDecorators(array(array('ViewHelper', array('helper' => 'formSubmit')))); $this->addElements(array($username, $password, $submit)); $this->setDecorators(array('FormElements', 'Fieldset', 'Form')); }
function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->setAction(WEBROOT . 'logs'); $this->addAttribs(array('id' => 'searchLogs', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); //BEGIN:Module $id = new Zend_Form_Element_Select('modul'); $options = array('' => 'Selectati modulul'); $module = new Default_Model_Logs(); $select = $module->getMapper()->getDbTable()->select()->group('modul')->order('created DESC'); $result = $module->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getModul()] = $value->getModul(); } } $id->addMultiOptions($options); $this->addElement($id); //END:Module //BEGIN:ActionType $id = new Zend_Form_Element_Select('actionType'); $options = array('' => 'Selectati tipul actiunii'); $module = new Default_Model_Logs(); $select = $module->getMapper()->getDbTable()->select()->group('actionType')->order('created DESC'); $result = $module->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getActionType()] = $value->getActionType(); } } $id->addMultiOptions($options); $this->addElement($id); //END:ActionType // BEGIN: data $data_inceput = new Zend_Form_Element_Text('data_inceput'); $data_inceput->setAttribs(array('class' => 'data_inceput', 'placeholder' => 'Data inceput')); $this->addElement($data_inceput); $data_sfarsit = new Zend_Form_Element_Text('data_sfarsit'); $data_sfarsit->setAttribs(array('class' => 'data_sfarsit', 'placeholder' => 'Data sfarsit')); $this->addElement($data_sfarsit); // END: data $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Cauta'); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'intrebare_form', 'class' => '')); $nume = new Zend_Form_Element_Text('tabel'); $nume->setLabel('Nume Tabel'); $nume->setAttribs(array('class' => 'text_input validate[required]', 'placeholder' => trim(Zend_Registry::get('translate')->_('Nume Tabel')), 'data-prompt-position' => 'topRight:-187')); $nume->setRequired(true); $this->addElement($nume); $button = new Zend_Form_Element_Submit('button'); $button->setValue(trim(Zend_Registry::get('translate')->_('Generate Model'))); $button->setAttribs(array('class' => 'question_submit')); $button->setIgnore(true); $this->addElement($button); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'comments_form', 'class' => '')); $description = new Zend_Form_Element_Textarea('description'); $description->setLabel('Comment text'); $description->setAttribs(array('class' => 'mess_textarea validate[required]', 'placeholder' => trim(Zend_Registry::get('translate')->_('Comment text')), 'data-prompt-position' => 'topLeft:6')); $description->setRequired(true); $this->addElement($description); $button = new Zend_Form_Element_Submit('button'); $button->setValue(trim(Zend_Registry::get('translate')->_('Send Comment'))); $button->setAttribs(array('class' => 'comments_submit')); $button->setIgnore(true); $this->addElement($button); }
public function init() { $this->setName('role'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $id->removeDecorator('label'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib("class", "inputbox"); $role_parent = new Zend_Form_Element_Multiselect('role_parent'); $role_parent->setLabel('Role Parent')->setmultiOptions($this->_selectOptionsRoles())->setAttrib('maxlength', 200)->setAttrib('size', 5)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))))->setAttrib("class", "toolboxdrop"); $prefered_uri = new Zend_Form_Element_Text('prefered_uri'); $prefered_uri->setLabel('Prefered Uri')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib("class", "inputbox"); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label'); $this->addElements(array($id, $name, $role_parent, $prefered_uri, $submit)); }
function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->addAttribs(array('id' => 'addExpense', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); $control = new Zend_Form_Element_Hidden('control'); $control->setValue('addExpense'); $this->addElement($control); // begin inputs $name = new Zend_Form_Element_Text('name'); $name->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_recurrent_expense_description'))); $name->setRequired(true); $this->addElement($name); $price = new Zend_Form_Element_Text('price'); $price->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_price'))); $price->setRequired(true); $this->addElement($price); //BEGIN: Date $date = new Zend_Form_Element_Text('date'); $date->setAttribs(array('class' => 'rightAdd dateSearch w_315', 'placeholder' => 'Date')); $date->setLabel('Select day'); $this->addElement($date); // END: Date //BEGIN:Id Group $idGroup = new Zend_Form_Element_Select('idGroup'); $options = array(); $pm = new Default_Model_Groups(); $select = $pm->getMapper()->getDbTable()->select()->where('NOT deleted')->order('name ASC'); $result = $pm->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idGroup->addMultiOptions($options); $idGroup->addValidator(new Zend_Validate_InArray(array_keys($options))); $idGroup->setAttribs(array('class' => 'select')); $idGroup->setRequired(false); $this->addElement($idGroup); //END:Id Group $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue(Zend_Registry::get('translate')->_('admin_add_recurrent_expense')); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'filterForm', 'class' => '')); $this->setAction(WEBROOT . 'recurrent-expenses'); // BEGIN: nume text $nameSearch = new Zend_Form_Element_Text('nameSearch'); $nameSearch->setAttribs(array('class' => 'text large', 'placeholder' => Zend_Registry::get('translate')->_('admin_name'))); $nameSearch->setRequired(false); $this->addElement($nameSearch); // END: nume text // BEGIN: prenume text $idGroupSearch = new Zend_Form_Element_Select('idGroupSearch'); $options = array('' => Zend_Registry::get('translate')->_('admin_select_expense')); $groups = new Default_Model_Groups(); $select = $groups->getMapper()->getDbTable()->select()->where('type=?', 0)->where('NOT deleted')->order('name ASC'); $result = $groups->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idGroupSearch->addMultiOptions($options); $idGroupSearch->addValidator(new Zend_Validate_InArray(array_keys($options))); $idGroupSearch->setAttribs(array('class' => 'select uniformSelect filter_selector')); $idGroupSearch->setRequired(false); $this->addElement($idGroupSearch); // END: prenume text // BEGIN: fromDate text $fromDate = new Zend_Form_Element_Text('fromDate'); $fromDate->setAttribs(array('class' => 'text large', 'placeholder' => Zend_Registry::get('translate')->_('admin_from_date'))); $fromDate->setRequired(false); $this->addElement($fromDate); // END: fromDate text // BEGIN: toDate text $toDate = new Zend_Form_Element_Text('toDate'); $toDate->setAttribs(array('class' => 'text large', 'placeholder' => Zend_Registry::get('translate')->_('admin_to_date'))); $toDate->setRequired(false); $this->addElement($toDate); // END: toDate text $search = new Zend_Form_Element_Submit('searchProduct'); $search->setValue(Zend_Registry::get('translate')->_('admin_filter')); $search->setAttribs(array('class' => 'submit')); $search->setIgnore(true); $this->addElement($search); }
public function init() { $form = array(); $passwordConfirmation = new App_Validate_PasswordConfirmation(); $password = new Zend_Form_Element_Password('password'); $password->setLabel(' New Password')->setRequired()->addValidator($passwordConfirmation)->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'clearfix form-item'))))->setAttrib('class', 'form-text'); $confirmPassword = new Zend_Form_Element_Password('confirmpassword'); $confirmPassword->setLabel('Confirm Password')->setAttrib('class', 'form-text')->setRequired()->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'clearfix form-item'))))->addValidator($passwordConfirmation); $this->addElements(array($oldpassword, $password, $confirmPassword)); $this->addDisplayGroup(array('password', 'confirmpassword'), 'field1', array('legend' => 'Reset User Password')); $group = $this->getDisplayGroup('field1'); $group->setDecorators(array('FormElements', 'Fieldset', array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'default-activity-list')))); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setValue('change')->setAttrib('class', 'form-submit'); $this->addElement($submit); $this->setMethod('post'); }