Lines 7-16
Link Here
|
7 |
[% PROCESS 'i18n.inc' %] |
7 |
[% PROCESS 'i18n.inc' %] |
8 |
[% SET footerjs = 1 %] |
8 |
[% SET footerjs = 1 %] |
9 |
[% INCLUDE 'doc-head-open.inc' %] |
9 |
[% INCLUDE 'doc-head-open.inc' %] |
10 |
[% PROCESS "patron-search.inc" %] |
|
|
11 |
[% SET libraries = Branches.all %] |
12 |
[% SET categories = Categories.all.unblessed %] |
13 |
[% SET columns = ['name', 'cardnumber', 'dateofbirth', 'category', 'branch', 'address', 'phone'] %] |
14 |
<title |
10 |
<title |
15 |
>[% FILTER collapse %] |
11 |
>[% FILTER collapse %] |
16 |
[% t("Notices management") | html %] |
12 |
[% t("Notices management") | html %] |
Lines 51-59
Link Here
|
51 |
|
47 |
|
52 |
<h1>Notices management</h1> |
48 |
<h1>Notices management</h1> |
53 |
|
49 |
|
54 |
<div class="dialog message">Printing a notice will mark it as sent.</div> |
50 |
<div class="page-section bg-warning">Printing a notice will mark it as sent.</div> |
55 |
|
51 |
|
56 |
[% IF notices && notices.count > 0 %] |
52 |
[% IF notices.count == 0 %] |
|
|
53 |
<div class="page-section bg-info"> No sent notices were found with those search parameters. </div> |
54 |
[% ELSE %] |
57 |
<div class="page-section"> |
55 |
<div class="page-section"> |
58 |
<span id="checkbox_actions" |
56 |
<span id="checkbox_actions" |
59 |
><a href="#" class="select_all"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="clear_all"><i class="fa fa-remove"></i> Clear all</a></span |
57 |
><a href="#" class="select_all"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="clear_all"><i class="fa fa-remove"></i> Clear all</a></span |
Lines 101-123
Link Here
|
101 |
<input type="submit" class="btn btn-primary" value="Print selected notices" id="print_multiple_button" /> |
99 |
<input type="submit" class="btn btn-primary" value="Print selected notices" id="print_multiple_button" /> |
102 |
</form> |
100 |
</form> |
103 |
</div> |
101 |
</div> |
104 |
[% ELSE %] |
|
|
105 |
Use the search form on the left to find sent notices, or go directly to a patron's notices. |
106 |
[% WRAPPER tabs id= "notices_patronsearch" %] |
107 |
[% WRAPPER tabs_nav %] |
108 |
[% WRAPPER tab_item tabname= "notices_patronsearch_pane" bt_active= 1 %]<span>Patrons</span>[% END %] |
109 |
[% END %] |
110 |
[% WRAPPER tab_panels %] |
111 |
[% WRAPPER tab_panel tabname="notices_patronsearch_pane" bt_active= 1 %] |
112 |
[% PROCESS patron_search_filters_simple %] |
113 |
[% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %] |
114 |
[% END %] |
115 |
[% END %] |
116 |
[% END %] |
117 |
|
118 |
[% IF notices && notices.count == 0 %] |
119 |
<div class="dialog message"> No sent notices were found with those search parameters. </div> |
120 |
[% END %] |
121 |
[% END %] |
102 |
[% END %] |
122 |
</main> |
103 |
</main> |
123 |
</div> |
104 |
</div> |
Lines 126-134
Link Here
|
126 |
<div class="col-md-2 order-md-1 order-sm-1"> |
107 |
<div class="col-md-2 order-md-1 order-sm-1"> |
127 |
<aside> |
108 |
<aside> |
128 |
<fieldset class="sidebar brief"> |
109 |
<fieldset class="sidebar brief"> |
129 |
<form id="notices-search" action="/cgi-bin/koha/tools/notices.pl" method="post"> |
110 |
<form id="notices-search" action="/cgi-bin/koha/tools/notices.pl" method="get"> |
130 |
[% INCLUDE 'csrf-token.inc' %] |
|
|
131 |
<input type="hidden" name="op" value="cud-search" /> |
132 |
<h3>Search filters</h3> |
111 |
<h3>Search filters</h3> |
133 |
<ol> |
112 |
<ol> |
134 |
<li> |
113 |
<li> |
Lines 252-316
Link Here
|
252 |
[% INCLUDE 'calendar.inc' %] |
231 |
[% INCLUDE 'calendar.inc' %] |
253 |
[% INCLUDE 'datatables.inc' %] |
232 |
[% INCLUDE 'datatables.inc' %] |
254 |
<script> |
233 |
<script> |
255 |
table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]; |
234 |
$(document).ready(function () { |
256 |
$(document).ready(function() { |
235 |
$("#notices").dataTable( |
257 |
$("#notices").dataTable($.extend(true, {}, dataTablesDefaults, { |
236 |
$.extend(true, {}, dataTablesDefaults, { |
258 |
"aoColumnDefs": [ |
237 |
aoColumnDefs: [{ bSortable: false, aTargets: ["nosort"] }], |
259 |
{ 'bSortable': false, 'aTargets': [ 'nosort' ] } |
238 |
aaSorting: [[1, "desc"]], |
260 |
], |
239 |
sPaginationType: "full", |
261 |
"aaSorting": [[1, "desc" ]], |
240 |
}) |
262 |
"sPaginationType": "full" |
241 |
); |
263 |
})); |
|
|
264 |
|
242 |
|
265 |
$("#notices").on("click", ".notice-title", function(e){ |
243 |
$("#notices").on("click", ".notice-title", function (e) { |
266 |
e.preventDefault(); |
244 |
e.preventDefault(); |
267 |
var title = $(this).text(); |
245 |
var title = $(this).text(); |
268 |
var noticeid = $(this).data("noticeid"); |
246 |
var noticeid = $(this).data("noticeid"); |
269 |
var body = $("#notice" + noticeid ).attr("srcdoc"); |
247 |
var body = $("#notice" + noticeid).attr("srcdoc"); |
270 |
$("#noticeModalLabel").text( title ); |
248 |
$("#noticeModalLabel").text(title); |
271 |
$("#noticeModal .modal-body").html( body ); |
249 |
$("#noticeModal .modal-body").html(body); |
272 |
$("#noticeModal").modal("show"); |
250 |
$("#noticeModal").modal("show"); |
273 |
}); |
251 |
}); |
274 |
|
252 |
|
275 |
$("#noticeModal").on("hide.bs.modal", function(){ |
253 |
$("#noticeModal").on("hide.bs.modal", function () { |
276 |
$("#noticeModalLabel").text(""); |
254 |
$("#noticeModalLabel").text(""); |
277 |
$("#noticeModal .modal-body").html(""); |
255 |
$("#noticeModal .modal-body").html(""); |
278 |
}); |
256 |
}); |
279 |
|
257 |
|
280 |
$("#notices_patronsearch").on("submit", filter); |
258 |
$("#print_multiple_button").click(function (e) { |
281 |
[% UNLESS notices %] |
|
|
282 |
[% IF ( Koha.Preference('PatronAutoComplete') ) %] |
283 |
patron_autocomplete($(".search_patron_filter"), { 'link-to': 'notices' }); |
284 |
[% END %] |
285 |
[% END %] |
286 |
|
287 |
$("#print_multiple_button").click(function(e){ |
288 |
var selected_notices = $("#print_multiple").find("input[name='message_ids']:checked"); |
259 |
var selected_notices = $("#print_multiple").find("input[name='message_ids']:checked"); |
289 |
if ( selected_notices.length == 0 ) { |
260 |
if (selected_notices.length == 0) { |
290 |
alert(_("Please select at least one sent notice.")); |
261 |
alert(_("Please select at least one sent notice.")); |
291 |
e.preventDefault(); |
262 |
e.preventDefault(); |
292 |
return false; |
263 |
return false; |
293 |
} |
264 |
} |
294 |
}); |
265 |
}); |
295 |
|
266 |
|
296 |
$(".select_all").click(function(e){ |
267 |
$(".select_all").click(function (e) { |
297 |
e.preventDefault(); |
268 |
e.preventDefault(); |
298 |
$("input[name='message_ids']").each(function(){ |
269 |
$("input[name='message_ids']").each(function () { |
299 |
$(this).prop("checked", true); |
270 |
$(this).prop("checked", true); |
300 |
}); |
271 |
}); |
301 |
}); |
272 |
}); |
302 |
|
273 |
|
303 |
$(".clear_all").click(function(e){ |
274 |
$(".clear_all").click(function (e) { |
304 |
e.preventDefault(); |
275 |
e.preventDefault(); |
305 |
$("input[name='message_ids']").each(function(){ |
276 |
$("input[name='message_ids']").each(function () { |
306 |
$(this).prop("checked", false); |
277 |
$(this).prop("checked", false); |
307 |
}); |
278 |
}); |
308 |
}); |
279 |
}); |
309 |
}); |
280 |
}); |
310 |
</script> |
281 |
</script> |
311 |
[% SET search_results_block_id = 'notices_patronsearch_pane_panel' %] |
|
|
312 |
[%# adjusting variable for patron-search.inc %] |
313 |
[% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/members/notices.pl?', redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/members/notices.pl?', redirect_if_attribute_equal => 'cardnumber' %] |
314 |
[% END %] |
282 |
[% END %] |
315 |
|
283 |
|
316 |
[% INCLUDE 'intranet-bottom.inc' %]</div |
284 |
[% INCLUDE 'intranet-bottom.inc' %]</div |