3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your search history</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
8 [% INCLUDE 'bodytag.inc' bodyid='opac-search-history' bodyclass='scrollto' %]
9 [% INCLUDE 'masthead.inc' %]
12 <ul class="breadcrumb">
13 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
14 [% IF ( loggedinusername ) %]
15 <li><a href="#">Your search history</a></li>
17 <li><a href="#">Search history</a></li>
21 <div class="container-fluid">
22 <div class="row-fluid">
23 [% IF ( OpacNav||loggedinusername ) %]
26 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
33 <div id="searchhistory" class="maincontent">
34 <h1>Search history</h1>
35 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
36 <div id="tabs" class="toptabs">
38 <li><a href="#biblio_tab">Catalog</a></li>
39 <li><a href="#authority_tab">Authority</a></li>
43 <div id="current_biblio">
44 [% IF ( current_biblio_searches ) %]
45 <h2>Current session</h2>
46 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
47 <div class="selections-toolbar toolbar">
48 <a class="CheckAll" href="#">Select all</a>
49 <a class="CheckNone" href="#">Clear all</a>
50 <span class="sep">|</span>
52 <span class="selections">Select searches to: </span>
53 <a href="#" class="removeitems disabled">Delete</a>
56 <input type="hidden" name="action" value="delete" />
57 <table class="historyt table table-bordered table-striped">
67 [% FOREACH s IN current_biblio_searches %]
69 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
70 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
71 <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>
72 <td>[% s.total %]</td>
77 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
79 [% END # IF ( current_biblio_searches ) %]
80 </div> <!-- / #current_biblio -->
82 <div id="previous_biblio">
83 [% IF ( previous_biblio_searches ) %]
84 <h2>Previous sessions</h2>
85 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
86 <div class="selections-toolbar toolbar">
87 <a class="CheckAll" href="#">Select all</a>
88 <a class="CheckNone" href="#">Clear all</a>
89 <span class="sep">|</span>
91 <span class="selections">Select searches to: </span>
92 <a href="#" class="removeitems disabled">Delete</a>
96 <input type="hidden" name="action" value="delete" />
97 <table class="historyt table table-bordered table-striped">
107 [% FOREACH s IN previous_biblio_searches %]
109 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
110 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
111 <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>
112 <td>[% s.total %]</td>
117 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
119 [% END # IF ( previous_biblio_searches ) %]
120 </div> <!-- / #previous_biblio -->
122 [% IF !current_biblio_searches && !previous_biblio_searches %]
123 <p>Your catalog search history is empty.</p>
125 </div> <!-- / #biblio_tab -->
127 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
128 <div id="authority_tab">
129 [% IF ( current_authority_searches ) %]
130 <h2>Current session</h2>
131 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
132 <div class="selections-toolbar toolbar">
133 <a class="CheckAll" href="#">Select all</a>
134 <a class="CheckNone" href="#">Clear all</a>
135 <span class="sep">|</span>
137 <span class="selections">Select searches to: </span>
138 <a href="#" class="removeitems disabled">Delete</a>
141 <input type="hidden" name="action" value="delete" />
142 <table class="historyt table table-bordered table-striped">
152 [% FOREACH s IN current_authority_searches %]
154 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
155 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
156 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
157 <td>[% s.total %]</td>
162 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
164 [% END # / IF ( current_authority_searches ) %]
166 [% IF ( previous_authority_searches ) %]
167 <h2>Previous sessions</h2>
168 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
169 <div class="selections-toolbar toolbar">
170 <a class="CheckAll" href="#">Select all</a>
171 <a class="CheckNone" href="#">Clear all</a>
172 <span class="sep">|</span>
174 <span class="selections">Select searches to: </span>
175 <a href="#" class="removeitems disabled">Delete</a>
178 <input type="hidden" name="action" value="delete" />
179 <table class="historyt table table-bordered table-striped">
189 [% FOREACH s IN previous_authority_searches %]
191 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
192 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
193 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
194 <td>[% s.total %]</td>
199 <input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches">
201 [% END # / IF ( previous_authority_searches )%]
203 [% IF !current_authority_searches && !previous_authority_searches %]
204 <p>Your authority search history is empty.</p>
206 </div> <!-- / #authority_tab -->
207 [% END # / IF Koha.Preference( 'OpacAuthorities' ) %]
208 </div> <!-- / #tabs -->
209 </div> <!-- / #searchhistory -->
210 </div> <!-- / .span10/12 -->
211 </div> <!-- / .row-fluid -->
212 </div> <!-- / .container-fluid -->
213 </div> <!-- / #main -->
215 [% INCLUDE 'opac-bottom.inc' %]
216 [% BLOCK jsinclude %]
217 [% INCLUDE 'datatables.inc' %]
218 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
219 <script type="text/javascript">
221 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
222 $(document).ready(function() {
223 // We show table ordered by descending dates by default
224 // (so that the more recent query is shown first)
225 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
226 "aaSorting": [[ 1, "desc" ]],
228 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
229 { "aTargets": [ 1 ], "sType": "title-string" },
233 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
235 $(".CheckNone").click(function(e){
237 var form = $(this).parents("form").get(0);
238 $(form).unCheckCheckboxes();
239 enableCheckboxActions(form);
241 $(".CheckAll").click(function(e){
243 var form = $(this).parents("form").get(0);
244 $(form).checkCheckboxes();
245 enableCheckboxActions(form);
248 $("input:checkbox").click(function(){
249 var form = $(this).parents("form").get(0);
250 enableCheckboxActions(form);
253 $(".removeitems,.remove-selected").click(function(e){
255 var form = $(this).parents("form").get(0);
256 var ids = $(form).find("input:checkbox:checked");
257 if ( $(ids).length < 1 ) {
260 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
267 function enableCheckboxActions(form){
268 // Enable/disable controls if checkboxes are checked
269 var checkedBoxes = $(form).find("input:checkbox:checked");
270 if ($(checkedBoxes).size()) {
271 $(form).find(".selections").html(_("With selected searches: "));
272 $(form).find(".selections-toolbar .links a").removeClass("disabled");
274 $(form).find(".selections").html(_("Select searches to: "));
275 $(form).find(".selections-toolbar .links a").addClass("disabled");