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 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
12 $(document).ready(function() {
13 // We show table ordered by descending dates by default
14 // (so that the more recent query is shown first)
15 $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
16 "aaSorting": [[ 1, "desc" ]],
18 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
19 { "aTargets": [ 1 ], "sType": "title-string" },
21 "sPaginationType": "full_numbers"
26 // DataTables removes hidden rows from the DOM, so we can't expect a
27 // "regular" submit to work and we need to build another form containing
28 // all form elements, and then submit this form.
29 $('form').submit(function(e) {
33 var table = form.find('table').dataTable();
35 var new_form = $('<form>')
36 .attr('action', form.attr('action'))
37 .attr('method', form.attr('method'));
38 form.find('input[type="hidden"]')
39 .add(table.$('input:checkbox:checked'))
41 var input = $('<input type="hidden">')
42 .attr('name', $(this).attr('name'))
43 .attr('value', $(this).attr('value'));
44 new_form.append(input);
46 $(document.body).append(new_form);
50 $(".CheckNone").click(function(e){
52 var form = $(this).parents("form").first();
53 var table = form.find('table').dataTable();
54 table.$('input[type="checkbox"]').attr('checked', false);
55 enableCheckboxActions(form);
57 $(".CheckAll").click(function(e){
59 var form = $(this).parents("form").first();
60 var table = form.find('table').dataTable();
61 table.$('input[type="checkbox"]').attr('checked', true);
62 enableCheckboxActions(form);
65 $("input:checkbox").click(function(){
66 var form = $(this).parents("form").first();
67 enableCheckboxActions(form);
70 $(".action_delete").click(function(e){
72 var form = $(this).parents("form").first();
73 var table = form.find('table').dataTable();
74 var ids = table.$("input:checkbox:checked");
75 if ( $(ids).length < 1 ) {
78 if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
86 function enableCheckboxActions(form){
87 // Enable/disable controls if checkboxes are checked
88 var table = form.find('table').dataTable();
89 var checkedBoxes = table.$("input:checkbox:checked");
90 if (checkedBoxes.size()) {
91 form.find(".selections").html(_("With selected searches: "));
92 form.find(".selections-toolbar .links a").removeClass("disabled");
94 form.find(".selections").html(_("Select searches to: "));
95 form.find(".selections-toolbar .links a").addClass("disabled");
103 <body id="catalogue_search-history" class="catalogue">
105 [% INCLUDE 'header.inc' %]
106 [% INCLUDE 'cat-search.inc' %]
108 <div id="breadcrumbs">
109 <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › Search history
112 <div id="doc3" class="yui-t2">
117 <h1>Search history</h1>
118 <div id="tabs" class="toptabs">
120 <li><a href="#biblio_tab">Catalog</a></li>
121 <li><a href="#authority_tab">Authority</a></li>
123 <div id="biblio_tab">
124 [% IF ( current_biblio_searches ) %]
125 <h2>Current session</h2>
126 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
127 <div class="selections-toolbar">
128 <a class="CheckAll" href="#">Select all</a>
129 <a class="CheckNone" href="#">Clear all</a>
130 <span class="sep">|</span>
132 <span class="selections">Select searches to: </span>
133 <a href="#" class="action_delete disabled">Delete</a>
136 <input type="hidden" name="action" value="delete" />
137 <table class="historyt">
147 [% FOREACH s IN current_biblio_searches %]
149 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
150 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
151 <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
152 <td>[% s.total %]</td>
160 [% IF ( previous_biblio_searches ) %]
161 <h2>Previous sessions</h2>
162 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
163 <div class="selections-toolbar">
164 <a class="CheckAll" href="#">Select all</a>
165 <a class="CheckNone" href="#">Clear all</a>
166 <span class="sep">|</span>
168 <span class="selections">Select searches to: </span>
169 <a href="#" class="action_delete disabled">Delete</a>
172 <input type="hidden" name="action" value="delete" />
173 <table class="historyt">
183 [% FOREACH s IN previous_biblio_searches %]
185 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
186 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
187 <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
188 <td>[% s.total %]</td>
196 [% IF !current_biblio_searches && !previous_biblio_searches %]
197 <p>Your catalog search history is empty.</p>
201 <div id="authority_tab">
202 [% IF ( current_authority_searches ) %]
203 <h2>Current session</h2>
204 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
205 <div class="selections-toolbar">
206 <a class="CheckAll" href="#">Select all</a>
207 <a class="CheckNone" href="#">Clear all</a>
208 <span class="sep">|</span>
210 <span class="selections">Select searches to: </span>
211 <a href="#" class="action_delete disabled">Delete</a>
214 <input type="hidden" name="action" value="delete" />
215 <table class="historyt">
225 [% FOREACH s IN current_authority_searches %]
227 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
228 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
229 <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
230 <td>[% s.total %]</td>
238 [% IF ( previous_authority_searches ) %]
239 <h2>Previous sessions</h2>
240 <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
241 <div class="selections-toolbar">
242 <a class="CheckAll" href="#">Select all</a>
243 <a class="CheckNone" href="#">Clear all</a>
244 <span class="sep">|</span>
246 <span class="selections">Select searches to: </span>
247 <a href="#" class="action_delete disabled">Delete</a>
250 <input type="hidden" name="action" value="delete" />
251 <table class="historyt">
261 [% FOREACH s IN previous_authority_searches %]
263 <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
264 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
265 <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
266 <td>[% s.total %]</td>
274 [% IF !current_authority_searches && !previous_authority_searches %]
275 <p>Your authority search history is empty.</p>
282 [% INCLUDE 'intranet-bottom.inc' %]