5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Your search history</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
10 [% INCLUDE 'bodytag.inc' bodyid='opac-search-history' bodyclass='scrollto' %]
11 [% INCLUDE 'masthead.inc' %]
14 <nav aria-label="breadcrumb">
15 <ul class="breadcrumb">
16 <li class="breadcrumb-item">
17 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
19 [% IF ( loggedinusername ) %]
20 <li class="breadcrumb-item">
21 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
23 <li class="breadcrumb-item">
24 <a href="#">Your search history</a>
27 <li class="breadcrumb-item">
28 <a href="#">Search history</a>
34 <div class="container-fluid">
36 [% IF ( OpacNav||loggedinusername ) %]
37 <div class="col col-lg-2 order-2 order-lg-1">
39 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
42 <div class="col-md-12 col-lg-10 order-1">
44 <div class="col order-first order-md-first order-lg-2">
47 <div id="searchhistory" class="maincontent">
48 <h1>Search history</h1>
49 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
50 <div id="tabs" class="toptabs">
52 <li><a href="#biblio_tab">Catalog</a></li>
53 <li><a href="#authority_tab">Authority</a></li>
57 <div id="current_biblio">
58 [% IF ( current_biblio_searches ) %]
59 <h2>Current session</h2>
60 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
62 [% INCLUDE 'toolbar_controls' %]
63 <input type="hidden" name="action" value="delete" />
64 <table class="historyt table table-bordered table-striped">
74 [% FOREACH s IN current_biblio_searches %]
76 <td class="selectcol">
77 <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" />
80 <label for="result[% s.id | html %]">
81 <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span>
85 <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink">
86 <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
88 <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a>
90 <td>[% s.total | html %]</td>
95 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
97 [% END # IF ( current_biblio_searches ) %]
98 </div> <!-- / #current_biblio -->
100 <div id="previous_biblio">
101 [% IF ( previous_biblio_searches ) %]
102 <h2>Previous sessions</h2>
103 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
104 [% INCLUDE 'toolbar_controls' %]
106 <input type="hidden" name="action" value="delete" />
107 <table class="historyt table table-bordered table-striped">
117 [% FOREACH s IN previous_biblio_searches %]
119 <td class="selectcol">
120 <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" />
123 <label for="result[% s.id | html %]">
124 <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span>
128 <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink">
129 <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
131 <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">
132 [% s.query_desc | html %]
135 <td>[% s.total | html %]</td>
140 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
142 [% END # IF ( previous_biblio_searches ) %]
143 </div> <!-- / #previous_biblio -->
145 [% IF !current_biblio_searches && !previous_biblio_searches %]
146 <p>Your catalog search history is empty.</p>
148 </div> <!-- / #biblio_tab -->
150 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
151 <div id="authority_tab">
152 [% IF ( current_authority_searches ) %]
153 <h2>Current session</h2>
154 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
155 [% INCLUDE 'toolbar_controls' %]
156 <input type="hidden" name="action" value="delete" />
157 <table class="historyt table table-bordered table-striped">
167 [% FOREACH s IN current_authority_searches %]
169 <td class="selectcol">
170 <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" />
173 <label for="result[% s.id | html %]">
174 <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span>
177 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td>
178 <td>[% s.total | html %]</td>
183 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
185 [% END # / IF ( current_authority_searches ) %]
187 [% IF ( previous_authority_searches ) %]
188 <h2>Previous sessions</h2>
189 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
190 [% INCLUDE 'toolbar_controls' %]
191 <input type="hidden" name="action" value="delete" />
192 <table class="historyt table table-bordered table-striped">
202 [% FOREACH s IN previous_authority_searches %]
204 <td class="selectcol">
205 <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" />
208 <label for="result[% s.id | html %]">
209 <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span>
212 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td>
213 <td>[% s.total | html %]</td>
218 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
220 [% END # / IF ( previous_authority_searches )%]
222 [% IF !current_authority_searches && !previous_authority_searches %]
223 <p>Your authority search history is empty.</p>
225 </div> <!-- / #authority_tab -->
226 [% END # / IF Koha.Preference( 'OpacAuthorities' ) %]
227 </div> <!-- / #tabs -->
228 </div> <!-- / #searchhistory -->
229 </div> <!-- / .col-lg-10/12 -->
230 </div> <!-- / .row -->
231 </div> <!-- / .container-fluid -->
232 </div> <!-- / #main -->
234 [% INCLUDE 'opac-bottom.inc' %]
236 [% BLOCK toolbar_controls %]
237 [% # Identical controls shown at the top of each table of search history %]
238 <div class="selections-toolbar toolbar">
239 <div class="check_control">
240 <a class="CheckAll btn btn-link btn-sm" href="#">Select all</a>
241 <a class="CheckNone btn btn-link btn-sm" href="#">Clear all</a>
244 <span class="selections">Select searches to: </span>
245 <a href="#" class="removeitems disabled btn btn-sm btn-link"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
250 [% BLOCK jsinclude %]
251 [% INCLUDE 'datatables.inc' %]
254 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
255 $(document).ready(function() {
256 // We show table ordered by descending dates by default
257 // (so that the more recent query is shown first)
258 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
259 "order": [[ 1, "desc" ]],
260 "dom": '<"top"<"table_entries"><"table_controls"fB>>t',
262 { "targets": [ 0 ], "sortable": false, "searchable": false },
263 { "targets": [ 1 ], "type": "title-string" },
267 "searchPlaceholder": _("Search")
271 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
273 $(".CheckNone").click(function(e){
275 var form = $(this).parents("form").get(0);
276 $(form).find("input:checkbox").prop("checked", false);
277 enableCheckboxActions(form);
279 $(".CheckAll").click(function(e){
281 var form = $(this).parents("form").get(0);
282 $(form).find("input:checkbox").prop("checked", true);
283 enableCheckboxActions(form);
286 $("input:checkbox").click(function(){
287 var form = $(this).parents("form").get(0);
288 enableCheckboxActions(form);
291 $(".removeitems,.remove-selected").click(function(e){
293 var form = $(this).parents("form").get(0);
294 var ids = $(form).find("input:checkbox:checked");
295 if ( $(ids).length < 1 ) {
298 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
303 $(".remove-selected").addClass("disabled");
306 function enableCheckboxActions(form){
307 // Enable/disable controls if checkboxes are checked
308 var checkedBoxes = $(form).find("input:checkbox:checked");
309 if ($(checkedBoxes).size()) {
310 $(form).find(".selections").html(_("With selected searches: "));
311 $(form).find(".selections-toolbar .links a").removeClass("disabled");
312 $(form).find(".remove-selected").removeClass("disabled");
314 $(form).find(".selections").html(_("Select searches to: "));
315 $(form).find(".selections-toolbar .links a").addClass("disabled");
316 $(form).find(".remove-selected").addClass("disabled");