Exemple #1
0
 public function _initSetupForm(Am_Form_Setup $form)
 {
     $form->addText("company")->setLabel(array("Your company name in payforit platform", ""))->addRule('required');
     $form->addText("password", array('size' => 40))->setLabel(array("Your password in payforit platform", ""))->addRule('required');
     $form->addSelect("window")->setLabel(array("Type of Payforit Window ", "to render for the end user"))->loadOptions(array('small' => 'small', 'embed_small ' => 'embed_small ', 'large' => 'large', 'embed_large' => 'embed_large'));
     $form->addAdvCheckbox("is_frame")->setLabel(array("Use Iframe", ""));
     $form->addAdvCheckbox("debugLog")->setLabel(array("Debug Log Enabled", "write all requests/responses to log"));
     // hide reattempt
     $form->addScript()->setScript('$(function(){$("[id^=\'row-reattempt-\']").remove()});');
 }
Exemple #2
0
 protected function _initSetupForm(Am_Form_Setup $form)
 {
     $group = $form->addGroup()->setLabel(array('ListMail Board Db and Prefix', "database name (if other database) plus ListMail\n" . "tables prefix, like <i>listmail.lm_</i>\n" . "here listmail in database <i>listmail</i> and tables prefix is <i>lm_</i>\n" . "after change click SAVE twice"));
     $group->addText("db", array('class' => 'db-prefix'))->addRule('required', 'this field is required');
     $group->addText("prefix", array('class' => 'db-prefix'));
     $group->addRule('callback2', '-error-', array($this, 'validateListmailDb'));
     $form->addSelect('expired_list')->setLabel(array('ListMail Expired List', 'Add expired members to the following list'))->loadOptions($this->getListmailGroups());
     if (!$this->isConfigured()) {
         $form->addScript()->setScript('jQuery(function($){ $("#expired_list-0").attr("disabled", true); })');
     }
 }
Exemple #3
0
    public function _initSetupForm(Am_Form_Setup $form)
    {
        $form->addInteger('merchantId', array('maxlength' => 20, 'size' => 15))->setLabel('Your WMI Merchant ID#')->addRule('required');
        $form->addSelect('signature')->setLabel('Signature Method')->loadOptions(array('' => 'None', 'md5' => 'MD5', 'sha1' => 'SHA1'));
        $form->addText('key', array('size' => 40))->setLabel('Secret Key')->addRule('callback2', 'error', array($this, 'validateSecretKey'));
        $form->addScript()->setScript(<<<CUT
jQuery(document).ready(function(\$){
    \$('#signature-0').change(function(){
        if(\$(this).val())
            \$('#row-key-0').show();
        else
            \$('#row-key-0').hide();
    }).change();
});
CUT
);
    }
    function _initSetupForm(Am_Form_Setup $form)
    {
        $form->setTitle(___('Single Login Session'));
        $form->addText('timeout', array('size' => 4))->setLabel(___('Session Timeout, min'));
        $form->setDefault('timeout', 5);
        $form->addSelect('action')->setId('form-action')->setLabel(___('Action on Simultaneous Login Attempt'))->loadOptions(array(self::ACTION_LOGIN_REJECT => ___('Show error and do not allow to login until session timeout'), self::ACTION_LOGOUT_OTHER => ___('Delete other session when user try to login from new one'), self::ACTION_NOTHING => ___('Nothing, allow simultaneous login for same user from different computers')));
        $form->addTextarea('error', array('class' => 'el-wide'))->setId('form-error')->setLabel(___('Error Message'));
        $form->setDefault('error', 'There is already exits active login session for your account. Simultaneous login from different computers is not allowed.');
        $error = self::ACTION_LOGIN_REJECT;
        $form->addScript()->setScript(<<<CUT
\$('#form-action').change(function(){
    \$('#form-error').closest('.row').toggle(\$(this).val() == '{$error}')
}).change();
CUT
);
        $form->addElement('email_checkbox', 'notify_admin')->setLabel(___('Notify Admin on Simultaneous Login'));
    }
Exemple #5
0
    function _initSetupForm(Am_Form_Setup $form)
    {
        $el = $form->addAdvRadio('api_type')->setLabel(___('Version of script'))->loadOptions(array('0' => ___('Downloaded on your own server'), '1' => ___('Hosted at Activecampaing\'s server')));
        $form->addScript()->setScript(<<<CUT
\$(document).ready(function() {
    function api_ch(val){
        \$("input[id^=api_key]").parent().parent().toggle(val == '1');
        \$("input[id^=api_user]").parent().parent().toggle(val == '0');
        \$("input[id^=api_password]").parent().parent().toggle(val == '0');    
    }
    \$("input[type=radio]").change(function(){ api_ch(\$(this).val()); }).change();
    api_ch(\$("input[type=radio]:checked").val());
});
CUT
);
        $form->addText('api_url', array('size' => 40))->setLabel('Activecampaign API url' . "\nit should be with http://");
        $form->addText('api_key', array('size' => 40))->setLabel('Activecampaign API Key');
        $form->addText('api_user', array('size' => 40))->setLabel('Activecampaign Admin Login');
        $form->addPassword('api_password', array('size' => 40))->setLabel('Activecampaign Admin Password');
        $form->addAdvCheckbox('debug')->setLabel(array('Debug logging', 'Record debug information in the log.'));
    }
Exemple #6
0
    protected function _initSetupForm(Am_Form_Setup $form)
    {
        $form->addText('login')->setLabel('API Login')->addRule('required');
        $form->addPassword('passwd')->setLabel('API Password')->addRule('required');
        $form->addText('pslid')->setLabel('PSLID (Service User)')->addRule('required');
        $form->addText('sun')->setLabel('Service User Number (SUN)')->addRule('required');
        $form->addText('lead_time')->setLabel('Lead time, days')->default = 12;
        for ($i = 1; $i <= 28; $i++) {
            $options[$i] = ___("%d-th day", $i);
        }
        $payment_day = $form->addMagicSelect('payment_day')->setLabel(___("Process Payment Day"))->loadOptions($options);
        $payment_day->default = 8;
        $payment_day->addRule('required');
        $form->addText('legal_name', array('class' => 'el-wide'))->setLabel(___("Legal Name\n" . "Please enter the legal name of your organisation " . "which will be included in the Direct Debit Guarantee statement"))->addRule('required');
        $form->addTextarea('legal_address', array('class' => 'el-wide', 'rows' => 5))->setLabel(___("Legal Address\n" . "Please enter the legal address of your organisation " . "which will be included in the Direct Debit Guarantee statement"))->addRule('required');
        $form->addAdvCheckbox('auddis', array('id' => 'auddis'))->setLabel("Log AUDDIS reports as Tickets in helpdesk\n" . "helpdesk module should be enabled");
        $form->addText('auddis_login', array('id' => 'auddis-login'))->setLabel('Username of user for AUDDIS reports');
        $form->addScript()->setScript(<<<CUT
(function(){
    \$('#auddis').change(function(){
        \$('#auddis-login').closest('.row').toggle(this.checked);
    }).change();
    \$('#auddis-login').autocomplete({
        minLength: 2,
        source: window.rootUrl + "/admin-users/autocomplete/"
    });
})()
CUT
);
    }
Exemple #7
0
    protected function _initSetupForm(Am_Form_Setup $form)
    {
        $form->addSelect('my_country')->setLabel(___('My Country'))->loadOptions($this->countries)->addRule('required');
        $form->addText('my_id')->setLabel(___('VAT Id'))->addRule('required');
        $gr = $form->addGroup()->setLabel(___("Local VAT Rate\n" . "for example 18.5 (no percent sign)"));
        $gr->addText('local_rate', array('size' => 5, 'maxlength' => 5));
        $gr->addStatic()->setContent(' %');
        $form->addAdvCheckbox('extempt_if_vat_number')->setLabel(___('Do not add VAT if a valid EU VAT Id entered by foreign customer'));
        $fs = $form->addGroup()->setLabel(___("Tax Rates for Other Countries\n" . 'in case of it is different with Local VAT Rate'));
        foreach ($this->countries as $k => $v) {
            $fs->addText('rate.' . $k, array('class' => 'vat-rate'));
        }
        $rate = $fs->addElement(new Am_Form_Element_VatRate('rate'));
        foreach ($this->countries as $k => $v) {
            $val = $this->getConfig('rate.' . $k, $this->getConfig('local_rate', ''));
            $attr = array('data-label' => $v . sprintf(' <input style="padding:0" type="text" onChange = "$(this).closest(\'div\').find(\'input[type=hidden]\').val($(this).val())"  name="" size="4" value="%s" /> %%', $val), 'data-value' => $val);
            $rate->addOption($v, $k, $attr);
        }
        $rate->setJsOptions('{
            getOptionName : function (name, option) {
                return name.replace(/\\[\\]$/, "") + "___" + option.value;
            },
            getOptionValue : function (option) {
                return $(option).data("value");
            }
        }');
        $rate->setValue(array_keys(array_filter($this->getConfig('rate', array()))));
        $form->addScript()->setScript(<<<CUT
\$('.vat-rate').hide();
\$('.vat-rate').val('');
CUT
);
    }