Example #1
0
 /**
  * Run the controller
  */
 public function run()
 {
     // Check if shop has been installed
     $blnInstalled = \Database::getInstance()->tableExists(Config::getTable());
     foreach (scan(TL_ROOT . '/system/modules/isotope/library/Isotope/Upgrade') as $strFile) {
         $strVersion = pathinfo($strFile, PATHINFO_FILENAME);
         if (preg_match('/To[0-9]{10}/', $strVersion)) {
             $strClass = 'Isotope\\Upgrade\\' . $strVersion;
             $strStep = 'Version ' . RepositoryVersion::format(substr($strVersion, 2));
             try {
                 $objUpgrade = new $strClass();
                 $objUpgrade->run($blnInstalled);
             } catch (\Exception $e) {
                 $this->handleException($strStep, $e);
             }
         }
     }
     if ($blnInstalled) {
         try {
             $this->verifySystemIntegrity();
             $this->purgeCaches();
         } catch (\Exception $e) {
             $this->handleException('Finalization', $e);
         }
     }
 }
Example #2
0
 /**
  * Process checkout
  *
  * @param Order $objOrder
  *
  * @return bool
  */
 public function trackOrder(Order $objOrder)
 {
     $objConfig = Config::findByPk($objOrder->config_id);
     if (null !== $objConfig) {
         if ($objConfig->ga_enable) {
             $this->trackGATransaction($objConfig, $objOrder);
         }
     }
     return true;
 }
Example #3
0
 /**
  * Compile the module
  * @return void
  */
 protected function compile()
 {
     $arrConfigs = array();
     $objConfigs = Config::findMultipleByIds($this->iso_config_ids);
     if (null !== $objConfigs) {
         while ($objConfigs->next()) {
             $arrConfigs[] = array('config' => $objConfigs->current(), 'label' => $objConfigs->current()->getLabel(), 'active' => Isotope::getConfig()->id == $objConfigs->id ? true : false, 'href' => \Environment::get('request') . (strpos(\Environment::get('request'), '?') === false ? '?' : '&') . 'config=' . $objConfigs->id);
         }
     }
     \Haste\Generator\RowClass::withKey('class')->addFirstLast()->applyTo($arrConfigs);
     $this->Template->configs = $arrConfigs;
 }
Example #4
0
    /**
     * Generate a daily summary for the overview page
     * @return array
     */
    protected function getDailySummary()
    {
        $strBuffer = '
<div class="tl_formbody_edit be_iso_overview">
<fieldset class="tl_tbox">
<legend style="cursor: default;">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_summary'] . '</legend>';
        $arrAllowedProducts = \Isotope\Backend\Product\Permission::getAllowedIds();
        $objOrders = \Database::getInstance()->prepare("\n            SELECT\n                c.id AS config_id,\n                c.name AS config_name,\n                c.currency,\n                COUNT(o.id) AS total_orders,\n                SUM(i.tax_free_price * i.quantity) AS total_sales,\n                SUM(i.quantity) AS total_items\n            FROM " . \Isotope\Model\ProductCollection::getTable() . " o\n            LEFT JOIN " . \Isotope\Model\ProductCollectionItem::getTable() . " i ON o.id=i.pid\n            LEFT OUTER JOIN " . \Isotope\Model\Config::getTable() . " c ON o.config_id=c.id\n            WHERE o.type='order' AND o.order_status>0 AND o.locked>=?\n            " . ($arrAllowedProducts === true ? '' : " AND i.product_id IN (" . (empty($arrAllowedProducts) ? '0' : implode(',', $arrAllowedProducts)) . ")") . "\n            GROUP BY config_id\n        ")->execute(strtotime('-24 hours'));
        if (!$objOrders->numRows) {
            $strBuffer .= '
<p class="tl_info" style="margin-top:10px">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_empty'] . '</p>';
        } else {
            $i = -1;
            $strBuffer .= '
<br>
<table class="tl_listing">
<tr>
    <th class="tl_folder_tlist">' . $GLOBALS['TL_LANG']['ISO_REPORT']['shop_config'] . '</th>
    <th class="tl_folder_tlist">' . $GLOBALS['TL_LANG']['ISO_REPORT']['currency'] . '</th>
    <th class="tl_folder_tlist">' . $GLOBALS['TL_LANG']['ISO_REPORT']['orders#'] . '</th>
    <th class="tl_folder_tlist">' . $GLOBALS['TL_LANG']['ISO_REPORT']['products#'] . '</th>
    <th class="tl_folder_tlist">' . $GLOBALS['TL_LANG']['ISO_REPORT']['sales#'] . '</th>
</tr>';
            while ($objOrders->next()) {
                $strBuffer .= '
<tr class="row_' . ++$i . ($i % 2 ? 'odd' : 'even') . '">
    <td class="tl_file_list">' . $objOrders->config_name . '</td>
    <td class="tl_file_list">' . $objOrders->currency . '</td>
    <td class="tl_file_list">' . $objOrders->total_orders . '</td>
    <td class="tl_file_list">' . $objOrders->total_items . '</td>
    <td class="tl_file_list">' . Isotope::formatPrice($objOrders->total_sales) . '</td>
</tr>';
            }
            $strBuffer .= '
</table>';
        }
        $strBuffer .= '
</fieldset>
</div>';
        return $strBuffer;
    }
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Table tl_iso_payment
 */
$GLOBALS['TL_DCA']['tl_iso_payment'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'closed' => true, 'onload_callback' => array(array('Isotope\\Backend', 'initializeSetupModule'), array('Isotope\\Backend\\Payment\\Callback', 'checkPermission'), array('Isotope\\Backend\\Payment\\Callback', 'loadShippingModules')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('name'), 'flag' => 1, 'panelLayout' => 'sort,filter;search,limit'), 'label' => array('fields' => array('name', 'type'), 'format' => '%s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>'), 'global_operations' => array('back' => array('label' => &$GLOBALS['TL_LANG']['MSC']['backBT'], 'href' => 'mod=&table=', 'class' => 'header_back', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'new' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['new'], 'href' => 'act=create', 'class' => 'header_new', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif', 'button_callback' => array('Isotope\\Backend\\Payment\\Callback', 'copyPaymentModule')), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"', 'button_callback' => array('Isotope\\Backend\\Payment\\Callback', 'deletePaymentModule')), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('Isotope\\Backend\\Payment\\Callback', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('type', 'protected'), 'default' => '{type_legend},name,label,type', 'cash' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'paybyway' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paybyway_merchant_id,paybyway_private_key;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'paypal' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paypal_account;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'postfinance' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},psp_pspid,psp_http_method,psp_hash_method,psp_hash_in,psp_hash_out,psp_dynamic_template,psp_payment_method;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'viveum' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},psp_pspid,psp_http_method,psp_hash_method,psp_hash_in,psp_hash_out,psp_dynamic_template;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'datatrans' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,trans_type,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},datatrans_id,datatrans_sign;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'innopay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},vads_site_id,vads_certificate;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'sparkasse' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend:hide},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},sparkasse_paymentmethod,trans_type,sparkasse_sslmerchant,sparkasse_sslpassword,sparkasse_merchantref;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'sofortueberweisung' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend:hide},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},trans_type,sofortueberweisung_user_id,sofortueberweisung_project_id,sofortueberweisung_project_password;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'saferpay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},saferpay_accountid,trans_type,saferpay_description,saferpay_vtconfig,saferpay_paymentmethods;{price_legend:hide},price,tax_class;{enabled_legend},enabled', 'billpay_saferpay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types;{gateway_legend},saferpay_accountid,trans_type,saferpay_description,saferpay_vtconfig,saferpay_paymentmethods;{price_legend:hide},price,tax_class;{enabled_legend},enabled', 'expercash' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},expercash_popupId,expercash_profile,expercash_popupKey,expercash_paymentMethod;{price_legend:hide},price,tax_class;{template_legend},expercash_css;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'epay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},trans_type,epay_windowstate,epay_merchantnumber,epay_secretkey;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'payone' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},trans_type,payone_clearingtype,payone_aid,payone_portalid,payone_key;{price_legend:hide},price,tax_class;{enabled_legend},debug,enabled', 'worldpay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},worldpay_instId,worldpay_callbackPW,worldpay_signatureFields,worldpay_md5secret,worldpay_description;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'quickpay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,trans_type,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},quickpay_merchantId,quickpay_agreementId,quickpay_apiKey,quickpay_privateKey,quickpay_paymentMethods;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled'), 'subpalettes' => array('protected' => 'groups'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['name'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'label' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['label'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['type'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'default' => 'cash', 'options_callback' => function () {
    return \Isotope\Model\Payment::getModelTypeOptions();
}, 'eval' => array('includeBlankOption' => true, 'helpwizard' => true, 'submitOnChange' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'note' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['note'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rte' => 'tinyMCE'), 'sql' => "text NULL"), 'new_order_status' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['new_order_status'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\OrderStatus::getTable() . '.name', 'options_callback' => array('\\Isotope\\Backend', 'getOrderStatus'), 'eval' => array('mandatory' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'price' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['price'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 16, 'rgxp' => 'surcharge', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'tax_class' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['tax_class'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'options_callback' => array('\\Isotope\\Model\\TaxClass', 'getOptionsWithSplit'), 'eval' => array('includeBlankOption' => true, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['MSC']['taxFree'], 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'allowed_cc_types' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['allowed_cc_types'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'options_callback' => array('Isotope\\Backend\\Payment\\Callback', 'getAllowedCCTypes'), 'eval' => array('multiple' => true, 'tl_class' => 'clr'), 'sql' => "text NULL"), 'trans_type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['trans_type'], 'exclude' => true, 'default' => 'capture', 'inputType' => 'select', 'options' => array('capture', 'auth'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50', 'helpwizard' => true), 'reference' => $GLOBALS['TL_LANG']['tl_iso_payment'], 'sql' => "varchar(8) NOT NULL default ''"), 'minimum_total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['minimum_total'], 'exclude' => true, 'inputType' => 'text', 'default' => 0, 'eval' => array('maxlength' => 255, 'rgxp' => 'price', 'tl_class' => 'clr w50'), 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'maximum_total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['maximum_total'], 'exclude' => true, 'inputType' => 'text', 'default' => 0, 'eval' => array('maxlength' => 255, 'rgxp' => 'price', 'tl_class' => 'w50'), 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'quantity_mode' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['quantity_mode'], 'exclude' => true, 'inputType' => 'select', 'options' => array('cart_items', 'cart_products'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['quantity_mode'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'minimum_quantity' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['minimum_quantity'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'clr w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'maximum_quantity' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['maximum_quantity'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'countries' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['countries'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \System::getCountries();
}, 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'w50 w50h', 'chosen' => true), 'sql' => "blob NULL"), 'shipping_modules' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['shipping_modules'], 'exclude' => true, 'inputType' => 'select', 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'w50 w50h', 'chosen' => true), 'sql' => "blob NULL"), 'product_types' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['product_types'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\ProductType::getTable() . '.name', 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'clr w50 w50h', 'chosen' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'product_types_condition' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['product_types_condition'], 'exclude' => true, 'inputType' => 'select', 'options' => array('onlyAvailable', 'allAvailable', 'oneAvailable'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'config_ids' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['config_ids'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'clr w50 w50h', 'chosen' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'paybyway_merchant_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['paybyway_merchant_id'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'"), 'paybyway_private_key' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['paybyway_private_key'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'paypal_account' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['paypal_account'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'rgxp' => 'email', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'psp_pspid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_pspid'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'psp_http_method' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_http_method'], 'exclude' => true, 'inputType' => 'select', 'default' => 'POST', 'options' => array('POST', 'GET'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(4) NOT NULL default ''"), 'psp_hash_method' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_method'], 'exclude' => true, 'default' => 'sha1', 'inputType' => 'select', 'options' => array('sha1', 'sha256', 'sha512'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_method'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(6) NOT NULL default ''"), 'psp_hash_in' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_in'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 128, 'hideInput' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'psp_hash_out' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_out'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 128, 'hideInput' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'psp_dynamic_template' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_dynamic_template'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 128, 'rgxp' => 'url', 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'psp_payment_method' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_payment_method'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function ($dc) {
    $payment = \Isotope\Model\Payment::findByPk($dc->id);
    if ($payment === null || !$payment instanceof \Isotope\Model\Payment\PSP) {
        return array();
    }
    return $payment->getPaymentMethods();
}, 'eval' => array('includeBlankOption' => true, 'tl_class' => 'clr'), 'sql' => "varchar(128) NOT NULL default ''"), 'datatrans_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['datatrans_id'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'datatrans_sign' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['datatrans_sign'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 128, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'vads_site_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['vads_site_id'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 8, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(8) NOT NULL default ''"), 'vads_certificate' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['vads_certificate'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'sparkasse_paymentmethod' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_paymentmethod'], 'exclude' => true, 'inputType' => 'select', 'options' => array('creditcard', 'maestro', 'directdebit'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_paymentmethod'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'sparkasse_sslmerchant' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_sslmerchant'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'sparkasse_sslpassword' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_sslpassword'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'hideInput' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'sparkasse_merchantref' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_merchantref'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'decodeEntities' => true, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''"), 'sofortueberweisung_user_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sofortueberweisung_user_id'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'sofortueberweisung_project_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sofortueberweisung_project_id'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'sofortueberweisung_project_password' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sofortueberweisung_project_password'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'saferpay_accountid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_accountid'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'saferpay_description' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_description'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''"), 'saferpay_vtconfig' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_vtconfig'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'saferpay_paymentmethods' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_paymentmethods'], 'inputType' => 'select', 'options' => array(1 => 'MasterCard', 2 => 'Visa', 3 => 'American Express', 4 => 'Diners Club', 5 => 'JCB', 6 => 'Saferpay Testkarte', 7 => 'Laser Card', 8 => 'Bonus Card', 9 => 'PostFinance E-Finance', 10 => 'PostFinance Card', 11 => 'Maestro International', 12 => 'MyOne', 13 => 'Lastschrift', 14 => 'Rechnung', 15 => 'Sofortüberweisung', 16 => 'PayPal', 17 => 'giropay', 18 => 'iDEAL', 19 => 'ClickandBuy', 20 => 'Homebanking AT (eps)', 21 => 'Mpass', 22 => 'ePrzelewy'), 'eval' => array('multiple' => true, 'size' => 5, 'chosen' => true, 'csv' => ',', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'expercash_popupId' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_popupId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'expercash_profile' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_profile'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 3, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(3) NOT NULL default '0'"), 'expercash_popupKey' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_popupKey'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 32, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'expercash_paymentMethod' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_paymentMethod'], 'exclude' => true, 'inputType' => 'select', 'options' => array('automatic_payment_method', 'elv_buy', 'elv_authorize', 'cc_buy', 'cc_authorize', 'giropay', 'sofortueberweisung'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_paymentMethod'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'expercash_css' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_css'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => 'css', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'epay_windowstate' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_windowstate'], 'exclude' => true, 'default' => '3', 'inputType' => 'select', 'options' => array('3', '4'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_windowstate_options'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'epay_merchantnumber' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_merchantnumber'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'epay_secretkey' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_secretkey'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'payone_clearingtype' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_clearingtype'], 'exclude' => true, 'inputType' => 'select', 'options' => array('elv', 'cc', 'dc', 'vor', 'rec', 'sb', 'wlt', 'fnc'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone'], 'eval' => array('mandatory' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(3) NOT NULL default ''"), 'payone_aid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_aid'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 6, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(6) NOT NULL default ''"), 'payone_portalid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_portalid'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 7, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(7) NOT NULL default ''"), 'payone_key' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_key'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'worldpay_instId' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_instId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 6, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(6) NOT NULL default '0'"), 'worldpay_callbackPW' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_callbackPW'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'worldpay_signatureFields' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_signatureFields'], 'exclude' => true, 'default' => 'instId:cartId:amount:currency', 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'worldpay_md5secret' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_md5secret'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'worldpay_description' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_description'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''"), 'quickpay_merchantId' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['quickpay_merchantId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'rgpx' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) NULL"), 'quickpay_agreementId' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['quickpay_agreementId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'rgpx' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) NULL"), 'quickpay_apiKey' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['quickpay_apiKey'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'quickpay_privateKey' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['quickpay_privateKey'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'quickpay_paymentMethods' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['quickpay_paymentMethods'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('decodeEntities' => true, 'tl_class' => 'clr long'), 'sql' => "text NULL"), 'requireCCV' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['requireCCV'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'guests' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['guests'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'protected' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['protected'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['groups'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'debug' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['debug'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'enabled' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['enabled'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''")));
Example #6
0
 */
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['recipients'] = array('recipient_email');
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['attachment_tokens'] = array('form_*', 'document');
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_text'] = array('uniqid', 'order_status', 'order_status_old', 'order_status_id', 'order_status_id_old', 'recipient_email', 'order_id', 'order_items', 'order_products', 'order_subtotal', 'order_total', 'document_number', 'cart_html', 'cart_text', 'document', 'billing_address', 'billing_address_*', 'shipping_address', 'shipping_address_*', 'form_*', 'payment_id', 'payment_label', 'payment_note', 'shipping_id', 'shipping_label', 'shipping_note', 'config_*', 'member_*');
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_subject'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_text'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_html'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_text'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_replyTo'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['recipients'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_recipient_cc'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['recipients'];
$GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['email_recipient_bcc'] =& $GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['isotope']['iso_order_status_change']['recipients'];
/**
 * Models
 */
$GLOBALS['TL_MODELS'][\Isotope\Model\Address::getTable()] = 'Isotope\\Model\\Address';
$GLOBALS['TL_MODELS'][\Isotope\Model\Attribute::getTable()] = 'Isotope\\Model\\Attribute';
$GLOBALS['TL_MODELS'][\Isotope\Model\BasePrice::getTable()] = 'Isotope\\Model\\BasePrice';
$GLOBALS['TL_MODELS'][\Isotope\Model\Config::getTable()] = 'Isotope\\Model\\Config';
$GLOBALS['TL_MODELS'][\Isotope\Model\Document::getTable()] = 'Isotope\\Model\\Document';
$GLOBALS['TL_MODELS'][\Isotope\Model\Download::getTable()] = 'Isotope\\Model\\Download';
$GLOBALS['TL_MODELS'][\Isotope\Model\Gallery::getTable()] = 'Isotope\\Model\\Gallery';
$GLOBALS['TL_MODELS'][\Isotope\Model\Group::getTable()] = 'Isotope\\Model\\Group';
$GLOBALS['TL_MODELS'][\Isotope\Model\Label::getTable()] = 'Isotope\\Model\\Label';
$GLOBALS['TL_MODELS'][\Isotope\Model\OrderStatus::getTable()] = 'Isotope\\Model\\OrderStatus';
$GLOBALS['TL_MODELS'][\Isotope\Model\Payment::getTable()] = 'Isotope\\Model\\Payment';
$GLOBALS['TL_MODELS'][\Isotope\Model\Product::getTable()] = 'Isotope\\Model\\Product';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCategory::getTable()] = 'Isotope\\Model\\ProductCategory';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollection::getTable()] = 'Isotope\\Model\\ProductCollection';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollectionDownload::getTable()] = 'Isotope\\Model\\ProductCollectionDownload';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollectionItem::getTable()] = 'Isotope\\Model\\ProductCollectionItem';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCollectionSurcharge::getTable()] = 'Isotope\\Model\\ProductCollectionSurcharge';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductPrice::getTable()] = 'Isotope\\Model\\ProductPrice';
$GLOBALS['TL_MODELS'][\Isotope\Model\ProductCache::getTable()] = 'Isotope\\Model\\ProductCache';
Example #7
0
 protected function formatValues($arrData, $arrCurrencies)
 {
     // Format row totals
     foreach ($arrData['rows'] as $dateGroup => $arrRow) {
         if (is_array($arrRow['columns'][4]['value'])) {
             foreach ($arrRow['columns'][4]['value'] as $currency => $varValue) {
                 Isotope::setConfig(Config::findByPk($arrCurrencies[$currency]));
                 $arrData['rows'][$dateGroup]['columns'][4]['value'][$currency] = Isotope::formatPriceWithCurrency($varValue);
             }
         }
     }
     // Format footer totals
     foreach ($arrData['footer'][4]['value'] as $currency => $varValue) {
         Isotope::setConfig(Config::findByPk($arrCurrencies[$currency]));
         $arrData['footer'][4]['value'][$currency] = Isotope::formatPriceWithCurrency($varValue);
     }
     if (empty($arrData['footer'][4]['value'])) {
         $arrData['footer'][4]['value'] = 0;
     }
     return $arrData;
 }
Example #8
0
        if (($objPage = \PageModel::findWithDetails($dc->id)) !== null) {
            $GLOBALS['TL_DCA']['tl_page']['fields']['iso_readerJumpTo']['rootNodes'] = array($objPage->rootId);
        }
    }
};
/**
 * Extend tl_page palettes
 */
$GLOBALS['TL_DCA']['tl_page']['palettes']['root'] = str_replace(';{publish_legend}', ';{isotope_legend},iso_config,iso_store_id;{publish_legend}', $GLOBALS['TL_DCA']['tl_page']['palettes']['root']);
$GLOBALS['TL_DCA']['tl_page']['palettes']['regular'] = str_replace(';{publish_legend}', ';{isotope_legend},iso_setReaderJumpTo;{publish_legend}', $GLOBALS['TL_DCA']['tl_page']['palettes']['regular']);
/**
 * Add a selector to tl_page
 */
$GLOBALS['TL_DCA']['tl_page']['palettes']['__selector__'][] = 'iso_setReaderJumpTo';
/**
 * Add subpalettes to tl_page
 */
$GLOBALS['TL_DCA']['tl_page']['subpalettes']['iso_setReaderJumpTo'] = 'iso_readerJumpTo';
/**
 * Add fields to tl_page
 */
$GLOBALS['TL_DCA']['tl_page']['fields']['iso_config'] = array('label' => &$GLOBALS['TL_LANG']['tl_page']['iso_config'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_page']['fields']['iso_store_id'] = array('label' => &$GLOBALS['TL_LANG']['tl_page']['iso_store_id'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'rgxp' => 'digit', 'nospace' => true, 'maxlength' => 2, 'tl_class' => 'w50'), 'sql' => "int(2) unsigned NOT NULL default '0'");
$GLOBALS['TL_DCA']['tl_page']['fields']['iso_setReaderJumpTo'] = array('label' => &$GLOBALS['TL_LANG']['tl_page']['iso_setReaderJumpTo'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_page']['fields']['iso_readerJumpTo'] = array('label' => &$GLOBALS['TL_LANG']['tl_page']['iso_readerJumpTo'], 'exclude' => true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'explanation' => 'isoReaderJumpTo', 'eval' => array('fieldType' => 'radio', 'mandatory' => true, 'helpwizard' => true), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'));
/**
 * Disable header edit button
 */
if ($_GET['table'] == \Isotope\Model\ProductCategory::getTable()) {
    $GLOBALS['TL_DCA']['tl_page']['config']['notEditable'] = true;
}
Example #9
0
 /**
  * Get the currently active Isotope configuration
  *
  * @return Config
  */
 public static function getConfig()
 {
     if (null === static::$objConfig) {
         static::initialize();
         if (($objCart = static::getCart()) !== null) {
             static::$objConfig = Config::findByPk($objCart->config_id);
         }
         // If cart was null or still did not find a config
         if (null === static::$objConfig) {
             global $objPage;
             static::$objConfig = TL_MODE == 'FE' ? Config::findByRootPageOrFallback($objPage->rootId) : Config::findByFallback();
         }
         // No config at all, create empty model as fallback
         if (null === static::$objConfig) {
             static::$objConfig = new Config();
             trigger_error($GLOBALS['TL_LANG']['ERR']['noDefaultStoreConfiguration']);
         }
     }
     return static::$objConfig;
 }
Example #10
0
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_gallery'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_gallery'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Gallery::getTable() . '.name', 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_collectionTpl'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_collectionTpl'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function (\DataContainer $dc) {
    return \Isotope\Backend::getTemplates('iso_collection_');
}, 'eval' => array('mandatory' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_filterTpl'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_filterTpl'], 'exclude' => true, 'default' => 'iso_filter_default', 'inputType' => 'select', 'options_callback' => array('Isotope\\Backend\\Module\\Callback', 'getFilterTemplates'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50', 'chosen' => true), 'sql' => "varchar(64) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_jump_first'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_jump_first'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_hide_list'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_hide_list'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_use_quantity'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_use_quantity'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_display404Page'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_display404Page'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_checkout_method'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_checkout_method'], 'exclude' => true, 'inputType' => 'radio', 'default' => 'member', 'options' => array('member', 'guest', 'both'), 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_checkout_method_ref'], 'eval' => array('mandatory' => true, 'submitOnChange' => true), 'sql' => "varchar(10) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_login_jumpTo'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_login_jumpTo'], 'exclude' => true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('fieldType' => 'radio', 'mandatory' => true, 'tl_class' => 'clr'), 'explanation' => 'jumpTo', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_loginRequired'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_loginRequired'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_addProductJumpTo'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_addProductJumpTo'], 'exclude' => true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'explanation' => 'jumpTo', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_cols'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_cols'], 'exclude' => true, 'default' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 1, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(1) unsigned NOT NULL default '1'");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_config_id'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_config_id'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('includeBlankOption' => true, 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_config_ids'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_config_ids'], 'exclude' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('multiple' => true, 'mandatory' => true, 'tl_class' => 'clr'), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_payment_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_payment_modules'], 'exclude' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => \Isotope\Model\Payment::getTable() . '.name', 'options_callback' => array('Isotope\\Backend\\Module\\Callback', 'getPaymentModules'), 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_shipping_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_shipping_modules'], 'exclude' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => \Isotope\Model\Shipping::getTable() . '.name', 'options_callback' => array('Isotope\\Backend\\Module\\Callback', 'getShippingModules'), 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['orderCompleteJumpTo'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['orderCompleteJumpTo'], 'exclude' => true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('mandatory' => true, 'fieldType' => 'radio', 'tl_class' => 'clr'), 'explanation' => 'jumpTo', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_forward_review'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_forward_review'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_order_conditions'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => 'tl_form.title', 'eval' => array('includeBlankOption' => true, 'tl_class' => 'clr w50', 'chosen' => true), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_order_conditions_position'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions_position'], 'exclude' => true, 'inputType' => 'radio', 'options' => array('top', 'before', 'after'), 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions_position'], 'eval' => array('tl_class' => 'w50 w50h'), 'sql' => "varchar(6) NOT NULL default 'after'");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_addToAddressbook'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_addToAddressbook'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''", 'eval' => array('tl_class' => 'w50 m12'));
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_orderCollectionBy'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_orderCollectionBy'], 'exclude' => true, 'default' => 'asc_id', 'inputType' => 'select', 'options' => $GLOBALS['TL_LANG']['MSC']['iso_orderCollectionBy'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_emptyMessage'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_emptyMessage'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr w50'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_noProducts'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_noProducts'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_emptyFilter'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_emptyFilter'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_noFilter'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_noFilter'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_category_scope'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_category_scope'], 'exclude' => true, 'inputType' => 'radio', 'default' => 'current_category', 'options' => array('current_category', 'current_and_first_child', 'current_and_all_children', 'parent', 'product', 'article', 'global'), 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_category_scope_ref'], 'eval' => array('tl_class' => 'clr w50 w50h', 'helpwizard' => true), 'sql' => "varchar(64) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_list_where'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_list_where'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('preserveTags' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['iso_filterModules'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['iso_filterModules'], 'exclude' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => 'tl_module.name', 'options_callback' => array('Isotope\\Backend\\Module\\Callback', 'getFilterModules'), 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy'));
Example #11
0
 /**
  * Load the current cart
  * @param   Config
  * @return  Cart
  */
 public static function findForCurrentStore()
 {
     global $objPage;
     if (TL_MODE != 'FE' || null === $objPage || $objPage->rootId == 0) {
         return null;
     }
     $time = time();
     $strHash = \Input::cookie(static::$strCookie);
     $intStore = (int) \PageModel::findByPk($objPage->rootId)->iso_store_id;
     //  Check to see if the user is logged in.
     if (FE_USER_LOGGED_IN !== true) {
         if ($strHash == '') {
             $strHash = sha1(session_id() . (!$GLOBALS['TL_CONFIG']['disableIpCheck'] ? \Environment::get('ip') : '') . $intStore . static::$strCookie);
             \System::setCookie(static::$strCookie, $strHash, $time + $GLOBALS['TL_CONFIG']['iso_cartTimeout'], $GLOBALS['TL_CONFIG']['websitePath']);
         }
         $objCart = static::findOneBy(array('uniqid=?', 'store_id=?'), array($strHash, $intStore));
     } else {
         $objCart = static::findOneBy(array('member=?', 'store_id=?'), array(\FrontendUser::getInstance()->id, $intStore));
     }
     // Create new cart
     if ($objCart === null) {
         $objConfig = Config::findByRootPageOrFallback($objPage->rootId);
         $objCart = new static();
         // Can't call the individual rows here, it would trigger markModified and a save()
         $objCart->setRow(array_merge($objCart->row(), array('tstamp' => $time, 'member' => FE_USER_LOGGED_IN === true ? \FrontendUser::getInstance()->id : 0, 'uniqid' => FE_USER_LOGGED_IN === true ? '' : $strHash, 'config_id' => $objConfig->id, 'store_id' => $intStore)));
     } else {
         $objCart->tstamp = $time;
     }
     return $objCart;
 }
Example #12
0
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Table tl_iso_rule
 */
$GLOBALS['TL_DCA']['tl_iso_rule'] = array('config' => array('dataContainer' => 'Table', 'ctable' => array('tl_iso_rule_restriction'), 'enableVersioning' => false, 'onload_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadAttributeValues')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'panelLayout' => 'filter;search,limit', 'fields' => array('type', 'name')), 'label' => array('fields' => array('name', 'code'), 'format' => '%s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>'), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset(); return AjaxRequest.toggleVisibility(this, %s);"', 'button_callback' => array('\\Isotope\\Backend\\Rule\\Callback', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('type', 'applyTo', 'enableCode', 'configRestrictions', 'memberRestrictions', 'productRestrictions'), 'default' => '{basic_legend},type', 'product' => '{basic_legend},type,name,discount;{limit_legend:hide},limitPerMember,limitPerConfig,minItemQuantity,maxItemQuantity,quantityMode;{datim_legend:hide},startDate,endDate,startTime,endTime;{advanced_legend:hide},configRestrictions,memberRestrictions,productRestrictions;{enabled_legend},enabled', 'cart' => '{basic_legend},type,applyTo,name,label,discount;{coupon_legend:hide},enableCode;{limit_legend:hide},limitPerMember,limitPerConfig,minSubtotal,maxSubtotal,minItemQuantity,maxItemQuantity,quantityMode;{datim_legend:hide},startDate,endDate,startTime,endTime;{advanced_legend:hide},configRestrictions,memberRestrictions,productRestrictions;{enabled_legend},enabled', 'cartsubtotal' => '{basic_legend},type,applyTo,name,label,discount,tax_class;{coupon_legend:hide},enableCode;{limit_legend:hide},limitPerMember,limitPerConfig,minSubtotal,maxSubtotal,minItemQuantity,maxItemQuantity,quantityMode;{datim_legend:hide},startDate,endDate,startTime,endTime;{advanced_legend:hide},configRestrictions,memberRestrictions,productRestrictions;{enabled_legend},enabled'), 'subpalettes' => array('enableCode' => 'code', 'configRestrictions' => 'configs,configCondition', 'memberRestrictions_guests' => 'memberCondition', 'memberRestrictions_groups' => 'memberCondition,groups', 'memberRestrictions_members' => 'memberCondition,members', 'productRestrictions_producttypes' => 'productCondition,producttypes', 'productRestrictions_pages' => 'productCondition,pages', 'productRestrictions_products' => 'productCondition,products', 'productRestrictions_variants' => 'productCondition,variants', 'productRestrictions_attribute' => 'attributeName,attributeCondition,attributeValue'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['type'], 'exclude' => true, 'filter' => true, 'default' => 'product', 'inputType' => 'select', 'options' => array('product', 'cart'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_rule']['type'], 'eval' => array('mandatory' => true, 'submitOnChange' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['name'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'label' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['label'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'discount' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['discount'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'rgxp' => 'discount', 'tl_class' => 'clr w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'tax_class' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['tax_class'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'options_callback' => array('\\Isotope\\Model\\TaxClass', 'getOptionsWithSplit'), 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'applyTo' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['applyTo'], 'exclude' => true, 'default' => 'products', 'inputType' => 'select', 'options' => array('products', 'items', 'subtotal'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_rule']['applyTo'], 'eval' => array('mandatory' => true, 'submitOnChange' => true, 'tl_class' => 'w50'), 'sql' => "varchar(8) NOT NULL default ''"), 'enableCode' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['enableCode'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'code' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['code'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255), 'sql' => "varchar(255) NOT NULL default ''"), 'limitPerMember' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['limitPerMember'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'digit', 'maxlength' => 10, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'limitPerConfig' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['limitPerConfig'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'digit', 'maxlength' => 10, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'minSubtotal' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['minSubtotal'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'maxSubtotal' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['maxSubtotal'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'minItemQuantity' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['minItemQuantity'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'maxItemQuantity' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['maxItemQuantity'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'quantityMode' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['quantityMode'], 'exclude' => true, 'inputType' => 'select', 'default' => 'product_quantity', 'options' => array('product_quantity', 'cart_products', 'cart_items'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_rule']['quantityMode'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'startDate' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['startDate'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'endDate' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['endDate'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'startTime' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['startTime'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'time', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'endTime' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['endTime'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'time', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'configRestrictions' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['configRestrictions'], 'inputType' => 'checkbox', 'exclude' => true, 'filter' => true, 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"), 'configCondition' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['configCondition'], 'exclude' => true, 'default' => '1', 'inputType' => 'radio', 'options' => array('1' => $GLOBALS['TL_LANG']['tl_iso_rule']['condition_true'], '0' => $GLOBALS['TL_LANG']['tl_iso_rule']['condition_false']), 'eval' => array('isAssociative' => true, 'tl_class' => 'w50'), 'sql' => "tinyint(1) NOT NULL default '0'"), 'configs' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['configs'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('mandatory' => true, 'multiple' => true, 'doNotSaveEmpty' => true, 'tl_class' => 'clr w50 w50h'), 'load_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadRestrictions')), 'save_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'saveRestrictions'))), 'memberRestrictions' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['memberRestrictions'], 'inputType' => 'radio', 'default' => 'none', 'exclude' => true, 'filter' => true, 'options' => array('none', 'guests', 'groups', 'members'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_rule']['memberRestrictions'], 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => "varchar(32) NOT NULL default ''"), 'memberCondition' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['memberCondition'], 'exclude' => true, 'default' => '1', 'inputType' => 'radio', 'options' => array('1' => $GLOBALS['TL_LANG']['tl_iso_rule']['condition_true'], '0' => $GLOBALS['TL_LANG']['tl_iso_rule']['condition_false']), 'eval' => array('isAssociative' => true, 'tl_class' => 'w50'), 'sql' => "tinyint(1) NOT NULL default '0'"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['groups'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('mandatory' => true, 'multiple' => true, 'doNotSaveEmpty' => true, 'tl_class' => 'clr'), 'load_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadRestrictions')), 'save_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'saveRestrictions'))), 'members' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['members'], 'exclude' => true, 'inputType' => 'tableLookup', 'eval' => array('mandatory' => true, 'doNotSaveEmpty' => true, 'tl_class' => 'clr', 'foreignTable' => 'tl_member', 'fieldType' => 'checkbox', 'listFields' => array('firstname', 'lastname', 'username', 'email'), 'searchFields' => array('firstname', 'lastname', 'username', 'email'), 'sqlWhere' => '', 'searchLabel' => 'Search members'), 'load_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadRestrictions')), 'save_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'saveRestrictions'))), 'productRestrictions' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['productRestrictions'], 'inputType' => 'radio', 'default' => 'none', 'exclude' => true, 'filter' => true, 'options' => array('none', 'producttypes', 'pages', 'products', 'variants', 'attribute'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_rule']['productRestrictions'], 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => "varchar(32) NOT NULL default ''"), 'productCondition' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['productCondition'], 'exclude' => true, 'default' => '1', 'inputType' => 'radio', 'options' => array('1' => $GLOBALS['TL_LANG']['tl_iso_rule']['condition_true'], '0' => $GLOBALS['TL_LANG']['tl_iso_rule']['condition_false']), 'eval' => array('isAssociative' => true, 'tl_class' => 'w50'), 'sql' => "tinyint(1) NOT NULL default '0'"), 'producttypes' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['producttypes'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\ProductType::getTable() . '.name', 'eval' => array('mandatory' => true, 'multiple' => true, 'doNotSaveEmpty' => true, 'tl_class' => 'clr'), 'load_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadRestrictions')), 'save_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'saveRestrictions'))), 'pages' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['pages'], 'exclude' => true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('mandatory' => true, 'multiple' => true, 'fieldType' => 'checkbox', 'doNotSaveEmpty' => true, 'tl_class' => 'clr'), 'load_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadRestrictions')), 'save_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'saveRestrictions'))), 'products' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['products'], 'exclude' => true, 'inputType' => 'tableLookup', 'eval' => array('mandatory' => true, 'doNotSaveEmpty' => true, 'tl_class' => 'clr', 'foreignTable' => 'tl_iso_product', 'fieldType' => 'checkbox', 'listFields' => array('type' => "(SELECT name FROM " . \Isotope\Model\ProductType::getTable() . " WHERE " . \Isotope\Model\Product::getTable() . ".type=" . \Isotope\Model\ProductType::getTable() . ".id)", 'name', 'sku'), 'searchFields' => array('name', 'alias', 'sku', 'description'), 'sqlWhere' => 'pid=0', 'searchLabel' => 'Search products'), 'load_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadRestrictions')), 'save_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'saveRestrictions'))), 'variants' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['variants'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'doNotSaveEmpty' => true, 'csv' => ',', 'tl_class' => 'clr long'), 'load_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'loadRestrictions')), 'save_callback' => array(array('\\Isotope\\Backend\\Rule\\Callback', 'saveRestrictions'))), 'attributeName' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['attributeName'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => array('\\Isotope\\Backend\\Rule\\Callback', 'getAttributeNames'), 'eval' => array('mandatory' => true, 'includeBlankOption' => true, 'submitOnChange' => true, 'tl_class' => 'clr w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'attributeCondition' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['attributeCondition'], 'exclude' => true, 'inputType' => 'select', 'options' => array('eq', 'neq', 'lt', 'gt', 'elt', 'egt', 'starts', 'ends', 'contains'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_rule']['attributeCondition'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(8) NOT NULL default ''"), 'attributeValue' => array('exclude' => true, 'eval' => array('decodeEntities' => true, 'tl_class' => 'clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'enabled' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_rule']['enabled'], 'exclude' => true, 'inputType' => 'checkbox', 'filter' => true, 'sql' => "char(1) NOT NULL default ''")));
Example #13
0
 /**
  * List template from all themes, show theme name
  * @param string
  * @param int
  * @return array
  */
 public static function getTemplates($strPrefix)
 {
     $arrTemplates = array();
     // Get the default templates
     foreach (\TemplateLoader::getPrefixedFiles($strPrefix) as $strTemplate) {
         $arrTemplates[$strTemplate] = $strTemplate;
     }
     $arrCustomized = glob(TL_ROOT . '/templates/' . $strPrefix . '*');
     // Add the customized templates
     if (is_array($arrCustomized)) {
         foreach ($arrCustomized as $strFile) {
             $strTemplate = basename($strFile, strrchr($strFile, '.'));
             if (!isset($arrTemplates[$strTemplate])) {
                 $arrTemplates[''][$strTemplate] = $strTemplate;
             }
         }
     }
     // Do not look for back end templates in theme folders (see #5379)
     if ($strPrefix == 'be_') {
         return $arrTemplates;
     }
     // Try to select the shop configs
     try {
         $objConfig = Config::findAll(array('order' => 'name'));
     } catch (\Exception $e) {
         $objConfig = null;
     }
     // Add the shop config templates
     if (null !== $objConfig) {
         while ($objConfig->next()) {
             if ($objConfig->templateGroup != '') {
                 $strFolder = sprintf($GLOBALS['TL_LANG']['MSC']['templatesConfig'], $objConfig->name);
                 $arrConfigTemplates = glob(TL_ROOT . '/' . $objConfig->templateGroup . '/' . $strPrefix . '*');
                 if (is_array($arrConfigTemplates)) {
                     foreach ($arrConfigTemplates as $strFile) {
                         $strTemplate = basename($strFile, strrchr($strFile, '.'));
                         if (!isset($arrTemplates[''][$strTemplate])) {
                             $arrTemplates[$strFolder][$strTemplate] = $strTemplate;
                         }
                     }
                 }
             }
         }
     }
     // Try to select the themes (see #5210)
     try {
         $objTheme = \ThemeModel::findAll(array('order' => 'name'));
     } catch (\Exception $e) {
         $objTheme = null;
     }
     // Add the theme templates
     if (null !== $objTheme) {
         while ($objTheme->next()) {
             if ($objTheme->templates != '') {
                 $strFolder = sprintf($GLOBALS['TL_LANG']['MSC']['templatesTheme'], $objTheme->name);
                 $arrThemeTemplates = glob(TL_ROOT . '/' . $objTheme->templates . '/' . $strPrefix . '*');
                 if (is_array($arrThemeTemplates)) {
                     foreach ($arrThemeTemplates as $strFile) {
                         $strTemplate = basename($strFile, strrchr($strFile, '.'));
                         if (!isset($arrTemplates[''][$strTemplate])) {
                             $arrTemplates[$strFolder][$strTemplate] = $strTemplate;
                         }
                     }
                 }
             }
         }
     }
     return $arrTemplates;
 }
Example #14
0
 /**
  * Send a notification when address has been changed
  *
  * @param Address $objAddress
  * @param array   $arrOldAddress
  * @param \User   $objMember
  * @param Config  $objConfig
  */
 protected function triggerNotificationCenter(Address $objAddress, array $arrOldAddress, \User $objMember, Config $objConfig)
 {
     if (!$this->nc_notification) {
         return;
     }
     /** @type Notification $objNotification */
     $objNotification = Notification::findByPk($this->nc_notification);
     if (null === $objNotification) {
         return;
     }
     $arrTokens = array();
     $arrTokens['admin_email'] = $GLOBALS['TL_ADMIN_EMAIL'];
     $arrTokens['domain'] = \Environment::get('host');
     $arrTokens['link'] = \Environment::get('base') . \Environment::get('request');
     foreach ($objAddress->row() as $k => $v) {
         $arrTokens['address_' . $k] = $v;
     }
     foreach ($arrOldAddress as $k => $v) {
         $arrTokens['address_old_' . $k] = $v;
     }
     foreach ($objMember->getData() as $k => $v) {
         $arrTokens['member_' . $k] = $v;
     }
     foreach ($objConfig->row() as $k => $v) {
         $arrTokens['config_' . $k] = $v;
     }
     $objNotification->send($arrTokens);
 }
Example #15
0
 protected function getFilterByConfigPanel()
 {
     $arrConfigs = array('' => &$GLOBALS['TL_LANG']['ISO_REPORT']['all']);
     $objConfigs = Config::findAll(array('order' => 'name'));
     if (null !== $objConfigs) {
         while ($objConfigs->next()) {
             $arrConfigs[$objConfigs->id] = $objConfigs->name;
         }
     }
     $arrSession = \Session::getInstance()->get('iso_reports');
     $varValue = (string) $arrSession[$this->name]['iso_config'];
     return array('name' => 'iso_config', 'label' => &$GLOBALS['TL_LANG']['ISO_REPORT']['shop_config'], 'type' => 'filter', 'value' => $varValue, 'active' => $varValue != '', 'class' => 'iso_config', 'options' => $arrConfigs);
 }
Example #16
0
 /**
  * List all records with formatted currency
  * @param array
  * @return string
  */
 public function listRow($row)
 {
     $arrRate = deserialize($row['rate']);
     if ($row['config'] && !$arrRate['unit']) {
         Isotope::setConfig(Config::findByPk($row['config']));
         $strRate = Isotope::formatPriceWithCurrency($arrRate['value'], false);
     } else {
         $strRate = $arrRate['value'] . '%';
     }
     return sprintf('%s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>', $row['name'], $strRate);
 }
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Load tl_iso_product data container and language files
 */
$this->loadDataContainer('tl_iso_product');
\System::loadLanguageFile('tl_iso_product');
/**
 * Table tl_iso_product_collection
 */
$GLOBALS['TL_DCA']['tl_iso_product_collection'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => false, 'ctable' => array(\Isotope\Model\ProductCollectionItem::getTable(), \Isotope\Model\ProductCollectionSurcharge::getTable(), \Isotope\Model\Address::getTable()), 'closed' => true, 'notDeletable' => \Input::get('act') == 'select', 'onload_callback' => array(array('Isotope\\Backend\\ProductCollection\\Callback', 'checkPermission')), 'onsubmit_callback' => array(array('Isotope\\Backend\\ProductCollection\\Callback', 'executeSaveHook')), 'sql' => array('keys' => array('id' => 'primary', 'uniqid' => 'unique', 'member,store_id,type' => 'index', 'uniqid,store_id,type' => 'index', 'source_collection_id,type' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('locked DESC'), 'panelLayout' => 'filter;sort,search,limit', 'filter' => array(array('type=?', 'order'), array('order_status>?', '0'), array("locked!=?", ''))), 'label' => array('fields' => array('document_number', 'locked', 'billing_address_id', 'total', 'order_status'), 'showColumns' => true, 'label_callback' => array('Isotope\\Backend\\ProductCollection\\Callback', 'getOrderLabel')), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'payment' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['payment'], 'href' => 'key=payment', 'icon' => 'system/modules/isotope/assets/images/money-coin.png', 'button_callback' => array('\\Isotope\\Backend\\ProductCollection\\Callback', 'paymentButton')), 'shipping' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['shipping'], 'href' => 'key=shipping', 'icon' => 'system/modules/isotope/assets/images/box-label.png', 'button_callback' => array('\\Isotope\\Backend\\ProductCollection\\Callback', 'shippingButton')), 'print_document' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['print_document'], 'href' => 'key=print_document', 'icon' => 'system/modules/isotope/assets/images/document-pdf-text.png'))), 'palettes' => array('default' => '{status_legend},order_status,date_paid,date_shipped;{details_legend},details,notes;{email_legend:hide},email_data;{billing_address_legend:hide},billing_address_data;{shipping_address_legend:hide},shipping_address_data'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'type' => array('eval' => array('doNotShow' => true), 'sql' => "varchar(32) NOT NULL default ''"), 'member' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['member'], 'foreignKey' => "tl_member.CONCAT(firstname, ' ', lastname)", 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'locked' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['locked'], 'flag' => 8, 'filter' => true, 'sorting' => true, 'eval' => array('rgxp' => 'date'), 'sql' => "varchar(10) NOT NULL default ''"), 'store_id' => array('eval' => array('doNotShow' => true), 'sql' => "int(2) unsigned NOT NULL default '0'"), 'settings' => array('eval' => array('doNotShow' => true), 'sql' => "blob NULL"), 'checkout_info' => array('eval' => array('doNotShow' => true), 'sql' => "blob NULL"), 'payment_data' => array('eval' => array('doNotShow' => true), 'sql' => "blob NULL"), 'shipping_data' => array('eval' => array('doNotShow' => true), 'sql' => "blob NULL"), 'source_collection_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['source_collection_id'], 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy', 'table' => 'tl_iso_product_collection')), 'document_number' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['document_number'], 'search' => true, 'sorting' => true, 'sql' => "varchar(64) NOT NULL default ''"), 'uniqid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['uniqid'], 'search' => true, 'sql' => "varchar(64) NULL"), 'order_status' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['order_status'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\OrderStatus::getTable() . '.name', 'options_callback' => array('\\Isotope\\Backend', 'getOrderStatus'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'), 'save_callback' => array(array('Isotope\\Backend\\ProductCollection\\Callback', 'updateOrderStatus'))), 'date_paid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['date_paid'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => method_exists($this, 'getDatePickerString') ? $this->getDatePickerString() : true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'date_shipped' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['date_shipped'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => method_exists($this, 'getDatePickerString') ? $this->getDatePickerString() : true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'config_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['config_id'], 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'payment_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['payment_id'], 'filter' => true, 'foreignKey' => \Isotope\Model\Payment::getTable() . '.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'shipping_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['shipping_id'], 'filter' => true, 'foreignKey' => \Isotope\Model\Shipping::getTable() . '.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'billing_address_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['billing_address_id'], 'foreignKey' => \Isotope\Model\Address::getTable() . '.label', 'eval' => array('doNotShow' => true), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'shipping_address_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['shipping_address_id'], 'foreignKey' => \Isotope\Model\Address::getTable() . '.label', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'details' => array('input_field_callback' => array('Isotope\\Backend\\ProductCollection\\Callback', 'generateOrderDetails'), 'eval' => array('doNotShow' => true)), 'subtotal' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['subtotal'], 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'tax_free_subtotal' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['tax_free_subtotal'], 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['total'], 'sorting' => true, 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'tax_free_total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['tax_free_total'], 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'currency' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['currency'], 'sql' => "varchar(4) NOT NULL default ''"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['language'], 'sql' => "varchar(5) NOT NULL default ''"), 'notes' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['notes'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:80px;'), 'sql' => "text NULL"), 'email_data' => array('input_field_callback' => array('Isotope\\Backend\\ProductCollection\\Callback', 'generateEmailData'), 'eval' => array('doNotShow' => true)), 'billing_address_data' => array('input_field_callback' => array('Isotope\\Backend\\ProductCollection\\Callback', 'generateBillingAddressData'), 'eval' => array('doNotShow' => true)), 'shipping_address_data' => array('input_field_callback' => array('Isotope\\Backend\\ProductCollection\\Callback', 'generateShippingAddressData'), 'eval' => array('doNotShow' => true))));
Example #18
0
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Table tl_iso_product_price
 */
$GLOBALS['TL_DCA']['tl_iso_product_price'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'ptable' => 'tl_iso_product', 'ctable' => array('tl_iso_product_pricetier'), 'onload_callback' => array(array('Isotope\\Backend\\ProductPrice\\Callback', 'initializeDCA')), 'sql' => array('keys' => array('id' => 'primary', 'pid' => 'index', 'config_id,member_group,start,stop,pid' => 'index'))), 'list' => array('sorting' => array('mode' => 4, 'fields' => array('id'), 'flag' => 1, 'panelLayout' => 'filter;search,limit', 'headerFields' => array('id', 'name', 'alias', 'sku'), 'disableGrouping' => true, 'child_record_callback' => array('Isotope\\Backend\\ProductPrice\\Callback', 'listRows')), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('default' => '{price_legend},price_tiers,tax_class;{limit_legend},config_id,member_group,start,stop'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_iso_product.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'belongsTo', 'load' => 'lazy')), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'price_tiers' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['price_tiers'], 'exclude' => true, 'inputType' => 'multiColumnWizard', 'eval' => array('doNotSaveEmpty' => true, 'tl_class' => 'clr', 'disableSorting' => true, 'columnFields' => array('min' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['price_tier_columns']['min'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'rgxp' => 'digit', 'style' => 'width:100px')), 'price' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['price_tier_columns']['price'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'rgxp' => 'price', 'style' => 'width:100px')))), 'load_callback' => array(array('Isotope\\Backend\\ProductPrice\\Callback', 'loadTiers')), 'save_callback' => array(array('Isotope\\Backend\\ProductPrice\\Callback', 'saveTiers'))), 'tax_class' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['tax_class'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'eval' => array('includeBlankOption' => true, 'tl_class' => 'clr'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'config_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['config_id'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'member_group' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['member_group'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \MemberGroupModel::getTable() . '.name', 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50', 'chosen' => true), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => method_exists($this, 'getDatePickerString') ? $this->getDatePickerString() : true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_product_price']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => method_exists($this, 'getDatePickerString') ? $this->getDatePickerString() : true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''")));
Example #19
0
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Table tl_iso_tax_rate
 */
$GLOBALS['TL_DCA']['tl_iso_tax_rate'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'closed' => true, 'onload_callback' => array(array('Isotope\\Backend', 'initializeSetupModule'), array('Isotope\\Backend\\TaxRate\\Callback', 'checkPermission'), array('Isotope\\Backend\\TaxRate\\Callback', 'addCurrencyRate')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'flag' => 1, 'fields' => array('name'), 'panelLayout' => 'filter;search,limit'), 'label' => array('fields' => array('name'), 'format' => '%s', 'label_callback' => array('Isotope\\Backend\\TaxRate\\Callback', 'listRow')), 'global_operations' => array('back' => array('label' => &$GLOBALS['TL_LANG']['MSC']['backBT'], 'href' => 'mod=&table=', 'class' => 'header_back', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'new' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['new'], 'href' => 'act=create', 'class' => 'header_new', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif', 'button_callback' => array('Isotope\\Backend\\TaxRate\\Callback', 'copyTaxRate')), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"', 'button_callback' => array('Isotope\\Backend\\TaxRate\\Callback', 'deleteTaxRate')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('protected'), 'default' => '{name_legend},name,label;{rate_legend},rate;{location_legend},address,countries,subdivisions,postalCodes;{condition_legend},amount;{config_legend:hide},config,stop,guests,protected'), 'subpalettes' => array('protected' => 'groups'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'relation' => array('type' => 'belongsTo', 'load' => 'lazy')), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['name'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'label' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['label'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'address' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['address'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'options' => array('billing', 'shipping'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate'], 'eval' => array('mandatory' => true, 'multiple' => true), 'sql' => "blob NULL"), 'countries' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['countries'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \System::getCountries();
}, 'eval' => array('multiple' => true, 'size' => 10, 'csv' => ',', 'tl_class' => 'w50 w50h', 'chosen' => true), 'sql' => "text NULL"), 'subdivisions' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['subdivisions'], 'exclude' => true, 'filter' => true, 'inputType' => 'conditionalselect', 'options_callback' => array('\\Isotope\\Backend', 'getSubdivisions'), 'eval' => array('conditionField' => 'countries', 'multiple' => true, 'size' => 10, 'csv' => ',', 'tl_class' => 'w50 w50h'), 'sql' => "text NULL"), 'postalCodes' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['postalCodes'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:40px', 'tl_class' => 'clr'), 'sql' => "text NULL"), 'rate' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['rate'], 'exclude' => true, 'inputType' => 'inputUnit', 'options' => array('%' => '%'), 'eval' => array('mandatory' => true, 'maxlength' => 255, 'rgxp' => 'price'), 'sql' => "varchar(255) NOT NULL default ''"), 'amount' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['amount'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('multiple' => true, 'size' => 2, 'maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'config' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['config'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('includeBlankOption' => true, 'submitOnChange' => true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['stop'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"), 'guests' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['guests'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"), 'protected' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['protected'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_tax_rate']['groups'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy'))));
Example #20
0
 /**
  * Store if we need to update the currencies
  * @param   mixed
  * @param   \DataContainer
  */
 public function checkNeedToConvertCurrencies($varValue, \DataContainer $dc)
 {
     $objConfig = Config::findByPk($dc->id);
     if ($objConfig !== null && $varValue != $objConfig->{$dc->field}) {
         $GLOBALS['ISOTOPE_CONFIG_UPDATE_CURRENCIES'] = true;
     }
     return $varValue;
 }
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Table tl_iso_rule_usage
 */
$GLOBALS['TL_DCA']['tl_iso_rule_usage'] = array('config' => array('sql' => array('keys' => array('id' => 'primary', 'pid' => 'index'))), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => \Isotope\Model\Rule::getTable() . '.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'belongsTo', 'load' => 'lazy')), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'order_id' => array('foreignKey' => \Isotope\Model\ProductCollection::getTable() . '.document_number', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'config_id' => array('foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'member_id' => array('foreignKey' => \MemberModel::getTable() . '.username', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'))));
 public function modifyDC(&$arrDca = null)
 {
     // get the product
     switch ($this->iso_direct_checkout_product_mode) {
         case 'product_type':
             if (($objTypes = FieldPaletteModel::findByPidAndTableAndField($this->objModule->id, 'tl_module', 'iso_direct_checkout_product_types')) !== null) {
                 while ($objTypes->next()) {
                     $arrColumns = array('type=?');
                     $arrValues = array($objTypes->iso_direct_checkout_product_type);
                     if ($this->iso_listingSortField) {
                         $arrSorting = array($this->iso_listingSortField => $this->iso_listingSortDirection == 'DESC' ? Sort::descending() : Sort::ascending());
                     } else {
                         $arrSorting = array();
                     }
                     $objProducts = Product::findPublishedBy($arrColumns, $arrValues, array('sorting' => $arrSorting));
                     if ($objProducts->count() > 0) {
                         $objProduct = $objProducts->current();
                         $this->arrProducts[] = array('product' => $objProduct, 'useQuantity' => $objTypes->iso_use_quantity);
                         $this->addProductFields($objProduct, $objTypes->iso_use_quantity, $objTypes->iso_addSubscriptionCheckbox, $arrDca);
                     }
                 }
             }
             break;
         default:
             if (($objProducts = FieldPaletteModel::findByPidAndTableAndField($this->objModule->id, 'tl_module', 'iso_direct_checkout_products')) !== null) {
                 while ($objProducts->next()) {
                     $objProduct = Product::findByPk($objProducts->iso_direct_checkout_product);
                     $this->arrProducts[] = array('product' => $objProduct, 'useQuantity' => $objProducts->iso_use_quantity);
                     $this->addProductFields($objProduct, $objProducts->iso_use_quantity, $objProducts->iso_addSubscriptionCheckbox, $arrDca);
                 }
             }
             break;
     }
     // add address fields
     \Controller::loadDataContainer('tl_iso_address');
     \System::loadLanguageFile('tl_iso_address');
     $arrAddressFields = deserialize(Config::findByPk($this->iso_config_id)->address_fields, true);
     // add billing address fields
     foreach ($arrAddressFields as $strName => $arrAddressField) {
         $arrData = $GLOBALS['TL_DCA']['tl_iso_address']['fields'][$strName];
         if (!is_array($arrData) || $arrAddressField['billing'] == 'disabled') {
             continue;
         }
         $arrData['eval']['mandatory'] = $arrAddressField['billing'] == 'mandatory';
         $this->arrBillingAddressFields[] = $strName;
         $this->addEditableField($strName, $arrData);
     }
     if ($this->iso_use_notes) {
         $this->addEditableField('notes', array('label' => &$GLOBALS['TL_LANG']['MSC']['iso_note'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('tl_class' => 'clr w50'), 'sql' => "text NULL"));
     }
     $this->addEditableField('shippingaddress', array('label' => array($GLOBALS['TL_LANG']['MSC']['differentShippingAddress'], $GLOBALS['TL_LANG']['MSC']['differentShippingAddress']), 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true)));
     // add shipping address fields
     $arrShippingAddressFields = array();
     foreach ($arrAddressFields as $strName => $arrAddressField) {
         $arrData = $GLOBALS['TL_DCA']['tl_iso_address']['fields'][$strName];
         if (!is_array($arrData) || $arrAddressField['shipping'] == 'disabled') {
             continue;
         }
         $arrData['eval']['mandatory'] = $arrAddressField['shipping'] == 'mandatory';
         $this->addEditableField('shippingaddress_' . $strName, $arrData);
         $arrShippingAddressFields[] = 'shippingaddress_' . $strName;
     }
     $this->dca['palettes']['__selector__'][] = 'shippingaddress';
     $this->dca['subpalettes']['shippingaddress'] = implode(',', $arrShippingAddressFields);
     $this->arrShippingAddressFields = $arrShippingAddressFields;
 }
Example #23
0
 /**
  * List template from all themes, show theme name
  *
  * @param string $strPrefix
  *
  * @return array
  */
 public static function getTemplates($strPrefix)
 {
     $arrTemplates = \Controller::getTemplateGroup($strPrefix);
     // Try to select the shop configs
     try {
         $objConfig = Config::findAll(array('order' => 'name'));
     } catch (\Exception $e) {
         $objConfig = null;
     }
     // Add the shop config templates
     if (null !== $objConfig) {
         while ($objConfig->next()) {
             if ($objConfig->templateGroup != '') {
                 $arrConfigTemplates = glob(TL_ROOT . '/' . $objConfig->templateGroup . '/' . $strPrefix . '*');
                 if (is_array($arrConfigTemplates)) {
                     foreach ($arrConfigTemplates as $strFile) {
                         $strTemplate = basename($strFile, strrchr($strFile, '.'));
                         if (!isset($arrTemplates[$strTemplate])) {
                             $arrTemplates[$strTemplate] = $strTemplate;
                         } else {
                             $arrTemplates[$strTemplate] = substr($arrTemplates[$strTemplate], 0, -1) . ', ' . sprintf($GLOBALS['TL_LANG']['MSC']['templatesConfig'], $objConfig->name) . ')';
                         }
                     }
                 }
             }
         }
     }
     return $arrTemplates;
 }
Example #24
0
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Table tl_iso_payment
 */
$GLOBALS['TL_DCA']['tl_iso_payment'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'closed' => true, 'onload_callback' => array(array('Isotope\\Backend', 'initializeSetupModule'), array('Isotope\\Backend\\Payment\\Callback', 'checkPermission'), array('Isotope\\Backend\\Payment\\Callback', 'loadShippingModules')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('name'), 'flag' => 1, 'panelLayout' => 'sort,filter;search,limit'), 'label' => array('fields' => array('name', 'type'), 'format' => '%s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>'), 'global_operations' => array('back' => array('label' => &$GLOBALS['TL_LANG']['MSC']['backBT'], 'href' => 'mod=&table=', 'class' => 'header_back', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'new' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['new'], 'href' => 'act=create', 'class' => 'header_new', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif', 'button_callback' => array('Isotope\\Backend\\Payment\\Callback', 'copyPaymentModule')), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"', 'button_callback' => array('Isotope\\Backend\\Payment\\Callback', 'deletePaymentModule')), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('Isotope\\Backend\\Payment\\Callback', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('type', 'protected'), 'default' => '{type_legend},name,label,type', 'cash' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'paybyway' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paybyway_merchant_id,paybyway_private_key;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'paypal' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paypal_account;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'postfinance' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},psp_pspid,psp_http_method,psp_hash_method,psp_hash_in,psp_hash_out,psp_dynamic_template;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'viveum' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},psp_pspid,psp_http_method,psp_hash_method,psp_hash_in,psp_hash_out,psp_dynamic_template;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'datatrans' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,trans_type,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},datatrans_id,datatrans_sign;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'sparkasse' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend:hide},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},sparkasse_paymentmethod,trans_type,sparkasse_sslmerchant,sparkasse_sslpassword,sparkasse_merchantref;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled', 'sofortueberweisung' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend:hide},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},trans_type,sofortueberweisung_user_id,sofortueberweisung_project_id,sofortueberweisung_project_password;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'saferpay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},saferpay_accountid,trans_type,saferpay_description,saferpay_vtconfig,saferpay_paymentmethods;{price_legend:hide},price,tax_class;{enabled_legend},enabled', 'billpay_saferpay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types;{gateway_legend},saferpay_accountid,trans_type,saferpay_description,saferpay_vtconfig,saferpay_paymentmethods;{price_legend:hide},price,tax_class;{enabled_legend},enabled', 'expercash' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},expercash_popupId,expercash_profile,expercash_popupKey,expercash_paymentMethod;{price_legend:hide},price,tax_class;{template_legend},expercash_css;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'epay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},trans_type,epay_windowstate,epay_merchantnumber,epay_secretkey;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'payone' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},trans_type,payone_clearingtype,payone_aid,payone_portalid,payone_key;{price_legend:hide},price,tax_class;{enabled_legend},debug,enabled', 'worldpay' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},worldpay_instId,worldpay_callbackPW,worldpay_signatureFields,worldpay_md5secret,worldpay_description;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},debug,enabled'), 'subpalettes' => array('protected' => 'groups'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['name'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'label' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['label'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['type'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'default' => 'cash', 'options_callback' => function () {
    return \Isotope\Model\Payment::getModelTypeOptions();
}, 'eval' => array('includeBlankOption' => true, 'helpwizard' => true, 'submitOnChange' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'note' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['note'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rte' => 'tinyMCE'), 'sql' => "text NULL"), 'new_order_status' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['new_order_status'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\OrderStatus::getTable() . '.name', 'options_callback' => array('\\Isotope\\Backend', 'getOrderStatus'), 'eval' => array('mandatory' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'price' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['price'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 16, 'rgxp' => 'surcharge', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'tax_class' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['tax_class'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'options_callback' => array('\\Isotope\\Model\\TaxClass', 'getOptionsWithSplit'), 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'allowed_cc_types' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['allowed_cc_types'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'options_callback' => array('Isotope\\Backend\\Payment\\Callback', 'getAllowedCCTypes'), 'eval' => array('multiple' => true, 'tl_class' => 'clr'), 'sql' => "text NULL"), 'trans_type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['trans_type'], 'exclude' => true, 'default' => 'capture', 'inputType' => 'select', 'options' => array('capture', 'auth'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50', 'helpwizard' => true), 'reference' => $GLOBALS['TL_LANG']['tl_iso_payment'], 'sql' => "varchar(8) NOT NULL default ''"), 'minimum_total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['minimum_total'], 'exclude' => true, 'inputType' => 'text', 'default' => 0, 'eval' => array('maxlength' => 255, 'rgxp' => 'price', 'tl_class' => 'clr w50'), 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'maximum_total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['maximum_total'], 'exclude' => true, 'inputType' => 'text', 'default' => 0, 'eval' => array('maxlength' => 255, 'rgxp' => 'price', 'tl_class' => 'w50'), 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'countries' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['countries'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \System::getCountries();
}, 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'w50 w50h', 'chosen' => true), 'sql' => "blob NULL"), 'shipping_modules' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['shipping_modules'], 'exclude' => true, 'inputType' => 'select', 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'w50 w50h', 'chosen' => true), 'sql' => "blob NULL"), 'product_types' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['product_types'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\ProductType::getTable() . '.name', 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'clr w50 w50h', 'chosen' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'product_types_condition' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['product_types_condition'], 'exclude' => true, 'inputType' => 'select', 'options' => array('onlyAvailable', 'allAvailable', 'oneAvailable'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'config_ids' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['config_ids'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'clr w50 w50h', 'chosen' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'paybyway_merchant_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['paybyway_merchant_id'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'"), 'paybyway_private_key' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['paybyway_private_key'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'paypal_account' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['paypal_account'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'rgxp' => 'email', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'psp_pspid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_pspid'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'psp_http_method' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_http_method'], 'exclude' => true, 'inputType' => 'select', 'default' => 'POST', 'options' => array('POST', 'GET'), 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(4) NOT NULL default ''"), 'psp_hash_method' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_method'], 'exclude' => true, 'default' => 'sha1', 'inputType' => 'select', 'options' => array('sha1', 'sha256', 'sha512'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_method'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(6) NOT NULL default ''"), 'psp_hash_in' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_in'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 128, 'hideInput' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'psp_hash_out' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_hash_out'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 128, 'hideInput' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'psp_dynamic_template' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['psp_dynamic_template'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 128, 'rgxp' => 'url', 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'datatrans_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['datatrans_id'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 100, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'datatrans_sign' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['datatrans_sign'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'sparkasse_paymentmethod' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_paymentmethod'], 'exclude' => true, 'inputType' => 'select', 'options' => array('creditcard', 'maestro', 'directdebit'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_paymentmethod'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'sparkasse_sslmerchant' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_sslmerchant'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'sparkasse_sslpassword' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_sslpassword'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'hideInput' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'sparkasse_merchantref' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sparkasse_merchantref'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'decodeEntities' => true, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''"), 'sofortueberweisung_user_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sofortueberweisung_user_id'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'sofortueberweisung_project_id' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sofortueberweisung_project_id'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'sofortueberweisung_project_password' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['sofortueberweisung_project_password'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'saferpay_accountid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_accountid'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 16, 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'saferpay_description' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_description'], 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''"), 'saferpay_vtconfig' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_vtconfig'], 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'saferpay_paymentmethods' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['saferpay_paymentmethods'], 'inputType' => 'select', 'options' => array(1 => 'MasterCard', 2 => 'Visa', 3 => 'American Express', 4 => 'Diners Club', 5 => 'JCB', 6 => 'Saferpay Testkarte', 7 => 'Laser Card', 8 => 'Bonus Card', 9 => 'PostFinance E-Finance', 10 => 'PostFinance Card', 11 => 'Maestro International', 12 => 'MyOne', 13 => 'Lastschrift', 14 => 'Rechnung', 15 => 'Sofortüberweisung', 16 => 'PayPal', 17 => 'giropay', 18 => 'iDEAL', 19 => 'ClickandBuy', 20 => 'Homebanking AT (eps)', 21 => 'Mpass', 22 => 'ePrzelewy'), 'eval' => array('multiple' => true, 'size' => 5, 'chosen' => true, 'csv' => ',', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'expercash_popupId' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_popupId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'expercash_profile' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_profile'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 3, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(3) NOT NULL default '0'"), 'expercash_popupKey' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_popupKey'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 32, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'expercash_paymentMethod' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_paymentMethod'], 'exclude' => true, 'inputType' => 'select', 'options' => array('automatic_payment_method', 'elv_buy', 'elv_authorize', 'cc_buy', 'cc_authorize', 'giropay', 'sofortueberweisung'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_paymentMethod'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'expercash_css' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['expercash_css'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => 'css', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'epay_windowstate' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_windowstate'], 'exclude' => true, 'default' => '3', 'inputType' => 'select', 'options' => array('3', '4'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_windowstate_options'], 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'epay_merchantnumber' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_merchantnumber'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'epay_secretkey' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['epay_secretkey'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'payone_clearingtype' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_clearingtype'], 'exclude' => true, 'inputType' => 'select', 'options' => array('elv', 'cc', 'dc', 'vor', 'rec', 'sb', 'wlt'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone'], 'eval' => array('mandatory' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(3) NOT NULL default ''"), 'payone_aid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_aid'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 6, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(6) NOT NULL default ''"), 'payone_portalid' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_portalid'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 7, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(7) NOT NULL default ''"), 'payone_key' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['payone_key'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'worldpay_instId' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_instId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 6, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(6) NOT NULL default '0'"), 'worldpay_callbackPW' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_callbackPW'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'worldpay_signatureFields' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_signatureFields'], 'exclude' => true, 'default' => 'instId:cartId:amount:currency', 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'worldpay_md5secret' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_md5secret'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 64, 'decodeEntities' => true, 'hideInput' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'worldpay_description' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['worldpay_description'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'clr long'), 'sql' => "varchar(255) NOT NULL default ''"), 'requireCCV' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['requireCCV'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'guests' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['guests'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'protected' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['protected'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['groups'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'debug' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['debug'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'enabled' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_payment']['enabled'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''")));
Example #25
0
 /**
  * Update the store configs with latest currency conversion data
  * @param   int Config id (optional, if none given, all will be taken)
  */
 public function convertCurrencies($intId = 0)
 {
     $arrColumns = array(Config::getTable() . '.currencyAutomator=?');
     $arrValues = array('1');
     if ($intId > 0) {
         $arrColumns[] = Config::getTable() . '.id=?';
         $arrValues[] = $intId;
     }
     $objConfigs = Config::findBy($arrColumns, $arrValues);
     if (null === $objConfigs) {
         return;
     }
     while ($objConfigs->next()) {
         switch ($objConfigs->currencyProvider) {
             case 'ecb.int':
                 $fltCourse = $objConfigs->currency == 'EUR' ? 1 : 0;
                 $fltCourseOrigin = $objConfigs->currencyOrigin == 'EUR' ? 1 : 0;
                 $objRequest = new \Request();
                 $objRequest->send('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
                 if ($objRequest->hasError()) {
                     \System::log('Error retrieving data from European Central Bank (ecb.int): ' . $objRequest->error . ' (Code ' . $objRequest->code . ')', __METHOD__, TL_ERROR);
                     return;
                 }
                 $objXml = new \SimpleXMLElement($objRequest->response);
                 foreach ($objXml->Cube->Cube->Cube as $currency) {
                     if (!$fltCourse && strtolower($currency['currency']) == strtolower($objConfigs->currency)) {
                         $fltCourse = (double) $currency['rate'];
                     }
                     if (!$fltCourseOrigin && strtolower($currency['currency']) == strtolower($objConfigs->currencyOrigin)) {
                         $fltCourseOrigin = (double) $currency['rate'];
                     }
                 }
                 // Log if one of the currencies is not available
                 if (!$fltCourse || !$fltCourseOrigin) {
                     \System::log('Could not find currency to convert in European Central Bank (ecb.int).', __METHOD__, TL_ERROR);
                     return;
                 }
                 $objConfigs->priceCalculateFactor = $fltCourse / $fltCourseOrigin;
                 $objConfigs->save();
                 break;
             case 'admin.ch':
                 $fltCourse = $objConfigs->currency == 'CHF' ? 1 : 0;
                 $fltCourseOrigin = $objConfigs->currencyOrigin == 'CHF' ? 1 : 0;
                 $objRequest = new \Request();
                 $objRequest->send('http://www.afd.admin.ch/publicdb/newdb/mwst_kurse/wechselkurse.php');
                 if ($objRequest->hasError()) {
                     \System::log('Error retrieving data from Swiss Federal Department of Finance (admin.ch): ' . $objRequest->error . ' (Code ' . $objRequest->code . ')', __METHOD__, TL_ERROR);
                     return;
                 }
                 $objXml = new \SimpleXMLElement($objRequest->response);
                 foreach ($objXml->devise as $currency) {
                     if (!$fltCourse && $currency['code'] == strtolower($objConfigs->currency)) {
                         $fltCourse = (double) $currency->kurs;
                     }
                     if (!$fltCourseOrigin && $currency['code'] == strtolower($objConfigs->currencyOrigin)) {
                         $fltCourseOrigin = (double) $currency->kurs;
                     }
                 }
                 // Log if one of the currencies is not available
                 if (!$fltCourse || !$fltCourseOrigin) {
                     \System::log('Could not find currency to convert in Swiss Federal Department of Finance (admin.ch).', __METHOD__, TL_ERROR);
                     return;
                 }
                 $objConfigs->priceCalculateFactor = $fltCourse / $fltCourseOrigin;
                 $objConfigs->save();
                 break;
             default:
                 // !HOOK: other currency providers
                 if (isset($GLOBALS['ISO_HOOKS']['convertCurrency']) && is_array($GLOBALS['ISO_HOOKS']['convertCurrency'])) {
                     foreach ($GLOBALS['ISO_HOOKS']['convertCurrency'] as $callback) {
                         $objCallback = \System::importStatic($callback[0]);
                         $objCallback->{$callback}[1]($objConfigs->current());
                     }
                 }
         }
     }
 }
<?php

/**
 * Isotope eCommerce for Contao Open Source CMS
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
/**
 * Load tl_iso_product data container and language files
 */
$this->loadDataContainer('tl_iso_product');
\System::loadLanguageFile('tl_iso_product');
/**
 * Table tl_iso_shipping
 */
$GLOBALS['TL_DCA']['tl_iso_shipping'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'closed' => true, 'onload_callback' => array(array('Isotope\\Backend', 'initializeSetupModule'), array('Isotope\\Backend\\Shipping\\Callback', 'checkPermission')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('name'), 'flag' => 1, 'panelLayout' => 'sort,filter;search,limit'), 'label' => array('fields' => array('name', 'type'), 'format' => '%s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>'), 'global_operations' => array('back' => array('label' => &$GLOBALS['TL_LANG']['MSC']['backBT'], 'href' => 'mod=&table=', 'class' => 'header_back', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'new' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['new'], 'href' => 'act=create', 'class' => 'header_new', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif', 'button_callback' => array('Isotope\\Backend\\Shipping\\Callback', 'copyShippingModule')), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"', 'button_callback' => array('Isotope\\Backend\\Shipping\\Callback', 'deleteShippingModule')), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('Isotope\\Backend\\Shipping\\Callback', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('type', 'protected'), 'default' => '{title_legend},name,label,type', 'flat' => '{title_legend},name,label,type;{note_legend:hide},note;{price_legend},price,tax_class,flatCalculation;{config_legend},countries,subdivisions,postalCodes,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,minimum_weight,maximum_weight,product_types,product_types_condition,config_ids;{expert_legend:hide},guests,protected;{enabled_legend},enabled', 'group' => '{title_legend},name,label,type;{note_legend:hide},note;{config_legend},group_methods;{price_legend},group_calculation,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled'), 'subpalettes' => array('protected' => 'groups'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['name'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'label' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['label'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['type'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'default' => 'flat', 'options_callback' => function () {
    return \Isotope\Model\Shipping::getModelTypeOptions();
}, 'eval' => array('helpwizard' => true, 'submitOnChange' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'note' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['note'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rte' => 'tinyMCE', 'decodeEntities' => true), 'sql' => "text NULL"), 'countries' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['countries'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
    return \System::getCountries();
}, 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'w50 w50h', 'chosen' => true), 'sql' => "blob NULL"), 'subdivisions' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['subdivisions'], 'exclude' => true, 'sorting' => true, 'inputType' => 'conditionalselect', 'options_callback' => array('Isotope\\Backend', 'getSubdivisions'), 'eval' => array('multiple' => true, 'size' => 8, 'conditionField' => 'countries', 'tl_class' => 'w50 w50h'), 'sql' => "longblob NULL"), 'postalCodes' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['postalCodes'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:40px', 'tl_class' => 'clr'), 'sql' => "text NULL"), 'minimum_total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['minimum_total'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 13, 'rgxp' => 'price', 'tl_class' => 'w50'), 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'maximum_total' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['maximum_total'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 13, 'rgxp' => 'price', 'tl_class' => 'w50'), 'sql' => "decimal(12,2) NOT NULL default '0.00'"), 'minimum_weight' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['minimum_weight'], 'exclude' => true, 'default' => array('unit' => 'kg'), 'inputType' => 'timePeriod', 'options' => array('mg', 'g', 'kg', 't', 'ct', 'oz', 'lb', 'st', 'grain'), 'reference' => &$GLOBALS['TL_LANG']['WGT'], 'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'maximum_weight' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['maximum_weight'], 'exclude' => true, 'default' => array('unit' => 'kg'), 'inputType' => 'timePeriod', 'options' => array('mg', 'g', 'kg', 't', 'ct', 'oz', 'lb', 'st', 'grain'), 'reference' => &$GLOBALS['TL_LANG']['WGT'], 'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'quantity_mode' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['quantity_mode'], 'exclude' => true, 'inputType' => 'select', 'options' => array('cart_items', 'cart_products'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['quantity_mode'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'minimum_quantity' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['minimum_quantity'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'clr w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'maximum_quantity' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['maximum_quantity'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 10, 'rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'product_types' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['product_types'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\ProductType::getTable() . '.name', 'eval' => array('multiple' => true, 'size' => 8, 'chosen' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'product_types_condition' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['product_types_condition'], 'exclude' => true, 'inputType' => 'select', 'options' => array('onlyAvailable', 'allAvailable', 'oneAvailable', 'calculation'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_shipping'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'config_ids' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['config_ids'], 'exclude' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('multiple' => true, 'size' => 8, 'tl_class' => 'clr w50 w50h', 'chosen' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'price' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['price'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 16, 'rgxp' => 'surcharge', 'tl_class' => 'w50'), 'sql' => "varchar(16) NOT NULL default ''"), 'tax_class' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['tax_class'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'options_callback' => array('\\Isotope\\Model\\TaxClass', 'getOptionsWithSplit'), 'eval' => array('includeBlankOption' => true, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['MSC']['taxFree'], 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'flatCalculation' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['flatCalculation'], 'exclude' => true, 'inputType' => 'select', 'options' => array('flat', 'perProduct', 'perItem'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_shipping'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'group_methods' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['group_methods'], 'exclude' => true, 'inputType' => 'checkboxWizard', 'options_callback' => function ($dc) {
    $objShipping = \Isotope\Model\Shipping::findBy(array($dc->table . '.id!=?'), $dc->id);
    return null === $objShipping ? array() : $objShipping->fetchEach('name');
}, 'eval' => array('mandatory' => true, 'multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => "blob NULL"), 'group_calculation' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['group_calculation'], 'exclude' => true, 'inputType' => 'select', 'options' => array('first', 'lowest', 'highest', 'summarize'), 'reference' => &$GLOBALS['TL_LANG']['tl_iso_shipping'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(10) NOT NULL default ''"), 'guests' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['guests'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'protected' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['protected'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['groups'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'enabled' => array('label' => &$GLOBALS['TL_LANG']['tl_iso_shipping']['enabled'], 'exclude' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''")));
Example #27
0
 *
 * Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
 *
 * @package    Isotope
 * @link       http://isotopeecommerce.org
 * @license    http://opensource.org/licenses/lgpl-3.0.html
 */
\System::loadLanguageFile(\Isotope\Model\Group::getTable());
/**
 * Extend tl_user palettes
 */
$GLOBALS['TL_DCA']['tl_user']['palettes']['extend'] = str_replace('{account_legend}', '{isotope_legend},iso_modules,iso_product_types,iso_product_typep,iso_payment_modules,iso_payment_modulep,iso_shipping_modules,iso_shipping_modulep,iso_tax_classes,iso_tax_classp,iso_tax_rates,iso_tax_ratep,iso_configs,iso_configp,iso_groups,iso_groupp;{account_legend}', $GLOBALS['TL_DCA']['tl_user']['palettes']['extend']);
$GLOBALS['TL_DCA']['tl_user']['palettes']['custom'] = str_replace('{account_legend}', '{isotope_legend},iso_modules,iso_product_types,iso_product_typep,iso_payment_modules,iso_payment_modulep,iso_shipping_modules,iso_shipping_modulep,iso_tax_classes,iso_tax_classp,iso_tax_rates,iso_tax_ratep,iso_configs,iso_configp,iso_groups,iso_groupp;{account_legend}', $GLOBALS['TL_DCA']['tl_user']['palettes']['custom']);
/**
 * Add fields to tl_user
 */
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_modules'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'options_callback' => array('Isotope\\Backend', 'getIsotopeModules'), 'reference' => &$GLOBALS['TL_LANG']['IMD'], 'eval' => array('multiple' => true, 'helpwizard' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_product_types'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_product_types'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\ProductType::getTable() . '.name', 'eval' => array('multiple' => true, 'helpwizard' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_product_typep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_product_typep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_payment_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_payment_modules'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\Payment::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_payment_modulep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_payment_modulep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_shipping_modules'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_shipping_modules'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\Shipping::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_shipping_modulep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_shipping_modulep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_classes'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_classes'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\TaxClass::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_classp'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_classp'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_rates'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_rates'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\TaxRate::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_tax_ratep'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_tax_ratep'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_configs'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_configs'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_configp'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_configp'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_groups'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_groups'], 'exclude' => true, 'inputType' => 'checkbox', 'options_callback' => array('\\Isotope\\Backend\\User\\Callback', 'getGroups'), 'eval' => array('multiple' => true, 'tl_class' => 'clr w50 w50h'), 'sql' => 'blob NULL');
$GLOBALS['TL_DCA']['tl_user']['fields']['iso_groupp'] = array('label' => &$GLOBALS['TL_LANG']['tl_user']['iso_groupp'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete', 'rootPaste'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true, 'tl_class' => 'w50 w50h'), 'sql' => 'blob NULL');