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 init() { parent::init(); $this->setAction('/core/feedback/participant'); $id = new Zend_Form_Element_Hidden('id'); $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite')); $country = new TA_Form_Element_Country('country'); $country->setLabel('Please select the country in which you work as primary place of employment.')->setDecorators(array('Composite')); $orgType = new Zend_Form_Element_Select('org_type'); $orgType->setLabel('Please select the type of organisation that most closely resembles your primary place of employment.')->setAttrib('class', 'medium')->setMultiOptions(array('0' => '---', 'nren' => 'National Research and Education Network (NREN)', 'high' => 'Higher / Further Education Institute (universities / college / polytechnic...)', 'ari' => 'Academic Research Institute', 'project' => 'Research project', 'admin' => 'Administrative departments of academic institutions', 'local' => 'Local / regional / central government department', 'cultural' => 'Cultural organisation (galeries, librairies, museums, etc.)', 'comm' => 'Commercial organisation', 'other' => 'Other non-profit (specify)'))->setDecorators(array('Composite')); $orgOther = new Zend_Form_Element_Text('org_type_other'); $orgOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $occupation = new Zend_Form_Element_Select('occupation'); $occupation->setLabel('Please select the title that most closely resembles your primary role in the organisation.')->setAttrib('class', 'medium')->setMultiOptions(array('0' => '---', 'director' => 'Director (responsible for overall organisational management)', 'manager' => 'Technical Manager', 'admin' => 'Administrative / Operational Manager', 'tech' => 'Technical staff / Engineer', 'res' => 'Researcher / Scientist', 'prof' => 'Professor / Teacher', 'pr' => 'Public Relations / Communications', 'bizz' => 'Business Development', 'stud' => 'Student', 'other' => 'Other (specify)'))->setDecorators(array('Composite')); $occOther = new Zend_Form_Element_Text('occupation_other'); $occOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $interest = new Zend_Form_Element_MultiCheckbox('interest'); $interest->setLabel('Please select your main areas of interest. Up to three selections are possible.')->setAttrib('class', 'tiny')->setMultiOptions(array('sec' => 'Network security (incident, prevention and response)', 'nom' => 'Network operations management', 'clouds' => 'Storage and clouds', 'grids' => 'Grids', 'media' => 'Media management and distribution', 'auth' => 'Authentication and Authorisation systems and federations', 'wireless' => 'Fixed & mobile wireless and roaming technologies', 'vid' => 'Video / web-based conferencing', 'reg' => 'Regulatory issues including privacy', 'pr' => 'PR / communications / business development', 'strat' => 'Strategic development: European policy setting and / or organisational management', 'other' => 'Other (specify)'))->addValidator('Callback', true, array('callback' => function ($value, $arr) { return count($arr['interest']) > 3 ? false : true; }, 'messages' => array(Zend_Validate_Callback::INVALID_VALUE => "Please don't select more than three options")))->setDecorators(array('Composite')); $intOther = new Zend_Form_Element_Text('interest_other'); $intOther->setDescription('Other, please specify')->setAttrib('class', 'medium')->setDecorators(array('Composite')); $this->addElements(array($id, $country, $orgType, $orgOther, $occupation, $occOther, $interest, $intOther)); $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator)); }
public function init() { // create elements $userId = new Zend_Form_Element_Hidden('id'); $mail = new Zend_Form_Element_Text('email'); $name = new Zend_Form_Element_Text('name'); $radio = new Zend_Form_Element_Radio('radio'); $file = new Zend_Form_Element_File('file'); $multi = new Zend_Form_Element_MultiCheckbox('multi'); $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'Figlet')); $submit = new Zend_Form_Element_Button('submit'); $cancel = new Zend_Form_Element_Button('cancel'); // config elements $mail->setLabel('Mail:')->setAttrib('placeholder', 'data please!')->setRequired(true)->setDescription('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fringilla purus eget ante ornare vitae iaculis est varius.')->addValidator('emailAddress'); $name->setLabel('Name:')->setRequired(true); $radio->setLabel('Radio:')->setMultiOptions(array('1' => PHP_EOL . 'test1', '2' => PHP_EOL . 'test2'))->setRequired(true); $file->setLabel('File:')->setRequired(true)->setDescription('Check file upload'); $multiOptions = array('view' => PHP_EOL . 'view', 'edit' => PHP_EOL . 'edit', 'comment' => PHP_EOL . 'comment'); $multi->setLabel('Multi:')->addValidator('Alpha')->setMultiOptions($multiOptions)->setRequired(true); $captcha->setLabel('Captcha:')->setRequired(true)->setDescription("This is a test"); $submit->setLabel('Save')->setAttrib('type', 'submit'); $cancel->setLabel('Cancel'); // add elements $this->addElements(array($userId, $mail, $name, $radio, $file, $captcha, $multi, $submit, $cancel)); // add display group $this->addDisplayGroup(array('email', 'name', 'radio', 'multi', 'file', 'captcha', 'submit', 'cancel'), 'users'); // set decorators EasyBib_Form_Decorator::setFormDecorator($this, EasyBib_Form_Decorator::BOOTSTRAP_MINIMAL, 'submit', 'cancel'); }
public function init() { $menu_items_model = new Admin_Model_MenuItems(); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Usergroup name')->setRequired(true)->setAttrib("class", "form-control")->setAttrib("style", "width:200px"); $menu_items = new Zend_Form_Element_Multiselect('admin_menu_item_id'); $menu_items->addValidator(new Zend_Validate_Digits(), true); $menu_items->setLabel('Menu Items: '); $menu_items->setAttrib("class", "select2"); $menu_items->setAttrib("data-placeholder", "Choose..."); $menu_items->setAttrib("style", "width:200px"); $menu_items->addMultiOptions($menu_items_model->getForDropDown()); $permit = new Zend_Form_Element_MultiCheckbox('permit'); $permit->setLabel('Available resources '); $resources_table = new Admin_Model_Resources(); foreach ($resources_table->getAll() as $resource) { $permit->addMultiOption((string) $resource->id, ' ' . $resource->name); } $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setLabel('Cancel'); $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black'); $cancel->setAttrib("onClick", "window.location = window.location.origin+'/admin/admin-usersgroups/'"); $submit = new Zend_Form_Element_Submit('save'); $submit->setAttrib('class', 'btn btn-primary'); $submit->setLabel('Confirm'); $this->setAction('')->setMethod('post')->addElement($name)->addElement($menu_items)->addElement($permit)->addElement($cancel)->addElement($submit); }
public function __construct($options = null) { parent::__construct($options); $this->setName('ServiceForm'); // SortNumber, int $sort = new Zend_Form_Element_Text('SortNumber'); $sort->setLabel('Sort number:'); // ServiceTitle, string $title = new Zend_Form_Element_Text('ServiceTitle'); $title->setLabel('Service title:')->setRequired(); // service categories, string (composed from MultiCheckbox) $vals = array(); $categories = array(); $_serviceCategories = new Admin_Model_ServiceCategory(); foreach ($_serviceCategories->getAllServiceCategories() as $category) { $vals[] = $category->ServiceCategoryID; $categories[$category->ServiceCategoryID] = $category->CategoryTitle; } $serviceCategories = new Zend_Form_Element_MultiCheckbox('ServiceCategories'); $serviceCategories->setLabel('Applicable service categories:')->setRequired()->addMultiOptions($categories)->setValue($vals); // ServiceText, string $text = new Zend_Form_Element_Textarea('ServiceText'); $text->setLabel('Service text:')->setRequired(); // Submit button $submit = new Zend_Form_Element_Submit('Submit'); $submit->setLabel('Submit'); $this->addElements(array($sort, $title, $serviceCategories, $text, $submit)); }
public function init() { $this->setAction('/core/submit/new'); $type = new Zend_Form_Element_MultiCheckbox('submission_type'); $type->setLabel('')->setRequired(false)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('submission_type'))->setSeparator('<br />')->setDecorators(array('Composite')); $title = new Zend_Form_Element_Text('title'); $title->setLabel('Title')->setRequired(true)->addValidator('StringLength', true, array(2, 64, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer title', Zend_Validate_StringLength::TOO_LONG => 'Your title is too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 64 characters')->setAttrib('maxLength', 64)->setDecorators(array('Composite')); $audience = new Zend_Form_Element_Radio('target_audience'); $audience->setLabel('Please mark the target audience for your presentation')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('target_audience'))->setSeparator('<br />')->setDecorators(array('Composite')); $publish = new Zend_Form_Element_Radio('publish_paper'); $publish->setLabel('Please indicate whether you wish to prepare a full paper for possible publication')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('publish_paper', 'submit'))->setSeparator('<br />')->setDecorators(array('Composite')); $topicModel = new Core_Model_Topic(); $topicsForSelect = $topicModel->getTopicsForSelect(); $topicsel = new Zend_Form_Element_MultiCheckbox('topic'); $topicsel->setLabel('Topic')->setRequired(false)->setAttrib('class', 'tiny')->setMultiOptions($topicsForSelect)->setSeparator('<br />')->setDecorators(array('Composite')); $keywords = new Zend_Form_Element_Text('keywords'); $keywords->setLabel('Keywords')->setRequired(false)->addValidator('StringLength', true, array(2, 500, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide longer keywords', Zend_Validate_StringLength::TOO_LONG => 'Your keywords are too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 500 characters')->setDecorators(array('Composite')); $abstract = new Zend_Form_Element_Textarea('abstract'); $abstract->setLabel('Submission Summary (If your submission is accepted, this will be publicly visible!)')->setAttrib('class', 'small')->setDescription('Must be between 5 and 2000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 2000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer abstract', Zend_Validate_StringLength::TOO_LONG => 'Your abstract is too long')))->setDecorators(array('Composite')); $comment = new Zend_Form_Element_Textarea('comment'); $comment->setLabel('Information for Reviewers')->setAttrib('class', 'small')->setDescription('Must be between 5 and 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 1000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer description', Zend_Validate_StringLength::TOO_LONG => 'Your description is too long')))->setDecorators(array('Composite')); $file = new TA_Form_Element_MagicFile('file'); $file->setLabel('Your submission (File must be pdf and no bigger than 10Mb) *')->setRequired(false)->addDecorators($this->_magicFileElementDecorator)->addValidators(array(array('Count', true, 1), array('Size', true, 10000000), array('Extension', true, array('pdf', 'case' => true)), array('MimeType', false, array('application/pdf')))); $file->getValidator('Extension')->setMessage('Only pdf files are allowed!'); $subform = new Zend_Form_SubForm(); $subform->setDecorators(array('FormElements')); $subform->addElements(array($type, $file, $title, $audience, $topicsel, $keywords, $abstract, $comment)); $this->addSubForm($subform, 'submission'); $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator)); }
/** * Create options element * * @return Zend_Form_Element_MultiCheckbox */ protected function _options() { $element = new Zend_Form_Element_MultiCheckbox('options', array('multiOptions' => array('keyRequired' => ' Key Required', 'preModerationRequired' => ' Pre-moderation', 'titleDisplayed' => ' Title Displayed', 'paginatorEnabled' => ' Page Navigation'))); $element->addDecorators($this->_inputDecorators); $element->setLabel('Options'); return $element; }
public function addFileIdElement() { $oFileId = new Zend_Form_Element_MultiCheckbox("file_id"); $oFileId->setLabel("Załączniki:"); $oFileId->setRequired(FALSE); $oFileId->addMultiOptions(array()); $this->addElement($oFileId); }
public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oFormName = new Zend_Form_Element_Hidden("form_name"); $oFormName->setValue(get_class()); $oFormName->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oFormName); $oNotificationTypeId = new Zend_Form_Element_MultiCheckbox("notification_type_id"); $oNotificationTypeId->setLabel("Typ:"); $oNotificationTypeId->setRequired(FALSE); $oNotificationTypeId->addMultiOptions($this->_aAllNotificationType); $this->addElement($oNotificationTypeId); $oNotificationStatusId = new Zend_Form_Element_MultiCheckbox("notification_status_id"); $oNotificationStatusId->setLabel("Status:"); $oNotificationStatusId->setRequired(FALSE); $oNotificationStatusId->addMultiOptions($this->_aAllNotificationStatus); $this->addElement($oNotificationStatusId); $oNotificationPriorityId = new Zend_Form_Element_MultiCheckbox("notification_priority_id"); $oNotificationPriorityId->setLabel("Priorytet:"); $oNotificationPriorityId->setRequired(FALSE); $oNotificationPriorityId->addMultiOptions($this->_aAllNotificationPriority); $this->addElement($oNotificationPriorityId); $oNotificationCategoryId = new Zend_Form_Element_Select("search_notification_category_id"); $oNotificationCategoryId->setLabel("Kategoria pytania:"); $oNotificationCategoryId->setRequired(FALSE); $oNotificationCategoryId->addMultiOptions($this->_aAllNotificationCategory); $this->addElement($oNotificationCategoryId); $oUserId = new Zend_Form_Element_Select("search_notification_user_id"); $oUserId->setLabel("Konsultant:"); $oUserId->setRequired(FALSE); $oUserId->addMultiOptions($this->_aAllUser); $this->addElement($oUserId); $oInitDate = new Zend_Form_Element_Text("init_date"); $oInitDate->setLabel("Data rozpoczęcia:"); $oInitDate->setRequired(FALSE); $oInitDate->setFilters($this->_aFilters); $this->addElement($oInitDate); $oBlankNotificationUserId = new Zend_Form_Element_Checkbox("search_blank_notification_user_id"); $oBlankNotificationUserId->setLabel("Pokaż nieprzydzielone zgłoszenia:"); $this->addElement($oBlankNotificationUserId); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oSubmit = $this->createElement("submit", "search_notification"); $oSubmit->setLabel("Szukaj"); $this->addElement($oSubmit); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/_defaultform.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }
public function init() { // Add hosts autocomplete $this->addElement('text', 'add_show_hosts_autocomplete', array('label' => _('Search Users:'), 'class' => 'input_text ui-autocomplete-input', 'required' => false)); $options = array(); $hosts = Application_Model_User::getHosts(); foreach ($hosts as $host) { $options[$host['index']] = $host['label']; } //Add hosts selection $hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts'); $hosts->setLabel(_('DJs:'))->setMultiOptions($options); $this->addElement($hosts); }
public function __construct($path, $minumumbal, $maximumbal) { parent::__construct($path, $minumumbal); $formfield = new App_Form_Field(); // $fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value $date = new ZendX_JQuery_Form_Element_DatePicker('date'); $date->setJQueryParam('dateFormat', 'dd/mm/yy'); $date->setAttrib('autocomplete', 'off'); $date->setRequired(true); $period = new Zend_Form_Element_Select('period'); $period->addMultiOption('', 'Select...'); $period->setRequired(true); $period->setAttrib('onchange', 'getInterests(this.value)'); $interest = new Zend_Form_Element_Text('interest'); $interest->setRequired(true); $tAmount = $formfield->field('Text', 'tAmount', '', '', 'mand amount1 number', 'Category name', true, '', '', '', '', '', 0, 0); // $tAmount = new Zend_Form_Element_Text('tAmount'); // $tAmount->setAttrib('class', 'amount1'); // $tAmount->setAttrib('class', 'number'); // $tAmount->setAttrib('readonly', true); // $tAmount->setRequired(true); $valid = new Zend_Validate_Between(array('min' => $minumumbal, 'max' => $maximumbal)); $tAmount->addValidators(array(array($valid, true))); // $tAmount->setAttrib('onchange', 'calculateMatureAmount()'); $matureamount = new Zend_Form_Element_Text('matureamount'); $matureamount->setAttrib('class', 'txt_put'); $amount = new Zend_Form_Element_Text('amount'); $amount->setAttrib('class', 'txt_put'); // $amount->setRequired(true); $amount->setAttrib('onchange', 'calculateTotalAmount(this.value),calculateMatureAmount()'); $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname'); $memberfirstname->setAttrib('class', 'textfield'); // $memberfirstname->setRequired(true); $fixedfee = new Zend_Form_Element_Text('fixedfee'); $fixedfee->setAttrib('class', 'txt_put'); $fixedfee->setAttrib('readonly', 'true'); $totalamount = new Zend_Form_Element_Text('totalamount'); $totalamount->setAttrib('class', 'txt_put'); $totalamount->setAttrib('readonly', 'true'); $memberId = new Zend_Form_Element_Hidden('memberId'); $productId = new Zend_Form_Element_Hidden('Id'); $membercode = new Zend_Form_Element_Hidden('code'); $typeId = new Zend_Form_Element_Hidden('typeId'); $Type = new Zend_Form_Element_Hidden('Type'); $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, $amount, $period, $matureamount, $interest, $tAmount, $memberfirstname, $fixedfee, $memberId, $membercode, $totalamount, $Type, $date, $productId, $typeId, $memberTypeIdv, $Yes, $back)); }
public function __construct($path, $minumumbal, $maximumbal) { parent::__construct($path, $minumumbal); $date1 = new ZendX_JQuery_Form_Element_DatePicker('date1'); $date1->setAttrib('class', 'txt_put'); $date1->setAttrib('autocomplete', 'off'); $date1->setJQueryParam('dateFormat', 'yy-mm-dd'); $date1->setRequired(true); $period = new Zend_Form_Element_Select('period'); $period->addMultiOption('', 'Select...'); $period->setAttrib('class', 'txt_put'); $period->setRequired(true); $period->setAttrib('onchange', 'getInterests("' . $path . '",this.value)'); $interest = new Zend_Form_Element_Text('interest'); $interest->setAttrib('class', 'txt_put'); // $interest->setAttrib('readonly', 'true'); $tAmount = new Zend_Form_Element_Text('tAmount'); $tAmount->setAttrib('class', 'txt_put'); $tAmount->setAttrib('onchange', 'calculateMatureAmount()'); $valid = new Zend_Validate_Between(array('min' => $minumumbal, 'max' => $maximumbal)); $tAmount->addValidators(array(array($valid, true))); $matureamount = new Zend_Form_Element_Text('matureamount'); $matureamount->setAttrib('class', 'txt_put'); $amount = new Zend_Form_Element_Text('amount'); $amount->setAttrib('class', 'txt_put'); // $amount->setRequired(true); $amount->setAttrib('onchange', 'calculateTotalAmount(this.value),calculateMatureAmount()'); $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname'); $memberfirstname->setAttrib('class', 'textfield'); // $memberfirstname->setRequired(true); $fixedfee = new Zend_Form_Element_Text('fixedfee'); $fixedfee->setAttrib('class', 'txt_put'); $fixedfee->setAttrib('readonly', 'true'); $totalamount = new Zend_Form_Element_Text('totalamount'); $totalamount->setAttrib('class', 'txt_put'); $totalamount->setAttrib('readonly', 'true'); $memberId = new Zend_Form_Element_Hidden('memberId'); $productId = new Zend_Form_Element_Hidden('Id'); $membercode = new Zend_Form_Element_Hidden('code'); $typeId = new Zend_Form_Element_Hidden('typeId'); $Type = new Zend_Form_Element_Hidden('Type'); $memberTypeIdv = new Zend_Form_Element_Hidden('memberTypeIdv'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setRequired(false); $Yes = new Zend_Form_Element_Submit('Yes'); $back = new Zend_Form_Element_Submit('Back'); $this->addElements(array($submit, $amount, $period, $matureamount, $interest, $tAmount, $memberfirstname, $fixedfee, $memberId, $membercode, $totalamount, $Type, $date1, $productId, $typeId, $memberTypeIdv, $Yes, $back)); }
public function init() { $this->setAction(url('facet-by-metadata')); $elTable = get_db()->getTable('Element'); $elements = array(); $elementIds = json_decode(get_option('facet_by_metadata_elements'), true); foreach ($elementIds as $elementId) { $element = $elTable->find($elementId); $elements[$elementId] = metadata($element, 'name') . ': ' . metadata($this->item, array($element->getElementSet()->name, $element->name)); } $checkboxes = new Zend_Form_Element_MultiCheckbox('elements'); $checkboxes->setMultiOptions($elements); $this->addElement($checkboxes); $this->addElement('hidden', 'item_id', array('value' => $this->item->id)); $this->addElement('submit', __('Find')); }
/** * create the form to change permission * * in this form we can set the acl roles, which are allowed or denied * for this action * * @param Admin_Model_DbRow_Controller $controller * @param Admin_Model_DbRow_Action $action * @param array $roles array of Admin_Model_DbTable_Acl_Role Objects * @param array $rulesAllow * @param array $rulesDeny */ public function __construct(Admin_Model_DbRow_Controller $controller, Admin_Model_DbRow_Action $action, array $roles, array $rulesAllow, array $rulesDeny) { parent::__construct($controller); $rolesAllow = new Zend_Form_Element_MultiCheckbox('rolesallow', array('label' => 'Allow access', 'order' => 7)); $rolesDeny = new Zend_Form_Element_MultiCheckbox('rolesdeny', array('label' => 'Explicit Deny Access', 'order' => 8)); foreach ($roles as $role) { $rolesAllow->addMultiOption($role->get('id'), $role->get('name')); $rolesDeny->addMultiOption($role->get('id'), $role->get('name')); } $rolesAllow->setValue($rulesAllow); $rolesDeny->setValue($rulesDeny); $this->addElements(array($rolesAllow, $rolesDeny, new Zend_Form_Element_Hidden('id', array('required' => true, 'value' => $action->get('id'), 'order' => 11)))); // remove description element (from base form) $this->removeElement('description'); $this->getElement('action')->setValue($action->get('actionName')); }
/** * */ public function getmodulesForm() { $this->setName('safinstancesModules'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbuttonc'); $safinstancesSafmodules = new Zend_Form_Element_MultiCheckbox('SafinstancesSafmodules'); $safinstancesSafmodules->setLabel('SafinstancesSafmodules'); $options = new Safmodules(); // AND isalwaysactive != 1 foreach ($options->fetchAll("istechnical != 1 AND name LIKE 'admin%' ", 'label') as $k) { $safinstancesSafmodules->addMultiOption($k->id, $k->label); } $this->addElements(array($this->idb, $this->hashb, $safinstancesSafmodules)); $this->addElements(array($submit)); return $this; }
public function init() { $reply_to = new Zend_Form_Element_Text('reply_to'); $reply_to->setLabel('Reply To')->setAttribs(array('style' => 'width:550px !important;'))->setRequired(true)->addValidator('NotEmpty'); $html_signature = new Zend_Form_Element_Text('html_signature'); $html_signature->setLabel('Html Signature')->setAttribs(array('style' => 'width:550px !important;'))->setRequired(true)->addValidator('NotEmpty'); $primary_phone = new Zend_Form_Element_Text('primary_phone'); $primary_phone->setLabel('Primary Phone')->setAttribs(array('style' => 'width:250px !important;'))->setRequired(true)->addValidator(new Zend_Validate_Digits(isValid("+1234567890"))); $cell_phone = new Zend_Form_Element_Text('cell_phone'); $cell_phone->setLabel('Cell Phone')->setAttribs(array('style' => 'width:250px !important;'))->setRequired(true)->addValidator(new Zend_Validate_Digits(isValid("+1234567890"))); $fax = new Zend_Form_Element_Text('fax'); $fax->setLabel('Fax')->setAttribs(array('style' => 'width:250px !important;'))->setRequired(true)->addValidator('NotEmpty'); $company = new Zend_Form_Element_Text('company'); $company->setLabel('Company')->setAttribs(array('style' => 'width:550px !important;'))->setRequired(true)->addValidator('NotEmpty'); $address = new Zend_Form_Element_Text('address'); $address->setLabel('Address')->setAttribs(array('style' => 'width:550px !important;'))->setRequired(true)->addValidator('NotEmpty'); $address2 = new Zend_Form_Element_Text('address2'); $address2->setLabel('Address2')->setAttribs(array('style' => 'width:550px !important;'))->setRequired(true)->addValidator('NotEmpty'); $city = new Zend_Form_Element_Text('city'); $city->setLabel('City')->setAttribs(array('style' => 'width:250px !important;'))->setRequired(true)->addValidator('NotEmpty'); $state = new Zend_Form_Element_Text('state'); $state->setLabel('State')->setAttribs(array('style' => 'width:250px !important;'))->setRequired(true)->addValidator('NotEmpty'); $zip = new Zend_Form_Element_Text('zip'); $zip->setLabel('Zip')->setAttribs(array('style' => 'width:150px !important;'))->setRequired(true)->addValidator(new Zend_Validate_Digits(isValid("1234567890"))); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email')->setAttribs(array('style' => 'width:350px !important;'))->setRequired(true)->addValidator('EmailAddress', TRUE); $report_template_id = new Zend_Form_Element_Select('report_template_id'); $report_template_id->setLabel('Report Template')->setRequired(true)->setMultiOptions(Jameen_ReportsTemplates::getMultiList()); $followup_template_id = new Zend_Form_Element_Select('followup_template_id'); $followup_template_id->setLabel('Followup Template')->setRequired(true)->setMultiOptions(Jameen_FollowupemailTemplates::getMultiList()); $followup_enabled = new Zend_Form_Element_MultiCheckbox('followup_enabled'); $followup_enabled->setLabel('Followup Enabled')->setRequired(true)->setAttribs(array('style' => 'width:53px !important;'))->addMultiOptions(array('checkedValue' => false)); $sms_enabled = new Zend_Form_Element_MultiCheckbox('sms_enabled'); $sms_enabled->setLabel('Sms Enabled')->setRequired(true)->setAttribs(array('style' => 'width:53px !important;'))->addMultiOptions(array('checkedValue' => false)); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('submit'); $this->addElements(array($reply_to, $html_signature, $primary_phone, $cell_phone, $fax, $company, $address, $address2, $city, $state, $zip, $email, $report_template_id, $followup_template_id, $followup_enabled, $sms_enabled)); /* $this->setElementDecorators(array( array('ViewHelper'), array('Label'), array('Errors', array('class'=>'error')), )); */ $this->setElementDecorators(array('ViewHelper', array(array('wrapperField' => 'HtmlTag'), array('tag' => 'div', 'class' => 'controls cont')), array('Label', array('placement' => 'prepend', 'class' => 'control-label')))); $this->setAttribs(array('action' => '')); }
public function __construct($spec, $aOptions = array()) { if (isset($aOptions['ajax'])) { $this->_ajax = $aOptions['ajax']; unset($aOptions['ajax']); } parent::__construct($spec, $aOptions); }
public function __construct() { Zend_Dojo::enableForm($this); $grantname = new Zend_Form_Element_Text('grantname'); $grantname->setRequired(true)->addValidators(array(array('NotEmpty'))); $grantname->addValidator('StringLength', false, array(6, 15)); $id = new Zend_Form_Element_Hidden('id' . $i); $activity_id = new Zend_Form_Element_MultiCheckbox('activity_id'); $activity_id->setAttrib('id', 'activity_id'); $subactivity_id = new Zend_Form_Element_MultiCheckbox('subactivity_id'); $subactivity_id->setAttrib('id', 'subactivity_id'); $grant_id = new Zend_Form_Element_Hidden('grant_id'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('class', 'roles'); $submit->setLabel('Submit'); $this->addElements(array($submit, $grantname, $grant_id, $id, $activity_id, $subactivity_id)); }
public function init() { $this->setTitle('Message Settings')->setDescription('Specify what messaging options will be available to members in this level.'); $this->loadDefaultDecorators(); $this->getDecorator('Description')->setOptions(array('tag' => 'h4', 'placement' => 'PREPEND')); $send = new Zend_Form_Element_MultiCheckbox('send'); $send->setLabel('Who can users send private messages to?')->setDescription("If you don't want to allow private messaging, de-select all options below.")->setMultiOptions(array('registered' => 'All Registered Members', 'network' => 'Users in the same network', 'members' => 'Friends')); $send->getDecorator('Description')->setOption('placement', 'PREPEND'); $submit = new Zend_Form_Element_Button('submit', array('type' => 'submit')); $submit->setLabel('Edit Level')->setIgnore(true); $level_id = new Zend_Form_Element_Hidden('level_id'); $level_id->addValidator('Int')->addValidator('DbRecordExists', array('table' => Engine_Api::_()->getDbtable('levels', 'authorization'), 'field' => 'level_id')); // Add elements $this->addElements(array($send, $level_id, $submit)); // Set element type classes //Engine_Form::setFormElementTypeClasses($this); }
public function __construct($options = null) { $this->_disabledDefaultActions = false; unset($options['object']); parent::__construct($options); $label = new Cible_Form_Element_Html('txtAddToNewsletter', array('value' => $this->getView()->getCibleText('profile_addto_newletter_label'))); $label->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'h2')))); $newsletterCategories = $this->getView()->GetAllNewsletterCategories(); $newsletterCategories = $newsletterCategories->toArray(); foreach ($newsletterCategories as $cat) { $catLst[$cat['C_ID']] = $cat['CI_Title']; } $chkCat = new Zend_Form_Element_MultiCheckbox("NP_Categories"); $chkCat->addMultiOptions($catLst); $chkCat->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'id' => '', 'class' => 'label_after_checkbox')))); $this->addElement($label); $this->addElement($chkCat); }
/** * Configure user form. * * @return void */ public function init() { // form config $this->setMethod('POST'); $this->setAction('/test/add'); $this->setAttrib('id', 'testForm'); /** * Add class to form for label alignment * * - Vertical .form-vertical (not required) Stacked, left-aligned labels over controls (default) * - Inline .form-inline Left-aligned label and inline-block controls for compact style * - Search .form-search Extra-rounded text input for a typical search aesthetic * - Horizontal .form-horizontal * * Use .form-horizontal to have same experience as with Bootstrap v1! */ $this->setAttrib('class', 'form-horizontal'); // create elements $userId = new Zend_Form_Element_Hidden('id'); $mail = new Zend_Form_Element_Text('email'); $name = new Zend_Form_Element_Text('name'); $radio = new Zend_Form_Element_Radio('radio'); $multi = new Zend_Form_Element_MultiCheckbox('multi'); $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'Figlet')); $submit = new Zend_Form_Element_Button('submit'); $cancel = new Zend_Form_Element_Button('cancel'); // config elements $userId->addValidator('digits'); $mail->setLabel('Mail:')->setRequired(true)->addValidator('emailAddress'); $name->setLabel('Name:')->setRequired(true); $radio->setLabel('Radio:')->setMultiOptions(array('1' => PHP_EOL . 'test1', '2' => PHP_EOL . 'test2'))->setRequired(true); $multiOptions = array('view' => PHP_EOL . 'view', 'edit' => PHP_EOL . 'edit', 'comment' => PHP_EOL . 'comment'); $multi->setLabel('Multi:')->addValidator('Alpha')->setMultiOptions($multiOptions)->setRequired(true); $captcha->setLabel('Captcha:')->setRequired(true)->setDescription("This is a test"); $submit->setLabel('Save'); $cancel->setLabel('Cancel'); // add elements $this->addElements(array($userId, $mail, $name, $radio, $multi, $captcha, $submit, $cancel)); // add display group $this->addDisplayGroup(array('email', 'name', 'radio', 'multi', 'captcha', 'submit', 'cancel'), 'users'); $this->getDisplayGroup('users')->setLegend('Add User'); // set decorators EasyBib_Form_Decorator::setFormDecorator($this, EasyBib_Form_Decorator::BOOTSTRAP, 'submit', 'cancel'); }
protected function createToElement() { $valid = array(); $invalid = array(); $options = array(); foreach ($this->multipleTokenData as $tokenData) { if ($tokenData['can_email']) { $disabled = false; $valid[] = $tokenData['gto_id_token']; } else { $disabled = true; $invalid[] = $tokenData['gto_id_token']; } $options[$tokenData['gto_id_token']] = $this->createToText($tokenData, $disabled); } $element = new \Zend_Form_Element_MultiCheckbox('token_select', array('disable' => $invalid, 'escape' => !$this->view, 'label' => $this->_('To'), 'multiOptions' => $options, 'required' => true)); $element->addValidator('InArray', false, array('haystack' => $valid)); return $element; }
public function init($subadmin_id) { global $mySession; $db = new Db(); $first_name_value = ""; $last_name_value = ""; $emailID_value = ""; $username_value = ""; $password_value = ""; $status_value = '1'; if ($subadmin_id != "") { $SubsData = $db->runQuery("select * from " . SUBADMIN . " where subadmin_id='" . $subadmin_id . "'"); $first_name_value = $SubsData[0]['first_name']; $last_name_value = $SubsData[0]['last_name']; $emailID_value = $SubsData[0]['emailID']; $username_value = $SubsData[0]['username']; $password_value = $SubsData[0]['password']; $status_value = $SubsData[0]['status']; $priv = $SubsData[0]['priviledges']; $priv = explode(",", $priv); } $first_name = new Zend_Form_Element_Text('first_name'); $first_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Subadmin first name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("style", "text-input medium-input")->setValue($first_name_value); $last_name = new Zend_Form_Element_Text('last_name'); $last_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Subadmin last name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "text-input medium-input")->setValue($last_name_value); $emailID = new Zend_Form_Element_Text('emailID'); $emailID->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Subadmin email address is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "text-input medium-input")->setValue($emailID_value); $username = new Zend_Form_Element_Text('username'); $username->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Subadmin username is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "text-input medium-input")->setValue($username_value); $password = new Zend_Form_Element_Password('password'); $password->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Subadmin password is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "text-input medium-input")->setValue($password_value); $StatusArr = array(); $StatusArr[0]['key'] = "0"; $StatusArr[0]['value'] = "Disable"; $StatusArr[1]['key'] = "1"; $StatusArr[1]['value'] = "Enable"; $status = new Zend_Form_Element_Select('status'); $status->addMultiOptions($StatusArr)->setAttrib("class", "textInput")->setValue($status_value); $priviledges = new Zend_Form_Element_MultiCheckbox('priviledges'); $priviledges->setRequired(true)->addMultiOption('configuration', 'Configuration')->addMultiOption('emailtemplates', 'Email Templates')->addMultiOption('generalsettings', 'General Settings')->addMultiOption('cmspages', 'CMS Pages')->addMultiOption('subscription', 'Subscription')->addMultiOption('calender', 'Calender')->addMultiOption('users', 'Users')->addMultiOption('blogs', 'Blogs')->addMultiOption('documents', 'Documents')->addMultiOption('action', 'Action Management')->addMultiOption('products', 'Products Management')->addMultiOption('messages', 'Messages')->addMultiOption('changepass', 'Change Password')->setValue($priv); $this->addElements(array($first_name, $last_name, $emailID, $username, $password, $status, $priviledges)); }
public function init() { /* Form Elements & Other Definitions Here ... */ /* $tablaOpcion = new Encuesta_Model_DbTable_Opcion; $rowsetOpciones = $tablaOpcion->fetchAll(); //$eOpciones = new Zend_Form_Element_Multiselect("opciones"); $eOpciones = new Zend_Form_Element_MultiCheckbox("opciones"); $eOpciones->setLabel("Opciones Disponibles:"); //$eOpciones->setAttrib("class", "form-control"); foreach ($rowsetOpciones as $opcion) { $eOpciones->addMultiOption($opcion->idOpcion, $opcion->opcion); } $eSubmit = new Zend_Form_Element_Submit("submit"); $eSubmit->setLabel("Guardar Opciones"); $eSubmit->setAttrib("class", "btn btn-success"); $this->addElement($eOpciones); $this->addElement($eSubmit); */ $categoriaDAO = new Encuesta_DAO_Categoria(); $opcionDAO = new Encuesta_DAO_Opcion(); $modelCategorias = $categoriaDAO->obtenerCategorias(); foreach ($modelCategorias as $modelCategoria) { $sub = new Zend_Form_SubForm(); $sub->setLegend($modelCategoria->getCategoria() . " :: " . $modelCategoria->getDescripcion()); $modelOpciones = $categoriaDAO->obtenerOpciones($modelCategoria->getIdCategoria()); $eElement = new Zend_Form_Element_MultiCheckbox($modelCategoria->getIdCategoria()); foreach ($modelOpciones as $modelOpcion) { $eElement->addMultiOption($modelOpcion->getIdOpcion(), $modelOpcion->getOpcion()); } $sub->addElement($eElement); $this->addSubForm($sub, $modelCategoria->getIdCategoria()); } $eSubmit = new Zend_Form_Element_Submit("submit"); $eSubmit->setLabel("Guardar Opciones"); $eSubmit->setAttrib("class", "btn btn-success"); $this->addElement($eSubmit); }
function init() { parent::init(); $social = HTS_Api::getInstance()->getSocialPlugin(); $name = $social->getName(); $viewPath = HTS_PATH . '/' . $name . '/views/scripts/' . strtolower($name); $view = $this->getView(); $view->addScriptPath($viewPath); $this->setMultiOptions($social->getPageList()); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'loadFanpages.phtml')))); }
public function __construct($beginDate, $matureDate, $minimumDeposit, $maxmDeposit, $app) { Zend_Dojo::enableForm($this); parent::__construct($beginDate, $matureDate, $minimumDeposit, $maxmDeposit); $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname'); $memberfirstname->setAttrib('class', 'txt_put'); $memberfirstname->setRequired(true); $savingAccount = new Zend_Form_Element_multiCheckbox('savingAccount'); $savingAccount->setAttrib('class', 'txt_put'); // $savingAccount->setRequired(true); $startdate = new ZendX_JQuery_Form_Element_DatePicker('loanAccountdate', array('label' => 'Date:')); $startdate->setJQueryParam('dateFormat', 'yy-mm-dd'); $startdate->setAttrib('size', '8'); $startdate->setAttrib('class', 'txt_put'); $startdate->setRequired(true); $amount = new Zend_Form_Element_Text('amount'); $amount->setRequired(true); $amount->addValidator('Float'); $amount->setAttrib('size', '8'); $amount->setAttrib('class', 'txt_put'); $amount->setAttrib('onchange', 'calculateTotalAmount(this.value)'); $loanInstallements = new Zend_Form_Element_Select('loanInterest'); $loanInstallements->addMultiOption('', 'Select...'); $loanInstallements->setAttrib('class', 'txt_put'); $loanInstallements->setAttrib('id', 'loanInterest'); $loanInstallements->setRequired(true); $loanInstallements->setAttrib('onchange', 'getInterests(this.value,"' . $app . '")'); $interest = new Zend_Form_Element_Text('interest'); $interest->setAttrib('class', 'txt_put'); $interest->setAttrib('id', 'interest'); $interest->setAttrib('size', '8'); $this->addElements(array($memberfirstname, $interest, $startdate, $amount, $loanInstallements)); $submit = new Zend_Form_Element_Submit('Submit'); $memberId = new Zend_Form_Element_Hidden('memberId'); $productId = new Zend_Form_Element_Hidden('productId'); $typeId = new Zend_Form_Element_Hidden('typeId'); $Type = new Zend_Form_Element_Hidden('Type'); $back = new Zend_Form_Element_Submit('Back'); $Yes = new Zend_Form_Element_Submit('Yes'); $this->addElements(array($submit, $memberId, $productId, $savingAccount, $typeId, $Type, $back, $Yes)); }
public function __construct($app) { Zend_Dojo::enableForm($this); parent::__construct($app); $office_id = new Zend_Form_Element_Select('office_id'); $office_id->addMultiOption('', 'Select...'); $office_id->setAttrib('class', 'txt_put'); $office_id->setAttrib('id', 'office_id'); $office_id->setAttrib('onchange', 'getGroups(this.value,"' . $app . '"),getMember(this.value,"' . $app . '")'); $groupname = new Zend_Form_Element_Text('groupname'); $groupname->setAttrib('id', 'groupname'); $groupname->setAttrib('class', 'txt_put'); //$groupname->setAttrib('size', '14'); $groupaddress_line1 = new Zend_Form_Element_Text('groupaddress_line1'); $groupaddress_line1->setAttrib('id', 'groupaddress_line1'); $groupaddress_line1->setAttrib('class', 'txt_put'); //$groupaddress_line1->setAttrib('size', '14'); $groupaddress_line2 = new Zend_Form_Element_Text('groupaddress_line2'); $groupaddress_line2->setAttrib('id', 'groupaddress_line2'); $groupaddress_line2->setAttrib('class', 'txt_put'); //$groupaddress_line2->setAttrib('size', '14'); $groupaddress_line3 = new Zend_Form_Element_Text('groupaddress_line3'); $groupaddress_line3->setAttrib('id', 'groupaddress_line3'); $groupaddress_line3->setAttrib('class', 'txt_put'); //$groupaddress_line3->setAttrib('size', '14'); $groupaddress_location = new Zend_Form_Element_Text('groupaddress_location'); $groupaddress_location->setAttrib('id', 'groupaddress_location'); $groupaddress_location->setAttrib('class', 'txt_put'); //$groupaddress_location->setAttrib('size', '14'); $groupname1 = new Zend_Form_Element_MultiCheckbox('groupname1'); $groupname1->setAttrib('id', 'groupname1'); $groupname1->setAttrib('class', 'txt_put'); $groupname1->setAttrib('disabled', 'true'); $member_id = new Zend_Form_Element_MultiCheckbox('member_id'); $member_id->setAttrib('id', 'member_id'); $member_id->setAttrib('class', 'txt_put'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('class', 'groups'); $submit->setlabel('submit'); $this->addElements(array($office_id, $groupname, $groupaddress_line1, $groupaddress_line2, $groupaddress_line3, $groupaddress_location, $member_id, $groupname1, $submit)); }
public function init() { $this->setMethod('post'); $this->setAttrib('action', DOMAIN . 'empscreening/add'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'empscreening'); $id = new Zend_Form_Element_Hidden('id'); $employee = new Zend_Form_Element_Select('employee'); $employee->setLabel('employee'); $employee->setRequired(true)->addErrorMessage('Please select employee.'); $employee->setAttrib('onchange', 'getemployeeData(this)'); $employee->setRegisterInArrayValidator(false); $bgcheck_status = new Zend_Form_Element_Select('bgcheck_status'); $bgcheck_status->setLabel('employee'); $bgcheck_status->setRequired(true)->addErrorMessage('Please select bgcheck status.'); $bgcheck_status->addMultiOption('0', 'Select status'); $bgcheck_status->addMultiOption('In process', 'In process'); $bgcheck_status->addMultiOption('On hold', 'On hold'); $bgcheck_status->addMultiOption('Complete', 'Complete'); $bgcheck_status->setRegisterInArrayValidator(false); $checktype = new Zend_Form_Element_MultiCheckbox('checktype'); $checktype->setAttrib('onclick', 'displayAgencyList()'); $bgcheckModal = new Default_Model_Bgscreeningtype(); $checktypesData = $bgcheckModal->fetchAll('isactive=1', 'type'); foreach ($checktypesData->toArray() as $data) { $checktype->addMultiOption($data['id'], $data['type']); } $checktype->setSeparator(PHP_EOL); $checkagency = new Zend_Form_Element_Hidden('checkagency'); $agency = new Zend_Form_Element_Hidden('agencyids'); $agencyData = Zend_Controller_Front::getInstance()->getRequest()->getParam('checkagency', null); if ($agencyData == 'checked') { $agency->setRequired(true); $agency->addValidator('NotEmpty', false, array('messages' => 'Please select agency.')); } $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $employee, $bgcheck_status, $checkagency, $checktype, $agency, $submit)); $this->setElementDecorators(array('ViewHelper')); }
public function getForm() { $form = new Zend_Form(); $form->setMethod('post'); $form->setDecorators(array(array('ViewScript', array('viewScript' => 'reports/report1Form.phtml')))); $items = $this->getPeriodItems('REQ_MOZ_CONTMOVEMENT'); $e = new Zend_Form_Element_Select('period', array('label' => 'Період', 'multiOptions' => $items, 'required' => true)); $form->addElement($e); $items = $this->getGuideItems('T_STRUCTURE_ITEM', true, false, 'CT.TITLE'); $e = new Zend_Form_Element_Select('establishment', array('label' => 'Установа', 'multiOptions' => $items)); $form->addElement($e); $items = $this->getGuideItems('T_EDUFORM', true); $e = new Zend_Form_Element_Select('eduform', array('label' => 'Форма навчання', 'multiOptions' => $items)); $form->addElement($e); $items = $this->getGuideItems('T_EDUBASIS', true); $e = new Zend_Form_Element_Select('edubase', array('label' => 'Форма фінансування', 'multiOptions' => $items)); $form->addElement($e); $items = $this->getGuideItems('T_COUNTRY', true); $e = new Zend_Form_Element_Select('country', array('label' => 'Громадянство (країна)', 'multiOptions' => $items)); $form->addElement($e); $items = $this->getGuideItems('T_COUNTRYTYPE', true); $e = new Zend_Form_Element_Select('countrytype', array('label' => 'Тип громадянства', 'multiOptions' => $items)); $form->addElement($e); $items = $this->getGuideItems('T_EDULEVEL'); $e = new Zend_Form_Element_MultiCheckbox('edulevel', array('label' => 'Рівень підготовки', 'multiOptions' => $items)); $e->setValue(array_keys($items)); $form->addElement($e); $refreshAct = Zend_Controller_Action_HelperBroker::getStaticHelper('url')->url(array('controller' => 'page', 'action' => 'show')); $e = new Zend_Form_Element_Submit('refresh', array('label' => 'Обновити', 'onclick' => "document.forms[0].action='{$refreshAct}'")); $form->addElement($e); $excelAct = Zend_Controller_Action_HelperBroker::getStaticHelper('url')->url(array('controller' => 'reports', 'action' => 'excel', 'report' => 1)); $e = new Zend_Form_Element_Submit('excel', array('label' => 'Excel', 'onclick' => "document.forms[0].action='{$excelAct}'")); $form->addElement($e); $form->setElementDecorators(array('ViewHelper', 'Errors')); $auth = Zend_Auth::getInstance(); $ident = $auth->getIdentity(); if ($ident->STRUCTURE_CODE != 0) { $form->getElement('establishment')->setValue($ident->STRUCTUREID); } return $form; }