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 | html %]</span></td>
74 <td><a href="[% OPACBaseURL | uri %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&[% s.query_cgi | uri %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink"><img src="[% interface | html %]/[% theme | html %]/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>
75 <td>[% s.total | html %]</td>
80 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
82 [% END # IF ( current_biblio_searches ) %]
83 </div> <!-- / #current_biblio -->
85 <div id="previous_biblio">
86 [% IF ( previous_biblio_searches ) %]
87 <h2>Previous sessions</h2>
88 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
89 <div class="selections-toolbar toolbar">
90 <a class="CheckAll" href="#">Select all</a>
91 <a class="CheckNone" href="#">Clear all</a>
92 <span class="sep">|</span>
94 <span class="selections">Select searches to: </span>
95 <a href="#" class="removeitems disabled">Delete</a>
99 <input type="hidden" name="action" value="delete" />
100 <table class="historyt table table-bordered table-striped">
110 [% FOREACH s IN previous_biblio_searches %]
112 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
113 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 | html %]</span></td>
114 <td><a href="[% OPACBaseURL | uri %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&[% s.query_cgi | uri %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink"><img src="[% interface | html %]/[% theme | html %]/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>
115 <td>[% s.total | html %]</td>
120 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
122 [% END # IF ( previous_biblio_searches ) %]
123 </div> <!-- / #previous_biblio -->
125 [% IF !current_biblio_searches && !previous_biblio_searches %]
126 <p>Your catalog search history is empty.</p>
128 </div> <!-- / #biblio_tab -->
130 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
131 <div id="authority_tab">
132 [% IF ( current_authority_searches ) %]
133 <h2>Current session</h2>
134 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
135 <div class="selections-toolbar toolbar">
136 <a class="CheckAll" href="#">Select all</a>
137 <a class="CheckNone" href="#">Clear all</a>
138 <span class="sep">|</span>
140 <span class="selections">Select searches to: </span>
141 <a href="#" class="removeitems disabled">Delete</a>
144 <input type="hidden" name="action" value="delete" />
145 <table class="historyt table table-bordered table-striped">
155 [% FOREACH s IN current_authority_searches %]
157 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
158 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 | html %]</span></td>
159 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | uri %]">[% s.query_desc | html %]</a></td>
160 <td>[% s.total | html %]</td>
165 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
167 [% END # / IF ( current_authority_searches ) %]
169 [% IF ( previous_authority_searches ) %]
170 <h2>Previous sessions</h2>
171 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
172 <div class="selections-toolbar toolbar">
173 <a class="CheckAll" href="#">Select all</a>
174 <a class="CheckNone" href="#">Clear all</a>
175 <span class="sep">|</span>
177 <span class="selections">Select searches to: </span>
178 <a href="#" class="removeitems disabled">Delete</a>
181 <input type="hidden" name="action" value="delete" />
182 <table class="historyt table table-bordered table-striped">
192 [% FOREACH s IN previous_authority_searches %]
194 <td><input type="checkbox" name="id" value="[% s.id | html %]" /></td>
195 <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 | html %]</span></td>
196 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | uri %]">[% s.query_desc | html %]</a></td>
197 <td>[% s.total | html %]</td>
202 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
204 [% END # / IF ( previous_authority_searches )%]
206 [% IF !current_authority_searches && !previous_authority_searches %]
207 <p>Your authority search history is empty.</p>
209 </div> <!-- / #authority_tab -->
210 [% END # / IF Koha.Preference( 'OpacAuthorities' ) %]
211 </div> <!-- / #tabs -->
212 </div> <!-- / #searchhistory -->
213 </div> <!-- / .span10/12 -->
214 </div> <!-- / .row-fluid -->
215 </div> <!-- / .container-fluid -->
216 </div> <!-- / #main -->
218 [% INCLUDE 'opac-bottom.inc' %]
219 [% BLOCK jsinclude %]
220 [% INCLUDE 'datatables.inc' %]
221 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
224 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
225 $(document).ready(function() {
226 // We show table ordered by descending dates by default
227 // (so that the more recent query is shown first)
228 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
229 "order": [[ 1, "desc" ]],
231 { "targets": [ 0 ], "sortable": false, "searchable": false },
232 { "targets": [ 1 ], "type": "title-string" },
236 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
238 $(".CheckNone").click(function(e){
240 var form = $(this).parents("form").get(0);
241 $(form).unCheckCheckboxes();
242 enableCheckboxActions(form);
244 $(".CheckAll").click(function(e){
246 var form = $(this).parents("form").get(0);
247 $(form).checkCheckboxes();
248 enableCheckboxActions(form);
251 $("input:checkbox").click(function(){
252 var form = $(this).parents("form").get(0);
253 enableCheckboxActions(form);
256 $(".removeitems,.remove-selected").click(function(e){
258 var form = $(this).parents("form").get(0);
259 var ids = $(form).find("input:checkbox:checked");
260 if ( $(ids).length < 1 ) {
263 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
270 function enableCheckboxActions(form){
271 // Enable/disable controls if checkboxes are checked
272 var checkedBoxes = $(form).find("input:checkbox:checked");
273 if ($(checkedBoxes).size()) {
274 $(form).find(".selections").html(_("With selected searches: "));
275 $(form).find(".selections-toolbar .links a").removeClass("disabled");
277 $(form).find(".selections").html(_("Select searches to: "));
278 $(form).find(".selections-toolbar .links a").addClass("disabled");