4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your search history</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
9 [% INCLUDE 'bodytag.inc' bodyid='opac-search-history' bodyclass='scrollto' %]
10 [% INCLUDE 'masthead.inc' %]
13 <ul class="breadcrumb">
14 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
15 [% IF ( loggedinusername ) %]
16 <li><a href="#">Your search history</a></li>
18 <li><a href="#">Search history</a></li>
22 <div class="container-fluid">
23 <div class="row-fluid">
24 [% IF ( OpacNav||loggedinusername ) %]
27 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
34 <div id="searchhistory" class="maincontent">
35 <h1>Search history</h1>
36 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
37 <div id="tabs" class="toptabs">
39 <li><a href="#biblio_tab">Catalog</a></li>
40 <li><a href="#authority_tab">Authority</a></li>
44 <div id="current_biblio">
45 [% IF ( current_biblio_searches ) %]
46 <h2>Current session</h2>
47 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
48 <div class="selections-toolbar toolbar">
49 <a class="CheckAll" href="#">Select all</a>
50 <a class="CheckNone" href="#">Clear all</a>
51 <span class="sep">|</span>
53 <span class="selections">Select searches to: </span>
54 <a href="#" class="removeitems disabled">Delete</a>
57 <input type="hidden" name="action" value="delete" />
58 <table class="historyt table table-bordered table-striped">
68 [% FOREACH s IN current_biblio_searches %]
70 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
71 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
72 <td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&[% s.query_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a> <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
73 <td>[% s.total %]</td>
78 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
80 [% END # IF ( current_biblio_searches ) %]
81 </div> <!-- / #current_biblio -->
83 <div id="previous_biblio">
84 [% IF ( previous_biblio_searches ) %]
85 <h2>Previous sessions</h2>
86 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
87 <div class="selections-toolbar toolbar">
88 <a class="CheckAll" href="#">Select all</a>
89 <a class="CheckNone" href="#">Clear all</a>
90 <span class="sep">|</span>
92 <span class="selections">Select searches to: </span>
93 <a href="#" class="removeitems disabled">Delete</a>
97 <input type="hidden" name="action" value="delete" />
98 <table class="historyt table table-bordered table-striped">
108 [% FOREACH s IN previous_biblio_searches %]
110 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
111 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
112 <td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&[% s.query_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a> <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
113 <td>[% s.total %]</td>
118 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
120 [% END # IF ( previous_biblio_searches ) %]
121 </div> <!-- / #previous_biblio -->
123 [% IF !current_biblio_searches && !previous_biblio_searches %]
124 <p>Your catalog search history is empty.</p>
126 </div> <!-- / #biblio_tab -->
128 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
129 <div id="authority_tab">
130 [% IF ( current_authority_searches ) %]
131 <h2>Current session</h2>
132 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
133 <div class="selections-toolbar toolbar">
134 <a class="CheckAll" href="#">Select all</a>
135 <a class="CheckNone" href="#">Clear all</a>
136 <span class="sep">|</span>
138 <span class="selections">Select searches to: </span>
139 <a href="#" class="removeitems disabled">Delete</a>
142 <input type="hidden" name="action" value="delete" />
143 <table class="historyt table table-bordered table-striped">
153 [% FOREACH s IN current_authority_searches %]
155 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
156 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
157 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
158 <td>[% s.total %]</td>
163 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
165 [% END # / IF ( current_authority_searches ) %]
167 [% IF ( previous_authority_searches ) %]
168 <h2>Previous sessions</h2>
169 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
170 <div class="selections-toolbar toolbar">
171 <a class="CheckAll" href="#">Select all</a>
172 <a class="CheckNone" href="#">Clear all</a>
173 <span class="sep">|</span>
175 <span class="selections">Select searches to: </span>
176 <a href="#" class="removeitems disabled">Delete</a>
179 <input type="hidden" name="action" value="delete" />
180 <table class="historyt table table-bordered table-striped">
190 [% FOREACH s IN previous_authority_searches %]
192 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
193 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
194 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
195 <td>[% s.total %]</td>
200 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
202 [% END # / IF ( previous_authority_searches )%]
204 [% IF !current_authority_searches && !previous_authority_searches %]
205 <p>Your authority search history is empty.</p>
207 </div> <!-- / #authority_tab -->
208 [% END # / IF Koha.Preference( 'OpacAuthorities' ) %]
209 </div> <!-- / #tabs -->
210 </div> <!-- / #searchhistory -->
211 </div> <!-- / .span10/12 -->
212 </div> <!-- / .row-fluid -->
213 </div> <!-- / .container-fluid -->
214 </div> <!-- / #main -->
216 [% INCLUDE 'opac-bottom.inc' %]
217 [% BLOCK jsinclude %]
218 [% INCLUDE 'datatables.inc' %]
219 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
222 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
223 $(document).ready(function() {
224 // We show table ordered by descending dates by default
225 // (so that the more recent query is shown first)
226 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
227 "aaSorting": [[ 1, "desc" ]],
229 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
230 { "aTargets": [ 1 ], "sType": "title-string" },
234 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
236 $(".CheckNone").click(function(e){
238 var form = $(this).parents("form").get(0);
239 $(form).unCheckCheckboxes();
240 enableCheckboxActions(form);
242 $(".CheckAll").click(function(e){
244 var form = $(this).parents("form").get(0);
245 $(form).checkCheckboxes();
246 enableCheckboxActions(form);
249 $("input:checkbox").click(function(){
250 var form = $(this).parents("form").get(0);
251 enableCheckboxActions(form);
254 $(".removeitems,.remove-selected").click(function(e){
256 var form = $(this).parents("form").get(0);
257 var ids = $(form).find("input:checkbox:checked");
258 if ( $(ids).length < 1 ) {
261 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
268 function enableCheckboxActions(form){
269 // Enable/disable controls if checkboxes are checked
270 var checkedBoxes = $(form).find("input:checkbox:checked");
271 if ($(checkedBoxes).size()) {
272 $(form).find(".selections").html(_("With selected searches: "));
273 $(form).find(".selections-toolbar .links a").removeClass("disabled");
275 $(form).find(".selections").html(_("Select searches to: "));
276 $(form).find(".selections-toolbar .links a").addClass("disabled");