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 <ul class="breadcrumb">
15 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
16 [% IF ( loggedinusername ) %]
17 <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">›</span></li>
18 <li><a href="#">Your search history</a></li>
20 <li><a href="#">Search history</a></li>
24 <div class="container-fluid">
25 <div class="row-fluid">
26 [% IF ( OpacNav||loggedinusername ) %]
29 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
36 <div id="searchhistory" class="maincontent">
37 <h1>Search history</h1>
38 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
39 <div id="tabs" class="toptabs">
41 <li><a href="#biblio_tab">Catalog</a></li>
42 <li><a href="#authority_tab">Authority</a></li>
46 <div id="current_biblio">
47 [% IF ( current_biblio_searches ) %]
48 <h2>Current session</h2>
49 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
50 <div class="selections-toolbar toolbar">
51 <a class="CheckAll" href="#">Select all</a>
52 <a class="CheckNone" href="#">Clear all</a>
53 <span class="sep">|</span>
55 <span class="selections">Select searches to: </span>
56 <a href="#" class="removeitems disabled">Delete</a>
59 <input type="hidden" name="action" value="delete" />
60 <table class="historyt table table-bordered table-striped">
70 [% FOREACH s IN current_biblio_searches %]
72 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
73 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
75 <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" class="rsssearchlink">
76 <i class="fa fa-rss rsssearchicon" title="Subscribe to this search"></i>
78 <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a>
80 <td>[% s.total | html %]</td>
85 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
87 [% END # IF ( current_biblio_searches ) %]
88 </div> <!-- / #current_biblio -->
90 <div id="previous_biblio">
91 [% IF ( previous_biblio_searches ) %]
92 <h2>Previous sessions</h2>
93 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
94 <div class="selections-toolbar toolbar">
95 <a class="CheckAll" href="#">Select all</a>
96 <a class="CheckNone" href="#">Clear all</a>
97 <span class="sep">|</span>
99 <span class="selections">Select searches to: </span>
100 <a href="#" class="removeitems disabled">Delete</a>
104 <input type="hidden" name="action" value="delete" />
105 <table class="historyt table table-bordered table-striped">
115 [% FOREACH s IN previous_biblio_searches %]
117 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
118 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
120 <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" class="rsssearchlink">
121 <i class="fa fa-rss rsssearchicon" title="Subscribe to this search"></i>
123 <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi | $raw %]">
124 [% s.query_desc | html %]
127 <td>[% s.total | html %]</td>
132 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
134 [% END # IF ( previous_biblio_searches ) %]
135 </div> <!-- / #previous_biblio -->
137 [% IF !current_biblio_searches && !previous_biblio_searches %]
138 <p>Your catalog search history is empty.</p>
140 </div> <!-- / #biblio_tab -->
142 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
143 <div id="authority_tab">
144 [% IF ( current_authority_searches ) %]
145 <h2>Current session</h2>
146 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
147 <div class="selections-toolbar toolbar">
148 <a class="CheckAll" href="#">Select all</a>
149 <a class="CheckNone" href="#">Clear all</a>
150 <span class="sep">|</span>
152 <span class="selections">Select searches to: </span>
153 <a href="#" class="removeitems disabled">Delete</a>
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><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
170 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
171 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td>
172 <td>[% s.total | html %]</td>
177 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
179 [% END # / IF ( current_authority_searches ) %]
181 [% IF ( previous_authority_searches ) %]
182 <h2>Previous sessions</h2>
183 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
184 <div class="selections-toolbar toolbar">
185 <a class="CheckAll" href="#">Select all</a>
186 <a class="CheckNone" href="#">Clear all</a>
187 <span class="sep">|</span>
189 <span class="selections">Select searches to: </span>
190 <a href="#" class="removeitems disabled">Delete</a>
193 <input type="hidden" name="action" value="delete" />
194 <table class="historyt table table-bordered table-striped">
204 [% FOREACH s IN previous_authority_searches %]
206 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
207 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
208 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td>
209 <td>[% s.total | html %]</td>
214 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
216 [% END # / IF ( previous_authority_searches )%]
218 [% IF !current_authority_searches && !previous_authority_searches %]
219 <p>Your authority search history is empty.</p>
221 </div> <!-- / #authority_tab -->
222 [% END # / IF Koha.Preference( 'OpacAuthorities' ) %]
223 </div> <!-- / #tabs -->
224 </div> <!-- / #searchhistory -->
225 </div> <!-- / .span10/12 -->
226 </div> <!-- / .row-fluid -->
227 </div> <!-- / .container-fluid -->
228 </div> <!-- / #main -->
230 [% INCLUDE 'opac-bottom.inc' %]
231 [% BLOCK jsinclude %]
232 [% INCLUDE 'datatables.inc' %]
233 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
236 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
237 $(document).ready(function() {
238 // We show table ordered by descending dates by default
239 // (so that the more recent query is shown first)
240 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
241 "order": [[ 1, "desc" ]],
243 { "targets": [ 0 ], "sortable": false, "searchable": false },
244 { "targets": [ 1 ], "type": "title-string" },
248 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
250 $(".CheckNone").click(function(e){
252 var form = $(this).parents("form").get(0);
253 $(form).unCheckCheckboxes();
254 enableCheckboxActions(form);
256 $(".CheckAll").click(function(e){
258 var form = $(this).parents("form").get(0);
259 $(form).checkCheckboxes();
260 enableCheckboxActions(form);
263 $("input:checkbox").click(function(){
264 var form = $(this).parents("form").get(0);
265 enableCheckboxActions(form);
268 $(".removeitems,.remove-selected").click(function(e){
270 var form = $(this).parents("form").get(0);
271 var ids = $(form).find("input:checkbox:checked");
272 if ( $(ids).length < 1 ) {
275 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
282 function enableCheckboxActions(form){
283 // Enable/disable controls if checkboxes are checked
284 var checkedBoxes = $(form).find("input:checkbox:checked");
285 if ($(checkedBoxes).size()) {
286 $(form).find(".selections").html(_("With selected searches: "));
287 $(form).find(".selections-toolbar .links a").removeClass("disabled");
289 $(form).find(".selections").html(_("Select searches to: "));
290 $(form).find(".selections-toolbar .links a").addClass("disabled");