Exemplo n.º 1
0
    public function initConfigForm(Am_Form $form)
    {
        $el = $form->addSelect('type', array('id' => 'newsletter-type-select'))->setLabel(___('Type'));
        $el->addOption(___('Single Checkbox'), 'checkbox');
        $el->addOption(___('Checkboxes for Selected Lists'), 'checkboxes');
        $form->addAdvCheckbox('no_label', array('id' => 'newsletter-no-label'))->setLabel(___("Hide Label"));
        $form->addScript()->setScript(<<<CUT
\$(function(){
    \$('#newsletter-type-select').change(function(){
        \$('#newsletter-no-label').closest('.row').toggle(\$(this).val() == 'checkbox')
    }).change();
})
CUT
);
        $lists = $form->addSortableMagicSelect('lists', array('id' => 'newsletter-lists-select'))->setLabel(___("Lists\n" . 'All List will be displayed if none selected'));
        $lists->loadOptions(Am_Di::getInstance()->newsletterListTable->getAdminOptions());
        $form->addScript()->setScript(<<<CUT
jQuery(document).ready(function(\$) {
    \$("#newsletter-type-select").change(function(){
        var val = \$(this).val();
        \$("#row-newsletter-lists-select").toggle(val == 'checkboxes');
    }).change();
});
CUT
);
        $form->addAdvCheckbox('unchecked')->setLabel(___("Default unchecked\n" . 'Leave unchecked if you want newsletter default to be checked'));
    }
Exemplo n.º 2
0
    public function initConfigForm(Am_Form $form)
    {
        $el = $form->addSelect('type', array('id' => 'newsletter-type-select'))->setLabel('Type');
        $el->addOption('Single Checkbox', 'checkbox');
        $el->addOption('Checkboxes for Selected Lists', 'checkboxes');
        $lists = $form->addMagicSelect('lists', array('id' => 'newsletter-lists-select'))->setLabel(array('Lists', 'All List will be displayed if none selected'));
        $lists->loadOptions(Am_Di::getInstance()->newsletterListTable->getAdminOptions());
        $form->addScript()->setScript(<<<CUT
jQuery(document).ready(function(\$) {
    \$("#newsletter-type-select").change(function(){
        var val = \$(this).val();
        \$("#row-newsletter-lists-select").toggle(val == 'checkboxes');
    }).change();
});
CUT
);
        $form->addAdvCheckbox('unchecked')->setLabel(array('Default unchecked', 'Must the checkboxes be initially unchecked?'));
    }
Exemplo n.º 3
0
 public function initConfigForm(Am_Form $form)
 {
     $form->addAdvCheckbox('dont_validate')->setLabel(___('Disable online VAT Id Validation'));
     $form->addAdvCheckbox('required')->setLabel(___('Required'));
 }
Exemplo n.º 4
0
    protected function _afterInitConfigForm(Am_Form $form)
    {
        foreach (Am_Report_Shift::getOptions() as $k => $v) {
            $s = Am_Report_Shift::create($k, null);
            $form->addAdvCheckbox('shift_' . $k, array('rel' => implode(' ', $s->getCompatiablePeriods())), array('content' => $v));
        }
        $form->addScript()->setScript(<<<CUT
\$(function(){
\$('select[name=period]').change(function(){
    \$(this).closest('.am-form').find('input[name^=shift_]').
        closest('div.row').hide();
    \$(this).closest('.am-form').find('input[name^=shift_][rel*=' + \$(this).val() + ']').
        closest('div.row').show();
}).change();
})
CUT
);
    }
Exemplo n.º 5
0
    public function createDeclarationForm()
    {
        $form = new Am_Form('dd-declaretion');
        $form->addProlog('<h2>Declaration</h2>');
        $form->addAdvCheckbox('i_agree')->setLabel('I wish to start Direct Debit')->addRule('required');
        $form->addSaveButton('Proceed');
        $form->addEpilog(<<<CUT
<h2>Information</h2>
<p>All the normal Direct Debit safeguards and guarantees
apply. No changes in the amount, date, frequency to be debited can be made
without notifying you at least five (5) working days in advance of your
account being debited. In the event of error, you are entitled to an immediate
refund from your Bank or Building Society. You have the right to cancel a Direct
Debit Instruction at any time simply by writing to your Bank or Building
Society, with a copy to us.</p>
CUT
);
        $form->addHidden(Am_Controller::ACTION_KEY)->setValue($this->getRequest()->getActionName());
        $form->addHidden('id')->setValue($this->getFiltered('id'));
        return $form;
    }
Exemplo n.º 6
0
 public function initConfigForm(Am_Form $form)
 {
     $form->addAdvCheckbox("isHtml")->setLabel("Is Html?");
     $form->addTextarea("text", array('cols' => 80, 'rows' => 20))->setLabel("Agreement text");
 }