Lines 1-5
Link Here
|
1 |
[% USE Koha %] |
1 |
[% USE Koha %] |
2 |
[% USE KohaDates %] |
2 |
[% USE KohaDates %] |
|
|
3 |
[% USE date %] |
4 |
|
5 |
[% BLOCK search_history_table %] |
6 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
7 |
<div> |
8 |
[% IF type == 'biblio' %] |
9 |
<a href="#" class="action_search">Start a new search</a> |
10 |
<span class='search_options form-inline'> |
11 |
<span>New search:</span> |
12 |
<select name='join'> |
13 |
<option value="or" selected="selected">match any of selected searches</option> |
14 |
<option value="and">match all of selected searches</option> |
15 |
</select> |
16 |
<button type="submit">Go</button> |
17 |
<a href="#" class="action_search_cancel">Cancel</a> |
18 |
</span> |
19 |
|
20 |
[% END %] |
21 |
</div> |
22 |
<div class="selections-toolbar toolbar"> |
23 |
<a class="CheckAll" href="#">Select all</a> |
24 |
<a class="CheckNone" href="#">Clear all</a> |
25 |
<span class="sep">|</span> |
26 |
<span class="links"> |
27 |
<span class="selections">Select searches to: </span> |
28 |
<a href="#" class="removeitems disabled">Delete</a> |
29 |
</span> |
30 |
</div> |
31 |
<input type="hidden" name="action" value="delete" /> |
32 |
<table class="historyt table table-bordered table-striped"> |
33 |
<thead> |
34 |
<tr> |
35 |
<th></th> |
36 |
<th class="not">Not</th> |
37 |
[% IF hide_session_column %] |
38 |
<th class="hide">Session date</th> |
39 |
[% ELSE %] |
40 |
<th>Session date</th> |
41 |
[% END %] |
42 |
<th>Date</th> |
43 |
<th>Search</th> |
44 |
<th>Results</th> |
45 |
</tr> |
46 |
</thead> |
47 |
<tbody> |
48 |
[% FOREACH s IN searches %] |
49 |
<tr> |
50 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
51 |
<td class="not"> |
52 |
<select name="not"> |
53 |
<option value=""></option> |
54 |
<option value="[% s.id %]" title="Search for the opposite of the criteria on this row">NOT</option> |
55 |
</select> |
56 |
</td> |
57 |
[% IF hide_session_column %] |
58 |
<td class="hide"> |
59 |
[% ELSE %] |
60 |
<td> |
61 |
[% END %] |
62 |
[% IF s.session %] |
63 |
[% session_ctime = date.format(s.session.session_ctime, '%Y-%m-%d %H:%M:%S') %] |
64 |
<span title="[% session_ctime %]"> |
65 |
[% IF s.session.session_id == sessionid %] |
66 |
<strong title="Current session"> |
67 |
[% END %] |
68 |
[% session_ctime | $KohaDates %] |
69 |
[% IF s.session.session_id == sessionid %] |
70 |
</strong> |
71 |
[% END %] |
72 |
</span> |
73 |
[% ELSE %] |
74 |
<span title="">Unknown</span> |
75 |
[% END %] |
76 |
</td> |
77 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
78 |
[% IF type == 'biblio' %] |
79 |
[% search_url = '/cgi-bin/koha/opac-search.pl' %] |
80 |
[% ELSIF type == 'authority' %] |
81 |
[% search_url = '/cgi-bin/koha/opac-authorities-home.pl' %] |
82 |
[% END %] |
83 |
<td> |
84 |
[% IF type == 'biblio' %] |
85 |
<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&[% s.query_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink"> |
86 |
<img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/> |
87 |
</a> |
88 |
[% END %] |
89 |
<a href="[% search_url %]?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
90 |
<td>[% s.total %]</td> |
91 |
</tr> |
92 |
[% END %] |
93 |
</tbody> |
94 |
</table> |
95 |
<input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> |
96 |
</form> |
97 |
[% END %] |
98 |
|
3 |
[% INCLUDE 'doc-head-open.inc' %] |
99 |
[% INCLUDE 'doc-head-open.inc' %] |
4 |
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your search history</title> |
100 |
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your search history</title> |
5 |
[% INCLUDE 'doc-head-close.inc' %] |
101 |
[% INCLUDE 'doc-head-close.inc' %] |
Lines 31-216
Link Here
|
31 |
<div class="span12"> |
127 |
<div class="span12"> |
32 |
[% END %] |
128 |
[% END %] |
33 |
<div id="searchhistory" class="maincontent"> |
129 |
<div id="searchhistory" class="maincontent"> |
34 |
<h1>Search history</h1> |
130 |
<h1>Search history</h1> |
35 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
131 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
36 |
<div id="tabs" class="toptabs"> |
132 |
<div id="tabs" class="toptabs"> |
37 |
<ul> |
133 |
<ul> |
38 |
<li><a href="#biblio_tab">Catalog</a></li> |
134 |
<li><a href="#biblio_tab">Catalog</a></li> |
39 |
<li><a href="#authority_tab">Authority</a></li> |
135 |
<li><a href="#authority_tab">Authority</a></li> |
40 |
</ul> |
136 |
</ul> |
|
|
137 |
[% END %] |
138 |
<div id="biblio_tab"> |
139 |
[% IF ( biblio_searches ) %] |
140 |
[% INCLUDE search_history_table |
141 |
searches = biblio_searches |
142 |
type = 'biblio' %] |
143 |
[% ELSE %] |
144 |
<p>Your catalog search history is empty.</p> |
41 |
[% END %] |
145 |
[% END %] |
42 |
<div id="biblio_tab"> |
146 |
</div> |
43 |
<div id="current_biblio"> |
|
|
44 |
[% IF ( current_biblio_searches ) %] |
45 |
<h2>Current session</h2> |
46 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
47 |
<div class="selections-toolbar toolbar"> |
48 |
<a class="CheckAll" href="#">Select all</a> |
49 |
<a class="CheckNone" href="#">Clear all</a> |
50 |
<span class="sep">|</span> |
51 |
<span class="links"> |
52 |
<span class="selections">Select searches to: </span> |
53 |
<a href="#" class="removeitems disabled">Delete</a> |
54 |
</span> |
55 |
</div> |
56 |
<input type="hidden" name="action" value="delete" /> |
57 |
<table class="historyt table table-bordered table-striped"> |
58 |
<thead> |
59 |
<tr> |
60 |
<th></th> |
61 |
<th>Date</th> |
62 |
<th>Search</th> |
63 |
<th>Results</th> |
64 |
</tr> |
65 |
</thead> |
66 |
<tbody> |
67 |
[% FOREACH s IN current_biblio_searches %] |
68 |
<tr> |
69 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
70 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
71 |
<td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&[% s.query_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a> <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 |
<input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> |
78 |
</form> |
79 |
[% END # IF ( current_biblio_searches ) %] |
80 |
</div> <!-- / #current_biblio --> |
81 |
|
82 |
<div id="previous_biblio"> |
83 |
[% IF ( previous_biblio_searches ) %] |
84 |
<h2>Previous sessions</h2> |
85 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
86 |
<div class="selections-toolbar toolbar"> |
87 |
<a class="CheckAll" href="#">Select all</a> |
88 |
<a class="CheckNone" href="#">Clear all</a> |
89 |
<span class="sep">|</span> |
90 |
<span class="links"> |
91 |
<span class="selections">Select searches to: </span> |
92 |
<a href="#" class="removeitems disabled">Delete</a> |
93 |
</span> |
94 |
</div> |
95 |
|
96 |
<input type="hidden" name="action" value="delete" /> |
97 |
<table class="historyt table table-bordered table-striped"> |
98 |
<thead> |
99 |
<tr> |
100 |
<th></th> |
101 |
<th>Date</th> |
102 |
<th>Search</th> |
103 |
<th>Results</th> |
104 |
</tr> |
105 |
</thead> |
106 |
<tbody> |
107 |
[% FOREACH s IN previous_biblio_searches %] |
108 |
<tr> |
109 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
110 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
111 |
<td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&[% s.query_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a> <a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
112 |
<td>[% s.total %]</td> |
113 |
</tr> |
114 |
[% END %] |
115 |
</tbody> |
116 |
</table> |
117 |
<input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> |
118 |
</form> |
119 |
[% END # IF ( previous_biblio_searches ) %] |
120 |
</div> <!-- / #previous_biblio --> |
121 |
|
122 |
[% IF !current_biblio_searches && !previous_biblio_searches %] |
123 |
<p>Your catalog search history is empty.</p> |
124 |
[% END %] |
125 |
</div> <!-- / #biblio_tab --> |
126 |
|
147 |
|
127 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
148 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %] |
128 |
<div id="authority_tab"> |
149 |
<div id="authority_tab"> |
129 |
[% IF ( current_authority_searches ) %] |
150 |
[% IF ( authority_searches ) %] |
130 |
<h2>Current session</h2> |
151 |
[% INCLUDE search_history_table |
131 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
152 |
searches = authority_searches |
132 |
<div class="selections-toolbar toolbar"> |
153 |
type = 'authority' %] |
133 |
<a class="CheckAll" href="#">Select all</a> |
154 |
[% ELSE %] |
134 |
<a class="CheckNone" href="#">Clear all</a> |
155 |
<p>Your authority search history is empty.</p> |
135 |
<span class="sep">|</span> |
156 |
[% END %] |
136 |
<span class="links"> |
157 |
</div> |
137 |
<span class="selections">Select searches to: </span> |
158 |
[% END %] |
138 |
<a href="#" class="removeitems disabled">Delete</a> |
159 |
</div> <!-- / #search_history --> |
139 |
</span> |
160 |
</div> <!-- / .span10/12 --> |
140 |
</div> |
161 |
</div> <!-- / .row-fluid --> |
141 |
<input type="hidden" name="action" value="delete" /> |
162 |
</div> <!-- / .container-fluid --> |
142 |
<table class="historyt table table-bordered table-striped"> |
|
|
143 |
<thead> |
144 |
<tr> |
145 |
<th></th> |
146 |
<th>Date</th> |
147 |
<th>Search</th> |
148 |
<th>Results</th> |
149 |
</tr> |
150 |
</thead> |
151 |
<tbody> |
152 |
[% FOREACH s IN current_authority_searches %] |
153 |
<tr> |
154 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
155 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
156 |
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
157 |
<td>[% s.total %]</td> |
158 |
</tr> |
159 |
[% END %] |
160 |
</tbody> |
161 |
</table> |
162 |
<input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> |
163 |
</form> |
164 |
[% END # / IF ( current_authority_searches ) %] |
165 |
|
166 |
[% IF ( previous_authority_searches ) %] |
167 |
<h2>Previous sessions</h2> |
168 |
<form action="/cgi-bin/koha/opac-search-history.pl" method="get"> |
169 |
<div class="selections-toolbar toolbar"> |
170 |
<a class="CheckAll" href="#">Select all</a> |
171 |
<a class="CheckNone" href="#">Clear all</a> |
172 |
<span class="sep">|</span> |
173 |
<span class="links"> |
174 |
<span class="selections">Select searches to: </span> |
175 |
<a href="#" class="removeitems disabled">Delete</a> |
176 |
</span> |
177 |
</div> |
178 |
<input type="hidden" name="action" value="delete" /> |
179 |
<table class="historyt table table-bordered table-striped"> |
180 |
<thead> |
181 |
<tr> |
182 |
<th></th> |
183 |
<th>Date</th> |
184 |
<th>Search</th> |
185 |
<th>Results</th> |
186 |
</tr> |
187 |
</thead> |
188 |
<tbody> |
189 |
[% FOREACH s IN previous_authority_searches %] |
190 |
<tr> |
191 |
<td><input type="checkbox" name="id" value="[% s.id %]" /></td> |
192 |
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> |
193 |
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td> |
194 |
<td>[% s.total %]</td> |
195 |
</tr> |
196 |
[% END %] |
197 |
</tbody> |
198 |
</table> |
199 |
<input type="submit" class="btn btn-danger remove-selected" value="Remove selected searches"> |
200 |
</form> |
201 |
[% END # / IF ( previous_authority_searches )%] |
202 |
|
203 |
[% IF !current_authority_searches && !previous_authority_searches %] |
204 |
<p>Your authority search history is empty.</p> |
205 |
[% END %] |
206 |
</div> <!-- / #authority_tab --> |
207 |
[% END # / IF Koha.Preference( 'OpacAuthorities' ) %] |
208 |
</div> <!-- / #tabs --> |
209 |
</div> <!-- / #searchhistory --> |
210 |
</div> <!-- / .span10/12 --> |
211 |
</div> <!-- / .row-fluid --> |
212 |
</div> <!-- / .container-fluid --> |
213 |
</div> <!-- / #main --> |
214 |
|
163 |
|
215 |
[% INCLUDE 'opac-bottom.inc' %] |
164 |
[% INCLUDE 'opac-bottom.inc' %] |
216 |
[% BLOCK jsinclude %] |
165 |
[% BLOCK jsinclude %] |
Lines 220-233
Link Here
|
220 |
//<![CDATA[ |
169 |
//<![CDATA[ |
221 |
var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?"); |
170 |
var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?"); |
222 |
$(document).ready(function() { |
171 |
$(document).ready(function() { |
223 |
// We show table ordered by descending dates by default |
172 |
// We show table ordered by descending dates by default |
224 |
// (so that the more recent query is shown first) |
173 |
// (so that the more recent query is shown first) |
225 |
$(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, { |
174 |
$(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, { |
226 |
"aaSorting": [[ 1, "desc" ]], |
175 |
"aaSorting": [[ 3, "desc" ]], |
227 |
"aoColumnDefs": [ |
176 |
"aoColumnDefs": [ |
228 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, |
177 |
{ "aTargets": [ 0, 1 ], "bSortable": false, "bSearchable": false }, |
229 |
{ "aTargets": [ 1 ], "sType": "title-string" }, |
178 |
{ "aTargets": [ 2, 3 ], "sType": "title-string" }, |
230 |
] |
179 |
] |
231 |
})); |
180 |
})); |
232 |
|
181 |
|
233 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %] |
182 |
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %] |
Lines 262-267
Link Here
|
262 |
} |
211 |
} |
263 |
return false; |
212 |
return false; |
264 |
}); |
213 |
}); |
|
|
214 |
$(".action_search").click(function() { |
215 |
var $form = $(this).parents('form'); |
216 |
$(this).hide(); |
217 |
$('.search_options').show(); |
218 |
$('.not').show(); |
219 |
return false; |
220 |
}); |
221 |
|
222 |
$('.search_options button[type="submit"]').click(function() { |
223 |
var $form = $(this).parents('form'); |
224 |
var $checked = $form.find('input:checkbox:checked'); |
225 |
if ($checked.length ) { |
226 |
$form.find('input[name="action"]').val('search'); |
227 |
$form.submit(); |
228 |
} else { |
229 |
alert(_("You have to select searches first")); |
230 |
} |
231 |
return false; |
232 |
}); |
233 |
|
234 |
$('.action_search_cancel').click(function() { |
235 |
$('.action_search').show(); |
236 |
$('.search_options').hide(); |
237 |
$('.not').hide(); |
238 |
return false; |
239 |
}).click(); |
240 |
|
241 |
$('form').each(function() { |
242 |
enableCheckboxActions(this); |
243 |
}); |
265 |
}); |
244 |
}); |
266 |
|
245 |
|
267 |
function enableCheckboxActions(form){ |
246 |
function enableCheckboxActions(form){ |