1 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Catalog › Search history</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9 <script type="text/javascript">
11 $(document).ready(function() {
12 // We show table ordered by descending dates by default
13 // (so that the more recent query is shown first)
14 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
15 "aaSorting": [[ 1, "desc" ]],
17 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
18 { "aTargets": [ 1 ], "sType": "title-string" },
20 "sPaginationType": "full_numbers"
25 // DataTables removes hidden rows from the DOM, so we can't expect a
26 // "regular" submit to work and we need to build another form containing
27 // all form elements, and then submit this form.
28 $('form').submit(function(e) {
32 var table = form.find('table').dataTable();
34 var new_form = $('<form>')
35 .attr('action', form.attr('action'))
36 .attr('method', form.attr('method'));
37 form.find('input[type="hidden"]')
38 .add(table.$('input:checkbox:checked'))
40 var input = $('<input type="hidden">')
41 .attr('name', $(this).attr('name'))
42 .attr('value', $(this).attr('value'));
43 new_form.append(input);
45 $(document.body).append(new_form);
49 $(".CheckNone").click(function(e){
51 var form = $(this).parents("form").first();
52 var table = form.find('table').dataTable();
53 table.$('input[type="checkbox"]').attr('checked', false);
54 enableCheckboxActions(form);
56 $(".CheckAll").click(function(e){
58 var form = $(this).parents("form").first();
59 var table = form.find('table').dataTable();
60 table.$('input[type="checkbox"]').attr('checked', true);
61 enableCheckboxActions(form);
64 $("input:checkbox").click(function(){
65 var form = $(this).parents("form").first();
66 enableCheckboxActions(form);
69 $(".action_delete").click(function(e){
71 var form = $(this).parents("form").first();
72 var table = form.find('table').dataTable();
73 var ids = table.$("input:checkbox:checked");
74 if ( $(ids).length < 1 ) {
79 if (ids.length == 1) {
80 msg = _("Are you sure you want to delete the selected search history entry?");
82 msg = _("Are you sure you want to delete the %s selected search history entries?").format(ids.length);
93 function enableCheckboxActions(form){
94 // Enable/disable controls if checkboxes are checked
95 var table = form.find('table').dataTable();
96 var checked_count = table.$("input:checkbox:checked").length;
98 if (checked_count == 1) {
99 form.find(".selections").html(_("With selected search: "));
101 form.find(".selections").html(_("With %s selected searches: ").format(checked_count));
103 form.find(".selections-toolbar .links a").removeClass("disabled");
105 form.find(".selections").html(_("Select searches to: "));
106 form.find(".selections-toolbar .links a").addClass("disabled");
114 <body id="catalogue_search-history" class="catalogue">
116 [% INCLUDE 'header.inc' %]
117 [% INCLUDE 'cat-search.inc' %]
119 <div id="breadcrumbs">
120 <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › Search history
123 <div id="doc3" class="yui-t2">
128 <h1>Search history</h1>
129 <div id="tabs" class="toptabs">
131 <li><a href="#biblio_tab">Catalog</a></li>
132 <li><a href="#authority_tab">Authority</a></li>
134 <div id="biblio_tab">
135 [% IF ( current_biblio_searches ) %]
136 <h2>Current session</h2>
137 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
138 <div class="selections-toolbar">
139 <a class="CheckAll" href="#">Select all</a>
140 <a class="CheckNone" href="#">Clear all</a>
141 <span class="sep">|</span>
143 <span class="selections">Select searches to: </span>
144 <a href="#" class="action_delete disabled">Delete</a>
147 <input type="hidden" name="action" value="delete" />
148 <table class="historyt">
158 [% FOREACH s IN current_biblio_searches %]
160 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
161 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
162 <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
163 <td>[% s.total %]</td>
171 [% IF ( previous_biblio_searches ) %]
172 <h2>Previous sessions</h2>
173 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
174 <div class="selections-toolbar">
175 <a class="CheckAll" href="#">Select all</a>
176 <a class="CheckNone" href="#">Clear all</a>
177 <span class="sep">|</span>
179 <span class="selections">Select searches to: </span>
180 <a href="#" class="action_delete disabled">Delete</a>
183 <input type="hidden" name="action" value="delete" />
184 <table class="historyt">
194 [% FOREACH s IN previous_biblio_searches %]
196 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
197 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
198 <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
199 <td>[% s.total %]</td>
207 [% IF !current_biblio_searches && !previous_biblio_searches %]
208 <p>Your catalog search history is empty.</p>
212 <div id="authority_tab">
213 [% IF ( current_authority_searches ) %]
214 <h2>Current session</h2>
215 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
216 <div class="selections-toolbar">
217 <a class="CheckAll" href="#">Select all</a>
218 <a class="CheckNone" href="#">Clear all</a>
219 <span class="sep">|</span>
221 <span class="selections">Select searches to: </span>
222 <a href="#" class="action_delete disabled">Delete</a>
225 <input type="hidden" name="action" value="delete" />
226 <table class="historyt">
236 [% FOREACH s IN current_authority_searches %]
238 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
239 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
240 <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
241 <td>[% s.total %]</td>
249 [% IF ( previous_authority_searches ) %]
250 <h2>Previous sessions</h2>
251 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
252 <div class="selections-toolbar">
253 <a class="CheckAll" href="#">Select all</a>
254 <a class="CheckNone" href="#">Clear all</a>
255 <span class="sep">|</span>
257 <span class="selections">Select searches to: </span>
258 <a href="#" class="action_delete disabled">Delete</a>
261 <input type="hidden" name="action" value="delete" />
262 <table class="historyt">
272 [% FOREACH s IN previous_authority_searches %]
274 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
275 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
276 <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
277 <td>[% s.total %]</td>
285 [% IF !current_authority_searches && !previous_authority_searches %]
286 <p>Your authority search history is empty.</p>
293 [% INCLUDE 'intranet-bottom.inc' %]