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

This commit is contained in:
vAugagneur
2013-01-14 14:24:14 +01:00
6 changed files with 25 additions and 30 deletions
+3
View File
@@ -145,6 +145,9 @@ class ConfigurationCore extends ObjectModel
*/
public static function get($key, $id_lang = null, $id_shop_group = null, $id_shop = null)
{
if (defined('_PS_DO_NOT_LOAD_CONFIGURATION_') && _PS_DO_NOT_LOAD_CONFIGURATION_)
return false;
// If conf if not initialized, try manual query
if (!self::$_CONF)
{
+13 -24
View File
@@ -419,41 +419,28 @@ class AdminControllerCore extends Controller
*/
public function processFilter()
{
$prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this)));
// Filter memorization
if (isset($_POST) && !empty($_POST) && isset($this->table))
foreach ($_POST as $key => $value)
{
if (is_array($this->table))
{
foreach ($this->table as $table)
if (stripos($key, $table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0)
$this->context->cookie->$key = !is_array($value) ? $value : serialize($value);
}
elseif (stripos($key, $this->table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0)
if (stripos($key, $this->table.'Filter_') === 0)
$this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : serialize($value);
elseif(stripos($key, 'submitFilter') === 0)
$this->context->cookie->$key = !is_array($value) ? $value : serialize($value);
}
if (isset($_GET) && !empty($_GET) && isset($this->table))
foreach ($_GET as $key => $value)
{
if (is_array($this->table))
{
foreach ($this->table as $table)
if (stripos($key, $table.'OrderBy') === 0 || stripos($key, $table.'Orderway') === 0)
$this->context->cookie->$key = $value;
}
elseif (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0)
if (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0)
$this->context->cookie->$key = $value;
}
$filters = $this->context->cookie->getFamily($this->table.'Filter_');
$filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_');
foreach ($filters as $key => $value)
{
/* Extracting filters from $_POST on key filter_ */
if ($value != null && !strncmp($key, $this->table.'Filter_', 7 + Tools::strlen($this->table)))
if ($value != null && !strncmp($key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table)))
{
$key = Tools::substr($key, 7 + Tools::strlen($this->table));
$key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->table));
/* Table alias could be specified using a ! eg. alias!field */
$tmp_tab = explode('!', $key);
$filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0];
@@ -835,11 +822,12 @@ class AdminControllerCore extends Controller
*/
public function processResetFilters()
{
$filters = $this->context->cookie->getFamily($this->table.'Filter_');
$prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this)));
$filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_');
foreach ($filters as $cookie_key => $filter)
if (strncmp($cookie_key, $this->table.'Filter_', 7 + Tools::strlen($this->table)) == 0)
if (strncmp($cookie_key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table)) == 0)
{
$key = substr($cookie_key, 7 + Tools::strlen($this->table));
$key = substr($cookie_key, 7 + Tools::strlen($prefix.$this->table));
/* Table alias could be specified using a ! eg. alias!field */
$tmp_tab = explode('!', $key);
$key = (count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]);
@@ -1592,6 +1580,7 @@ class AdminControllerCore extends Controller
$helper->multiple_fieldsets = $this->multiple_fieldsets;
$helper->row_hover = $this->row_hover;
$helper->position_identifier = $this->position_identifier;
$helper->controller_name = $this->controller_name;
// For each action, try to add the corresponding skip elements list
$helper->list_skip_actions = $this->list_skip_actions;
+5 -4
View File
@@ -530,11 +530,12 @@ class HelperListCore extends Helper
if ($this->position_identifier && ($this->orderBy == 'position' && $this->orderWay != 'DESC'))
$table_dnd = true;
$prefix = isset($this->controller_name) ? str_replace(array('admin', 'controller'), '', Tools::strtolower($this->controller_name)) : '';
foreach ($this->fields_list as $key => $params)
{
if (!isset($params['type']))
$params['type'] = 'text';
$value = Context::getContext()->cookie->{$this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)};
$value = Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)};
switch ($params['type'])
{
case 'bool':
@@ -558,9 +559,9 @@ class HelperListCore extends Helper
case 'select':
foreach ($params['list'] as $option_value => $option_display)
{
if (isset(Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']})
&& Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} == $option_value
&& Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} != '')
if (isset(Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']})
&& Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} == $option_value
&& Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} != '')
$this->fields_list[$key]['select'][$option_value]['selected'] = 'selected';
}
break;
@@ -24,7 +24,7 @@
* International Registered Trademark & Property of PrestaShop SA
*/
require_once(_PS_ROOT_DIR_.'/config/settings.inc.php');
define('_PS_DO_NOT_LOAD_CONFIGURATION_', true);
if (Tools::getValue('bo'))
{
if (!is_dir(_PS_ROOT_DIR_.'/admin/'))
+2
View File
@@ -812,6 +812,8 @@ table#cart_summary #total_price_container {
font-size:13px
}
.cart_voucher p {padding-bottom:0;}
.cart_voucher p.discount_name_block {float:left;}
.cart_voucher #display_cart_vouchers {
clear:both;
line-height: 20px;
+1 -1
View File
@@ -185,7 +185,7 @@
<form action="{if $opc}{$link->getPageLink('order-opc', true)}{else}{$link->getPageLink('order', true)}{/if}" method="post" id="voucher">
<fieldset>
<p class="title_block"><label for="discount_name">{l s='Vouchers'}</label></p>
<p>
<p class="discount_name_block">
<input type="text" class="discount_name" id="discount_name" name="discount_name" value="{if isset($discount_name) && $discount_name}{$discount_name}{/if}" />
</p>
<p class="submit"><input type="hidden" name="submitDiscount" /><input type="submit" name="submitAddDiscount" value="{l s='OK'}" class="button" /></p>