public function __construct($options = null) { $this->_disabledDefaultActions = true; $readOnly = $options['readOnlyForm']; $payement = $options['payMean']; $config = Zend_Registry::get('config'); unset($options['readOnlyForm']); unset($options['payMean']); parent::__construct($options); $this->setAttrib('id', 'accountManagement'); $buttonLabel = $this->getView()->getClientText('form_label_confirm_order_btn'); if (in_array($payement, array('visa', 'mastercard'))) { $this->setAction($config->payment->url); $buttonLabel = $this->getView()->getClientText('form_label_confirm_payment_btn'); } $baseDir = $this->getView()->baseUrl(); // Account data summary $summary = new Cible_Form_Element_Html('summary', array('value' => $readOnly)); $summary->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline left')))); $this->addElement($summary); $storeId = new Zend_Form_Element_Hidden('ps_store_id', array('value' => $config->payment->storeId)); $storeId->removeDecorator('label'); $this->addElement($storeId); $hppKey = new Zend_Form_Element_Hidden('hpp_key', array('value' => $config->payment->hppkey)); $hppKey->removeDecorator('label'); $this->addElement($hppKey); $total = new Zend_Form_Element_Hidden('charge_total'); $total->removeDecorator('label'); $this->addElement($total); // Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($buttonLabel)->setAttrib('class', 'nextStepButton')->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'stepBottomNext')))); $this->addElement($submit); }
public function __construct($options = null) { $data = $options['data']; unset($options['data']); parent::__construct($options); foreach ($data as $name => $value) { $tmp = explode('_', $name); $text = array_pop($tmp) . ' : ' . $value; $elem = new Cible_Form_Element_Html($name, array('value' => $text)); $elem->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline left')))); $this->addElement($elem); } }
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); }
public function __construct($options = null) { // $this->_disabledDefaultActions = true; // $this->_object = $options['object']; unset($options['object']); parent::__construct($options); // Subform for the retailer status on website $retailerForm = new Cible_Form_SubForm(); $retailerForm->setName('retailerForm')->removeDecorator('DtDdWrapper'); //checkbox to set the retailers address as valid $isValid = new Zend_Form_Element_Checkbox('R_Active'); $isValid->setLabel($this->getView()->getCibleText('form_label_approved_onweb')); $isValid->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $retailerForm->addElement($isValid); $isRetailer = new Zend_Form_Element_Radio('isDistributeur'); $isRetailer->setLabel($this->getView()->getCibleText('form_label_Display_web'))->setOrder(0); $isRetailer->setSeparator(''); $isRetailer->setAttrib('class', 'vertAlignRadio'); $isRetailer->addMultiOptions(array(1 => $this->getView()->getCibleText('form_account_no'), 2 => $this->getView()->getCibleText('form_account_yes')))->setValue(1); $txtFr = new Cible_Form_Element_Html('lblFr', array('value' => $this->getView()->getCibleText('form_address_retailer_fr'))); $txtFr->setOrder(1)->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'formLanguage')))); $retailerForm->addElement($txtFr); $adressRetailer = new Cible_View_Helper_FormAddress($retailerForm); $adressRetailer->enableFields(array('name' => true, 'firstAddress' => false, 'secondAddress' => false, 'state' => false, 'cityTxt' => false, 'zipCode' => false, 'country' => false, 'firstTel' => false, 'secondTel' => false, 'fax' => false, 'email' => false, 'webSite' => false)); $adressRetailer->formAddress(); $retailerForm->addElement($isRetailer); $retailerForm->getElement('AI_SecondTel')->setAttrib('class', 'stdTextInput phoneFree'); // Subform for the retailer status on website $retailerFormEn = new Cible_Form_SubForm(); $retailerFormEn->setName('retailerFormEn')->removeDecorator('DtDdWrapper'); $txtEn = new Cible_Form_Element_Html('lblEn', array('value' => $this->getView()->getCibleText('form_address_retailer_en'))); $txtEn->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'formLanguage')))); $adressRetailerEn = new Cible_View_Helper_FormAddress($retailerFormEn); $adressRetailerEn->enableFields(array('name' => false, 'firstAddress' => false, 'secondAddress' => false, 'firstTel' => false, 'secondTel' => false, 'webSite' => false)); $adressRetailerEn->formAddress(); $retailerFormEn->addElement($txtEn); $retailerFormEn->getElement('AI_SecondTel')->setAttrib('class', 'stdTextInput phoneFree'); //*** Add subform to the form ***/ $this->addSubForm($retailerForm, 'retailerForm'); $this->addSubForm($retailerFormEn, 'retailerFormEn'); }
public function __construct($options = null) { $this->_disabledDefaultActions = true; parent::__construct($options); $baseDir = $this->getView()->baseUrl(); if (!empty($options['mode']) && $options['mode'] == 'edit') { $this->_mode = 'edit'; } else { $this->_mode = 'add'; } $langId = Zend_Registry::get('languageID'); $this->setAttrib('id', 'accountManagement'); $this->setAttrib('class', 'step3'); // $addressParams = array( // "fieldsValue" => array(), // "display" => array(), // "required" => array(), // ); //Hidden fields for the state and cities id $selectedState = new Zend_Form_Element_Hidden('selectedState'); $selectedState->removeDecorator('label'); $selectedCity = new Zend_Form_Element_Hidden('selectedCity'); $selectedCity->removeDecorator('label'); $this->addElement($selectedState); $this->addElement($selectedCity); // Salutation $salutation = new Zend_Form_Element_Select('salutation'); $salutation->setLabel($this->getView()->getCibleText('form_label_salutation'))->setAttrib('class', 'smallTextInput')->setOrder(1); $greetings = $this->getView()->getAllSalutation(); foreach ($greetings as $greeting) { $salutation->addMultiOption($greeting['S_ID'], $greeting['ST_Value']); } // language hidden field $language = new Zend_Form_Element_Hidden('language', array('value' => $langId)); $language->removeDecorator('label'); // langauge hidden field // FirstName $firstname = new Zend_Form_Element_Text('firstName'); $firstname->setLabel($this->getView()->getCibleText('form_label_fName'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttribs(array('class' => 'stdTextInput'))->setOrder(2); // LastName $lastname = new Zend_Form_Element_Text('lastName'); $lastname->setLabel($this->getView()->getCibleText('form_label_lName'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttribs(array('class' => 'stdTextInput'))->setOrder(3); // email $regexValidate = new Cible_Validate_Email(); $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch'); $emailNotFoundInDBValidator = new Zend_Validate_Db_NoRecordExists('GenericProfiles', 'GP_Email'); $emailNotFoundInDBValidator->setMessage($this->getView()->getClientText('validation_message_email_already_exists'), 'recordFound'); $email = new Zend_Form_Element_Text('email'); $email->setLabel($this->getView()->getCibleText('form_label_email'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator($regexValidate)->setAttribs(array('maxlength' => 50, 'class' => 'stdTextInput'))->setOrder(4); if ($this->_mode == 'add') { $email->addValidator($emailNotFoundInDBValidator); } // email // password $password = new Zend_Form_Element_Password('password'); if ($this->_mode == 'add') { $password->setLabel($this->getView()->getCibleText('form_label_password')); } else { $password->setLabel($this->getView()->getCibleText('form_label_newPwd')); } $password->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextInput')->setRequired(true)->setOrder(5)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))); // password // password confirmation $passwordConfirmation = new Zend_Form_Element_Password('passwordConfirmation'); if ($this->_mode == 'add') { $passwordConfirmation->setLabel($this->getView()->getCibleText('form_label_confirmPwd')); } else { $passwordConfirmation->setLabel($this->getView()->getCibleText('form_label_confirmNewPwd')); } $passwordConfirmation->addFilter('StripTags')->addFilter('StringTrim')->setRequired(true)->setOrder(6)->setAttrib('class', 'stdTextInput'); if (!empty($_POST['identification']['password'])) { $passwordConfirmation->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('error_message_password_isEmpty')))); $Identical = new Zend_Validate_Identical($_POST['identification']['password']); $Identical->setMessages(array('notSame' => $this->getView()->getCibleText('error_message_password_notSame'))); $passwordConfirmation->addValidator($Identical); } // password confirmation // Company name $company = new Zend_Form_Element_Text('company'); $company->setLabel($this->getView()->getCibleText('form_label_company'))->setRequired(false)->setOrder(7)->setAttribs(array('class' => 'stdTextInput')); // function in company $functionCompany = new Zend_Form_Element_Text('functionCompany'); $functionCompany->setLabel($this->getView()->getCibleText('form_label_account_function_company'))->setRequired(false)->setOrder(8)->setAttribs(array('class' => 'stdTextInput')); // Are you a retailer $retailer = new Zend_Form_Element_Select('isRetailer'); $retailer->setLabel($this->getView()->getClientText('form_label_retailer'))->setAttrib('class', 'smallTextInput'); $retailer->addMultiOption(0, $this->getView()->getCibleText('button_no')); $retailer->addMultiOption(1, $this->getView()->getCibleText('button_yes')); // Text Subscribe $textSubscribe = $this->getView()->getCibleText('form_label_subscribe'); $textSubscribe = str_replace('%URL_PRIVACY_POLICY%', Cible_FunctionsPages::getPageLinkByID($this->_config->page_privacy_policy->pageID), $textSubscribe); // Newsletter subscription $newsletterSubscription = new Zend_Form_Element_Checkbox('newsletterSubscription'); $newsletterSubscription->setLabel($textSubscribe); if ($this->_mode == 'add') { $newsletterSubscription->setChecked(1); } $newsletterSubscription->setAttrib('class', 'long-text'); $newsletterSubscription->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); if ($this->_mode == 'add') { $termsAgreement = new Zend_Form_Element_Checkbox('termsAgreement'); $termsAgreement->setLabel(str_replace('%URL_TERMS_CONDITIONS%', Cible_FunctionsPages::getPageLinkByID($this->_config->termsAndConditions->pageId), $this->getView()->getClientText('form_label_terms_agreement'))); $termsAgreement->setAttrib('class', 'long-text'); $termsAgreement->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $termsAgreement->setRequired(true); $termsAgreement->addValidator('notEmpty', true, array('messages' => array('isEmpty' => 'You must agree to the terms'))); } else { $termsAgreement = new Zend_Form_Element_Hidden('termsAgreement', array('value' => 1)); } // Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($this->getView()->getCibleText('form_label_next_step_btn'))->setAttrib('class', 'nextStepButton'); // Reference number for the job $txtConnaissance = new Cible_Form_Element_Html('knowYou', array('value' => $this->getView()->getCibleText('form_account_mieux_vous_connaitre_legend'))); $txtConnaissance->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'description left')))); $refJobId = new Zend_Form_Element_Text('refJobId'); $refJobId->setLabel('refJobId')->setRequired(false)->setAttribs(array('class' => 'stdTextInput')); // Reference number for the role $refRoleId = new Zend_Form_Element_Text('refRoleId'); $refRoleId->setLabel('refRoleId')->setRequired(false)->setAttribs(array('class' => 'stdTextInput')); // Reference number for the job title $refJobTitleId = new Zend_Form_Element_Text('refJobTitleId'); $refJobTitleId->setLabel('refJobTitleId')->setRequired(false)->setAttribs(array('class' => 'stdTextInput')); $refJobTitleId = new Zend_Form_Element_Text('refJobTitleId'); $refJobTitleId->setLabel('refJobTitleId')->setRequired(false)->setAttribs(array('class' => 'stdTextInput')); // Provincial tax exemption $noProvTax = new Zend_Form_Element_Checkbox('noProvTax'); $noProvTax->setLabel($this->getView()->getCibleText('form_label_account_provincial_tax')); $noProvTax->setAttrib('class', 'long-text')->setOrder(13); $noProvTax->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); // Provincial tax exemption $noFedTax = new Zend_Form_Element_Checkbox('noFedTax'); $noFedTax->setLabel($this->getView()->getCibleText('form_label_account_federal_tax')); $noFedTax->setAttrib('class', 'long-text')->setOrder(14); $noFedTax->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); /* Identification sub form */ $identificationSub = new Zend_Form_SubForm(); $identificationSub->setName('identification')->removeDecorator('DtDdWrapper'); $identificationSub->setLegend($this->getView()->getCibleText('form_account_subform_identification_legend')); $identificationSub->setAttrib('class', 'identificationClass subFormClass'); $identificationSub->addElement($language); $identificationSub->addElement($salutation); $identificationSub->addElement($lastname); $identificationSub->addElement($firstname); $identificationSub->addElement($email); $identificationSub->addElement($password); $identificationSub->addElement($passwordConfirmation); $identificationSub->addElement($company); $this->addSubForm($identificationSub, 'identification'); // $identificationSub->addElement($functionCompany); $addrContactMedia = new Cible_View_Helper_FormAddress($identificationSub); if ($options['resume']) { $addrContactMedia->setProperty('addScript', false); } $addrContactMedia->enableFields(array('firstTel', 'secondTel', 'fax', 'webSite')); $addrContactMedia->formAddress(); $identificationSub->addElement($noProvTax); $identificationSub->addElement($noFedTax); /* Identification sub form */ /* billing address */ // Billing address $addressFacturationSub = new Zend_Form_SubForm(); $addressFacturationSub->setName('addressFact')->removeDecorator('DtDdWrapper'); $addressFacturationSub->setLegend($this->getView()->getCibleText('form_account_subform_addBilling_legend')); $addressFacturationSub->setAttrib('class', 'addresseBillingClass subFormClass'); $billingAddr = new Cible_View_Helper_FormAddress($addressFacturationSub); $billingAddr->setProperty('addScriptState', false); if ($options['resume']) { $billingAddr->setProperty('addScript', false); } $billingAddr->enableFields(array('firstAddress', 'secondAddress', 'state', 'cityTxt', 'zipCode', 'country', 'firstTel', 'secondTel')); $billingAddr->formAddress(); $addrBill = new Zend_Form_Element_Hidden('addrBill'); $addrBill->removeDecorator('label'); $addressFacturationSub->addElement($addrBill); $addressFacturationSub->getElement('AI_SecondAddress')->removeDecorator('label'); $this->addSubForm($addressFacturationSub, 'addressFact'); /* delivery address */ $addrShip = new Zend_Form_Element_Hidden('addrShip'); $addrShip->removeDecorator('label'); $addressShippingSub = new Zend_Form_SubForm(); $addressShippingSub->setName('addressShipping')->removeDecorator('DtDdWrapper'); $addressShippingSub->setLegend($this->getView()->getCibleText('form_account_subform_addShipping_legend')); $addressShippingSub->setAttrib('class', 'addresseShippingClass subFormClass'); $shipAddr = new Cible_View_Helper_FormAddress($addressShippingSub); if ($options['resume']) { $shipAddr->setProperty('addScript', false); } $shipAddr->duplicateAddress($addressShippingSub); $shipAddr->setProperty('addScriptState', false); $shipAddr->enableFields(array('firstAddress', 'secondAddress', 'state', 'cityTxt', 'zipCode', 'country', 'firstTel', 'secondTel')); $shipAddr->formAddress(); $addressShippingSub->addElement($addrShip); $this->addSubForm($addressShippingSub, 'addressShipping'); if ($this->_mode == 'edit') { $this->addElement($termsAgreement); } $this->addElement($submit); $submit->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'stepBottomNext')))); if ($this->_mode == 'add') { $termsAgreement->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox', 'id' => 'dd-terms-agreement')))); } }
public function populate(array $values) { $baseDir = $this->getView()->BaseUrl(); $content = ''; $isSaved = false; $currentYear = date('Y', time()); if (empty($values['MP_YearsParticipate'])) { $values['MP_YearsParticipate'] = $currentYear . ','; } $isSaved = preg_match('/' . $currentYear . '/', $values['MP_YearsParticipate']); if (!$isSaved && $values['MP_Category'] == 46) { $lastChar = strrpos($values['MP_YearsParticipate'], ',', -1); if (!$lastChar) { $values['MP_YearsParticipate'] .= ','; } $values['MP_YearsParticipate'] .= $currentYear . ','; } parent::populate($values); if (!empty($values['firstP'])) { $subject = '##ROLE## : ' . $this->getView()->link('##HREF##', '##FNAME## ##LNAME##'); if ($values['firstP'][4]) { $subject .= " (reçu pour impôts)"; } $href = $baseDir . '/users/index/general/actionKey/edit/id/' . $values['firstP']['1']; $values['firstP']['1'] = $href; $content = str_replace(array('##ROLE##', '##HREF##', '##FNAME##', '##LNAME##'), $values['firstP'], $subject); } if (!empty($values['secP'])) { $subject = '##ROLE## : ' . $this->getView()->link('##HREF##', '##FNAME## ##LNAME##'); if ($values['secP'][4]) { $subject .= " (reçu pour impôts)"; } $href = $baseDir . '/users/index/general/actionKey/edit/id/' . $values['secP']['1']; $values['secP']['1'] = $href; $content .= '<br />'; $content .= str_replace(array('##ROLE##', '##HREF##', '##FNAME##', '##LNAME##'), $values['secP'], $subject); } if (empty($values['firstP']) || empty($values['secP'])) { // $img = <img title="Supprimer" alt="" src=""> $img = $this->getView()->image('/extranet/icons/button_add.png', array('title' => 'Ajouter')); $href = $this->getView()->BaseUrl() . '/parent/index/list/actionKey/add/child/' . $values['MP_GenericProfileId']; $link = $this->getView()->link($href, $img . 'Ajouter les parents / représentants légaux', array('class' => 'addParents')); if (!empty($content)) { $content .= '<br />'; } $content .= $link; } $firstP = new Cible_Form_Element_Html('parents', array('value' => $content)); $firstP->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'left clearLeft')))); $this->getDisplayGroup('other')->addElement($firstP); $firstP->setOrder(1); }
/** * Class constructor * * @return void */ public function __construct($options = null) { parent::__construct($options); $labelCSS = Cible_FunctionsGeneral::getLanguageLabelColor($options); $imageSrc = $options['imageSrc']; $dataId = $options['dataId']; $imgField = $options['imgField']; $isNewImage = $options['isNewImage']; $moduleName = $options['moduleName']; $formItemPrices = new Zend_Form_SubForm(); $formTop = new Zend_Form_SubForm(); $formBottom = new Zend_Form_SubForm(); // $this = new Zend_Form_SubForm(); if ($dataId == '') { $pathTmp = "../../../../../data/images/" . $moduleName . "/tmp"; } else { $pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp"; } // hidden specify if new image for the news // $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage)); // $newImage->removeDecorator('Label'); // $this->addElement($newImage); // Name of the product line $name = new Zend_Form_Element_Text('II_Name'); $name->setLabel($this->getView()->getCibleText('item_label_name') . "<span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $label = $name->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $formTop->addElement($name); // List of products $oProducts = new ProductsObject(); $listProd = $oProducts->productsCollection(Zend_Registry::get('currentEditLanguage')); $products = new Zend_Form_Element_Select('I_ProductID'); $products->setLabel($this->getView()->getCibleText('form_item_products_label') . "<span class='field_required'>*</span>")->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'largeSelect')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title')))); $products->addMultiOption('', $this->getView()->getCibleText('form_select_default_label')); $products->addMultiOptions($listProd); // foreach ($listProd as $data) // { // $products->addMultiOption($data['P_ID'], $data['PI_Name']); // } $formTop->addElement($products); // Product $productCode = new Zend_Form_Element_Text('I_ProductCode'); $productCode->setLabel($this->getView()->getCibleText('form_product_code_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $formTop->addElement($productCode); // Item sequence $sequence = new Zend_Form_Element_Text('I_Seq'); $sequence->setLabel($this->getView()->getCibleText('form_product_sequence_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'smallTextInput'); $formTop->addElement($sequence); // Detail Price $detailPrice = new Zend_Form_Element_Text('I_PriceDetail'); $detailPrice->setLabel($this->getView()->getCibleText('form_item_pricedetail_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'smallTextInput'); $formTop->addElement($detailPrice); // Pro price $proPrice = new Zend_Form_Element_Text('I_PricePro'); $proPrice->setLabel($this->getView()->getCibleText('form_item_pricepro_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'smallTextInput'); $formTop->addElement($proPrice); //******************************************************** //* Sub form containing data defining prices and volumes * //******************************************************** $txtQty = new Cible_Form_Element_Html('lblQty', array('value' => $this->getView()->getCibleText('form_item_qty_label'))); $txtQty->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline left')))); $formItemPrices->addElement($txtQty); $txtPrices = new Cible_Form_Element_Html('lblPrices', array('value' => $this->getView()->getCibleText('form_item_prices_label'))); $txtPrices->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline right')))); $formItemPrices->addElement($txtPrices); // Qty limit 1 $qtyInf = new Zend_Form_Element_Text('I_LimitVol1'); $qtyInf->setLabel($this->getView()->getCibleText('form_item_limitvol1_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'inputColLeft'))))->setAttrib('class', 'smallTextInput left'); $formItemPrices->addElement($qtyInf); // Price Vol 1 $firstPrice = new Zend_Form_Element_Text('I_PriceVol1'); $firstPrice->removeDecorator('Label')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'inputColRight'))))->setAttrib('class', 'smallTextInput'); $formItemPrices->addElement($firstPrice); // Qty limit 2 $qtyMiddle = new Zend_Form_Element_Text('I_LimitVol2'); $qtyMiddle->setLabel($this->getView()->getCibleText('form_item_limitvol2_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'inputColLeft'))))->setAttrib('class', 'smallTextInput textRight'); $formItemPrices->addElement($qtyMiddle); // Price vol 2 $secondPrice = new Zend_Form_Element_Text('I_PriceVol2'); $secondPrice->removeDecorator('Label')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'inputColRight', 'id' => 'title'))))->setAttrib('class', 'smallTextInput textRight'); $formItemPrices->addElement($secondPrice); // Price vol 3 $thirdPrice = new Zend_Form_Element_Text('I_PriceVol3'); $thirdPrice->setLabel($this->getView()->getCibleText('form_item_priceVol3_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'inputColRight'))))->setAttrib('class', 'smallTextInput textRight'); $formItemPrices->addElement($thirdPrice); //******************************************************** $special = new Zend_Form_Element_Checkbox('I_Special'); $special->setLabel($this->getView()->getCibleText('form_item_special_label')); $special->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $formBottom->addElement($special); // Special Price $specialPrice = new Zend_Form_Element_Text('I_PrixSpecial'); $specialPrice->setLabel($this->getView()->getCibleText('form_item_specialPrice_label'))->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'smallTextInput'); $formBottom->addElement($specialPrice); // Checkbox for tax of the province $taxProv = new Zend_Form_Element_Checkbox('P_TaxProv'); $taxProv->setLabel($this->getView()->getCibleText('form_item_taxprov_label'))->setAttrib('checked', 'checked'); $taxProv->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $formBottom->addElement($taxProv); // Checkbox for federal tax $taxFed = new Zend_Form_Element_Checkbox('P_TaxFed'); $taxFed->setLabel($this->getView()->getCibleText('form_item_taxfed_label'))->setAttrib('checked', 'checked'); $taxFed->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $formBottom->addElement($taxFed); $formItemPrices->setLegend($this->getView()->getCibleText('subform_itemprices_legend')); $formItemPrices->setAttrib('class', 'smallFieldsetBorder'); // $this->setLegend($this->getView()->getCibleText('subform_professional_legend')); // $this->setAttrib('class', 'fieldsetBorder'); // $this->addSubForm($this, 'productFormLeft'); // $this->addSubForm($this, 'productFormRight'); $this->addSubForm($formTop, 'formTop'); $this->addSubForm($formItemPrices, 'formItemPrices'); $this->addSubForm($formBottom, 'formBottom'); }