Bug 10904: Limit patron update request management by branch
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / search-history.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 <title>Koha &rsaquo; Catalog &rsaquo; Search history</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/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">
10 //<![CDATA[
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" ]],
17         "aoColumnDefs": [
18             { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
19             { "aTargets": [ 1 ], "sType": "title-string" },
20         ],
21         "sPaginationType": "full_numbers"
22     }));
23
24     $('#tabs').tabs();
25
26     $(".CheckNone").click(function(e){
27         e.preventDefault();
28         var form = $(this).parents("form").get(0);
29         $(form).unCheckCheckboxes();
30         enableCheckboxActions(form);
31     });
32     $(".CheckAll").click(function(e){
33         e.preventDefault();
34         var form = $(this).parents("form").get(0);
35         $(form).checkCheckboxes();
36         enableCheckboxActions(form);
37     });
38
39     $("input:checkbox").click(function(){
40         var form = $(this).parents("form").get(0);
41         enableCheckboxActions(form);
42     });
43
44     $(".action_delete").click(function(e){
45         e.preventDefault();
46         var form = $(this).parents("form").get(0);
47         var ids = $(form).find("input:checkbox:checked");
48         if ( $(ids).length < 1 ) {
49             return false;
50         }
51         if ( confirm(MSG_CONFIRM_DELETE_HISTORY) ) {
52             $(form).submit();
53         }
54         return false;
55     });
56
57 });
58
59 function enableCheckboxActions(form){
60     // Enable/disable controls if checkboxes are checked
61     var checkedBoxes = $(form).find("input:checkbox:checked");
62     if ($(checkedBoxes).size()) {
63       $(form).find(".selections").html(_("With selected searches: "));
64       $(form).find(".selections-toolbar .links a").removeClass("disabled");
65     } else {
66       $(form).find(".selections").html(_("Select searches to: "));
67       $(form).find(".selections-toolbar .links a").addClass("disabled");
68     }
69 }
70
71 //]]>
72
73 </script>
74 </head>
75 <body id="catalogue_search-history" class="catalogue">
76
77 [% INCLUDE 'header.inc' %]
78 [% INCLUDE 'cat-search.inc' %]
79
80 <div id="breadcrumbs">
81   <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Search history
82 </div>
83
84 <div id="doc3" class="yui-t2">
85
86 <div id="bd">
87   <div id="yui-main">
88     <div class="yui-b">
89       <h1>Search history</h1>
90       <div id="tabs" class="toptabs">
91         <ul>
92           <li><a href="#biblio_tab">Catalog</a></li>
93           <li><a href="#authority_tab">Authority</a></li>
94         </ul>
95         <div id="biblio_tab">
96           [% IF ( current_biblio_searches ) %]
97             <h2>Current session</h2>
98             <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
99               <div class="selections-toolbar">
100                 <a class="CheckAll" href="#">Select all</a>
101                 <a class="CheckNone" href="#">Clear all</a>
102                 <span class="sep">|</span>
103                 <span class="links">
104                   <span class="selections">Select searches to: </span>
105                   <a href="#" class="action_delete disabled">Delete</a>
106                 </span>
107               </div>
108               <input type="hidden" name="action" value="delete" />
109               <table class="historyt">
110                 <thead>
111                   <tr>
112                     <th></th>
113                     <th>Date</th>
114                     <th>Search</th>
115                     <th>Results</th>
116                   </tr>
117                 </thead>
118                 <tbody>
119                 [% FOREACH s IN current_biblio_searches %]
120                   <tr>
121                     <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
122                     <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
123                     <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
124                     <td>[% s.total %]</td>
125                   </tr>
126                 [% END %]
127                 </tbody>
128               </table>
129             </form>
130           [% END %]
131
132           [% IF ( previous_biblio_searches ) %]
133             <h2>Previous sessions</h2>
134             <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
135               <div class="selections-toolbar">
136                 <a class="CheckAll" href="#">Select all</a>
137                 <a class="CheckNone" href="#">Clear all</a>
138                 <span class="sep">|</span>
139                 <span class="links">
140                   <span class="selections">Select searches to: </span>
141                   <a href="#" class="action_delete disabled">Delete</a>
142                 </span>
143               </div>
144               <input type="hidden" name="action" value="delete" />
145               <table class="historyt">
146                 <thead>
147                   <tr>
148                     <th></th>
149                     <th>Date</th>
150                     <th>Search</th>
151                     <th>Results</th>
152                   </tr>
153                 </thead>
154                 <tbody>
155                 [% FOREACH s IN previous_biblio_searches %]
156                   <tr>
157                     <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
158                     <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
159                     <td><a href="/cgi-bin/koha/catalogue/search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
160                     <td>[% s.total %]</td>
161                   </tr>
162                 [% END %]
163                 </tbody>
164               </table>
165             </form>
166           [% END %]
167
168           [% IF !current_biblio_searches && !previous_biblio_searches %]
169             <p>Your catalog search history is empty.</p>
170           [% END %]
171         </div>
172
173         <div id="authority_tab">
174           [% IF ( current_authority_searches ) %]
175             <h2>Current session</h2>
176             <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
177               <div class="selections-toolbar">
178                 <a class="CheckAll" href="#">Select all</a>
179                 <a class="CheckNone" href="#">Clear all</a>
180                 <span class="sep">|</span>
181                 <span class="links">
182                   <span class="selections">Select searches to: </span>
183                   <a href="#" class="action_delete disabled">Delete</a>
184                 </span>
185               </div>
186               <input type="hidden" name="action" value="delete" />
187               <table class="historyt">
188                 <thead>
189                   <tr>
190                     <th></th>
191                     <th>Date</th>
192                     <th>Search</th>
193                     <th>Results</th>
194                   </tr>
195                 </thead>
196                 <tbody>
197                 [% FOREACH s IN current_authority_searches %]
198                   <tr>
199                     <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
200                     <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
201                     <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
202                     <td>[% s.total %]</td>
203                   </tr>
204                 [% END %]
205                 </tbody>
206               </table>
207             </form>
208           [% END %]
209
210           [% IF ( previous_authority_searches ) %]
211             <h2>Previous sessions</h2>
212             <form action="/cgi-bin/koha/catalogue/search-history.pl" method="get">
213               <div class="selections-toolbar">
214                 <a class="CheckAll" href="#">Select all</a>
215                 <a class="CheckNone" href="#">Clear all</a>
216                 <span class="sep">|</span>
217                 <span class="links">
218                   <span class="selections">Select searches to: </span>
219                   <a href="#" class="action_delete disabled">Delete</a>
220                 </span>
221               </div>
222               <input type="hidden" name="action" value="delete" />
223               <table class="historyt">
224                 <thead>
225                   <tr>
226                     <th></th>
227                     <th>Date</th>
228                     <th>Search</th>
229                     <th>Results</th>
230                   </tr>
231                 </thead>
232                 <tbody>
233                 [% FOREACH s IN previous_authority_searches %]
234                   <tr>
235                     <td><input type="checkbox" name="id" value="[% s.id %]" /></td>
236                     <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
237                     <td><a href="/cgi-bin/koha/authorities/authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
238                     <td>[% s.total %]</td>
239                   </tr>
240                 [% END %]
241                 </tbody>
242               </table>
243             </form>
244           [% END %]
245
246           [% IF !current_authority_searches && !previous_authority_searches %]
247             <p>Your authority search history is empty.</p>
248           [% END %]
249         </div>
250       </div>
251     </div>
252   </div>
253 </div>
254 [% INCLUDE 'intranet-bottom.inc' %]