Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap

This commit is contained in:
Kevin Granger
2013-09-18 17:10:59 +02:00
28 changed files with 366 additions and 129 deletions
@@ -27,13 +27,22 @@
{block name="field"}
{if $field['type'] == 'theme'}
{if $field['can_display_themes']}
{foreach $field.themes as $theme}
<div class="select_theme {if $theme->id == $field['id_theme']}select_theme_choice{/if}" onclick="$(this).find('input').attr('checked', true); $('.select_theme').removeClass('select_theme_choice'); $(this).toggleClass('select_theme_choice');">
{$theme->name}<br />
<img src="../themes/{$theme->directory}/preview.jpg" alt="{$theme->directory}" /><br />
<input type="radio" name="id_theme" value="{$theme->id}" {if $theme->id == $field['id_theme']}checked="checked"{/if} />
<div class="col-lg-12">
<div class="row">
{foreach $field.themes as $theme}
<div class="col-lg-2 {if $theme->id == $field['id_theme']}select_theme_choice{/if}" onclick="$(this).find('input').attr('checked', true); $('.select_theme').removeClass('select_theme_choice'); $(this).toggleClass('select_theme_choice');">
<div class="radio">
<label>
<input type="radio" name="id_theme" value="{$theme->id}" {if $theme->id == $field['id_theme']}checked="checked"{/if} /> {$theme->name}
</label>
</div>
<div class="theme_container">
<img class="thumbnail" src="../themes/{$theme->directory}/preview.jpg" alt="{$theme->directory}" />
</div>
</div>
{/foreach}
</div>
{/foreach}
</div>
{/if}
{else}
{$smarty.block.parent}
@@ -30,17 +30,17 @@
class="{if isset($tr.class)} {$tr.class}{/if}"
{if isset($tr.color) && $color_on_bg}style="background-color: {$tr.color}"{/if}
>
{if $has_bulk_actions}
<td class="center">
{if {$has_bulk_actions}}
{if isset($list_skip_actions.delete)}
{if !in_array($tr.$identifier, $list_skip_actions.delete)}
<input type="checkbox" name="{$table}Box[]" value="{$tr.$identifier}" class="noborder" />
{/if}
{else}
{if isset($list_skip_actions.delete)}
{if !in_array($tr.$identifier, $list_skip_actions.delete)}
<input type="checkbox" name="{$table}Box[]" value="{$tr.$identifier}" class="noborder" />
{/if}
{else}
<input type="checkbox" name="{$table}Box[]" value="{$tr.$identifier}" class="noborder" />
{/if}
</td>
{/if}
{foreach $fields_display AS $key => $params}
{block name="open_td"}
<td
@@ -254,8 +254,10 @@
>
<thead>
<tr class="nodrag nodrop">
<th class="center">
{if $has_bulk_actions}
<th class="center fixed-width-xs">
</th>
{/if}
{foreach $fields_display AS $key => $params}
<th class="{if isset($params.class)}{$params.class}{/if}{if isset($params.align)} {$params.align}{/if}">
@@ -308,12 +310,11 @@
</tr>
{if !$simple_header && $show_filters}
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}">
{if $has_bulk_actions}
<td class="center">
{if $has_bulk_actions}
--
{/if}
--
</td>
{/if}
{* Filters (input, select, date or bool) *}
{foreach $fields_display AS $key => $params}
<td {if isset($params.align)} class="{$params.align}" {/if}>
+2
View File
@@ -268,6 +268,8 @@
'CompareProductCore' => 'classes/CompareProduct.php',
'Configuration' => '',
'ConfigurationCore' => 'classes/Configuration.php',
'ConfigurationKPI' => '',
'ConfigurationKPICore' => 'classes/ConfigurationKPI.php',
'ConfigurationTest' => '',
'ConfigurationTestCore' => 'classes/ConfigurationTest.php',
'Connection' => '',
+32 -32
View File
@@ -97,10 +97,10 @@ class ConfigurationCore extends ObjectModel
if ($id_shop_group === null)
$id_shop_group = Shop::getContextShopGroupID(true);
$sql = 'SELECT id_configuration
FROM '._DB_PREFIX_.'configuration
WHERE name = \''.pSQL($key).'\''
.Configuration::sqlRestriction($id_shop_group, $id_shop);
$sql = 'SELECT `'.bqSQL(self::$definition['primary']).'`
FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'`
WHERE name = \''.pSQL($key).'\'
'.Configuration::sqlRestriction($id_shop_group, $id_shop);
return (int)Db::getInstance()->getValue($sql);
}
@@ -111,8 +111,8 @@ class ConfigurationCore extends ObjectModel
{
self::$_CONF = array();
$sql = 'SELECT c.`name`, cl.`id_lang`, IF(cl.`id_lang` IS NULL, c.`value`, cl.`value`) AS value, c.id_shop_group, c.id_shop
FROM `'._DB_PREFIX_.'configuration` c
LEFT JOIN `'._DB_PREFIX_.'configuration_lang` cl ON (c.id_configuration = cl.id_configuration)';
FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'` c
LEFT JOIN `'._DB_PREFIX_.bqSQL(self::$definition['table']).'_lang` cl ON (c.`'.bqSQL(self::$definition['primary']).'` = cl.`'.bqSQL(self::$definition['primary']).'`)';
if (!$results = Db::getInstance()->executeS($sql))
return;
@@ -153,7 +153,7 @@ class ConfigurationCore extends ObjectModel
{
Configuration::loadConfiguration();
if (!self::$_CONF)
return Db::getInstance()->getValue('SELECT `value` FROM `'._DB_PREFIX_.'configuration` WHERE `name` = "'.pSQL($key).'"');
return Db::getInstance()->getValue('SELECT `value` FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'` WHERE `name` = "'.pSQL($key).'"');
}
$id_lang = (int)$id_lang;
if ($id_shop === null)
@@ -323,7 +323,7 @@ class ConfigurationCore extends ObjectModel
if (!$lang)
{
// Update config not linked to lang
$result &= Db::getInstance()->update('configuration', array(
$result &= Db::getInstance()->update(self::$definition['table'], array(
'value' => pSQL($value, $html),
'date_upd' => date('Y-m-d H:i:s'),
), '`name` = \''.pSQL($key).'\''.Configuration::sqlRestriction($id_shop_group, $id_shop), 1, true);
@@ -331,13 +331,13 @@ class ConfigurationCore extends ObjectModel
else
{
// Update multi lang
$sql = 'UPDATE '._DB_PREFIX_.'configuration_lang cl
$sql = 'UPDATE `'._DB_PREFIX_.bqSQL(self::$definition['table']).'_lang` cl
SET cl.value = \''.pSQL($value, $html).'\',
cl.date_upd = NOW()
WHERE cl.id_lang = '.(int)$lang.'
AND cl.id_configuration = (
SELECT c.id_configuration
FROM '._DB_PREFIX_.'configuration c
AND cl.`'.bqSQL(self::$definition['primary']).'` = (
SELECT c.`'.bqSQL(self::$definition['primary']).'`
FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'` c
WHERE c.name = \''.pSQL($key).'\''
.Configuration::sqlRestriction($id_shop_group, $id_shop)
.')';
@@ -363,11 +363,11 @@ class ConfigurationCore extends ObjectModel
if ($lang)
{
$result &= Db::getInstance()->insert('configuration_lang', array(
'id_configuration' => $configID,
'id_lang' => $lang,
'value' => pSQL($value, $html),
'date_upd' => date('Y-m-d H:i:s'),
$result &= Db::getInstance()->insert(self::$definition['table'].'_lang', array(
self::$definition['primary'] => $configID,
'id_lang' => $lang,
'value' => pSQL($value, $html),
'date_upd' => date('Y-m-d H:i:s'),
));
}
}
@@ -390,15 +390,15 @@ class ConfigurationCore extends ObjectModel
return false;
$result = Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'configuration_lang`
WHERE `id_configuration` IN (
SELECT `id_configuration`
FROM `'._DB_PREFIX_.'configuration`
DELETE FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'_lang`
WHERE ``'.bqSQL(self::$definition['primary']).'`` IN (
SELECT ``'.bqSQL(self::$definition['primary']).'``
FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'`
WHERE `name` = "'.pSQL($key).'"
)');
$result2 = Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'configuration`
DELETE FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'`
WHERE `name` = "'.pSQL($key).'"');
self::$_CONF = null;
@@ -423,11 +423,11 @@ class ConfigurationCore extends ObjectModel
$id = Configuration::getIdByName($key, $id_shop_group, $id_shop);
Db::getInstance()->execute('
DELETE FROM '._DB_PREFIX_.'configuration
WHERE id_configuration = '.(int)$id);
DELETE FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'`
WHERE `'.bqSQL(self::$definition['primary']).'` = '.(int)$id);
Db::getInstance()->execute('
DELETE FROM '._DB_PREFIX_.'configuration_lang
WHERE id_configuration = '.(int)$id);
DELETE FROM `'._DB_PREFIX_.bqSQL(self::$definition['table']).'_lang`
WHERE `'.bqSQL(self::$definition['primary']).'` = '.(int)$id);
self::$_CONF = null;
}
@@ -522,15 +522,15 @@ class ConfigurationCore extends ObjectModel
public function getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
{
$query = '
SELECT DISTINCT main.`'.bqSQL($this->def['primary']).'` FROM `'._DB_PREFIX_.bqSQL($this->def['table']).'` main
SELECT DISTINCT main.`'.bqSQL($this->def['primary']).'`
FROM `'._DB_PREFIX_.bqSQL($this->def['table']).'` main
'.$sql_join.'
WHERE id_configuration NOT IN
( SELECT id_configuration
WHERE id_configuration NOT IN (
SELECT id_configuration
FROM '._DB_PREFIX_.bqSQL($this->def['table']).'_lang
) '.$sql_filter.'
'.($sql_sort != '' ? $sql_sort : '').'
'.($sql_limit != '' ? $sql_limit : '').'
';
'.($sql_limit != '' ? $sql_limit : '');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
}
}
}
+170
View File
@@ -0,0 +1,170 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class ConfigurationKPICore extends Configuration
{
public static $definition_backup;
public static function setKpiDefinition()
{
ConfigurationKPI::$definition_backup = Configuration::$definition;
Configuration::$definition['table'] = 'configuration_kpi';
Configuration::$definition['primary'] = 'id_configuration_kpi';
}
public static function unsetKpiDefinition()
{
Configuration::$definition = ConfigurationKPI::$definition_backup;
}
public static function getIdByName($key, $id_shop_group = null, $id_shop = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::getIdByName($key, $id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function loadConfiguration()
{
ConfigurationKPI::setKpiDefinition();
$r = parent::loadConfiguration();
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function get($key, $id_lang = null, $id_shop_group = null, $id_shop = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::get($key, $id_lang, $id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function getGlobalValue($key, $id_lang = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::getGlobalValue($key, $id_lang);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function getInt($key, $id_shop_group = null, $id_shop = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::getInt($key, $id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function getMultiple($keys, $id_lang = null, $id_shop_group = null, $id_shop = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::getMultiple($keys, $id_lang, $id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function hasKey($key, $id_lang = null, $id_shop_group = null, $id_shop = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::hasKey($key, $id_lang, $id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function set($key, $values, $id_shop_group = null, $id_shop = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::set($key, $values, $id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function updateGlobalValue($key, $values, $html = false)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::updateGlobalValue($key, $values, $html);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function updateValue($key, $values, $html = false, $id_shop_group = null, $id_shop = null)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::updateValue($key, $values, $html, $id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function deleteByName($key)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::deleteByName($key);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function deleteFromContext($key)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::deleteFromContext($key);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function hasContext($key, $id_lang, $context)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::hasContext($key, $id_lang, $context);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function isOverridenByCurrentContext($key)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::isOverridenByCurrentContext($key);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
public static function isLangKey($key)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::isLangKey($key);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
protected static function sqlRestriction($id_shop_group, $id_shop)
{
ConfigurationKPI::setKpiDefinition();
$r = parent::sqlRestriction($id_shop_group, $id_shop);
ConfigurationKPI::unsetKpiDefinition();
return $r;
}
}
@@ -55,7 +55,7 @@ class AdminAddressesControllerCore extends AdminController
$this->countries_array[$country['id_country']] = $country['name'];
$this->fields_list = array(
'id_address' => array('title' => $this->l('ID'), 'align' => 'center'),
'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'firstname' => array('title' => $this->l('First Name'), 'filter_key' => 'a!firstname'),
'lastname' => array('title' => $this->l('Last Name'), 'filter_key' => 'a!lastname'),
'address1' => array('title' => $this->l('Address')),
+2 -1
View File
@@ -48,7 +48,8 @@ class AdminCartsControllerCore extends AdminController
$this->fields_list = array(
'id_cart' => array(
'title' => $this->l('ID'),
'align' => 'center'
'align' => 'center',
'class' => 'fixed-width-xs'
),
'id_order' => array(
'title' => $this->l('Order ID'),
@@ -347,9 +347,9 @@ class AdminCategoriesControllerCore extends AdminController
$helper->icon = 'icon-off';
$helper->color = 'color1';
$helper->title = $this->l('Disabled Categories');
if (Configuration::get('PS_KPI_DISABLED_CATS') !== false)
$helper->value = Configuration::get('PS_KPI_DISABLED_CATS');
if (Configuration::get('PS_KPI_DISABLED_CATS_EXPIRE') < $time)
if (ConfigurationKPI::get('DISABLED_CATS') !== false)
$helper->value = ConfigurationKPI::get('DISABLED_CATS');
if (ConfigurationKPI::get('DISABLED_CATS_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=disabled_categories';
$kpis[] = $helper->generate();
@@ -358,9 +358,9 @@ class AdminCategoriesControllerCore extends AdminController
$helper->icon = 'icon-bookmark-empty';
$helper->color = 'color2';
$helper->title = $this->l('Empty Categories');
if (Configuration::get('PS_KPI_EMPTY_CATS') !== false)
$helper->value = Configuration::get('PS_KPI_EMPTY_CATS');
if (Configuration::get('PS_KPI_EMPTY_CATS_EXPIRE') < $time)
if (ConfigurationKPI::get('EMPTY_CATS') !== false)
$helper->value = ConfigurationKPI::get('EMPTY_CATS');
if (ConfigurationKPI::get('EMPTY_CATS_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=empty_categories';
$kpis[] = $helper->generate();
+5 -5
View File
@@ -43,11 +43,11 @@ class AdminCmsControllerCore extends AdminController
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array(
'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'link_rewrite' => array('title' => $this->l('URL'), 'width' => 'auto'),
'meta_title' => array('title' => $this->l('Title'), 'width' => '300', 'filter_key' => 'b!meta_title'),
'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'),
'active' => array('title' => $this->l('Displayed'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'link_rewrite' => array('title' => $this->l('URL')),
'meta_title' => array('title' => $this->l('Title'), 'filter_key' => 'b!meta_title'),
'position' => array('title' => $this->l('Position'),'filter_key' => 'position', 'align' => 'center', 'class' => 'fixed-width-md', 'position' => 'position'),
'active' => array('title' => $this->l('Displayed'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
);
// The controller can't be call directly
@@ -37,7 +37,7 @@ class AdminContactsControllerCore extends AdminController
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array(
'id_contact' => array('title' => $this->l('ID'), 'align' => 'center'),
'id_contact' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'name' => array('title' => $this->l('Title')),
'email' => array('title' => $this->l('Email address')),
'description' => array('title' => $this->l('Description')),
@@ -58,7 +58,9 @@ class AdminCustomerThreadsControllerCore extends AdminController
$this->fields_list = array(
'id_customer_thread' => array(
'title' => $this->l('ID')
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'customer' => array(
'title' => $this->l('Customer'),
@@ -79,7 +79,8 @@ class AdminCustomersControllerCore extends AdminController
$this->fields_list = array(
'id_customer' => array(
'title' => $this->l('ID'),
'align' => 'center'
'align' => 'center',
'class' => 'fixed-width-xs'
),
'id_gender' => array(
'title' => $this->l('Title'),
@@ -72,12 +72,12 @@ class AdminEmployeesControllerCore extends AdminController
$this->profiles_array[$profile['name']] = $profile['name'];
$this->fields_list = array(
'id_employee' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'lastname' => array('title' => $this->l('Last Name'), 'width' => 'auto'),
'firstname' => array('title' => $this->l('First Name'), 'width' => 130),
'email' => array('title' => $this->l('Email address'), 'width' => 180),
'profile' => array('title' => $this->l('Profile'), 'width' => 90, 'type' => 'select', 'list' => $this->profiles_array, 'filter_key' => 'pl!name'),
'active' => array('title' => $this->l('Can log in'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'width' => 30),
'id_employee' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'lastname' => array('title' => $this->l('Last Name')),
'firstname' => array('title' => $this->l('First Name')),
'email' => array('title' => $this->l('Email address')),
'profile' => array('title' => $this->l('Profile'), 'type' => 'select', 'list' => $this->profiles_array, 'filter_key' => 'pl!name'),
'active' => array('title' => $this->l('Can log in'), 'align' => 'center', 'active' => 'status', 'type' => 'bool'),
);
$this->fields_options = array(
+2 -1
View File
@@ -53,7 +53,8 @@ class AdminGendersControllerCore extends AdminController
$this->fields_list = array(
'id_gender' => array(
'title' => $this->l('ID'),
'align' => 'center'
'align' => 'center',
'class' => 'fixed-width-xs'
),
'name' => array(
'title' => $this->l('Name'),
+2 -1
View File
@@ -46,7 +46,8 @@ class AdminGroupsControllerCore extends AdminController
$this->fields_list = array(
'id_group' => array(
'title' => $this->l('ID'),
'align' => 'center'
'align' => 'center',
'class' => 'fixed-width-xs'
),
'name' => array(
'title' => $this->l('Name'),
+2 -2
View File
@@ -41,8 +41,8 @@ class AdminImagesControllerCore extends AdminController
$this->addRowAction('delete');
$this->fields_list = array(
'id_image_type' => array('title' => $this->l('ID'), 'align' => 'center'),
'name' => array('title' => $this->l('Name'), 'width' => 'auto'),
'id_image_type' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'name' => array('title' => $this->l('Name')),
'width' => array('title' => $this->l('Width'), 'suffix' => ' px'),
'height' => array('title' => $this->l('Height'), 'suffix' => ' px'),
'products' => array('title' => $this->l('Products'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false),
+14 -14
View File
@@ -1252,11 +1252,11 @@ class AdminOrdersControllerCore extends AdminController
$helper->color = 'color1';
$helper->title = $this->l('Conversion Rate');
$helper->subtitle = $this->l('30 days');
if (Configuration::get('PS_KPI_CONVERSION_RATE') !== false)
$helper->value = Configuration::get('PS_KPI_CONVERSION_RATE');
if (Configuration::get('PS_KPI_CONVERSION_RATE_CHART') !== false)
$helper->data = Configuration::get('PS_KPI_CONVERSION_RATE_CHART');
if (Configuration::get('PS_KPI_CONVERSION_RATE_EXPIRE') < $time)
if (ConfigurationKPI::get('CONVERSION_RATE') !== false)
$helper->value = ConfigurationKPI::get('CONVERSION_RATE');
if (ConfigurationKPI::get('CONVERSION_RATE_CHART') !== false)
$helper->data = ConfigurationKPI::get('CONVERSION_RATE_CHART');
if (ConfigurationKPI::get('CONVERSION_RATE_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=conversion_rate';
$kpis[] = $helper->generate();
@@ -1266,9 +1266,9 @@ class AdminOrdersControllerCore extends AdminController
$helper->color = 'color2';
$helper->title = $this->l('Abandoned Carts');
$helper->subtitle = $this->l('Today');
if (Configuration::get('PS_KPI_ABANDONED_CARTS') !== false)
$helper->value = Configuration::get('PS_KPI_ABANDONED_CARTS');
if (Configuration::get('PS_KPI_ABANDONED_CARTS_EXPIRE') < $time)
if (ConfigurationKPI::get('ABANDONED_CARTS') !== false)
$helper->value = ConfigurationKPI::get('ABANDONED_CARTS');
if (ConfigurationKPI::get('ABANDONED_CARTS_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=abandoned_cart';
$kpis[] = $helper->generate();
@@ -1278,9 +1278,9 @@ class AdminOrdersControllerCore extends AdminController
$helper->color = 'color3';
$helper->title = $this->l('Average Order Value');
$helper->subtitle = $this->l('30 days');
if (Configuration::get('PS_KPI_AVG_ORDER_VALUE') !== false)
$helper->value = Configuration::get('PS_KPI_AVERAGE_ORDER_VALUE');
if (Configuration::get('PS_KPI_AVG_ORDER_VALUE_EXPIRE') < $time)
if (ConfigurationKPI::get('AVG_ORDER_VALUE') !== false)
$helper->value = ConfigurationKPI::get('AVERAGE_ORDER_VALUE');
if (ConfigurationKPI::get('AVG_ORDER_VALUE_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=average_order_value';
$kpis[] = $helper->generate();
@@ -1290,9 +1290,9 @@ class AdminOrdersControllerCore extends AdminController
$helper->color = 'color4';
$helper->title = $this->l('Net Profit per Visitor');
$helper->subtitle = $this->l('30 days');
if (Configuration::get('PS_KPI_NETPROFIT_VISITOR') !== false)
$helper->value = Configuration::get('PS_KPI_NETPROFIT_VISITOR');
if (Configuration::get('PS_KPI_NETPROFIT_VISITOR_EXPIRE') < $time)
if (ConfigurationKPI::get('NETPROFIT_VISITOR') !== false)
$helper->value = ConfigurationKPI::get('NETPROFIT_VISITOR');
if (ConfigurationKPI::get('NETPROFIT_VISITOR_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=netprofit_visitor';
$kpis[] = $helper->generate();
@@ -142,7 +142,7 @@ class AdminPreferencesControllerCore extends AdminController
if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED'))
{
$fields['PS_SSL_ENABLED']['type'] = 'disabled';
$fields['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools::getShopDomainSsl().Tools::safeOutput($_SERVER['REQUEST_URI']).'">'.
$fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://'.Tools::getShopDomainSsl().Tools::safeOutput($_SERVER['REQUEST_URI']).'">'.
$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>';
}
@@ -2299,9 +2299,9 @@ class AdminProductsControllerCore extends AdminController
$helper->icon = 'icon-archive';
$helper->color = 'color1';
$helper->title = $this->l('Products in Stock');
if (Configuration::get('PS_KPI_PRODUCTS_STOCK') !== false)
$helper->value = Configuration::get('PS_KPI_PRODUCTS_STOCK');
if (Configuration::get('PS_KPI_PRODUCTS_STOCK_EXPIRE') < $time)
if (ConfigurationKPI::get('PRODUCTS_STOCK') !== false)
$helper->value = ConfigurationKPI::get('PRODUCTS_STOCK');
if (ConfigurationKPI::get('PRODUCTS_STOCK_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=products_stock';
$kpis[] = $helper->generate();
@@ -2310,9 +2310,9 @@ class AdminProductsControllerCore extends AdminController
$helper->icon = 'icon-tags';
$helper->color = 'color2';
$helper->title = $this->l('Average Gross Margin');
if (Configuration::get('PS_KPI_AVG_GROSS_MARGIN') !== false)
$helper->value = Configuration::get('PS_KPI_AVG_GROSS_MARGIN');
if (Configuration::get('PS_KPI_AVG_GROSS_MARGIN_EXPIRE') < $time)
if (ConfigurationKPI::get('AVG_GROSS_MARGIN') !== false)
$helper->value = ConfigurationKPI::get('AVG_GROSS_MARGIN');
if (ConfigurationKPI::get('AVG_GROSS_MARGIN_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=avg_gross_margin';
$kpis[] = $helper->generate();
@@ -46,7 +46,8 @@ class AdminProfilesControllerCore extends AdminController
$this->fields_list = array(
'id_profile' => array(
'title' => $this->l('ID'),
'align' => 'center'
'align' => 'center',
'class' => 'fixed-width-xs'
),
'name' => array('title' => $this->l('Name'))
);
@@ -47,9 +47,9 @@ class AdminSearchConfControllerCore extends AdminController
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array(
'alias' => array('title' => $this->l('Aliases'), 'width' => 'auto'),
'search' => array('title' => $this->l('Search'), 'width' => 100),
'active' => array('title' => $this->l('Status'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
'alias' => array('title' => $this->l('Aliases')),
'search' => array('title' => $this->l('Search')),
'active' => array('title' => $this->l('Status'), 'class' => 'fixed-width-md', 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
);
// Search options
+17 -17
View File
@@ -80,9 +80,9 @@ class AdminStatsControllerCore extends AdminStatsTabController
$value = 0;
$value .= '%';
Configuration::updateValue('PS_KPI_CONVERSION_RATE_CHART', Tools::jsonEncode($data));
Configuration::updateValue('PS_KPI_CONVERSION_RATE', $value);
Configuration::updateValue('PS_KPI_CONVERSION_RATE_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
ConfigurationKPI::updateValue('CONVERSION_RATE_CHART', Tools::jsonEncode($data));
ConfigurationKPI::updateValue('CONVERSION_RATE', $value);
ConfigurationKPI::updateValue('CONVERSION_RATE_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
break;
case 'abandoned_cart':
@@ -92,8 +92,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
WHERE `date_add` BETWEEN "'.pSQL(date('Y-m-d')).' 00:00:00" AND "'.pSQL(date('Y-m-d')).' 23:59:59"
AND id_cart NOT IN (SELECT id_cart FROM `'._DB_PREFIX_.'orders`)
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
Configuration::updateValue('PS_KPI_ABANDONED_CARTS', $value);
Configuration::updateValue('PS_KPI_ABANDONED_CARTS_EXPIRE', strtotime('+10 min'));
ConfigurationKPI::updateValue('ABANDONED_CARTS', $value);
ConfigurationKPI::updateValue('ABANDONED_CARTS_EXPIRE', strtotime('+10 min'));
break;
case 'products_stock':
@@ -103,8 +103,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
'.Shop::addSqlAssociation('product', 'p').'
'.Product::sqlStock('p'));
$value = round($row['total'] ? $row['stock'] / $row['total'] : 0, 2).'%';
Configuration::updateValue('PS_KPI_PRODUCTS_STOCK', $value);
Configuration::updateValue('PS_KPI_PRODUCTS_STOCK_EXPIRE', strtotime('+10 min'));
ConfigurationKPI::updateValue('PRODUCTS_STOCK', $value);
ConfigurationKPI::updateValue('PRODUCTS_STOCK_EXPIRE', strtotime('+10 min'));
break;
case 'avg_gross_margin':
@@ -113,8 +113,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p'));
$value = round(100 * $value, 2).'%';
Configuration::updateValue('PS_KPI_AVG_GROSS_MARGIN', $value);
Configuration::updateValue('PS_KPI_AVG_GROSS_MARGIN_EXPIRE', strtotime('+6 hour'));
ConfigurationKPI::updateValue('AVG_GROSS_MARGIN', $value);
ConfigurationKPI::updateValue('AVG_GROSS_MARGIN_EXPIRE', strtotime('+6 hour'));
break;
case 'disabled_categories':
@@ -123,8 +123,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
FROM `'._DB_PREFIX_.'category` c
'.Shop::addSqlAssociation('category', 'c').'
WHERE c.active = 0');
Configuration::updateValue('PS_KPI_DISABLED_CATS', $value);
Configuration::updateValue('PS_KPI_DISABLED_CATS_EXPIRE', strtotime('+2 hour'));
ConfigurationKPI::updateValue('DISABLED_CATS', $value);
ConfigurationKPI::updateValue('DISABLED_CATS_EXPIRE', strtotime('+2 hour'));
break;
case 'empty_categories':
@@ -137,8 +137,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
FROM `'._DB_PREFIX_.'category_product` cp
'.Shop::addSqlAssociation('category', 'cp'));
$value = intval($total - $used);
Configuration::updateValue('PS_KPI_EMPTY_CATS', $value);
Configuration::updateValue('PS_KPI_EMPTY_CATS_EXPIRE', strtotime('+2 hour'));
ConfigurationKPI::updateValue('EMPTY_CATS', $value);
ConfigurationKPI::updateValue('EMPTY_CATS_EXPIRE', strtotime('+2 hour'));
break;
case 'average_order_value':
@@ -150,8 +150,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
WHERE `invoice_date` BETWEEN "'.pSQL(date('Y-m-d', strtotime('-31 day'))).' 00:00:00" AND "'.pSQL(date('Y-m-d', strtotime('-1 day'))).' 23:59:59"
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
$value = Tools::displayPrice($row['orders'] ? $row['total_paid_tax_excl'] / $row['orders'] : 0, $currency);
Configuration::updateValue('PS_KPI_AVG_ORDER_VALUE', $value);
Configuration::updateValue('PS_KPI_AVG_ORDER_VALUE_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
ConfigurationKPI::updateValue('AVG_ORDER_VALUE', $value);
ConfigurationKPI::updateValue('AVG_ORDER_VALUE_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
break;
case 'netprofit_visitor':
@@ -207,8 +207,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
else
$value = Tools::displayPrice(0, $currency);
Configuration::updateValue('PS_KPI_NETPROFIT_VISITOR', $value);
Configuration::updateValue('PS_KPI_NETPROFIT_VISITOR_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
ConfigurationKPI::updateValue('NETPROFIT_VISITOR', $value);
ConfigurationKPI::updateValue('NETPROFIT_VISITOR_EXPIRE', strtotime(date('Y-m-d 00:00:00', strtotime('+1 day'))));
break;
default:
+10 -10
View File
@@ -45,16 +45,16 @@ class AdminStoresControllerCore extends AdminController
);
$this->fields_list = array(
'id_store' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'name' => array('title' => $this->l('Name'), 'width' => 120, 'filter_key' => 'a!name'),
'address1' => array('title' => $this->l('Address'), 'width' => 120, 'filter_key' => 'a!address1'),
'city' => array('title' => $this->l('City'), 'width' => 100),
'postcode' => array('title' => $this->l('Zip code'), 'width' => 50),
'state' => array('title' => $this->l('State'), 'width' => 100, 'filter_key' => 'st!name'),
'country' => array('title' => $this->l('Country'), 'width' => 100, 'filter_key' => 'cl!name'),
'phone' => array('title' => $this->l('Phone'), 'width' => 70),
'fax' => array('title' => $this->l('Fax'), 'width' => 70),
'active' => array('title' => $this->l('Enabled'), 'width' => 70, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
'id_store' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'name' => array('title' => $this->l('Name'), 'filter_key' => 'a!name'),
'address1' => array('title' => $this->l('Address'), 'filter_key' => 'a!address1'),
'city' => array('title' => $this->l('City')),
'postcode' => array('title' => $this->l('Zip code')),
'state' => array('title' => $this->l('State'), 'filter_key' => 'st!name'),
'country' => array('title' => $this->l('Country'), 'filter_key' => 'cl!name'),
'phone' => array('title' => $this->l('Phone')),
'fax' => array('title' => $this->l('Fax')),
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
);
$this->bulk_actions = array(
+5 -2
View File
@@ -46,7 +46,9 @@ class AdminTabsControllerCore extends AdminController
$this->fields_list = array(
'id_tab' => array(
'title' => $this->l('ID')
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'name' => array(
'title' => $this->l('Name')
@@ -71,7 +73,8 @@ class AdminTabsControllerCore extends AdminController
'position' => array(
'title' => $this->l('Position'),
'filter_key' => 'a!position',
'position' => 'position'
'position' => 'position',
'class' => 'fixed-width-md'
)
);
@@ -210,6 +210,7 @@ class AdminThemesControllerCore extends AdminController
'id_theme' => array(
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'name' => array(
'title' => $this->l('Name'),
+22
View File
@@ -440,6 +440,28 @@ CREATE TABLE `PREFIX_configuration_lang` (
PRIMARY KEY (`id_configuration`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_configuration_kpi` (
`id_configuration_kpi` int(10) unsigned NOT NULL auto_increment,
`id_shop_group` INT(11) UNSIGNED DEFAULT NULL,
`id_shop` INT(11) UNSIGNED DEFAULT NULL,
`name` varchar(32) NOT NULL,
`value` text,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_configuration_kpi`),
KEY `name` (`name`),
KEY `id_shop` (`id_shop`),
KEY `id_shop_group` (`id_shop_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_configuration_kpi_lang` (
`id_configuration_kpi` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`value` text,
`date_upd` datetime default NULL,
PRIMARY KEY (`id_configuration_kpi`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_connections` (
`id_connections` int(10) unsigned NOT NULL auto_increment,
`id_shop_group` INT(11) UNSIGNED NOT NULL DEFAULT '1',
+22
View File
@@ -4,3 +4,25 @@ INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VAL
ALTER TABLE `PREFIX_employee` CHANGE `bo_show_screencast` `bo_menu` TINYINT(1) NOT NULL DEFAULT '0';
UPDATE `PREFIX_employee` SET bo_menu = 0;
CREATE TABLE `PREFIX_configuration_kpi` (
`id_configuration_kpi` int(10) unsigned NOT NULL auto_increment,
`id_shop_group` INT(11) UNSIGNED DEFAULT NULL,
`id_shop` INT(11) UNSIGNED DEFAULT NULL,
`name` varchar(32) NOT NULL,
`value` text,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_configuration_kpi`),
KEY `name` (`name`),
KEY `id_shop` (`id_shop`),
KEY `id_shop_group` (`id_shop_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_configuration_kpi_lang` (
`id_configuration_kpi` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`value` text,
`date_upd` datetime default NULL,
PRIMARY KEY (`id_configuration_kpi`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;