public function __construct($options = null) { $this->_disabledDefaultActions = true; $this->_addRequiredAsterisks = false; parent::__construct($options); $baseDir = $this->getView()->baseUrl(); $this->getView()->headLink()->appendStylesheet("{$this->getView()->baseUrl()}/themes/default/css/login.css", 'all'); $this->setAttrib('class', 'login'); $regexValidate = new Cible_Validate_Email(); $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch'); $email = new Zend_Form_Element_Text('email'); $email->setLabel($this->getView()->getClientText('login_form_email_label'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator($regexValidate)->setAttrib('class', 'loginTextInput'); $this->addElement($email); $password = new Zend_Form_Element_Password('password'); $password->setLabel($this->getView()->getClientText('login_form_password_label'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'loginTextInput')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))); $this->addElement($password); // checkbox for client persistance $status = new Zend_Form_Element_Checkbox('stayOn'); $status->setLabel($this->getView()->getClientText('login_form_stayOn_label')); $status->setValue(1); $status->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd')))); $this->addElement($status); // Submit button $submit = new Zend_Form_Element_Submit('submit_login'); $submit->setLabel('')->setAttrib('class', 'subscribeButton-' . Zend_Registry::get("languageSuffix")); $submit->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd')))); $this->addElement($submit); $this->setAttrib('class', 'login-form'); }
/** * Class constructor * * @return void */ public function __construct($options) { parent::__construct($options); $imageSrc = $options['imageSrc']; $dataId = $options['dataId']; $imgField = $options['imgField']; $isNewImage = $options['isNewImage']; $moduleName = $options['moduleName']; // List of sub categories $oItems = new ItemsObject(); $listItems = $oItems->itemsCollection(Zend_Registry::get('currentEditLanguage')); $items = new Zend_Form_Element_Select('IP_ItemId'); $items->setLabel($this->getView()->getCibleText('form_gift_item_label'))->setAttrib('class', 'largeSelect')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))); $items->addMultiOption('', $this->getView()->getCibleText('form_select_default_label')); $items->addMultiOptions($listItems); $this->addElement($items); // discount item price $price = new Zend_Form_Element_Text('IP_Price'); $price->setLabel($this->getView()->getCibleText('form_item_specialPrice_label'))->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', 'smallTextInput'); $this->addElement($price); // List of sub categories $conditionItems = new Zend_Form_Element_Select('IP_ConditionItemId'); $conditionItems->setLabel($this->getView()->getCibleText('form_condition_item_label'))->setAttrib('class', 'largeSelect')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))); $conditionItems->addMultiOption('', $this->getView()->getCibleText('form_select_default_label')); $conditionItems->addMultiOptions($listItems); $this->addElement($conditionItems); // number of items to add items dicount $nbItem = new Zend_Form_Element_Text('IP_NbItem'); $nbItem->setLabel($this->getView()->getCibleText('form_number_items_label'))->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', 'smallTextInput'); $this->addElement($nbItem); // number of items to add items dicount $conditionAmount = new Zend_Form_Element_Text('IP_ConditionAmount'); $conditionAmount->setLabel($this->getView()->getCibleText('form_condition_amount_label'))->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', 'smallTextInput'); $this->addElement($conditionAmount); }
public function __construct($options = null) { $this->_disabledDefaultActions = true; parent::__construct($options); $countries = Cible_FunctionsGeneral::getCountries(); $states = Cible_FunctionsGeneral::getStates(); }
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) { parent::__construct($options); // salutation $salutation = new Zend_Form_Element_Select('salutation'); $salutation->setLabel('Salutation :')->setAttrib('class', 'largeSelect'); $categoriesData = $this->getView()->getAllSalutation(); foreach ($categoriesData as $categoryData) { $salutation->addMultiOption($categoryData['C_ID'], $categoryData['CI_Title']); } $this->addElement($salutation); // fName $fname = new Zend_Form_Element_Text('firstName'); $fname->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'))))->setAttrib('class', 'stdTextInput'); $this->addElement($fname); // lName $lname = new Zend_Form_Element_Text('lastName'); $lname->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'))))->setAttrib('class', 'stdTextInput'); $this->addElement($lname); // email $regexValidate = new Cible_Validate_Email(); $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch'); $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)->setAttrib('class', 'stdTextInput'); $this->addElement($email); }
public function __construct($options = null) { // variable parent::__construct($options); $baseDir = $options['baseDir']; // name $name = new Zend_Form_Element_Text('EGI_Name'); $name->setLabel($this->getView()->getCibleText('form_label_name'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $this->addElement($name); // description $description = new Zend_Form_Element_Textarea('EGI_Description'); $description->setLabel($this->getView()->getCibleText('form_label_description'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextareaEdit'); $this->addElement($description); //status $status = new Zend_Form_Element_Select('EG_Status'); $status->setLabel($this->getView()->getCibleText('form_label_status'))->setAttrib('class', 'stdSelect'); $status = Cible_FunctionsGeneral::fillStatusSelectBox($status, 'Extranet_Groups', 'EG_Status'); $this->addElement($status); // Hidden GroupID $groupID = new Zend_Form_Element_Hidden('groupID'); $groupID->removeDecorator('label'); $groupID->removeDecorator('DtDdWrapper'); if (isset($options['groupID'])) { $groupID->setValue($options['groupID']); } $this->addElement($groupID); }
/** * * @param array $options Options to build the form */ public function __construct($options = null) { parent::__construct($options); // Text $text = new Cible_Form_Element_Editor('FTI_Text', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $text->setLabel($this->getView()->getCibleText('form_label_text'))->setAttrib('class', 'mediumEditor'); $this->addElement($text); }
public function __construct($options = null) { parent::__construct($options); $this->setAttrib('enctype', 'multipart/form-data'); $inputFile = new Zend_Form_Element_File('file'); $inputFile->setLabel($this->_view->getCibleText('importNewsletterMembers_select_file_label'))->setRequired(true)->addValidator('Count', false, 1, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field')))); $this->addElement($inputFile); }
public function __construct($options = null) { parent::__construct($options); $status = new Zend_Form_Element_Select('status'); $status->setLabel($this->getView()->getClientText('quote_request_status_label')); $status->addMultiOptions(array(1 => $this->getView()->getCibleText('quoteRequest_status_1'), 2 => $this->getView()->getCibleText('quoteRequest_status_2'))); $this->addElement($status); }
public function __construct($options = null) { parent::__construct($options); // Title $title = new Zend_Form_Element_Text('NR_Title'); $title->setLabel($this->getView()->getCibleText('form_label_title'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $this->addElement($title); // Date picker $datePicker = new Cible_Form_Element_DatePicker('NR_Date', array('jquery.params' => array('changeYear' => true, 'changeMonth' => true))); $datePicker->setLabel($this->getView()->getCibleText('form_extranet_newsletter_label_releaseDate'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator('Date', true, array('messages' => array('dateNotYYYY-MM-DD' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateInvalid' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateFalseFormat' => $this->getView()->getCibleText('validation_message_invalid_date')))); $this->addElement($datePicker); // Language $language = new Zend_Form_Element_Select('NR_LanguageID'); $language->setLabel($this->getView()->getCibleText('form_label_language'))->setAttrib('class', 'largeSelect'); $languagesData = Cible_FunctionsGeneral::getAllLanguage(); foreach ($languagesData as $languageData) { $language->addMultiOption($languageData['L_ID'], $languageData['L_Title']); } $this->addElement($language); // Category $category = new Zend_Form_Element_Select('NR_CategoryID'); $category->setLabel($this->getView()->getCibleText('form_label_category'))->setAttrib('class', 'largeSelect'); $categoriesData = $this->getView()->getAllNewsletterCategories(); foreach ($categoriesData as $categoryData) { $category->addMultiOption($categoryData['C_ID'], $categoryData['CI_Title']); } $this->addElement($category); // Model $model = new Zend_Form_Element_Select('NR_ModelID'); $model->setLabel($this->getView()->getCibleText('form_label_model'))->setAttrib('class', 'largeSelect'); $modelsData = $this->getView()->getAllNewsletterModels(); foreach ($modelsData as $modelData) { $model->addMultiOption($modelData['NMI_NewsletterModelID'], $modelData['NMI_Title']); } $this->addElement($model); //if($this->salutationDefaultText!=""){ $intro = new Cible_Form_Element_Editor('NR_TextIntro', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $intro->setLabel($this->getView()->getCibleText('form_label_newsletter_text_intro'))->setAttrib('class', 'largeEditor'); $this->addElement($intro); // show online $showOnline = new Zend_Form_Element_Checkbox('NR_Online'); $showOnline->setLabel($this->getView()->getCibleText('form_label_showOnline')); $showOnline->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($showOnline); // email // $regexValidate = new Cible_Validate_Email(); // $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch'); $email = new Zend_Form_Element_Text('NR_AdminEmail'); $email->setLabel($this->getView()->getCibleText('newsletter_form_label_admin_email'))->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->setAttrib('class', 'stdTextInput'); /*$email->setDecorators(array( 'ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'dd_form dd_email')) ));*/ // $email->setAttrib('class', 'newsletter_form_element text_email'); $this->addElement($email); }
public function __construct($options = null) { parent::__construct($options); $this->_currentEditLanguage = Zend_Registry::get('currentEditLanguage'); $this->_labelCSS = Cible_FunctionsGeneral::getLanguageLabelColor($options); if (isset($options['addAction'])) { $this->_currentMode = 'add'; } $lang = new Cible_Form_Element_LanguageSelector('langSelector', $this->_params, array('lang' => $this->_currentEditLanguage, 'mode' => $this->_currentMode)); $lang->setValue($this->_currentEditLanguage)->removeDecorator('Label'); $this->addElement($lang); }
public function __construct($options = null) { parent::__construct($options); $newsletterID = $options['newsletterID']; $imageSrc = $options['imageSrc']; $isNewImage = $options['isNewImage']; // Title $title = new Zend_Form_Element_Text('NA_Title'); $title->setLabel($this->getView()->getCibleText('form_label_title'))->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput'); $this->addElement($title); // article image if ($newsletterID == '') { $pathTmp = "../../../../../data/images/newsletter/tmp"; } else { $pathTmp = "../../../../../data/images/newsletter/{$newsletterID}/tmp"; } // hidden specify if new image for the news $newImage = new Zend_Form_Element_Hidden('isNewImage', array('value' => $isNewImage)); $newImage->removeDecorator('Label'); //$newImage->setDecorators(array('ViewHelper')); $this->addElement($newImage); $imageTmp = new Zend_Form_Element_Hidden('ImageSrc_tmp'); $imageTmp->removeDecorator('Label'); $this->addElement($imageTmp); $imageOrg = new Zend_Form_Element_Hidden('ImageSrc_original'); $imageOrg->removeDecorator('Label'); $this->addElement($imageOrg); $imageView = new Zend_Form_Element_Image('ImageSrc_preview', array('onclick' => 'return false;')); $imageView->setImage($imageSrc); $this->addElement($imageView); $imagePicker = new Cible_Form_Element_ImagePicker('ImageSrc', array('onchange' => "document.getElementById('imageView').src = document.getElementById('ImageSrc').value", 'associatedElement' => 'ImageSrc_preview', 'pathTmp' => $pathTmp, 'contentID' => $newsletterID)); $imagePicker->removeDecorator('Label'); $this->addElement($imagePicker); $imageAlt = new Zend_Form_Element_Text("NA_ImageAlt"); $imageAlt->setLabel($this->getView()->getCibleText('form_label_description_image'))->setAttrib('class', 'stdTextInput'); $this->addElement($imageAlt); // resume text $resume = new Cible_Form_Element_Editor('NA_Resume', array('mode' => Cible_Form_Element_Editor::ADVANCED)); $resume->setLabel($this->getView()->getCibleText('form_label_short_text'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('validation_message_empty_field')))); $resume->setAttrib('class', 'largeEditor'); $this->addElement($resume); $optionText = new Zend_Form_Element_Radio('NA_TextLink'); $optionText->setRequired(true)->addMultiOption('1', $this->getView()->getCibleText('extranet_newsletter_option_text_url_text'))->addMultiOption('2', $this->getView()->getCibleText('extranet_newsletter_option_text_url_url'))->addMultiOption('3', $this->getView()->getCibleText('extranet_newsletter_option_text_url_nothing')); // Text $text = new Cible_Form_Element_Editor('NA_Text', array('mode' => Cible_Form_Element_Editor::ADVANCED, 'class' => 'textAreaToMoveUp')); $text->setLabel($this->getView()->getCibleText('form_label_text'))->setAttrib('class', 'largeEditor'); $this->addElement($text); $url = new Zend_Form_Element_Text('NA_URL'); $url->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextInputNewsletterURL'); $this->addElement($optionText); $this->addElement($url); $this->addDisplayGroup(array('NA_TextLink', 'NA_URL'), 'linkTo', array('legend' => $this->getView()->getCibleText('extranet_newsletter_text_url'))); }
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 = true; parent::__construct($options); $newsletterCategories = $this->getView()->GetAllNewsletterCategories(); $newsletterCategories = $newsletterCategories->toArray(); foreach ($newsletterCategories as $cat) { $chkCat = new Zend_Form_Element_Checkbox("chkNewsletter{$cat['C_ID']}"); $chkCat->setLabel($cat['CI_Title']); $chkCat->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($chkCat); } }
public function __construct($options = null) { $this->_disabledDefaultActions = true; $this->_object = $options['object']; unset($options['object']); parent::__construct($options); // $memberForm = new Cible_Form_SubForm(array('name' => 'membersForm')); // new password $password = new Zend_Form_Element_Password('MP_Password'); $password->setLabel($this->getView()->getCibleText('form_label_newPwd'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextInput')->setAttrib('autocomplete', 'off'); $this->addElement($password); // password confirmation $passwordConfirmation = new Zend_Form_Element_Password('passwordConfirmation'); $passwordConfirmation->setLabel($this->getView()->getCibleText('form_label_confirmNewPwd'))->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'stdTextInput')->setAttrib('autocomplete', 'off'); $this->addElement($passwordConfirmation); }
public function __construct($options = null) { parent::__construct($options); if (!$this->_disabledLangSwitcher) { $this->_currentEditLanguage = Zend_Registry::get('currentEditLanguage'); $this->_labelCSS = Cible_FunctionsGeneral::getLanguageLabelColor($options); if (isset($options['addAction'])) { $this->_currentMode = 'add'; } $lang = new Cible_Form_Element_LanguageSelector('langSelector', $this->_params, array('lang' => $this->_currentEditLanguage, 'mode' => $this->_currentMode)); $lang->setValue($this->_currentEditLanguage)->setDecorators(array('ViewHelper')); if (!$this->_disabledDefaultActions) { $this->addActionButton($lang); } } }
/** * * @param array $options Options to build the form */ public function __construct($options = null) { // Disable the defaults buttons if (isset($options['disableAction'])) { $this->_disabledDefaultActions = $options['disableAction']; } if (isset($options['recipients'])) { $recipients = $options['recipients']; $recipientsList = $this->_setRecipientList($recipients); unset($options['recipients']); } parent::__construct($options); // Title $title = new Zend_Form_Element_Text('FI_Title'); $title->setLabel($this->getView()->getCibleText('form_label_title'))->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(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $this->addElement($title); // Notification $notification = new Zend_Form_Element_Checkbox('F_Notification'); $notification->setLabel($this->getView()->getCibleText('form_label_has_notification')); $notification->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($notification); $emailList = new Zend_Form_Element_Textarea('FN_Email'); $emailList->setAttrib('title', $this->getView()->getCibleText('form_notification_emails_info')); if (!empty($recipientsList)) { $emailList->setValue($recipientsList); } $emailList->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'formRecipientsEmail')))); $this->addElement($emailList); // isSercure // $hasProfil = new Zend_Form_Element_Checkbox('F_Profil'); // $hasProfil->setLabel($this->getView()->getCibleText( // 'form_label_has_profil')); // $hasProfil->setDecorators(array( // 'ViewHelper', // array('label', array('placement' => 'append')), // array( // array('row' => 'HtmlTag'), // array('tag' => 'dd', 'class' => 'label_after_checkbox')), // )); // // $this->addElement($hasProfil); //hasCaptcha $hasCaptcha = new Zend_Form_Element_Checkbox('F_Captcha'); $hasCaptcha->setLabel($this->getView()->getCibleText('form_label_has_captcha'))->setValue(true)->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($hasCaptcha); $this->setAttrib('id', 'Form'); }
public function __construct($options = null) { // $this->_disabledDefaultActions = true; // if (isset($options['object'])) // $this->_object = $options['object']; unset($options['object']); parent::__construct($options); $this->setAttrib('id', 'orders'); // Status of the customer to access to the cart and order process $status = new Zend_Form_Element_Select('MP_Status'); $status->setLabel($this->getView()->getCibleText('form_label_account_status')); $statusList = array('-1' => 'Désactivé', '0' => 'Email non validé', '1' => 'À valider', '2' => 'Activé'); $status->addMultiOptions($statusList); $this->addElement($status); // Company name $company = new Zend_Form_Element_Text('MP_CompanyName'); $company->setLabel($this->getView()->getCibleText('form_label_company'))->setRequired(false)->setAttribs(array('class' => 'stdTextInput')); $this->addElement($company); // Billing address $addressFacturationSub = new Cible_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->enableFields(array('firstAddress', 'secondAddress', 'state', 'cityTxt', 'zipCode', 'country', 'firstTel', 'seconfTel', 'fax')); $billingAddr->formAddress(); $addrBill = new Zend_Form_Element_Hidden('MP_BillingAddrId'); $addrBill->removeDecorator('label'); $addressFacturationSub->addElement($addrBill); $this->addSubForm($addressFacturationSub, 'addressFact'); /* delivery address */ $addrShip = new Zend_Form_Element_Hidden('MP_ShippingAddrId'); $addrShip->removeDecorator('label'); $addressShippingSub = new Cible_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); $shipAddr->duplicateAddress($addressShippingSub); $shipAddr->enableFields(array('firstAddress', 'secondAddress', 'state', 'cityTxt', 'zipCode', 'country', 'firstTel', 'seconfTel', 'fax')); $shipAddr->formAddress(); $addressShippingSub->addElement($addrShip); $this->addSubForm($addressShippingSub, 'addressShipping'); $this->addSubForm($addressShippingSub, 'addressShipping'); }
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; parent::__construct($options); // email $regexValidate = new Cible_Validate_Email(); $regexValidate->setMessage($this->getView()->getCibleText('validation_message_emailAddressInvalid'), 'regexNotMatch'); $email = new Zend_Form_Element_Text('email'); $this->setAttrib('class', 'zendFormNewsletter'); $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)->setAttrib('class', 'stdTextInput'); $this->addElement($email); //unsubscription reason $reason = new Zend_Form_Element_Select('reason'); $this->setAttrib('class', 'zendFormNewsletter'); $reason->setLabel($this->getView()->getCibleText('form_label_unsubscribe_reason'))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'reasonSelect', 'id' => ''))))->setAttrib('class', 'stdSelect'); $selectoptions = array(); $oRef = new ReferencesObject(); $options = $oRef->getRefByType('unsubscrArg'); foreach ($options as $option) { $value = $option['R_TypeRef'] . '-' . $option['R_ID']; $selectoptions[$option['R_ID']] = $option['RI_Value']; } $reason->addMultiOptions($selectoptions); $reason->addMultiOption(0, 'Autre'); $this->addElement($reason); //unsubscription reason $reasonOther = new Zend_Form_Element_Textarea('reasonOther'); $this->setAttrib('class', 'zendFormNewsletter'); $reasonOther->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'reasonOther hidden', 'id' => ''))))->setAttrib('class', 'reasonTextarea'); $this->addElement($reasonOther); $unsubscribeButton = new Zend_Form_Element_Submit('unsubscribe'); $unsubscribeButton->setLabel($this->getView()->getCibleText('newsletter_title_desabonnement_text'))->setAttrib('id', 'unsubmitSave')->setAttrib('class', 'unsubscribeButton1')->removeDecorator('Label')->removeDecorator('DtDdWrapper'); $this->addElement($unsubscribeButton); $this->addDisplayGroup(array('unsubscribe'), 'actions'); $actions = $this->getDisplayGroup('actions'); $this->setDisplayGroupDecorators(array('formElements', 'fieldset', array(array('outerHtmlTag' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'dd-unsubscribe-button')))); $requiredFields = new Zend_Form_Element_Hidden('RequiredFields'); $requiredFields->setLabel('<span class="field_required">*</span>' . $this->getView()->getCibleText('form_field_required_label') . '<br /><br />'); $requiredFields->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_required_fields')))); $this->addElement($requiredFields); $this->setDecorators(array('FormElements', 'Form')); }
public function __construct($options = null) { parent::__construct($options); // tinymce editor for the text of the text online $value = new Zend_Form_Element_Textarea('ST_Value'); $value->setLabel('Valeur:')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Vous devez saisir un texte')))->setAttrib('class', 'mediumEditor'); $this->addElement($value); $identifier = new Zend_Form_Element_Hidden('ST_Identifier'); $identifier->removeDecorator('DtDdWrapper'); $identifier->removeDecorator('label'); $this->addElement($identifier); $language = new Zend_Form_Element_Hidden('ST_LangID'); $language->removeDecorator('DtDdWrapper'); $language->removeDecorator('label'); $this->addElement($language); $type = new Zend_Form_Element_Hidden('ST_Type'); $type->removeDecorator('DtDdWrapper'); $type->removeDecorator('label'); $this->addElement($type); }
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) { parent::__construct($options); $labelCSS = Cible_FunctionsGeneral::getLanguageLabelColor($options); $imageSrc = $options['imageSrc']; $dataId = $options['dataId']; $imgField = $options['imgField']; $isNewImage = $options['isNewImage']; $moduleName = $options['moduleName']; if ($dataId == '') { $pathTmp = "../../../../../data/images/" . $moduleName . "/tmp"; } else { $pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp"; } // Name of the group of banner $valueName = new Zend_Form_Element_Text('BG_Name'); $valueName->setLabel($this->getView()->getCibleText('form_banner_name_label'))->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 = $valueName->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($valueName); }
public function __construct($options = null) { parent::__construct($options); /***************************************/ // Collection subform $collectionForm = new Zend_Form_SubForm(); // Collection name $name = new Zend_Form_Element_Text('NFCS_Name'); $name->setLabel($this->getView()->getCibleText('form_label_collection_name'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput')->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array('Errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_before_input')))); $collectionForm->addElement($name); /********************************************************/ // Add subform to the form $this->addSubForm($collectionForm, 'collectionForm'); /********************************************************/ // Add button $addFilter = new Zend_Form_Element_Button('addFilterSet'); $addFilter->setLabel($this->getView()->getCibleText('link_add_newsletter_filterSet')); $addFilter->setAttrib('class', 'stdButton'); $addFilter->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'li')))); $addFilter->setOrder(2); $this->addActionButton($addFilter); }
public function __construct($options = null) { parent::__construct($options); $status = $options['status']; $planedDate = $options['planedDate']; $planedTime = $options['planedTime']; $collectionsData = $options['filterList']; $statusOptions = new Zend_Form_Element_Select('NR_Status'); $statusOptions->setLabel('Action')->setAttrib('class', 'largeSelect'); $statusOptions->addMultiOption('1', 'Terminé (Ne pas envoyer à nouveau)'); $statusOptions->addMultiOption('2', "Envoyez à ceux qui ne l'ont pas reçu"); $statusOptions->addMultiOption('3', 'Envoyez à tous les destinataires'); $this->addElement($statusOptions); $send = new Zend_Form_Element_Submit('newsletter_send'); $send->setLabel('Envoyer')->setAttrib('class', 'stdButton')->setOrder(2); $this->addActionButton($send); $collectionFilters = new Zend_Form_Element_Select('NR_CollectionFiltersID'); $collectionFilters->setLabel($this->getView()->getCibleText('form_label_collection_name'))->setAttrib('class', 'largeSelect'); // $collectionsSelect = new NewsletterFilterCollectionsSet(); // $select = $collectionsSelect->select() // ->order('NFCS_Name'); // $collectionsData = $collectionsSelect->fetchAll($select); $collectionFilters->addMultiOption(0, $this->getView()->getCibleText('newsletter_send_filter_selectOne')); foreach ($collectionsData as $key => $collection) { $collectionFilters->addMultiOption($key, $collection); } $this->addElement($collectionFilters); // MailingDateScheduled $datePicker = new Cible_Form_Element_DatePicker('NR_MailingDate', array('jquery.params' => array('changeYear' => true, 'changeMonth' => true))); $datePicker->setLabel($this->getView()->getCibleText('form_label_releaseDate_planned_date'))->setAttrib('class', 'stdTextInput')->setValue($planedDate)->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator('Date', true, array('messages' => array('dateNotYYYY-MM-DD' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateInvalid' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateFalseFormat' => $this->getView()->getCibleText('validation_message_invalid_date')))); $this->addElement($datePicker); // MailingTimeScheduled $regexValidate = new Zend_Validate_Regex('/^([0-1]\\d|2[0-3]):([0-5]\\d)$/'); $regexValidate->setMessage('Temps invalide (HH:MM)', 'regexNotMatch'); $time = new Zend_Form_Element_Text('NR_MailingTime'); $time->setLabel('HH:MM')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->addValidator($regexValidate)->setValue($planedTime); $this->addElement($time); }
public function __construct($options = null, $pagesData = array()) { // variable parent::__construct($options); $baseDir = $options['baseDir']; //$this->getView()->dump($pagesData); foreach ($pagesData as $page) { $checkBox = new Zend_Form_Element_Checkbox($page['P_ID']); $checkBox->setLabel($page['PI_PageTitle']); $this->addElement($checkBox); if (count($page['child'] > 0)) { FormExtranetGroupAssociate::checkBoxChildConstruct($this, $page['child']); } } // submit button (save) $submitSave = new Zend_Form_Element_Submit('submit'); $submitSave->setLabel('Sauvegarder')->setName('submitSave')->setAttrib('id', 'submitSave')->setAttrib('class', 'stdButton')->removeDecorator('DtDdWrapper'); $this->addElement($submitSave); // cancel button $cancel = new Zend_Form_Element_Button('Annuler', array('onclick' => "document.location.href='{$baseDir}'")); $cancel->setAttrib('class', 'stdButton')->setName('Annuler')->removeDecorator('DtDdWrapper'); $this->addElement($cancel); }
public function __construct($options = null, $groupsData = array()) { // variable parent::__construct($options); $baseDir = $options['baseDir']; // html text $textAdministratorGroup = new Cible_Form_Element_Html('htmlAdministratorGroup', array('value' => $this->getView()->getCibleText('label_administrator_actives'))); $this->addElement($textAdministratorGroup); $checkBox = new Zend_Form_Element_MultiCheckbox('groups'); $checkBox->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'checkbox_list')))); //$checkBox->setDescription('<em>Example:</em> mydomain.com') //->addDecorator('Description', array('escape' => false)); //show administrator group (first level) $groupAdmin = Cible_FunctionsAdministrators::getAdministratorGroupData(1)->toArray(); $checkBox->addMultiOption("1", $groupAdmin['EGI_Name'] . " (" . $groupAdmin['EGI_Description'] . ")"); $i = 0; foreach ($groupsData as $group) { if ($group['EG_Status'] == 'active') { $checkBox->addMultiOption($group['EG_ID'], $group['EGI_Name'] . " (" . $group['EGI_Description'] . ")"); } $i++; } $this->addElement($checkBox); }
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']; if ($dataId == '') { $pathTmp = "../../../../../data/images/" . $moduleName . "/tmp"; } else { $pathTmp = "../../../../../data/images/" . $moduleName . "/" . $dataId . "/tmp"; } // Value of the shipping free $valueShippingFees = new Zend_Form_Element_Text('CP_ShippingFees'); $valueShippingFees->setLabel($this->getView()->getCibleText('form_parameters_montant_label'))->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 = $valueShippingFees->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); // Value of the shipping fees limit $valueShippingFeesLimit = new Zend_Form_Element_Text('CP_ShippingFeesLimit'); $valueShippingFeesLimit->setLabel($this->getView()->getCibleText('form_parameters_limit_transport_label'))->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 = $valueShippingFeesLimit->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); // Value of the COD $valueMontantFraisCOD = new Zend_Form_Element_Text('CP_MontantFraisCOD'); $valueMontantFraisCOD->setLabel($this->getView()->getCibleText('form_parameters_COD_label'))->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 = $valueMontantFraisCOD->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); // Email for the command $valueAdminOrdersEmail = new Zend_Form_Element_Text('CP_AdminOrdersEmail'); $valueAdminOrdersEmail->setLabel($this->getView()->getCibleText('form_parameters_email_label'))->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 = $valueAdminOrdersEmail->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); // Id of the free Item // List of products $oItems = new ItemsObject(); $listItem = $oItems->itemsCollection(Zend_Registry::get('currentEditLanguage')); $itemID = new Zend_Form_Element_Select('CP_FreeItemID'); $itemID->setLabel($this->getView()->getCibleText('form_parameters_free_item_label'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdSelect')->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')))); $itemID->addMultiOption('', $this->getView()->getCibleText('form_select_default_label')); $itemID->addMultiOptions($listItem); // Value of the minimum amount to have a free item $valueFreeMiniAmount = new Zend_Form_Element_Text('CP_FreeMiniAmount'); $valueFreeMiniAmount->setLabel($this->getView()->getCibleText('form_parameters_free_item_minimum_label'))->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 = $valueFreeMiniAmount->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); // Value of the minimum amount to have a free item $valueBonusPointDollar = new Zend_Form_Element_Text('CP_BonusPointDollar'); $valueBonusPointDollar->setLabel($this->getView()->getCibleText('form_parameters_bonus_label'))->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 = $valueBonusPointDollar->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); // Value of the canadian tax TPS $valueTauxTaxeFed = new Zend_Form_Element_Text('CP_TauxTaxeFed'); $valueTauxTaxeFed->setLabel($this->getView()->getCibleText('form_parameters_taxe_label'))->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 = $valueTauxTaxeFed->getDecorator('Label'); $label->setOption('class', $this->_labelCSS); $this->addElement($valueShippingFees); $this->addElement($valueShippingFeesLimit); $this->addElement($valueMontantFraisCOD); $this->addElement($valueAdminOrdersEmail); $this->addElement($itemID); $this->addElement($valueFreeMiniAmount); $this->addElement($valueBonusPointDollar); $this->addElement($valueTauxTaxeFed); }
public function __construct($options = null) { $this->_disabledDefaultActions = true; parent::__construct($options); $baseDir = $this->getView()->baseUrl(); $countries = Cible_FunctionsGeneral::getCountries(); $langId = Zend_Registry::get('languageID'); $json_countries = json_encode($countries); $script = <<<EOS var countries = {$json_countries}; var langId = {$langId}; var first = 1; \$(window).load(function(){ // \$('#country').val('7'); }); \$('#country').change(function(){ var ctl_states = \$('#state') var ctl_cities = \$('#city') ctl_states.empty(); ctl_cities.empty(); if(first) { \$('#country').val('7'); \$('#state').val('11'); } \$('#retailers-list').html(''); \$.getJSON('{$this->getView()->baseUrl()}/retailers/index/ajax-retailers/field/countryId/value/' + \$(this).val() + '/langId/' + langId, function(data){ \$('#retailers-list').html(data); }); \$.getJSON( '{$this->getView()->baseUrl()}/retailers/index/ajax-states/countryId/' + \$(this).val() + '/langId/' + langId, function(states_list){ \$('<option value="" label="">{$this->getView()->getCibleText('form_label_select_state')}</option>').appendTo(ctl_states); \$.each(states_list, function(i, item){ if(\$('#selectedState').val() == item.id){ \$('<option value="'+item.id+'" label="'+item.name+'" selected="selected">'+item.name+'</option>').appendTo(ctl_states); \$('#selectedState').val(''); } else if(first){ if(item.id==11){ \$('<option value="'+item.id+'" label="'+item.name+'" selected="selected">'+item.name+'</option>').appendTo(ctl_states); \$('#selectedState').val(''); } else{ \$('<option value="'+item.id+'" label="'+item.name+'">'+item.name+'</option>').appendTo(ctl_states); } } else \$('<option value="'+item.id+'" label="'+item.name+'">'+item.name+'</option>').appendTo(ctl_states); }); }); }).change(); \$('#state').change(function(){ var ctl_cities = \$('#city'); ctl_cities.empty(); \$('#retailers-list').html(''); var stateId = \$(this).val(); if (\$('#selectedState').val() != '') stateId = \$('#selectedState').val(); // alert(first); if(first){ first = 0; stateId = 11; } if(stateId) { \$.getJSON('{$this->getView()->baseUrl()}/retailers/index/ajax-retailers/field/stateId/value/' + stateId + '/langId/' + langId, function(data){ \$('#retailers-list').html(data); }); \$.getJSON('{$this->getView()->baseUrl()}/retailers/index/ajax-cities/stateId/' + stateId + '/filter/1', function(data){ \$('<option value="" label="">{$this->getView()->getCibleText('form_label_select_city')}</option>').appendTo(ctl_cities); \$.each(data, function(i, item){ if(\$('#selectedCity').val() == item.C_ID) { \$('<option value="'+item.C_ID+'" label="'+item.C_Name+'" selected="selected">'+item.C_Name+'</option>').appendTo(ctl_cities); \$('#selectedCity').val(''); } else \$('<option value="'+item.C_ID+'" label="'+item.C_Name+'">'+item.C_Name+'</option>').appendTo(ctl_cities); }); }); } }).change(); \$('#city').change(function(){ \$('#retailers-list').html(''); idCity = \$('#selectedCity').val(); if (\$('#selectedCity').val() == '') idCity = \$(this).val(); \$.getJSON('{$this->getView()->baseUrl()}/retailers/index/ajax-retailers/field/cityId/value/' + idCity + '/langId/' + langId, function(data){ \$('#retailers-list').html(data); }); }); EOS; $this->getView()->jQuery()->addOnLoad($script); // Country $country = new Zend_Form_Element_Select('country'); $country->setLabel($this->getView()->getCibleText('form_label_country'))->setAttrib('class', 'stdSelect'); foreach ($countries as $_country) { $country->addMultiOption($_country['ID'], $_country['name']); } $this->addElement($country); // State $state = new Zend_Form_Element_Select('state'); $state->setLabel($this->getView()->getCibleText('form_label_state'))->setAttrib('class', 'stdSelect'); $this->addElement($state); // City $city = new Zend_Form_Element_Select('city'); $city->setLabel($this->getView()->getCibleText('form_label_city'))->setAttrib('class', 'stdSelect'); $city->addMultiOption('', $this->getView()->getCibleText('form_label_select_city')); $this->addElement($city); $this->addAttribs(array('id' => 'formDetaillants')); }
public function __construct($options = null) { $this->_disabledDefaultActions = true; parent::__construct($options); $this->setAttrib('id', 'accountManagement'); $this->setAttrib('class', 'step2'); $baseDir = $this->getView()->baseUrl(); //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); /* 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 subFormOrder'); $billingAddr = new Cible_View_Helper_FormAddress($addressFacturationSub); $billingAddr->setProperty('addScriptState', 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); $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 subFormOrder'); $shipAddr = new Cible_View_Helper_FormAddress($addressShippingSub); $shipAddr->duplicateAddress($addressShippingSub); $shipAddr->setProperty('addScriptState', false); $shipAddr->enableFields(array('firstAddress', 'secondAddress', 'state', 'city', 'zipCode', 'country', 'firstTel', 'secondTel')); $shipAddr->formAddress(); $addressShippingSub->addElement($addrShip); $this->addSubForm($addressShippingSub, 'addressShipping'); // $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'))) // ->setDecorators(array( // 'ViewHelper', // array('label', array('placement' => 'append')), // array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')), // )); // // $this->addElement($termsAgreement); //Means of payment $paymentMeans = new Zend_Form_Element_Select('paymentMeans'); $paymentMeans->setLabel($this->getView()->getCibleText('form_label_payment_means'))->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput')->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array('errors', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'selectPayment')))); $paymentMeans->addMultiOption('', $this->getView()->getClientText('cart_details_select_choose_label')); $paymentMeans->addMultiOption('visa', $this->getView()->getCibleText('form_label_payement_visa')); $paymentMeans->addMultiOption('mastercard', $this->getView()->getCibleText('form_label_payement_mastercard')); $paymentMeans->addMultiOption('compte', $this->getView()->getCibleText('form_label_payement_account')); $paymentMeans->addMultiOption('cod', $this->getView()->getCibleText('form_label_payement_cod')); $this->addElement($paymentMeans); // Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($this->getView()->getCibleText('form_label_next_step_btn'))->setAttrib('class', 'nextStepButton')->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'stepBottomNext')))); $this->addElement($submit); }