/
list_header.tpl
220 lines (206 loc) · 9.17 KB
/
list_header.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-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/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if !$simple_header}
<script type="text/javascript">
$(document).ready(function() {
$('table.{$table} .filter').keypress(function(event){
formSubmit(event, 'submitFilterButton{$table}')
})
});
</script>
{* Display column names and arrows for ordering (ASC, DESC) *}
{if $is_order_position}
<script type="text/javascript" src="../js/jquery/plugins/jquery.tablednd.js"></script>
<script type="text/javascript">
var token = '{$token}';
var come_from = '{$table}';
var alternate = {if $order_way == 'DESC'}'1'{else}'0'{/if};
</script>
<script type="text/javascript" src="../js/admin-dnd.js"></script>
{/if}
<script type="text/javascript">
$(function() {
if ($("table.{$table} .datepicker").length > 0)
$("table.{$table} .datepicker").datepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd'
});
});
</script>
{/if}{* End if simple_header *}
{if $show_toolbar}
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
{/if}
{if !$simple_header}
<div class="leadin">{block name="leadin"}{/block}</div>
{/if}
{block name="override_header"}{/block}
{hook h='displayAdminListBefore'}
{if isset($name_controller)}
{capture name=hookName assign=hookName}display{$name_controller|ucfirst}ListBefore{/capture}
{hook h=$hookName}
{elseif isset($smarty.get.controller)}
{capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}ListBefore{/capture}
{hook h=$hookName}
{/if}
{if !$simple_header}
<form method="post" action="{$action}" class="form">
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
{/if}
<table class="table_grid" name="list_table">
{if !$simple_header}
<tr>
<td style="vertical-align: bottom;">
<span style="float: left;">
{if $page > 1}
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$table}').value=1"/>
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$table}').value={$page - 1}"/>
{/if}
{l s='Page'} <b>{$page}</b> / {$total_pages}
{if $page < $total_pages}
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$table}').value={$page + 1}"/>
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$table}').value={$total_pages}"/>
{/if}
| {l s='Display'}
<select name="pagination" onchange="submit()">
{* Choose number of results per page *}
{foreach $pagination AS $value}
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
{/foreach}
</select>
/ {$list_total} {l s='result(s)'}
</span>
<span style="float: right;">
<input type="submit" name="submitReset{$table}" value="{l s='Reset'}" class="button" />
<input type="submit" id="submitFilterButton{$table}" name="submitFilter" value="{l s='Filter'}" class="button" />
</span>
<span class="clear"></span>
</td>
</tr>
{/if}
<tr>
<td{if $simple_header} style="border:none;"{/if}>
<table
{if $table_id} id={$table_id}{/if}
class="table {if $table_dnd}tableDnD{/if} {$table}"
cellpadding="0" cellspacing="0"
style="width: 100%; margin-bottom:10px;">
<col width="10px" />
{foreach $fields_display AS $key => $params}
<col {if isset($params.width) && $params.width != 'auto'}width="{$params.width}px"{/if}/>
{/foreach}
{if $shop_link_type}
<col width="80px" />
{/if}
{if $has_actions}
<col width="52px" />
{/if}
<thead>
<tr class="nodrag nodrop" style="height: 40px">
<th class="center">
{if $has_bulk_actions}
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$table}Box[]', this.checked)" />
{/if}
</th>
{foreach $fields_display AS $key => $params}
<th {if isset($params.align)} class="{$params.align}"{/if}>
{if isset($params.hint)}<span class="hint" name="help_box">{$params.hint}<span class="hint-pointer"> </span></span>{/if}
<span class="title_box">
{$params.title}
</span>
{if (!isset($params.orderby) || $params.orderby) && !$simple_header}
<br />
<a href="{$currentIndex}&{$table}Orderby={$key|urlencode}&{$table}Orderway=desc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<img border="0" src="../img/admin/down{if isset($order_by) && ($key == $order_by) && ($order_way == 'DESC')}_d{/if}.gif" /></a>
<a href="{$currentIndex}&{$table}Orderby={$key|urlencode}&{$table}Orderway=asc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<img border="0" src="../img/admin/up{if isset($order_by) && ($key == $order_by) && ($order_way == 'ASC')}_d{/if}.gif" /></a>
{elseif !$simple_header}
<br />
{/if}
</th>
{/foreach}
{if $shop_link_type}
<th>
{if $shop_link_type == 'shop'}
{l s='Shop'}
{else}
{l s='Group shop'}
{/if}
<br />
</th>
{/if}
{if $has_actions}
<th class="center">{l s='Actions'}{if !$simple_header}<br /> {/if}</th>
{/if}
</tr>
{if !$simple_header}
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}" style="height: 35px;">
<td class="center">
{if $has_bulk_actions}
--
{/if}
</td>
{* Filters (input, select, date or bool) *}
{foreach $fields_display AS $key => $params}
<td {if isset($params.align)} class="{$params.align}" {/if}>
{if isset($params.search) && !$params.search}
--
{else}
{if $params.type == 'bool'}
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$key}">
<option value="">--</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
</select>
{elseif $params.type == 'date' || $params.type == 'datetime'}
{l s='From'} <input type="text" class="filter datepicker" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($value.0)}$value.0{/if}"{if isset($params.width)} style="width:70px"{/if}/><br />
{l s='To'} <input type="text" class="filter datepicker" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($value.1)}$value.1{/if}"{if isset($params.width)} style="width:70px"{/if}/>
{elseif $params.type == 'select'}
{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}>
<option value="" {if $params.value == ''} selected="selected" {/if}>--</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if $option_display == $params.value || $option_value == $params.value} selected="selected"{/if}>{$option_display}</option>
{/foreach}
{/if}
</select>
{/if}
{else}
<input type="text" class="filter" name="{$table}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'htmlall':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{else}style="width:95%"{/if} />
{/if}
{/if}
</td>
{/foreach}
{if $shop_link_type}
<td>--</td>
{/if}
{if $has_actions}
<td class="center">--</td>
{/if}
</tr>
{/if}
</thead>