Bug 10936: (prog theme) remove duplicate 'Standard number' option in Advanced search
[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     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
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       [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
44         <div id="tabs" class="toptabs">
45           <ul>
46             <li><a href="#biblio_tab">Catalog searches</a></li>
47             <li><a href="#authority_tab">Authority searches</a></li>
48           </ul>
49       [% END %]
50         <div id="biblio_tab">
51           [% IF ( current_biblio_searches ) %]
52             <h2>Current session</h2>
53             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
54               <input type="hidden" name="action" value="delete" />
55               <input type="hidden" name="previous" value="0" />
56               <input type="hidden" name="type" value="biblio" />
57               <input type="submit" class="deleteshelf" value="Delete your current catalog history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
58             </form>
59             <table class="historyt">
60               <thead>
61                 <tr>
62                   <th>Date</th>
63                   <th>Search</th>
64                   <th>Results</th>
65                 </tr>
66               </thead>
67               <tbody>
68               [% FOREACH s IN current_biblio_searches %]
69                 <tr>
70                   <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
71                   <td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
72                   <td>[% s.total %]</td>
73                 </tr>
74               [% END %]
75               </tbody>
76             </table>
77           [% END %]
78
79           [% IF ( previous_biblio_searches ) %]
80             <h2>Previous sessions</h2>
81             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
82               <input type="hidden" name="action" value="delete" />
83               <input type="hidden" name="previous" value="1" />
84               <input type="hidden" name="type" value="biblio" />
85               <input type="submit" class="deleteshelf" value="Delete your previous catalog search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
86             </form>
87             <table class="historyt">
88               <thead>
89                 <tr>
90                   <th>Date</th>
91                   <th>Search</th>
92                   <th>Results</th>
93                 </tr>
94               </thead>
95               <tbody>
96               [% FOREACH s IN previous_biblio_searches %]
97                 <tr>
98                   <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
99                   <td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
100                   <td>[% s.total %]</td>
101                 </tr>
102               [% END %]
103               </tbody>
104             </table>
105           [% END %]
106
107           [% IF !current_biblio_searches && !previous_biblio_searches %]
108             <p>Your catalog search history is empty.</p>
109           [% END %]
110         </div>
111
112
113       [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
114         <div id="authority_tab">
115           [% IF ( current_authority_searches ) %]
116             <h2>Current session</h2>
117             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
118               <input type="hidden" name="action" value="delete" />
119               <input type="hidden" name="previous" value="0" />
120               <input type="hidden" name="type" value="authority" />
121               <input type="submit" class="deleteshelf" value="Delete your current authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
122             </form>
123             <table class="historyt">
124               <thead>
125                 <tr>
126                   <th>Date</th>
127                   <th>Search</th>
128                   <th>Results</th>
129                 </tr>
130               </thead>
131               <tbody>
132               [% FOREACH s IN current_authority_searches %]
133                 <tr>
134                   <td><span title="[% s.time %]">[% s.time %]</span></td>
135                   <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
136                   <td>[% s.total %]</td>
137                 </tr>
138               [% END %]
139               </tbody>
140             </table>
141           [% END %]
142
143           [% IF ( previous_authority_searches ) %]
144             <h2>Previous sessions</h2>
145             <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
146               <input type="hidden" name="action" value="delete" />
147               <input type="hidden" name="previous" value="1" />
148               <input type="hidden" name="type" value="authority" />
149               <input type="submit" class="deleteshelf" value="Delete your previous authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
150             </form>
151             <table class="historyt">
152               <thead>
153                 <tr>
154                   <th>Date</th>
155                   <th>Search</th>
156                   <th>Results</th>
157                 </tr>
158               </thead>
159               <tbody>
160               [% FOREACH s IN previous_authority_searches %]
161                 <tr>
162                   <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
163                   <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
164                   <td>[% s.total %]</td>
165                 </tr>
166               [% END %]
167               </tbody>
168             </table>
169           [% END %]
170
171           [% IF !current_authority_searches && !previous_authority_searches %]
172             <p>Your authority search history is empty.</p>
173           [% END %]
174         </div>
175       </div>
176         [% END %]
177     </div>
178   </div>
179 </div>
180
181 [% IF ( OpacNav ) %]
182   <div class="yui-b">
183     <div id="leftmenus" class="container">
184       [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
185     </div>
186   </div>
187 [% ELSIF ( loggedinusername ) %]
188   <div class="yui-b">
189     <div id="leftmenus" class="container">
190       [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
191     </div>
192   </div>
193 [% END %]
194
195 </div>
196 [% INCLUDE 'opac-bottom.inc' %]