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="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">›</span></li>
17 <li><a href="#">Your search history</a></li>
19 <li><a href="#">Search history</a></li>
23 <div class="container-fluid">
24 <div class="row-fluid">
25 [% IF ( OpacNav||loggedinusername ) %]
28 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
35 <div id="searchhistory" class="maincontent">
36 <h1>Search history</h1>
37 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
38 <div id="tabs" class="toptabs">
40 <li><a href="#biblio_tab">Catalog</a></li>
41 <li><a href="#authority_tab">Authority</a></li>
45 <div id="current_biblio">
46 [% IF ( current_biblio_searches ) %]
47 <h2>Current session</h2>
48 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
49 <div class="selections-toolbar toolbar">
50 <a class="CheckAll" href="#">Select all</a>
51 <a class="CheckNone" href="#">Clear all</a>
52 <span class="sep">|</span>
54 <span class="selections">Select searches to: </span>
55 <a href="#" class="removeitems disabled">Delete</a>
58 <input type="hidden" name="action" value="delete" />
59 <table class="historyt table table-bordered table-striped">
69 [% FOREACH s IN current_biblio_searches %]
71 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
72 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
73 <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>
74 <td>[% s.total %]</td>
79 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
81 [% END # IF ( current_biblio_searches ) %]
82 </div> <!-- / #current_biblio -->
84 <div id="previous_biblio">
85 [% IF ( previous_biblio_searches ) %]
86 <h2>Previous sessions</h2>
87 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
88 <div class="selections-toolbar toolbar">
89 <a class="CheckAll" href="#">Select all</a>
90 <a class="CheckNone" href="#">Clear all</a>
91 <span class="sep">|</span>
93 <span class="selections">Select searches to: </span>
94 <a href="#" class="removeitems disabled">Delete</a>
98 <input type="hidden" name="action" value="delete" />
99 <table class="historyt table table-bordered table-striped">
109 [% FOREACH s IN previous_biblio_searches %]
111 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
112 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
113 <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>
114 <td>[% s.total %]</td>
119 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
121 [% END # IF ( previous_biblio_searches ) %]
122 </div> <!-- / #previous_biblio -->
124 [% IF !current_biblio_searches && !previous_biblio_searches %]
125 <p>Your catalog search history is empty.</p>
127 </div> <!-- / #biblio_tab -->
129 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
130 <div id="authority_tab">
131 [% IF ( current_authority_searches ) %]
132 <h2>Current session</h2>
133 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
134 <div class="selections-toolbar toolbar">
135 <a class="CheckAll" href="#">Select all</a>
136 <a class="CheckNone" href="#">Clear all</a>
137 <span class="sep">|</span>
139 <span class="selections">Select searches to: </span>
140 <a href="#" class="removeitems disabled">Delete</a>
143 <input type="hidden" name="action" value="delete" />
144 <table class="historyt table table-bordered table-striped">
154 [% FOREACH s IN current_authority_searches %]
156 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
157 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
158 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
159 <td>[% s.total %]</td>
164 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
166 [% END # / IF ( current_authority_searches ) %]
168 [% IF ( previous_authority_searches ) %]
169 <h2>Previous sessions</h2>
170 <form action="/cgi-bin/koha/opac-search-history.pl" method="post">
171 <div class="selections-toolbar toolbar">
172 <a class="CheckAll" href="#">Select all</a>
173 <a class="CheckNone" href="#">Clear all</a>
174 <span class="sep">|</span>
176 <span class="selections">Select searches to: </span>
177 <a href="#" class="removeitems disabled">Delete</a>
180 <input type="hidden" name="action" value="delete" />
181 <table class="historyt table table-bordered table-striped">
191 [% FOREACH s IN previous_authority_searches %]
193 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
194 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
195 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
196 <td>[% s.total %]</td>
201 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
203 [% END # / IF ( previous_authority_searches )%]
205 [% IF !current_authority_searches && !previous_authority_searches %]
206 <p>Your authority search history is empty.</p>
208 </div> <!-- / #authority_tab -->
209 [% END # / IF Koha.Preference( 'OpacAuthorities' ) %]
210 </div> <!-- / #tabs -->
211 </div> <!-- / #searchhistory -->
212 </div> <!-- / .span10/12 -->
213 </div> <!-- / .row-fluid -->
214 </div> <!-- / .container-fluid -->
215 </div> <!-- / #main -->
217 [% INCLUDE 'opac-bottom.inc' %]
218 [% BLOCK jsinclude %]
219 [% INCLUDE 'datatables.inc' %]
220 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
223 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
224 $(document).ready(function() {
225 // We show table ordered by descending dates by default
226 // (so that the more recent query is shown first)
227 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
228 "order": [[ 1, "desc" ]],
230 { "targets": [ 0 ], "sortable": false, "searchable": false },
231 { "targets": [ 1 ], "type": "title-string" },
235 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
237 $(".CheckNone").click(function(e){
239 var form = $(this).parents("form").get(0);
240 $(form).unCheckCheckboxes();
241 enableCheckboxActions(form);
243 $(".CheckAll").click(function(e){
245 var form = $(this).parents("form").get(0);
246 $(form).checkCheckboxes();
247 enableCheckboxActions(form);
250 $("input:checkbox").click(function(){
251 var form = $(this).parents("form").get(0);
252 enableCheckboxActions(form);
255 $(".removeitems,.remove-selected").click(function(e){
257 var form = $(this).parents("form").get(0);
258 var ids = $(form).find("input:checkbox:checked");
259 if ( $(ids).length < 1 ) {
262 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
269 function enableCheckboxActions(form){
270 // Enable/disable controls if checkboxes are checked
271 var checkedBoxes = $(form).find("input:checkbox:checked");
272 if ($(checkedBoxes).size()) {
273 $(form).find(".selections").html(_("With selected searches: "));
274 $(form).find(".selections-toolbar .links a").removeClass("disabled");
276 $(form).find(".selections").html(_("Select searches to: "));
277 $(form).find(".selections-toolbar .links a").addClass("disabled");