// fixed icon column type issue on HelperList

// now callback column call a method of AdminController and not of Entity
// clean datepicker in HelperList
This commit is contained in:
aFolletete
2011-10-10 15:35:25 +00:00
parent 2cebea328f
commit 0cae1812d2
3 changed files with 25 additions and 16 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
{* {*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -36,14 +36,14 @@
{/if} {/if}
</td> </td>
{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}
{if isset($params.align)} {$params.align}{/if}" {if isset($params.align)} {$params.align}{/if}"
{if (!isset($params.position) && !$no_link)} {if (!isset($params.position) && !$no_link)}
onclick="document.location = '{$current_index}&{$identifier}={$tr.$identifier}{if $view}&view{else}&update{/if}{$table}&token={$token}'">{if isset($params.prefix)}$params.prefix{/if} onclick="document.location = '{$current_index}&{$identifier}={$tr.$identifier}{if $view}&view{else}&update{/if}{$table}&token={$token}'">{if isset($params.prefix)}$params.prefix{/if}
{else} {else}
@@ -68,8 +68,8 @@
{/if} {/if}
{elseif isset($params.image)} {elseif isset($params.image)}
{$tr.$key} {$tr.$key}
{*{elseif (isset($params.icon) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default'])))} {elseif (isset($params.icon))}
<img src="../img/admin/{$tr.$key.icon_path}" alt="$tr.$key" title="$tr.$key" />*} <img src="../img/admin/{$tr[$key]}" alt="{$tr[$key]}" title="{$tr[$key]}" />
{elseif isset($params.price)} {elseif isset($params.price)}
{$tr.$key} {$tr.$key}
{elseif isset($params.float)} {elseif isset($params.float)}
+17 -8
View File
@@ -1,5 +1,5 @@
{* {*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -42,7 +42,16 @@
</script> </script>
<script type="text/javascript" src="../js/admin-dnd.js"></script> <script type="text/javascript" src="../js/admin-dnd.js"></script>
{/if} {/if}
<script type="text/javascript">
$(function() {
$(".datepicker").datepicker({
prevText:"",
nextText:""
});
});
</script>
{if $add_button} {if $add_button}
<br /><a href="{$currentIndex}&add{$table}&token={$token}"><img src="../img/admin/add.gif" border="0" /> {l s='Add new'}</a><br /><br /> <br /><a href="{$currentIndex}&add{$table}&token={$token}"><img src="../img/admin/add.gif" border="0" /> {l s='Add new'}</a><br /><br />
{/if} {/if}
@@ -104,7 +113,7 @@
{/if} {/if}
</th> </th>
{/foreach} {/foreach}
{if $shop_link_type} {if $shop_link_type}
<th style="width: 80px"> <th style="width: 80px">
{if $shop_link_type == 'shop'} {if $shop_link_type == 'shop'}
@@ -113,7 +122,7 @@
{l s='Group shop'} {l s='Group shop'}
{/if} {/if}
</th> </th>
{/if} {/if}
{if $has_actions} {if $has_actions}
<th style="width: 52px">{l s='Actions'}</th> <th style="width: 52px">{l s='Actions'}</th>
{/if} {/if}
@@ -124,7 +133,7 @@
-- --
{/if} {/if}
</td> </td>
{* Filters (input, select, date or bool) *} {* Filters (input, select, date or bool) *}
{foreach $fields_display AS $key => $params} {foreach $fields_display AS $key => $params}
<td {if isset($params.align)} class="{$params.align}" {/if}> <td {if isset($params.align)} class="{$params.align}" {/if}>
@@ -138,8 +147,8 @@
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option> <option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
</select> </select>
{elseif $params.type == 'date' || $params.type == 'datetime'} {elseif $params.type == 'date' || $params.type == 'datetime'}
{l s='From'} <input type="text" class="filter" id="{$name_id}_0" name="{$name}[0]" value="{if isset($value.0)}$value.0{/if}"{if isset($params.width)} style="width:{$params.width}px"{/if}/><br /> {l s='From'} <input type="text" class="filter datepicker" id="{$name_id}_0" name="{$name}[0]" value="{if isset($value.0)}$value.0{/if}"{if isset($params.width)} style="width:{$params.width}px"{/if}/><br />
{l s='To'} <input type="text" class="filter" id="{$name_id}_1" name="{$name}[1]" value="{if isset($value.1)}$value.1{/if}"{if isset($params.width)} style="width:{$params.width}px"{/if}/> {l s='To'} <input type="text" class="filter datepicker" id="{$name_id}_1" name="{$name}[1]" value="{if isset($value.1)}$value.1{/if}"{if isset($params.width)} style="width:{$params.width}px"{/if}/>
{elseif $params.type == 'select'} {elseif $params.type == 'select'}
{if isset($params.filter_key)} {if isset($params.filter_key)}
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}> <select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
@@ -157,7 +166,7 @@
{/if} {/if}
</td> </td>
{/foreach} {/foreach}
{if $shop_link_type} {if $shop_link_type}
<td>--</td> <td>--</td>
{/if} {/if}
+2 -2
View File
@@ -241,7 +241,7 @@ class HelperListCore extends Helper
else else
$echo = $tr[$key]; $echo = $tr[$key];
$this->_list[$index][$key] = isset($params['callback']) ? call_user_func_array(array((isset($params['callback_object'])) ? $params['callback_object'] : $this->className, $params['callback']), array($echo, $tr)) : $echo; $this->_list[$index][$key] = isset($params['callback']) ? call_user_func_array(array((isset($params['callback_object'])) ? $params['callback_object'] : $this->context->controller, $params['callback']), array($echo, $tr)) : $echo;
} }
} }
} }
@@ -383,7 +383,7 @@ class HelperListCore extends Helper
$value = ''; $value = '';
$name = $this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key); $name = $this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key);
$name_id = str_replace('!', '__', $name); $name_id = str_replace('!', '__', $name);
$this->includeDatepicker(array($name_id.'_0', $name_id.'_1')); $this->context->controller->addJqueryUI('ui.datepicker');
break; break;
case 'select': case 'select':
foreach ($params['select'] AS $option_value => $option_display) foreach ($params['select'] AS $option_value => $option_display)