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">
61 <div class="selections-toolbar toolbar">
62 <a class="CheckAll btn btn-link btn-sm" href="#">Select all</a>
63 <a class="CheckNone btn btn-link btn-sm" href="#">Clear all</a>
64 <span class="sep">|</span>
66 <span class="selections">Select searches to: </span>
67 <a href="#" class="removeitems disabled">Delete</a>
70 <input type="hidden" name="action" value="delete" />
71 <table class="historyt table table-bordered table-striped">
81 [% FOREACH s IN current_biblio_searches %]
83 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
84 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
86 <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">
87 <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
89 <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a>
91 <td>[% s.total | html %]</td>
96 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
98 [% END # IF ( current_biblio_searches ) %]
99 </div> <!-- / #current_biblio -->
101 <div id="previous_biblio">
102 [% IF ( previous_biblio_searches ) %]
103 <h2>Previous sessions</h2>
104 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
105 <div class="selections-toolbar toolbar">
106 <a class="CheckAll btn btn-link btn-sm" href="#">Select all</a>
107 <a class="CheckNone btn btn-link btn-sm" href="#">Clear all</a>
108 <span class="sep">|</span>
110 <span class="selections">Select searches to: </span>
111 <a href="#" class="btn btn-link btn-sm removeitems disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
115 <input type="hidden" name="action" value="delete" />
116 <table class="historyt table table-bordered table-striped">
126 [% FOREACH s IN previous_biblio_searches %]
128 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
129 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
131 <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">
132 <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
134 <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">
135 [% s.query_desc | html %]
138 <td>[% s.total | html %]</td>
143 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
145 [% END # IF ( previous_biblio_searches ) %]
146 </div> <!-- / #previous_biblio -->
148 [% IF !current_biblio_searches && !previous_biblio_searches %]
149 <p>Your catalog search history is empty.</p>
151 </div> <!-- / #biblio_tab -->
153 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
154 <div id="authority_tab">
155 [% IF ( current_authority_searches ) %]
156 <h2>Current session</h2>
157 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
158 <div class="selections-toolbar toolbar">
159 <a class="CheckAll" href="#">Select all</a>
160 <a class="CheckNone" href="#">Clear all</a>
161 <span class="sep">|</span>
163 <span class="selections">Select searches to: </span>
164 <a href="#" class="btn btn-link btn-sm removeitems disabled"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
167 <input type="hidden" name="action" value="delete" />
168 <table class="historyt table table-bordered table-striped">
178 [% FOREACH s IN current_authority_searches %]
180 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
181 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
182 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td>
183 <td>[% s.total | html %]</td>
188 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
190 [% END # / IF ( current_authority_searches ) %]
192 [% IF ( previous_authority_searches ) %]
193 <h2>Previous sessions</h2>
194 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
195 <div class="selections-toolbar toolbar">
196 <a class="CheckAll" href="#">Select all</a>
197 <a class="CheckNone" href="#">Clear all</a>
198 <span class="sep">|</span>
200 <span class="selections">Select searches to: </span>
201 <a href="#" class="removeitems disabled">Delete</a>
204 <input type="hidden" name="action" value="delete" />
205 <table class="historyt table table-bordered table-striped">
215 [% FOREACH s IN previous_authority_searches %]
217 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
218 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
219 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td>
220 <td>[% s.total | html %]</td>
225 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
227 [% END # / IF ( previous_authority_searches )%]
229 [% IF !current_authority_searches && !previous_authority_searches %]
230 <p>Your authority search history is empty.</p>
232 </div> <!-- / #authority_tab -->
233 [% END # / IF Koha.Preference( 'OpacAuthorities' ) %]
234 </div> <!-- / #tabs -->
235 </div> <!-- / #searchhistory -->
236 </div> <!-- / .col-lg-10/12 -->
237 </div> <!-- / .row -->
238 </div> <!-- / .container-fluid -->
239 </div> <!-- / #main -->
241 [% INCLUDE 'opac-bottom.inc' %]
242 [% BLOCK jsinclude %]
243 [% INCLUDE 'datatables.inc' %]
244 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
247 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
248 $(document).ready(function() {
249 // We show table ordered by descending dates by default
250 // (so that the more recent query is shown first)
251 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
252 "order": [[ 1, "desc" ]],
254 { "targets": [ 0 ], "sortable": false, "searchable": false },
255 { "targets": [ 1 ], "type": "title-string" },
259 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
261 $(".CheckNone").click(function(e){
263 var form = $(this).parents("form").get(0);
264 $(form).unCheckCheckboxes();
265 enableCheckboxActions(form);
267 $(".CheckAll").click(function(e){
269 var form = $(this).parents("form").get(0);
270 $(form).checkCheckboxes();
271 enableCheckboxActions(form);
274 $("input:checkbox").click(function(){
275 var form = $(this).parents("form").get(0);
276 enableCheckboxActions(form);
279 $(".removeitems,.remove-selected").click(function(e){
281 var form = $(this).parents("form").get(0);
282 var ids = $(form).find("input:checkbox:checked");
283 if ( $(ids).length < 1 ) {
286 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
293 function enableCheckboxActions(form){
294 // Enable/disable controls if checkboxes are checked
295 var checkedBoxes = $(form).find("input:checkbox:checked");
296 if ($(checkedBoxes).size()) {
297 $(form).find(".selections").html(_("With selected searches: "));
298 $(form).find(".selections-toolbar .links a").removeClass("disabled");
300 $(form).find(".selections").html(_("Select searches to: "));
301 $(form).find(".selections-toolbar .links a").addClass("disabled");