fc9da828e7a14dceb8d76721f4bcf46b79d19862
[koha_fer] / koha-tmpl / opac-tmpl / prog / en / modules / opac-search-history.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
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 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript">
8 //<![CDATA[
9 var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete your search history?");
10 $(document).ready(function() {
11     // We show table ordered by descending dates by default
12     // (so that the more recent query is shown first)
13     $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
14         "aaSorting": [[ 0, "desc" ]],
15         "aoColumns": [
16             { "sType": "title-string" },
17             null,
18             null
19         ]
20     }));
21
22     $('#tabs').tabs();
23 });
24 //]]>
25
26 </script>
27 </head>
28 <body id="opac-search-history">
29 [% IF ( OpacNav ) %]
30 <div id="doc3" class="yui-t1">
31 [% ELSIF ( loggedinusername ) %]
32 <div id="doc3" class="yui-t1">
33 [% ELSE %]
34 <div id="doc3" class="yui-t7">
35 [% END %]
36    <div id="bd">
37 [% INCLUDE 'masthead.inc' %]
38
39 <div id="yui-main">
40   <div class="yui-b">
41     <div class="yui-g">
42       <h1>Search history</h1>
43       <div id="tabs" class="toptabs">
44         <ul>
45           <li><a href="#biblio_tab">Biblio</a></li>
46           <li><a href="#authority_tab">Authority</a></li>
47         </ul>
48         <div id="biblio_tab">
49           [% IF ( current_biblio_searches ) %]
50             <h2>Current session</h2>
51             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
52               <input type="hidden" name="action" value="delete" />
53               <input type="hidden" name="previous" value="0" />
54               <input type="hidden" name="type" value="biblio" />
55               <input type="submit" class="deleteshelf" value="Delete your current biblio history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
56             </form>
57             <table class="historyt">
58               <thead>
59                 <tr>
60                   <th>Date</th>
61                   <th>Search</th>
62                   <th>Results</th>
63                 </tr>
64               </thead>
65               <tbody>
66               [% FOREACH s IN current_biblio_searches %]
67                 <tr>
68                   <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
69                   <td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
70                   <td>[% s.total %]</td>
71                 </tr>
72               [% END %]
73               </tbody>
74             </table>
75           [% END %]
76
77           [% IF ( previous_biblio_searches ) %]
78             <h2>Previous sessions</h2>
79             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
80               <input type="hidden" name="action" value="delete" />
81               <input type="hidden" name="previous" value="1" />
82               <input type="hidden" name="type" value="biblio" />
83               <input type="submit" class="deleteshelf" value="Delete your previous biblio search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
84             </form>
85             <table class="historyt">
86               <thead>
87                 <tr>
88                   <th>Date</th>
89                   <th>Search</th>
90                   <th>Results</th>
91                 </tr>
92               </thead>
93               <tbody>
94               [% FOREACH s IN previous_biblio_searches %]
95                 <tr>
96                   <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
97                   <td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
98                   <td>[% s.total %]</td>
99                 </tr>
100               [% END %]
101               </tbody>
102             </table>
103           [% END %]
104
105         <div id="authority_tab">
106           [% IF ( current_authority_searches ) %]
107             <h2>Current session</h2>
108             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
109               <input type="hidden" name="action" value="delete" />
110               <input type="hidden" name="previous" value="0" />
111               <input type="hidden" name="type" value="authority" />
112               <input type="submit" class="deleteshelf" value="Delete your current authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
113             </form>
114             <table class="historyt">
115               <thead>
116                 <tr>
117                   <th>Date</th>
118                   <th>Search</th>
119                   <th>Results</th>
120                 </tr>
121               </thead>
122               <tbody>
123               [% FOREACH s IN current_authority_searches %]
124                 <tr>
125                   <td><span title="[% s.time %]">[% s.time %]</span></td>
126                   <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
127                   <td>[% s.total %]</td>
128                 </tr>
129               [% END %]
130               </tbody>
131             </table>
132           [% END %]
133
134           [% IF ( previous_authority_searches ) %]
135             <h2>Previous sessions</h2>
136             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
137               <input type="hidden" name="action" value="delete" />
138               <input type="hidden" name="previous" value="1" />
139               <input type="hidden" name="type" value="authority" />
140               <input type="submit" class="deleteshelf" value="Delete your previous authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
141             </form>
142             <table class="historyt">
143               <thead>
144                 <tr>
145                   <th>Date</th>
146                   <th>Search</th>
147                   <th>Results</th>
148                 </tr>
149               </thead>
150               <tbody>
151               [% FOREACH s IN previous_authority_searches %]
152                 <tr>
153                   <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
154                   <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
155                   <td>[% s.total %]</td>
156                 </tr>
157               [% END %]
158               </tbody>
159             </table>
160           [% END %]
161
162           [% IF !current_authority_searches && !previous_authority_searches %]
163             <p>Your authority search history is empty.</p>
164           [% END %]
165         </div>
166       </div>
167     </div>
168   </div>
169 </div>
170
171 [% IF ( OpacNav ) %]
172   <div class="yui-b">
173     <div id="leftmenus" class="container">
174       [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
175     </div>
176   </div>
177 [% ELSIF ( loggedinusername ) %]
178   <div class="yui-b">
179     <div id="leftmenus" class="container">
180       [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
181     </div>
182   </div>
183 [% END %]
184
185 </div>
186 [% INCLUDE 'opac-bottom.inc' %]