1 | {combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'} |
---|
2 | {combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"} |
---|
3 | |
---|
4 | {footer_script}{literal} |
---|
5 | (function($) { |
---|
6 | $(document).ready(function(){ |
---|
7 | |
---|
8 | $oTable = $('#product_list').dataTable({ |
---|
9 | "iDisplayLength": 10, |
---|
10 | "bStateSave": true, |
---|
11 | "bAutoWidth": false, |
---|
12 | "aoColumns" : [ |
---|
13 | { sWidth: '2%','sClass': 'center', 'bSortable': false, }, |
---|
14 | { sWidth: '40%','sClass': 'product_row' }, |
---|
15 | { sWidth: '40%'}, |
---|
16 | { sWidth: '7%' }, |
---|
17 | ], |
---|
18 | "oLanguage": { |
---|
19 | "sProcessing": "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}", |
---|
20 | "sSearch": '<span class="icon-search"></span>'+"{/literal}{'Search'|translate|escape:'javascript'}{literal}", |
---|
21 | "sLengthMenu": "{/literal}{'Display _MENU_ records per page'|translate|escape:'javascript'}{literal}", |
---|
22 | "sInfo": "{/literal}{'Showing _START_ to _END_ of _TOTAL_ records'|translate|escape:'javascript'}{literal}", |
---|
23 | "sInfoEmpty": "{/literal}{'Showing 0 to 0 of 0 records'|translate|escape:'javascript'}{literal}", |
---|
24 | "sInfoFiltered": "{/literal}{'(filtered from _MAX_ total records)'|translate|escape:'javascript'}{literal}", |
---|
25 | "sInfoPostFix": "", |
---|
26 | "sLoadingRecords": "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}", |
---|
27 | "sZeroRecords": "{/literal}{'No matching option found'|translate|escape:'javascript'}{literal}", |
---|
28 | "oPaginate": { |
---|
29 | "sFirst": "{/literal}{'First'|translate|escape:'javascript'}{literal}", |
---|
30 | "sPrevious": '← '+"{/literal}{'Previous'|translate|escape:'javascript'}{literal}", |
---|
31 | "sNext": "{/literal}{'Next'|translate|escape:'javascript'}{literal}"+' →', |
---|
32 | "sLast": "{/literal}{'Last'|translate|escape:'javascript'}{literal}", |
---|
33 | }, |
---|
34 | }, |
---|
35 | }); |
---|
36 | |
---|
37 | $(document).on('click', '#prodSelectAll', function () { |
---|
38 | $('#product_list input[type=checkbox]').prop('checked', true); |
---|
39 | return false; |
---|
40 | }); |
---|
41 | |
---|
42 | $(document).on('click', '#prodSelectNone', function(){ |
---|
43 | $('#product_list input[type=checkbox]').prop('checked', false); |
---|
44 | return false; |
---|
45 | }); |
---|
46 | |
---|
47 | $(document).on('click', '#prodSelectInvert', function(){ |
---|
48 | $('#product_list input[type=checkbox]').each(function(){ |
---|
49 | if($(this).is (':checked')){ |
---|
50 | $(this).prop('checked', false); |
---|
51 | }else{ |
---|
52 | $(this).prop('checked', true); |
---|
53 | } |
---|
54 | }); |
---|
55 | return false; |
---|
56 | }); |
---|
57 | |
---|
58 | }); |
---|
59 | })(jQuery); |
---|
60 | {/literal}{/footer_script} |
---|
61 | |
---|
62 | |
---|
63 | <div class="titrePage"> |
---|
64 | <h2>{'Product'|@translate}</h2> |
---|
65 | </div> |
---|
66 | |
---|
67 | <div id=prod_table> |
---|
68 | <form id="form"> |
---|
69 | <table id=product_list> |
---|
70 | <thead> |
---|
71 | <tr> |
---|
72 | <th></th> |
---|
73 | <th>{'Product'|@translate}</th> |
---|
74 | <th>{'Note administrator'|@translate}</th> |
---|
75 | <th>{'Price'|@translate}</th> |
---|
76 | |
---|
77 | </tr> |
---|
78 | </tread> |
---|
79 | <tbody> |
---|
80 | {foreach from=$mps_product item=product name=product} |
---|
81 | <tr class="{if $smarty.foreach.product.index is odd}row1{else}row2{/if}"> |
---|
82 | <td><input type="checkbox" name="productcheck[]" value={$product.id}></td> |
---|
83 | <td>{$product.product} </td> |
---|
84 | <td>{$product.noteAdmin}</td> |
---|
85 | <td>{$product.price} {$mps_conf.currency}</td> |
---|
86 | </tr> |
---|
87 | |
---|
88 | |
---|
89 | {/foreach} |
---|
90 | </tbody> |
---|
91 | </table> |
---|
92 | |
---|
93 | <div style="clear:right"></div> |
---|
94 | |
---|
95 | <p class="checkActions"> |
---|
96 | {'Select:'|@translate} |
---|
97 | <a href="#" id="prodSelectAll">{'All'|@translate}</a>, |
---|
98 | <a href="#" id="prodSelectNone">{'None'|@translate}</a>, |
---|
99 | <a href="#" id="prodSelectInvert">{'Invert'|@translate}</a> |
---|
100 | </p> |
---|
101 | <input type="radio" name="thisprod" value="add" checked>{'Add the selected products for these images'|@translate}</input>  |
---|
102 | <input type="radio" name="thisprod" value="del">{'Delete the selected products for these images'|@translate}</input> |
---|
103 | </form> |
---|
104 | </div> |
---|
105 | |
---|