3 [% INCLUDE 'doc-head-open.inc' %]
4 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your search history
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="action_delete 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>
80 <div id="previous_biblio">
81 [% IF ( previous_biblio_searches ) %]
82 <h2>Previous sessions</h2>
83 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
84 <div class="selections-toolbar toolbar">
85 <a class="CheckAll" href="#">Select all</a>
86 <a class="CheckNone" href="#">Clear all</a>
87 <span class="sep">|</span>
89 <span class="selections">Select searches to: </span>
90 <a href="#" class="action_delete disabled">Delete</a>
94 <input type="hidden" name="action" value="delete" />
95 <table class="historyt table table-bordered table-striped">
105 [% FOREACH s IN previous_biblio_searches %]
107 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
108 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
109 <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>
110 <td>[% s.total %]</td>
119 [% IF !current_biblio_searches && !previous_biblio_searches %]
120 <p>Your catalog search history is empty.</p>
124 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
125 <div id="authority_tab">
126 [% IF ( current_authority_searches ) %]
127 <h2>Current session</h2>
128 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
129 <div class="selections-toolbar toolbar">
130 <a class="CheckAll" href="#">Select all</a>
131 <a class="CheckNone" href="#">Clear all</a>
132 <span class="sep">|</span>
134 <span class="selections">Select searches to: </span>
135 <a href="#" class="action_delete disabled">Delete</a>
138 <input type="hidden" name="action" value="delete" />
139 <table class="historyt table table-bordered table-striped">
149 [% FOREACH s IN current_authority_searches %]
151 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
152 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
153 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
154 <td>[% s.total %]</td>
162 [% IF ( previous_authority_searches ) %]
163 <h2>Previous sessions</h2>
164 <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
165 <div class="selections-toolbar toolbar">
166 <a class="CheckAll" href="#">Select all</a>
167 <a class="CheckNone" href="#">Clear all</a>
168 <span class="sep">|</span>
170 <span class="selections">Select searches to: </span>
171 <a href="#" class="action_delete disabled">Delete</a>
174 <input type="hidden" name="action" value="delete" />
175 <table class="historyt table table-bordered table-striped">
185 [% FOREACH s IN previous_authority_searches %]
187 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
188 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
189 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
190 <td>[% s.total %]</td>
198 [% IF !current_authority_searches && !previous_authority_searches %]
199 <p>Your authority search history is empty.</p>
210 [% INCLUDE 'opac-bottom.inc' %]
211 [% BLOCK jsinclude %]
212 [% INCLUDE 'datatables.inc' %]
213 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
214 <script type="text/javascript">
216 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
217 $(document).ready(function() {
218 // We show table ordered by descending dates by default
219 // (so that the more recent query is shown first)
220 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
221 "aaSorting": [[ 1, "desc" ]],
223 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
224 { "aTargets": [ 1 ], "sType": "title-string" },
228 [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
230 $(".CheckNone").click(function(e){
232 var form = $(this).parents("form").get(0);
233 $(form).unCheckCheckboxes();
234 enableCheckboxActions(form);
236 $(".CheckAll").click(function(e){
238 var form = $(this).parents("form").get(0);
239 $(form).checkCheckboxes();
240 enableCheckboxActions(form);
243 $("input:checkbox").click(function(){
244 var form = $(this).parents("form").get(0);
245 enableCheckboxActions(form);
248 $(".action_delete").click(function(e){
250 var form = $(this).parents("form").get(0);
251 var ids = $(form).find("input:checkbox:checked");
252 if ( $(ids).length < 1 ) {
255 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
262 function enableCheckboxActions(form){
263 // Enable/disable controls if checkboxes are checked
264 var checkedBoxes = $(form).find("input:checkbox:checked");
265 if ($(checkedBoxes).size()) {
266 $(form).find(".selections").html(_("With selected searches: "));
267 $(form).find(".selections-toolbar .links a").removeClass("disabled");
269 $(form).find(".selections").html(_("Select searches to: "));
270 $(form).find(".selections-toolbar .links a").addClass("disabled");