Lines 4-25
Link Here
|
4 |
[% USE date %] |
4 |
[% USE date %] |
5 |
|
5 |
|
6 |
[% BLOCK search_history_table %] |
6 |
[% BLOCK search_history_table %] |
7 |
<form action="/cgi-bin/koha/catalogue/search-history.pl" method="get"> |
7 |
<form action="/cgi-bin/koha/catalogue/search-history.pl" method="get" class="datatable"> |
8 |
[%# Search from multiple lines is only enabled for biblios %] |
8 |
[%# Search from multiple lines is only enabled for biblios %] |
9 |
[% IF type == 'biblio' %] |
|
|
10 |
<div> |
11 |
<a href="#" class="action_search">Start a new search</a> |
12 |
<span class='search_options'> |
13 |
<span>New search:</span> |
14 |
<select name='join'> |
15 |
<option value="or" selected="selected">match any of selected searches</option> |
16 |
<option value="and">match all of selected searches</option> |
17 |
</select> |
18 |
<button type="submit">Go</button> |
19 |
<a href="#" class="action_search_cancel">Cancel</a> |
20 |
</span> |
21 |
</div> |
22 |
[% END %] |
23 |
<div class="selections-toolbar"> |
9 |
<div class="selections-toolbar"> |
24 |
<a class="CheckAll" href="#"><i class="fa fa-check"></i> Select all visible rows</a> |
10 |
<a class="CheckAll" href="#"><i class="fa fa-check"></i> Select all visible rows</a> |
25 |
<span class="sep">|</span> |
11 |
<span class="sep">|</span> |
Lines 35-41
Link Here
|
35 |
<thead> |
21 |
<thead> |
36 |
<tr> |
22 |
<tr> |
37 |
<th></th> |
23 |
<th></th> |
38 |
<th class="not">Not</th> |
24 |
<th>Id</th> |
39 |
<th>Session date</th> |
25 |
<th>Session date</th> |
40 |
<th>Date</th> |
26 |
<th>Date</th> |
41 |
<th>Search</th> |
27 |
<th>Search</th> |
Lines 46-57
Link Here
|
46 |
[% FOREACH s IN searches %] |
32 |
[% FOREACH s IN searches %] |
47 |
<tr> |
33 |
<tr> |
48 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
34 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
49 |
<td class="not"> |
35 |
<td>#[% s.id %]</td> |
50 |
<select name="not"> |
|
|
51 |
<option value=""></option> |
52 |
<option value="[% s.id %]" title="Search for the opposite of the criteria on this row">NOT</option> |
53 |
</select> |
54 |
</td> |
55 |
<td> |
36 |
<td> |
56 |
[% IF s.session %] |
37 |
[% IF s.session %] |
57 |
[% session_ctime = date.format(s.session.session_ctime, '%Y-%m-%d %H:%M:%S') %] |
38 |
[% session_ctime = date.format(s.session.session_ctime, '%Y-%m-%d %H:%M:%S') %] |
Lines 81-86
Link Here
|
81 |
</tbody> |
62 |
</tbody> |
82 |
</table> |
63 |
</table> |
83 |
</form> |
64 |
</form> |
|
|
65 |
|
66 |
[% IF type == 'biblio' %] |
67 |
<form method="post"> |
68 |
<input type="hidden" name="action" value="search"/> |
69 |
<input type="text" name="search" placeholder="(#1 or #3) and #6"/> |
70 |
<button type="submit">Combine queries</button> |
71 |
</form> |
72 |
[% END %] |
84 |
[% END %] |
73 |
[% END %] |
85 |
|
74 |
|
86 |
[% INCLUDE 'doc-head-open.inc' %] |
75 |
[% INCLUDE 'doc-head-open.inc' %] |
Lines 145-152
Link Here
|
145 |
"aaSorting": [[ 3, "desc" ]], |
134 |
"aaSorting": [[ 3, "desc" ]], |
146 |
"aoColumnDefs": [ |
135 |
"aoColumnDefs": [ |
147 |
{ "aTargets": [ 0, 1 ], "bSortable": false, "bSearchable": false }, |
136 |
{ "aTargets": [ 0, 1 ], "bSortable": false, "bSearchable": false }, |
148 |
{ "aTargets": [ 2, 3 ], "sType": "title-string" }, |
137 |
{ "aTargets": [ 2, 3 ], "sType": "title-string" } |
149 |
{ "aTargets": [ 1 ], "bVisible": false } |
|
|
150 |
], |
138 |
], |
151 |
"sPaginationType": "full_numbers" |
139 |
"sPaginationType": "full_numbers" |
152 |
})); |
140 |
})); |
Lines 156-162
Link Here
|
156 |
// DataTables removes hidden rows from the DOM, so we can't expect a |
144 |
// DataTables removes hidden rows from the DOM, so we can't expect a |
157 |
// "regular" submit to work and we need to build another form containing |
145 |
// "regular" submit to work and we need to build another form containing |
158 |
// all form elements, and then submit this form. |
146 |
// all form elements, and then submit this form. |
159 |
$('#tabs form').submit(function(e) { |
147 |
$('#tabs form.datatable').submit(function(e) { |
160 |
e.preventDefault(); |
148 |
e.preventDefault(); |
161 |
|
149 |
|
162 |
var form = $(this); |
150 |
var form = $(this); |
Lines 218-255
Link Here
|
218 |
return false; |
206 |
return false; |
219 |
}); |
207 |
}); |
220 |
|
208 |
|
221 |
$(".action_search").click(function() { |
|
|
222 |
var $form = $(this).parents('form'); |
223 |
var table = $form.find('table').dataTable(); |
224 |
var $checked = table.$('input:checkbox:checked'); |
225 |
$(this).hide(); |
226 |
$('.search_options').show(); |
227 |
table.fnSetColumnVis(1, true); |
228 |
return false; |
229 |
}); |
230 |
|
231 |
$('.search_options button[type="submit"]').click(function() { |
232 |
var $form = $(this).parents('form'); |
233 |
var table = $form.find('table').dataTable(); |
234 |
var $checked = table.$('input:checkbox:checked'); |
235 |
if ($checked.length) { |
236 |
$form.find('input[name="action"]').val('search'); |
237 |
$form.submit(); |
238 |
} else { |
239 |
alert(_("You have to select searches first")); |
240 |
} |
241 |
return false; |
242 |
}); |
243 |
|
244 |
$('.action_search_cancel').click(function() { |
245 |
var form = $(this).parents('form').first(); |
246 |
var table = form.find('table').dataTable(); |
247 |
$('.action_search').show(); |
248 |
$('.search_options').hide(); |
249 |
table.fnSetColumnVis(1, false); |
250 |
return false; |
251 |
}).click(); |
252 |
|
253 |
$('#tabs form').each(function() { |
209 |
$('#tabs form').each(function() { |
254 |
enableCheckboxActions($(this)); |
210 |
enableCheckboxActions($(this)); |
255 |
}); |
211 |
}); |