From 17ec57e1353da73dd3907aabd67bb07791b89f62 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Wed, 19 Oct 2011 08:40:47 +0000 Subject: [PATCH] // Fixed bug position in HelperList --- admin-dev/themes/template/list_content.tpl | 18 +++++++++--------- classes/AdminController.php | 2 ++ classes/HelperList.php | 10 ++++++---- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/admin-dev/themes/template/list_content.tpl b/admin-dev/themes/template/list_content.tpl index 84d43041c..50c6758eb 100644 --- a/admin-dev/themes/template/list_content.tpl +++ b/admin-dev/themes/template/list_content.tpl @@ -38,7 +38,7 @@ {foreach $fields_display AS $key => $params} {elseif isset($params.position)} - {if $orderBy == 'position' && $orderWay != 'DESC'} - - {l s='Down'} + {if $order_by == 'position' && $order_way != 'DESC'} + + {l s='Down'} + - - {l s='Up'}'; + + {l s='Up'} + {else} - {$tr.$key.position} + 1 + {$tr.$key.position + 1} {/if} {elseif isset($params.image)} {$tr.$key} diff --git a/classes/AdminController.php b/classes/AdminController.php index 78eabe3fa..96570f03d 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -1068,6 +1068,8 @@ class AdminControllerCore extends Controller $helper->currentIndex = self::$currentIndex; $helper->className = $this->className; $helper->table = $this->table; + $helper->_orderBy = $this->_orderBy; + $helper->_orderWay = $this->_orderWay; $helper->shopLink = $this->shopLink; $helper->shopLinkType = $this->shopLinkType; $helper->identifier = $this->identifier; diff --git a/classes/HelperList.php b/classes/HelperList.php index b88a0cac8..f1701ccf2 100644 --- a/classes/HelperList.php +++ b/classes/HelperList.php @@ -43,13 +43,13 @@ class HelperListCore extends Helper protected $_pagination = array(20, 50, 100, 300); /** @var string ORDER BY clause determined by field/arrows in list header */ - protected $_orderBy; + public $_orderBy; /** @var string Default ORDER BY clause when $_orderBy is not defined */ protected $_defaultOrderBy = false; /** @var string Order way (ASC, DESC) determined by arrows in list header */ - protected $_orderWay; + public $_orderWay; public $identifier; @@ -95,7 +95,8 @@ class HelperListCore extends Helper 'id_category' => 'id_category_to_move', 'id_cms_category' => 'id_cms_category_to_move', 'id_cms' => 'id_cms', - 'id_attribute' => 'id_attribute' + 'id_attribute' => 'id_attribute', + 'id_carrier' => 'id_carrier' ); // @var boolean ask for simple header : no filters, no paginations and no sorting @@ -217,7 +218,7 @@ class HelperListCore extends Helper else if (isset($params['position'])) { $this->_list[$index][$key] = array( - 'position' => $tr[$key], + 'position' => (int)$tr[$key], 'position_url_down' => $this->currentIndex. '&'.$key_to_get.'='.(int)$id_category.'&'.$this->identifiersDnd[$this->identifier].'='.$id. '&way=1&position='.((int)$tr['position'] + 1).'&token='.$this->token, @@ -281,6 +282,7 @@ class HelperListCore extends Helper 'id_category' => $id_category, 'bulk_actions' => $this->bulk_actions, 'key_to_get' => $key_to_get, + 'order_by' => $this->_orderBy, 'positions' => isset($positions) ? $positions : null, 'is_cms' => $this->is_cms, 'fields_display' => $this->fieldsDisplay,