Lines 31-121
Link Here
|
31 |
<div class="span12"> |
31 |
<div class="span12"> |
32 |
[% END %] |
32 |
[% END %] |
33 |
<div id="searchhistory" class="maincontent"> |
33 |
<div id="searchhistory" class="maincontent"> |
34 |
<h1>Search history</h1> |
34 |
<h1>Search history</h1> |
35 |
|
35 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
36 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
36 |
<div id="tabs" class="toptabs"> |
37 |
<div id="tabs" class="toptabs"> |
37 |
<ul> |
38 |
<ul> |
38 |
<li><a href="#biblio_tab">Catalog</a></li> |
39 |
<li><a href="#biblio_tab">Catalog</a></li> |
39 |
<li><a href="#authority_tab">Authority</a></li> |
40 |
<li><a href="#authority_tab">Authority</a></li> |
40 |
</ul> |
41 |
</ul> |
41 |
[% END %] |
|
|
42 |
<div id="biblio_tab"> |
43 |
<div id="current_biblio"> |
44 |
[% IF ( current_biblio_searches ) %] |
45 |
<h2>Current session</h2> |
46 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
47 |
<div class="selections-toolbar toolbar"> |
48 |
<a class="CheckAll" href="#">Select all</a> |
49 |
<a class="CheckNone" href="#">Clear all</a> |
50 |
<span class="sep">|</span> |
51 |
<span class="links"> |
52 |
<span class="selections">Select searches to: </span> |
53 |
<a href="#" class="action_delete disabled">Delete</a> |
54 |
</span> |
55 |
</div> |
56 |
<input type="hidden" name="action" value="delete" /> |
57 |
<table class="historyt table table-bordered table-striped"> |
58 |
<thead> |
59 |
<tr> |
60 |
<th></th> |
61 |
<th>Date</th> |
62 |
<th>Search</th> |
63 |
<th>Results</th> |
64 |
</tr> |
65 |
</thead> |
66 |
<tbody> |
67 |
[% FOREACH s IN current_biblio_searches %] |
68 |
<tr> |
69 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
70 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
71 |
<td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
72 |
<td>[% s.total %]</td> |
73 |
</tr> |
74 |
[% END %] |
75 |
</tbody> |
76 |
</table> |
77 |
</form> |
42 |
[% END %] |
78 |
[% END %] |
43 |
<div id="biblio_tab"> |
79 |
</div> |
44 |
[% IF ( current_biblio_searches ) %] |
|
|
45 |
<h2>Current session</h2> |
46 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
47 |
<input type="hidden" name="action" value="delete" /> |
48 |
<input type="hidden" name="previous" value="0" /> |
49 |
<input type="hidden" name="type" value="biblio" /> |
50 |
<input type="submit" class="deleteshelf" value="Delete your current catalog history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" /> |
51 |
</form> |
52 |
<table class="historyt table table-bordered table-condensed table-striped"> |
53 |
<thead> |
54 |
<tr> |
55 |
<th>Date</th> |
56 |
<th>Search</th> |
57 |
<th>Results</th> |
58 |
</tr> |
59 |
</thead> |
60 |
<tbody> |
61 |
[% FOREACH s IN current_biblio_searches %] |
62 |
<tr> |
63 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
64 |
<td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
65 |
<td>[% s.total %]</td> |
66 |
</tr> |
67 |
[% END %] |
68 |
</tbody> |
69 |
</table> |
70 |
[% END %] |
71 |
|
72 |
[% IF ( previous_biblio_searches ) %] |
73 |
<h2>Previous sessions</h2> |
74 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
75 |
<input type="hidden" name="action" value="delete" /> |
76 |
<input type="hidden" name="previous" value="1" /> |
77 |
<input type="hidden" name="type" value="biblio" /> |
78 |
<input type="submit" class="deleteshelf" value="Delete your previous catalog search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" /> |
79 |
</form> |
80 |
<table class="historyt table table-bordered table-condensed table-striped"> |
81 |
<thead> |
82 |
<tr> |
83 |
<th>Date</th> |
84 |
<th>Search</th> |
85 |
<th>Results</th> |
86 |
</tr> |
87 |
</thead> |
88 |
<tbody> |
89 |
[% FOREACH s IN previous_biblio_searches %] |
90 |
<tr> |
91 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
92 |
<td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
93 |
<td>[% s.total %]</td> |
94 |
</tr> |
95 |
[% END %] |
96 |
</tbody> |
97 |
</table> |
98 |
[% END %] |
99 |
|
80 |
|
100 |
[% IF !current_biblio_searches && !previous_biblio_searches %] |
81 |
<div id="previous_biblio"> |
101 |
<p>Your catalog search history is empty.</p> |
82 |
[% IF ( previous_biblio_searches ) %] |
102 |
[% END %] |
83 |
<h2>Previous sessions</h2> |
103 |
</div> |
84 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
|
|
85 |
<div class="selections-toolbar toolbar"> |
86 |
<a class="CheckAll" href="#">Select all</a> |
87 |
<a class="CheckNone" href="#">Clear all</a> |
88 |
<span class="sep">|</span> |
89 |
<span class="links"> |
90 |
<span class="selections">Select searches to: </span> |
91 |
<a href="#" class="action_delete disabled">Delete</a> |
92 |
</span> |
93 |
</div> |
94 |
|
95 |
<input type="hidden" name="action" value="delete" /> |
96 |
<table class="historyt table table-bordered table-striped"> |
97 |
<thead> |
98 |
<tr> |
99 |
<th></th> |
100 |
<th>Date</th> |
101 |
<th>Search</th> |
102 |
<th>Results</th> |
103 |
</tr> |
104 |
</thead> |
105 |
<tbody> |
106 |
[% FOREACH s IN previous_biblio_searches %] |
107 |
<tr> |
108 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
109 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
110 |
<td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
111 |
<td>[% s.total %]</td> |
112 |
</tr> |
113 |
[% END %] |
114 |
</tbody> |
115 |
</table> |
116 |
</form> |
117 |
[% END %] |
118 |
</div> |
104 |
|
119 |
|
|
|
120 |
[% IF !current_biblio_searches && !previous_biblio_searches %] |
121 |
<p>Your catalog search history is empty.</p> |
122 |
[% END %] |
123 |
</div> |
105 |
|
124 |
|
106 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
125 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
107 |
<div id="authority_tab"> |
126 |
<div id="authority_tab"> |
108 |
[% IF ( current_authority_searches ) %] |
127 |
[% IF ( current_authority_searches ) %] |
109 |
<h2>Current session</h2> |
128 |
<h2>Current session</h2> |
110 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
129 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
111 |
<input type="hidden" name="action" value="delete" /> |
130 |
<div class="selections-toolbar toolbar"> |
112 |
<input type="hidden" name="previous" value="0" /> |
131 |
<a class="CheckAll" href="#">Select all</a> |
113 |
<input type="hidden" name="type" value="authority" /> |
132 |
<a class="CheckNone" href="#">Clear all</a> |
114 |
<input type="submit" class="deleteshelf" value="Delete your current authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" /> |
133 |
<span class="sep">|</span> |
115 |
</form> |
134 |
<span class="links"> |
116 |
<table class="historyt table table-bordered table-condensed table-striped"> |
135 |
<span class="selections">Select searches to: </span> |
|
|
136 |
<a href="#" class="action_delete disabled">Delete</a> |
137 |
</span> |
138 |
</div> |
139 |
<input type="hidden" name="action" value="delete" /> |
140 |
<table class="historyt table table-bordered table-striped"> |
117 |
<thead> |
141 |
<thead> |
118 |
<tr> |
142 |
<tr> |
|
|
143 |
<th></th> |
119 |
<th>Date</th> |
144 |
<th>Date</th> |
120 |
<th>Search</th> |
145 |
<th>Search</th> |
121 |
<th>Results</th> |
146 |
<th>Results</th> |
Lines 124-129
Link Here
|
124 |
<tbody> |
149 |
<tbody> |
125 |
[% FOREACH s IN current_authority_searches %] |
150 |
[% FOREACH s IN current_authority_searches %] |
126 |
<tr> |
151 |
<tr> |
|
|
152 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
127 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
153 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
128 |
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
154 |
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
129 |
<td>[% s.total %]</td> |
155 |
<td>[% s.total %]</td> |
Lines 131-149
Link Here
|
131 |
[% END %] |
157 |
[% END %] |
132 |
</tbody> |
158 |
</tbody> |
133 |
</table> |
159 |
</table> |
134 |
[% END %] |
160 |
</form> |
135 |
|
161 |
[% END %] |
136 |
[% IF ( previous_authority_searches ) %] |
162 |
|
137 |
<h2>Previous sessions</h2> |
163 |
[% IF ( previous_authority_searches ) %] |
138 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
164 |
<h2>Previous sessions</h2> |
139 |
<input type="hidden" name="action" value="delete" /> |
165 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
140 |
<input type="hidden" name="previous" value="1" /> |
166 |
<div class="selections-toolbar toolbar"> |
141 |
<input type="hidden" name="type" value="authority" /> |
167 |
<a class="CheckAll" href="#">Select all</a> |
142 |
<input type="submit" class="deleteshelf" value="Delete your previous authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" /> |
168 |
<a class="CheckNone" href="#">Clear all</a> |
143 |
</form> |
169 |
<span class="sep">|</span> |
144 |
<table class="historyt table table-bordered table-condensed table-striped"> |
170 |
<span class="links"> |
|
|
171 |
<span class="selections">Select searches to: </span> |
172 |
<a href="#" class="action_delete disabled">Delete</a> |
173 |
</span> |
174 |
</div> |
175 |
<input type="hidden" name="action" value="delete" /> |
176 |
<table class="historyt table table-bordered table-striped"> |
145 |
<thead> |
177 |
<thead> |
146 |
<tr> |
178 |
<tr> |
|
|
179 |
<th></th> |
147 |
<th>Date</th> |
180 |
<th>Date</th> |
148 |
<th>Search</th> |
181 |
<th>Search</th> |
149 |
<th>Results</th> |
182 |
<th>Results</th> |
Lines 152-157
Link Here
|
152 |
<tbody> |
185 |
<tbody> |
153 |
[% FOREACH s IN previous_authority_searches %] |
186 |
[% FOREACH s IN previous_authority_searches %] |
154 |
<tr> |
187 |
<tr> |
|
|
188 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
155 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
189 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
156 |
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
190 |
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
157 |
<td>[% s.total %]</td> |
191 |
<td>[% s.total %]</td> |
Lines 159-169
Link Here
|
159 |
[% END %] |
193 |
[% END %] |
160 |
</tbody> |
194 |
</tbody> |
161 |
</table> |
195 |
</table> |
162 |
[% END %] |
196 |
</form> |
|
|
197 |
[% END %] |
163 |
|
198 |
|
164 |
[% IF !current_authority_searches && !previous_authority_searches %] |
199 |
[% IF !current_authority_searches && !previous_authority_searches %] |
165 |
<p>Your authority search history is empty.</p> |
200 |
<p>Your authority search history is empty.</p> |
166 |
[% END %] |
201 |
[% END %] |
167 |
</div> |
202 |
</div> |
168 |
</div> |
203 |
</div> |
169 |
[% END %] |
204 |
[% END %] |
Lines 176-198
Link Here
|
176 |
[% INCLUDE 'opac-bottom.inc' %] |
211 |
[% INCLUDE 'opac-bottom.inc' %] |
177 |
[% BLOCK jsinclude %] |
212 |
[% BLOCK jsinclude %] |
178 |
[% INCLUDE 'datatables.inc' %] |
213 |
[% INCLUDE 'datatables.inc' %] |
|
|
214 |
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> |
179 |
<script type="text/javascript"> |
215 |
<script type="text/javascript"> |
180 |
//<![CDATA[ |
216 |
//<![CDATA[ |
181 |
var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete your search history?"); |
217 |
var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history?"); |
182 |
$(document).ready(function() { |
218 |
$(document).ready(function() { |
183 |
// We show table ordered by descending dates by default |
219 |
// We show table ordered by descending dates by default |
184 |
// (so that the more recent query is shown first) |
220 |
// (so that the more recent query is shown first) |
185 |
$(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, { |
221 |
$(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, { |
186 |
"aaSorting": [[ 0, "desc" ]], |
222 |
"aaSorting": [[ 1, "desc" ]], |
187 |
"aoColumns": [ |
223 |
"aoColumnDefs": [ |
188 |
{ "sType": "title-string" }, |
224 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, |
189 |
null, |
225 |
{ "aTargets": [ 1 ], "sType": "title-string" }, |
190 |
null |
226 |
] |
191 |
] |
227 |
})); |
192 |
})); |
228 |
|
|
|
229 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %] |
230 |
|
231 |
$(".CheckNone").click(function(e){ |
232 |
e.preventDefault(); |
233 |
var form = $(this).parents("form").get(0); |
234 |
$(form).unCheckCheckboxes(); |
235 |
enableCheckboxActions(form); |
236 |
}); |
237 |
$(".CheckAll").click(function(e){ |
238 |
e.preventDefault(); |
239 |
var form = $(this).parents("form").get(0); |
240 |
$(form).checkCheckboxes(); |
241 |
enableCheckboxActions(form); |
193 |
}); |
242 |
}); |
194 |
|
243 |
|
195 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %] |
244 |
$("input:checkbox").click(function(){ |
|
|
245 |
var form = $(this).parents("form").get(0); |
246 |
enableCheckboxActions(form); |
247 |
}); |
248 |
|
249 |
$(".action_delete").click(function(e){ |
250 |
e.preventDefault(); |
251 |
var form = $(this).parents("form").get(0); |
252 |
var ids = $(form).find("input:checkbox:checked"); |
253 |
if ( $(ids).length < 1 ) { |
254 |
return false; |
255 |
} |
256 |
if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) { |
257 |
$(form).submit(); |
258 |
} |
259 |
return false; |
260 |
}); |
261 |
}); |
262 |
|
263 |
function enableCheckboxActions(form){ |
264 |
// Enable/disable controls if checkboxes are checked |
265 |
var checkedBoxes = $(form).find("input:checkbox:checked"); |
266 |
if ($(checkedBoxes).size()) { |
267 |
$(form).find(".selections").html(_("With selected searches: ")); |
268 |
$(form).find(".selections-toolbar .links a").removeClass("disabled"); |
269 |
} else { |
270 |
$(form).find(".selections").html(_("Select searches to: ")); |
271 |
$(form).find(".selections-toolbar .links a").addClass("disabled"); |
272 |
} |
273 |
} |
274 |
|
196 |
//]]> |
275 |
//]]> |
197 |
|
276 |
|
198 |
</script> |
277 |
</script> |