示例#1
0
文件: Plugin.php 项目: grlf/eyedock
    function _afterInitSetupForm(Am_Form_Setup $form)
    {
        $url = Am_Controller::escape(REL_ROOT_URL) . '/default/admin-content/p/newsletter/index';
        $text = ___("Once the plugin configuration is finished on this page, do not forget to add\n" . "a record on %saMember CP -> Protect Content -> Newsletters%s page", '<a href="' . $url . '" target="_blank" class="link">', '</a>');
        $form->addProlog(<<<CUT
<div class="warning_box">
    {$text}
</div>
CUT
);
        if ($this->canGetLists()) {
            $lists = array();
            try {
                foreach ($this->getLists() as $k => $v) {
                    $lists[$k] = $v['title'];
                }
            } catch (Exception $e) {
                //just log
                $this->getDi()->errorLogTable->logException($e);
            }
            $gr = $form->addGroup()->setLabel(___('Unsubscribe customer from selected newsletter threads'));
            $gr->addSelect('unsubscribe_after_signup')->loadOptions(array('' => ___('Please Select'), self::UNSUBSCRIBE_AFTER_ADDED => ___('After the user has been added'), self::UNSUBSCRIBE_AFTER_PAID => ___('After first payment has been completed')));
            $gr->addStatic()->setContent('<br><br>');
            $gr->addMagicSelect('unsubscribe_after_signup_lists')->loadOptions($lists);
        }
        parent::_afterInitSetupForm($form);
    }
示例#2
0
文件: listmail.php 项目: grlf/eyedock
 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); })');
     }
 }
示例#3
0
 public function _initSetupForm(Am_Form_Setup $form)
 {
     $form->addText('api_key', array('size' => 40))->setLabel(array('Campaignmonitor API Key', 'from your campaignmonitor account -> Account Settings -> API Key'))->addRule('required');
     if ($this->getConfig('api_key')) {
         $options = $this->getClientApiId();
         $el = $form->addSelect('client_api_id')->setLabel(array('Client API Id', 'select your client which you will use with aMember'))->loadOptions($options);
         if ($options) {
             $el->addRule('required');
         }
     }
     $form->addTextarea('custom_fields', array('rows' => 5, 'cols' => 20))->setLabel(array('Additional Fields', "campaignmonitor_field|amember_field\n" . "eg: FNAME|name_f\n" . "USERIP|remote_addr\n" . "ADDED|added\n" . "one link - one string\n" . "EmailAddress/Name - always present\n"));
     if ($this->getConfig('api_key') && $this->getConfig('client_api_id') && $this->getDi()->plugins_misc->isEnabled('misc-campaignmonitor')) {
         $group = $form->addGroup()->setLabel(array('Activate Webhooks'));
         $group->addRule('callback2', '-error-', array($this, 'updateWebhooks'));
         foreach ($this->getLists() as $lId => $l) {
             $group->addAdvCheckbox("webhook_" . $lId)->setContent('for ' . $l['title'] . '<br>');
         }
     }
     $form->addAdvCheckbox('debug_mode')->setLabel(array('Debug Mode Enabled', "write debug info to logs\nit's recommended enable it at the first time"));
 }
示例#4
0
文件: Tax.php 项目: grlf/eyedock
    function _initSetupForm(Am_Form_Setup $form)
    {
        $gr = $form->addGroup('')->setLabel(___("Electronically Supplied Service\n" . 'Enable if ALL your products are electronic services.'));
        $gr->addAdvCheckbox('tax_digital');
        $gr->addHTML()->setHTML(<<<EOT
<div><a href="javascript:;" onclick="\$('#tax_digital_example').toggle()" class="local">Examples of Electronic Service</a></div>
<div id="tax_digital_example" style="display:none">
<ul class="list">
 <li>Website supply, web-hosting, distance maintenance of programmes  and equipment;</li>
 <li>Supply of software and updating thereof;</li>
 <li>Supply of images, text and information and making available of databases;</li>
 <li>Supply of music, films and games, including games of chance and gambling games, and of
political, cultural, artistic, sporting, scientific and entertainment broadcast and events;</li>
 <li>Supply of distance teaching.</li>
</ul>
</div>
EOT
);
        $fieldSet = $form->addFieldSet('maxmind', array('id' => 'maxmind'))->setLabel('Location Validation Settings');
        $fieldSet->addHTML(null, array('class' => 'no-label'))->setHTML(<<<EOT
<p>According to new EU VAT rules your are required to collect two pieces of non-conflicting evidence of customer's location country if you are selling Digital (Electronic Service) Products. These two pieces of evidence will be checked on each invoice which has Digital Product included:</p>
<ul class="list">
    <li>Address Contry (so make sure that you  have added Address info brick to signup form)</li>
    <li>IP Address Country</li>
</ul>
<p>In order to get country from customer's IP address, aMember uses MaxMind GeoIP2 service. Please signup <a href = "https://www.maxmind.com/en/geoip2-precision-country" target="_blank" class="link">here</a> in order to get MaxMind user ID and license key.</p>
           
EOT
);
        $fieldSet->addAdvCheckbox('tax_location_validation')->setLabel(___("Enable Location Validation\n" . 'aMember will require two peices of location evidence before an invoice is created. ' . 'Invoice that fials validation will be blocked and user will receive warning.'));
        $fieldSet->addAdvCheckbox('tax_location_validate_all')->setLabel(___("Validate Location even if Invoice has no VAT \n" . "Validate All New Invoices (even if invoice has no VAT)\n" . "If unchecked, location will be validated only when \n" . "user selects country inside EU and only if VAT should be applied to invoice.\n" . "Free invoices won't be validated still"));
        $fieldSet->addAdvCheckbox('tax_location_validate_self')->setLabel(___("Enable Self-Validation\n" . "If validation failed, user will be able to confirm current location manually\n"));
        $fieldSet->addText('tax_maxmind_user_id')->setLabel(___('MaxMind User ID'));
        $fieldSet->addText('tax_maxmind_license')->setLabel(___('MaxMind License'));
        $fieldSet = $form->addFieldSet('vat_id')->setLabel(___("Account Information"));
        $fieldSet->addSelect('my_country')->setLabel(___('My Country'))->loadOptions($this->countries)->addRule('required');
        $fieldSet->addText('my_id')->setLabel(___('VAT Id'))->addRule('required');
        $fieldSet = $form->addFieldSet('numbering')->setLabel(___('Invoice numbering'));
        $fieldSet->addAdvCheckbox("sequential")->setLabel(___("Sequential Receipt# Numbering\n" . "aMember still creates unique id for invoices, but it will\n" . "generate PDF receipts for each payment that will be\n" . "available in the member area for customers"));
        $form->setDefault('sequential', 1);
        $form->setDefault('tax_digital', 1);
        $fieldSet->addText('invoice_prefix')->setLabel(___("Receipt# Number Prefix\n" . 'If you change prefix numbers will start over from 1'))->setValue('INV-');
        $fieldSet->addText('initial_invoice_number')->setLabel(___('Initial Receipt# Number'))->setValue(1);
        $fieldSet->addText('invoice_refund_prefix')->setLabel(___("Refund Receipt# Prefix\n" . 'If you change prefix numbers will start over from 1'))->setValue('RFND-');
        $fieldSet->addText('initial_invoice_refund_number')->setLabel(___('Initial Receipt# Refund Number'))->setValue(1);
        $fs = $form->addFieldSet('rates')->setLabel(___('VAT Rates, %'));
        $rates = array_filter($this->getConfig('rates', array()));
        foreach ($this->rates as $c => $rate) {
            if (!isset($this->countries[$c])) {
                continue;
            }
            $r = $fs->addText('rate.' . $c, 'size=3')->setLabel($this->countries[$c]);
            $r->setValue(!empty($rate[$c]) ? $rate[$c] : $this->rates[$c]);
        }
    }