Example #1
0
 public function __construct($minimumDeposit)
 {
     parent::__construct($minimumDeposit);
     $savings_amount = new Zend_Form_Element_Text('savings_amount');
     $savings_amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum 
                                          Amount To open a savings account =' . $minimumDeposit)))));
     $savings_amount->setAttrib('class', 'txt_put');
     $savings_amount->setAttrib('id', 'amount');
     $savings_amount->setRequired(true);
     $savings_amount->setAttrib('onchange', 'calculateTotalAmount(this.value)');
     $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname');
     $memberfirstname->setAttrib('class', 'textfield');
     $memberfirstname->setAttrib('id', 'selector');
     //         $memberfirstname->setRequired(true);
     $date1 = new ZendX_JQuery_Form_Element_DatePicker('date1', array('label' => 'Date:'));
     $date1->setAttrib('class', 'txt_put');
     $date1->setJQueryParam('dateFormat', 'yy-mm-dd');
     $date1->setRequired(true);
     $memberId = new Zend_Form_Element_Hidden('memberId');
     $Type = new Zend_Form_Element_Hidden('Type');
     $productId = new Zend_Form_Element_Hidden('productId');
     $typeId = new Zend_Form_Element_Hidden('typeId');
     $memberTypeIdv = new Zend_Form_Element_Hidden('memberTypeIdv');
     $submit = new Zend_Form_Element_Submit('Submit');
     $Yes = new Zend_Form_Element_Submit('Yes');
     $back = new Zend_Form_Element_Submit('Back');
     $this->addElements(array($submit, $savings_amount, $memberfirstname, $memberId, $date1, $productId, $typeId, $Type, $memberTypeIdv, $back, $Yes));
 }
 public function __construct($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));
 }
Example #3
0
 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));
 }
Example #4
0
 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));
 }
Example #5
0
 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));
 }
Example #6
0
 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));
 }
Example #7
0
 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));
 }
Example #8
0
 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'));
 }
Example #9
0
 public function init()
 {
     // 		$category_id = new Zend_Form_Element_Select('category_id');
     // 		$category_id->addMultiOption('','Select...');
     // 		$category_id->setAttrib('class', 'txt_put')
     // 					->setLabel('Credit Line');
     // 		$category_id->setRequired(true)
     // 					->addValidators(array(array('NotEmpty')))
     // 					->setDecorators(array('ViewHelper',
     // 						array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 						array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 						array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 						array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     $sectortname = new Zend_Form_Element_Text('productname');
     $sectortname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productdetails', 'productname'));
     $sectortname->setAttrib('class', 'txt_put')->setLabel('Sector Name');
     $sectortname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $product_id = new Zend_Form_Element_Hidden('product_id');
     $product_id->setAttrib('class', 'txt_put');
     $sectorshortname = new Zend_Form_Element_Text('productshortname');
     $sectorshortname->setAttrib('class', 'txt_put')->setLabel('Sector Short Name');
     $sectorshortname->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(1, 3))))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $sector_description = new Zend_Form_Element_Textarea('product_description', array('rows' => 3, 'cols' => 20));
     $sector_description->setAttrib('class', '')->setLabel('Sector description');
     $sector_description->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $bank_id = new Zend_Form_Element_MultiCheckbox('bank_id');
     $bank_id->setAttrib('class', 'txt_put')->setLabel('Bank  Name');
     $bank_id->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td', 'requiredSuffix' => ' *')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $this->addElements(array($category_id, $sectortname, $sectorshortname, $sector_description, $product_id, $bank_id));
     // 			$cust = new settings_Model_Customization();
     // 			$sample = $cust->fetchcustomized("ourbank_customizingform",9);
     // 			foreach($sample as $cust1) {
     // 				switch($cust1['feild_type']) {
     // 					case "text" : $Instance = new Zend_Form_Element_Text($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$Instance->setAttrib('size','8');
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "radio" :  $Instance = new Zend_Form_Element_Radio($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$appliesTo = $cust->getTableInfo($cust1['table_name']);
     // 						foreach ($appliesTo as $gracePeriodRow) {
     // 							$radioValues[current($gracePeriodRow)] = end($gracePeriodRow);
     // 						}
     // 						$Instance->setMultiOptions($radioValues);
     // 						unset($radioValues);
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "select" : $Instance = new Zend_Form_Element_Select($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$appliesTo = $cust->getTableInfo($cust1['table_name']);
     // 						foreach ($appliesTo as $gracePeriodRow) {
     // 							$radioValues[current($gracePeriodRow)] = end($gracePeriodRow);
     // 						}
     // 						$Instance->setMultiOptions($radioValues);
     // 						unset($radioValues);
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "description" : $Instance = new Zend_Form_Element_Textarea($cust1['feild_name'], array('rows' => 3,'cols' => 20,));
     // 						$Instance->setLabel($cust1['display_name']);
     // 						if ($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     //
     // 					case "checkbox" : $Instance = new Zend_Form_Element_MultiCheckbox($cust1['feild_name']);
     // 						$Instance->setLabel($cust1['display_name']);
     // 						$appliesTo = $cust->getTableInfo($cust1['table_name']);
     // 						foreach ($appliesTo as $gracePeriodRow) {
     // 							$radioValues[current($gracePeriodRow)] = end($gracePeriodRow);
     // 						}
     // 						$Instance->setMultiOptions($radioValues);
     // 						unset($radioValues);
     // 						if($cust1['feild_name'])
     // 							$Instance->setRequired(true)
     // 									->setDecorators(array('ViewHelper',
     // 									array('Description',array('tag'=>'','escape'=>false)),'Errors',
     // 									array(array('data'=>'HtmlTag'), array('tag' => 'td')),
     // 									array('Label', array('tag' => 'td','requiredSuffix' => ' *',)),
     // 									array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
     // 					break;
     // 				}
     // 				$this->addElements(array($Instance));
     // 			}
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('id', 'save')->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('colspan' => '8 ')), array(array('data' => 'HtmlTag'), array('tag' => 'td ', 'colspan' => '8')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $this->addElements(array($submit));
 }
Example #10
0
 /**
  * Defines and build an input field which is not a text field.
  * According to the parameter elem, it will set the element.
  *
  * $params['exclude']   => boolean; The column will not be built.<br />
  * $params['required '] => boolean;<br />
  * $params['elem']      => select, checkbox, radio, editor;<br />
  *                         If $params['elem'] = select, then the $params['src']<br />
  *                         parameter must be defined.
  * $params['src']       => string; name of the source for the element.<br />
  *
  * @param array $meta
  * @param array $params
  *
  * @return void
  */
 public function setElementInput(array $meta, array $params)
 {
     if (!empty($params)) {
         if (!isset($params['elem'])) {
             $params['elem'] = '';
         }
         $fieldId = $meta['COLUMN_NAME'];
         switch ($params['elem']) {
             case 'select':
                 if (empty($params['src'])) {
                     throw new Exception('Trying to build an element but no data source given');
                 }
                 $this->_defineSrc($params, $meta);
                 $element = new Zend_Form_Element_Select($fieldId);
                 $element->setLabel($this->getView()->getCibleText('form_label_' . $fieldId))->setAttrib('class', 'largeSelect')->addMultiOptions($this->_srcData);
                 $element = $this->_setBasicDecorator($element);
                 break;
             case 'checkbox':
                 $element = new Zend_Form_Element_Checkbox($fieldId);
                 $element->setLabel($this->getView()->getCibleText('form_label_' . $fieldId));
                 $this->_decoParams['class'] .= 'label_after_checkbox';
                 $this->_decoParams['labelPos'] = 'append';
                 $element = $this->_setBasicDecorator($element);
                 break;
             case 'radio':
                 $this->_defineSrc($params, $meta);
                 $element = new Zend_Form_Element_Radio($fieldId);
                 $element->setLabel($this->getView()->getCibleText('form_label_' . $fieldId));
                 $element->setSeparator('')->addMultiOptions($this->_srcData);
                 $this->_decoParams['class'] .= 'radio radioInline';
                 $element = $this->_setBasicDecorator($element);
                 break;
             case 'hidden':
                 $element = new Zend_Form_Element_Hidden($fieldId);
                 $element->removeDecorator('Label');
                 $element->removeDecorator('DtDdWrapper');
                 break;
             case 'multiCheckbox':
                 if (empty($params['src'])) {
                     throw new Exception('Trying to build an element but no data source given');
                 }
                 $this->_defineSrc($params, $meta);
                 $element = new Zend_Form_Element_MultiCheckbox($fieldId);
                 $element->addMultiOptions($this->_srcData);
                 $element->setLabel($this->getView()->getCibleText('form_label_' . $fieldId));
                 $element->setAttrib('class', 'multicheckbox');
                 $element->setSeparator(' ');
                 $element = $this->_setBasicDecorator($element);
                 break;
             case 'multiSelect':
                 break;
             default:
                 $element = new Zend_Form_Element_Text($fieldId);
                 $element->setLabel($this->getView()->getCibleText('form_label_' . $fieldId))->addFilter('StringTrim')->setAttrib('class', 'smallTextInput');
                 $element = $this->_setBasicDecorator($element);
                 break;
         }
         if (!empty($params['disabled'])) {
             $element->setAttrib('disabled', (bool) $params['disabled']);
         }
         $this->addElement($element);
     }
 }