Esempio n. 1
0
 function addBillingPlanElements(HTML_QuickForm2_Container $fieldSet, $plan)
 {
     $prefix = '_plan[' . $plan . '][';
     $suffix = ']';
     $firstPrice = $fieldSet->addElement('text', $prefix . 'first_price' . $suffix)->setLabel(___("First Price\n" . "price of first period of subscription"));
     $firstPrice->addRule('gte', ___('must be equal or greather than 0'), 0.0)->addRule('regex', ___('must be a number in format 99 or 99.99'), '/^(\\d+(\\.\\d+)?|)$/');
     $firstPeriod = $fieldSet->addElement('period', $prefix . 'first_period' . $suffix)->setLabel(___('First Period'));
     $group = $fieldSet->addGroup()->setLabel(___("Rebill Times\n" . "This is the number of payments which\n" . "will occur at the Second Price"));
     $group->setSeparator(' ');
     $sel = $group->addElement('select', $prefix . '_rebill_times' . $suffix)->setId('s_rebill_times');
     $sel->addOption(___('No more charges'), 0);
     $sel->addOption(___('Charge Second Price Once'), 1);
     $sel->addOption(___('Charge Second Price x Times'), 'x');
     $sel->addOption(___('Rebill Second Price until cancelled'), IProduct::RECURRING_REBILLS);
     $txt = $group->addElement('text', $prefix . 'rebill_times' . $suffix, array('size' => 5, 'maxlength' => 6))->setId('t_rebill_times');
     $secondPrice = $fieldSet->addElement('text', $prefix . 'second_price' . $suffix)->setLabel(___("Second Price\n" . "price that must be billed for second and\n" . "the following periods of subscription"));
     $secondPrice->addRule('gte', ___('must be equal or greather than 0.0'), 0.0)->addRule('regex', ___('must be a number in format 99 or 99.99'), '/^\\d+(\\.\\d+)?$/');
     $secondPeriod = $fieldSet->addElement('period', $prefix . 'second_period' . $suffix)->setLabel(___('Second Period'));
     $secondPeriod = $fieldSet->addElement('text', $prefix . 'terms' . $suffix, array('size' => 40, 'class' => 'translate'))->setLabel(___("Terms Text\nautomatically calculated if empty"));
     $fs = $fieldSet->addGroup()->setLabel(___("Quantity\ndefault - 1, normally you do not need to change it\nFirst and Second Price is the total for specified qty"));
     $fs->setSeparator(' ');
     $fs->addInteger($prefix . 'qty' . $suffix, array('placeholder' => 1));
     $fs->addCheckbox($prefix . 'variable_qty' . $suffix, array('class' => 'variable_qty'))->setContent(___('allow user to change quantity'));
     if (Am_Di::getInstance()->config->get('product_paysystem')) {
         $fieldSet->addMagicSelect($prefix . 'paysys_id' . $suffix)->setLabel(___("Payment System\n" . "Choose payment system to be used with this product"))->loadOptions(Am_Di::getInstance()->paysystemList->getOptions());
     }
     foreach (Am_Di::getInstance()->billingPlanTable->customFields()->getAll() as $k => $f) {
         $el = $f->addToQf2($fieldSet);
         $el->setName($prefix . $el->getName() . $suffix);
     }
 }
Esempio n. 2
0
 public function insertBrick(HTML_QuickForm2_Container $form)
 {
     if ($this->getConfig('type') == 'checkboxes') {
         $options = Am_Di::getInstance()->newsletterListTable->getUserOptions();
         if ($enabled = $this->getConfig('lists')) {
             $_ = $options;
             $options = array();
             foreach ($enabled as $id) {
                 $options[$id] = $_[$id];
             }
         }
         if (!$options) {
             return;
         }
         // no lists enabled
         $group = $form->addGroup('_newsletter')->setLabel($this->___('Subscribe to Site Newsletters'));
         $group->setSeparator("<br />\n");
         foreach ($options as $list_id => $title) {
             $c = $group->addAdvCheckbox($list_id)->setContent($title);
             if (!$this->getConfig('unchecked')) {
                 $c->setAttribute('checked');
             }
         }
     } else {
         $c = $form->addAdvCheckbox('_newsletter')->setLabel($this->___('Subscribe to Site Newsletters'));
         if (!$this->getConfig('unchecked')) {
             $c->setAttribute('checked');
         }
     }
 }
Esempio n. 3
0
 public function renderElement(HTML_QuickForm2_Container $form)
 {
     $form->options['Subuser'][$this->getId()] = $this->title;
     $group = $form->addGroup($this->getId())->setLabel($this->title)->setAttribute('id', $this->getId())->setAttribute('class', 'searchField empty');
     $sel = $group->addSelect('val');
     $sel->loadOptions($this->options);
 }
 function addBillingPlanElements(HTML_QuickForm2_Container $fieldSet, $plan)
 {
     $prefix = '_plan[' . $plan . '][';
     $suffix = ']';
     $firstPrice = $fieldSet->addElement('text', $prefix . 'first_price' . $suffix)->setLabel(___("First Price\n" . "price of first period of subscription"));
     $firstPrice->addRule('gte', ___('must be equal or greather than 0'), 0.0)->addRule('regex', ___('must be a number in format 99 or 99.99'), '/^(\\d+(\\.\\d+)?|)$/');
     $firstPeriod = $fieldSet->addElement('period', $prefix . 'first_period' . $suffix)->setLabel(___('First Period'));
     $group = $fieldSet->addGroup()->setLabel(___("Rebill Times\n" . "This is the number of payments which\n" . "will occur at the Second Price"));
     $sel = $group->addElement('select', $prefix . '_rebill_times' . $suffix)->setId('s_rebill_times');
     $sel->addOption(___('No more charges'), 0);
     $sel->addOption(___('Charge Second Price Once'), 1);
     $sel->addOption(___('Charge Second Price x Times'), 'x');
     $sel->addOption(___('Rebill Second Price until cancelled'), IProduct::RECURRING_REBILLS);
     $txt = $group->addElement('text', $prefix . 'rebill_times' . $suffix, array('size' => 5, 'maxlength' => 6))->setId('t_rebill_times');
     $secondPrice = $fieldSet->addElement('text', $prefix . 'second_price' . $suffix)->setLabel(___("Second Price\n" . "price that must be billed for second and\n" . "the following periods of subscription"));
     $secondPrice->addRule('gte', ___('must be equal or greather than 0.0'), 0.0)->addRule('regex', ___('must be a number in format 99 or 99.99'), '/^\\d+(\\.\\d+)?$/');
     $secondPeriod = $fieldSet->addElement('period', $prefix . 'second_period' . $suffix)->setLabel(___('Second Period'));
     $secondPeriod = $fieldSet->addElement('text', $prefix . 'terms' . $suffix, array('size' => 40, 'class' => 'translate'))->setLabel(___("Terms Text\nautomatically calculated if empty"));
     foreach (Am_Di::getInstance()->billingPlanTable->customFields()->getAll() as $k => $f) {
         $el = $f->addToQf2($fieldSet);
         $el->setName($prefix . $el->getName() . $suffix);
     }
 }
Esempio n. 5
0
 public function insertBrick(HTML_QuickForm2_Container $form)
 {
     $captcha = $form->addGroup()->setLabel($this->___("Enter Verification Text\nplease type text from image"));
     $captcha->addRule('callback', $this->___('Text has been entered incorrectly'), array($this, 'validate'));
     $this->static = $captcha->addStatic('captcha')->setContent(Am_Di::getInstance()->recaptcha->render($this->getConfig('theme')));
 }
Esempio n. 6
0
 public function insertBrick(HTML_QuickForm2_Container $form)
 {
     $captcha = $form->addGroup()->setLabel($this->___("Anti Spam"));
     $captcha->addRule('callback', $this->___('Anti Spam check failed'), array($this, 'validate'));
     $this->static = $captcha->addStatic('captcha')->setContent(Am_Di::getInstance()->recaptcha->render($this->getConfig('theme')));
 }
 public function renderElement(HTML_QuickForm2_Container $form)
 {
     $form->options['Newsletter Lists'][$this->getId()] = $this->title;
     $group = $form->addGroup($this->getId())->setLabel($this->title)->setAttribute('id', $this->getId())->setAttribute('class', 'searchField empty');
     $group->addSelect('val', array('multiple' => 'multiple', 'size' => 5))->loadOptions(Am_Di::getInstance()->newsletterListTable->getAdminOptions());
 }
Esempio n. 8
0
 public function renderElement(HTML_QuickForm2_Container $form)
 {
     $form->options[___('User Groups')][$this->getId()] = $this->title;
     $group = $form->addGroup($this->getId())->setLabel($this->title)->setAttribute('id', $this->getId())->setAttribute('class', 'searchField empty');
     $group->addSelect('ids', 'multiple=multiple size=5')->loadOptions($this->getOptions());
 }
Esempio n. 9
0
 /**
  * @return HTML_QuickForm2_Container
  */
 public function addGroup(HTML_QuickForm2_Container $form)
 {
     $form->options[$this->fieldGroupTitle][$this->getId()] = $this->title;
     return $form->addGroup($this->getId())->setLabel($this->title)->setAttribute('id', $this->getId())->setAttribute('class', 'searchField empty');
 }
Esempio n. 10
0
 public function renderElement(HTML_QuickForm2_Container $form)
 {
     //$form->options['Quick Filter'][$this->getId()] = $this->title;
     $group = $form->addGroup($this->getId())->setLabel($this->title)->setAttribute('id', $this->getId())->setAttribute('class', 'searchField empty');
     $group->addText('val');
 }
Esempio n. 11
0
 public function renderElement(HTML_QuickForm2_Container $form)
 {
     $form->options[___('Misc')][$this->getId()] = $this->title;
     $g = $form->addGroup($this->getId())->setLabel($this->title)->setAttribute('id', $this->getId())->setAttribute('class', 'searchField empty');
     $g->addSelect('type')->loadOptions($this->op);
 }