// Fixed bug position in HelperList
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
{foreach $fields_display AS $key => $params}
|
{foreach $fields_display AS $key => $params}
|
||||||
<td
|
<td
|
||||||
{if isset($params.position)}
|
{if isset($params.position)}
|
||||||
id="td_{if $id_category}$id_category{else}0{/if}_{$tr.$identifier}"
|
id="td_{if $id_category}{$id_category}{else}0{/if}_{$tr.$identifier}"
|
||||||
{/if}
|
{/if}
|
||||||
class="{if !$no_link}pointer{/if}
|
class="{if !$no_link}pointer{/if}
|
||||||
{if isset($params.position) && $order_by == 'position'} dragHandle{/if}
|
{if isset($params.position) && $order_by == 'position'} dragHandle{/if}
|
||||||
@@ -55,16 +55,16 @@
|
|||||||
<img src="../img/admin/{if $tr.$key}enabled.gif{else}disabled.gif{/if}"
|
<img src="../img/admin/{if $tr.$key}enabled.gif{else}disabled.gif{/if}"
|
||||||
alt="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" title="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" />
|
alt="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" title="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" />
|
||||||
{elseif isset($params.position)}
|
{elseif isset($params.position)}
|
||||||
{if $orderBy == 'position' && $orderWay != 'DESC'}
|
{if $order_by == 'position' && $order_way != 'DESC'}
|
||||||
<a {if !($tr.$key.position != $positions[sizeof($positions) - 1])}style="display: none;"{/if} href="{$tr.$key.position_url_down}">
|
<a href="{$tr.$key.position_url_down}" {if !($tr.$key.position != $positions[count($positions) - 1])}style="display: none;"{/if}>
|
||||||
<img src="../img/admin/{if $orderWay == 'ASC'}down{else}up{/if}.gif"
|
<img src="../img/admin/{if $order_way == 'ASC'}down{else}up{/if}.gif" alt="{l s='Down'}" title="{l s='Down'}" />
|
||||||
alt="{l s='Down'}" title="{l s='Down'}" /></a>
|
</a>
|
||||||
|
|
||||||
<a {if !($tr.$key.position != $positions.0)}style="display: none;"{/if} href="{$tr.$key.position_url_up}">
|
<a href="{$tr.$key.position_url_up}" {if !($tr.$key.position != $positions.0)}style="display: none;"{/if}>
|
||||||
<img src="../img/admin/{if $orderWay == 'ASC'}up{else}down{/if}.gif"
|
<img src="../img/admin/{if $order_way == 'ASC'}up{else}down{/if}.gif" alt="{l s='Up'}" title="{l s='Up'}" />
|
||||||
alt="{l s='Up'}" title="{l s='Up'}" /></a>';
|
</a>
|
||||||
{else}
|
{else}
|
||||||
{$tr.$key.position} + 1
|
{$tr.$key.position + 1}
|
||||||
{/if}
|
{/if}
|
||||||
{elseif isset($params.image)}
|
{elseif isset($params.image)}
|
||||||
{$tr.$key}
|
{$tr.$key}
|
||||||
|
|||||||
@@ -1068,6 +1068,8 @@ class AdminControllerCore extends Controller
|
|||||||
$helper->currentIndex = self::$currentIndex;
|
$helper->currentIndex = self::$currentIndex;
|
||||||
$helper->className = $this->className;
|
$helper->className = $this->className;
|
||||||
$helper->table = $this->table;
|
$helper->table = $this->table;
|
||||||
|
$helper->_orderBy = $this->_orderBy;
|
||||||
|
$helper->_orderWay = $this->_orderWay;
|
||||||
$helper->shopLink = $this->shopLink;
|
$helper->shopLink = $this->shopLink;
|
||||||
$helper->shopLinkType = $this->shopLinkType;
|
$helper->shopLinkType = $this->shopLinkType;
|
||||||
$helper->identifier = $this->identifier;
|
$helper->identifier = $this->identifier;
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ class HelperListCore extends Helper
|
|||||||
protected $_pagination = array(20, 50, 100, 300);
|
protected $_pagination = array(20, 50, 100, 300);
|
||||||
|
|
||||||
/** @var string ORDER BY clause determined by field/arrows in list header */
|
/** @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 */
|
/** @var string Default ORDER BY clause when $_orderBy is not defined */
|
||||||
protected $_defaultOrderBy = false;
|
protected $_defaultOrderBy = false;
|
||||||
|
|
||||||
/** @var string Order way (ASC, DESC) determined by arrows in list header */
|
/** @var string Order way (ASC, DESC) determined by arrows in list header */
|
||||||
protected $_orderWay;
|
public $_orderWay;
|
||||||
|
|
||||||
public $identifier;
|
public $identifier;
|
||||||
|
|
||||||
@@ -95,7 +95,8 @@ class HelperListCore extends Helper
|
|||||||
'id_category' => 'id_category_to_move',
|
'id_category' => 'id_category_to_move',
|
||||||
'id_cms_category' => 'id_cms_category_to_move',
|
'id_cms_category' => 'id_cms_category_to_move',
|
||||||
'id_cms' => 'id_cms',
|
'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
|
// @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']))
|
else if (isset($params['position']))
|
||||||
{
|
{
|
||||||
$this->_list[$index][$key] = array(
|
$this->_list[$index][$key] = array(
|
||||||
'position' => $tr[$key],
|
'position' => (int)$tr[$key],
|
||||||
'position_url_down' => $this->currentIndex.
|
'position_url_down' => $this->currentIndex.
|
||||||
'&'.$key_to_get.'='.(int)$id_category.'&'.$this->identifiersDnd[$this->identifier].'='.$id.
|
'&'.$key_to_get.'='.(int)$id_category.'&'.$this->identifiersDnd[$this->identifier].'='.$id.
|
||||||
'&way=1&position='.((int)$tr['position'] + 1).'&token='.$this->token,
|
'&way=1&position='.((int)$tr['position'] + 1).'&token='.$this->token,
|
||||||
@@ -281,6 +282,7 @@ class HelperListCore extends Helper
|
|||||||
'id_category' => $id_category,
|
'id_category' => $id_category,
|
||||||
'bulk_actions' => $this->bulk_actions,
|
'bulk_actions' => $this->bulk_actions,
|
||||||
'key_to_get' => $key_to_get,
|
'key_to_get' => $key_to_get,
|
||||||
|
'order_by' => $this->_orderBy,
|
||||||
'positions' => isset($positions) ? $positions : null,
|
'positions' => isset($positions) ? $positions : null,
|
||||||
'is_cms' => $this->is_cms,
|
'is_cms' => $this->is_cms,
|
||||||
'fields_display' => $this->fieldsDisplay,
|
'fields_display' => $this->fieldsDisplay,
|
||||||
|
|||||||
Reference in New Issue
Block a user