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