|
Line 0
Link Here
|
|
|
1 |
[% USE raw %] |
| 2 |
[% USE Asset %] |
| 3 |
[% USE KohaDates %] |
| 4 |
[% USE Branches %] |
| 5 |
[% USE Categories %] |
| 6 |
[% USE TablesSettings %] |
| 7 |
[% SET footerjs = 1 %] |
| 8 |
[% INCLUDE 'doc-head-open.inc' %] |
| 9 |
<title>Notices management › Tools › Koha</title> |
| 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 |
[% INCLUDE 'doc-head-close.inc' %] |
| 15 |
<style> |
| 16 |
.notice { display: none; } |
| 17 |
</style> |
| 18 |
</head> |
| 19 |
|
| 20 |
<body id="tools_notices_mgmt" class="tools"> |
| 21 |
[% WRAPPER 'header.inc' %] |
| 22 |
[% INCLUDE 'circ-search.inc' %] |
| 23 |
[% END %] |
| 24 |
|
| 25 |
[% WRAPPER 'sub-header.inc' %] |
| 26 |
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> |
| 27 |
<ol> |
| 28 |
<li> |
| 29 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
| 30 |
</li> |
| 31 |
<li> |
| 32 |
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> |
| 33 |
</li> |
| 34 |
<li> |
| 35 |
<a href="#" aria-current="page"> |
| 36 |
Notices management |
| 37 |
</a> |
| 38 |
</li> |
| 39 |
</ol> |
| 40 |
</nav> |
| 41 |
[% END %] |
| 42 |
|
| 43 |
<div class="main container-fluid"> |
| 44 |
<div class="row"> |
| 45 |
<div class="col-sm-10 col-sm-push-2"> |
| 46 |
<main> |
| 47 |
|
| 48 |
<h1>Notices management</h1> |
| 49 |
|
| 50 |
[% IF notices %] |
| 51 |
|
| 52 |
<table id="notices"> |
| 53 |
<thead> |
| 54 |
<tr> |
| 55 |
<th>Time created</th> |
| 56 |
<th>Patron</th> |
| 57 |
<th>Notice</th> |
| 58 |
<th>Type</th> |
| 59 |
<th>Status</th> |
| 60 |
<th>Updated on</th> |
| 61 |
<th>Actions</th> |
| 62 |
</tr> |
| 63 |
</thead> |
| 64 |
<tbody> |
| 65 |
[% FOREACH notice IN notices %] |
| 66 |
<tr> |
| 67 |
<td>[% notice.time_queued | $KohaDates with_hours = 1 %]</td> |
| 68 |
<td>[% INCLUDE 'patron-title.inc' patron=notice.patron hide_patron_infos_if_needed=1 %]</td> |
| 69 |
<td> |
| 70 |
<a class="notice-title" data-noticeid="[% notice.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% notice.borrowernumber | uri %]&noticeid=[% notice.message_id | uri %]">[% notice.subject | html %]</a> |
| 71 |
<iframe class="notice" id="notice[% notice.message_id | html %]" srcdoc="[% notice.content | html | html_line_break %]"></iframe> |
| 72 |
</td> |
| 73 |
<td>[% notice.message_transport_type | html %]</td> |
| 74 |
<td>[% notice.status | html %]</td> |
| 75 |
<td>[% notice.updated_on | $KohaDates with_hours = 1 %]</td> |
| 76 |
<td class="actions"><button class="btn btn-default btn-xs print"><i class="fa fa-print"></i> Print</button></td> |
| 77 |
</tr> |
| 78 |
[% END %] |
| 79 |
</tbody> |
| 80 |
</table> |
| 81 |
|
| 82 |
[% ELSE %] |
| 83 |
|
| 84 |
<div class="dialog message"> |
| 85 |
Use the search form on the left to find sent notices. |
| 86 |
</div> |
| 87 |
|
| 88 |
[% END %] |
| 89 |
|
| 90 |
</main> |
| 91 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
| 92 |
|
| 93 |
<div class="col-sm-2 col-sm-pull-10"> |
| 94 |
<aside> |
| 95 |
<fieldset class="sidebar brief"> |
| 96 |
<h3>Go to a patron's notices</h3> |
| 97 |
<ol> |
| 98 |
<li> |
| 99 |
<div id="notices_patronsearch_pane" role="tabpanel" class="tab-pane active"> |
| 100 |
[% PROCESS patron_search_filters_simple %] |
| 101 |
[% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %] |
| 102 |
</div> |
| 103 |
</li> |
| 104 |
</ol> |
| 105 |
</fieldset> |
| 106 |
<fieldset class="sidebar brief"> |
| 107 |
<form id="notices-search" action="/cgi-bin/koha/tools/notices.pl" method="post"> |
| 108 |
<input type="hidden" name="op" value="search"> |
| 109 |
<h3>Search filters</h3> |
| 110 |
<ol> |
| 111 |
<li> |
| 112 |
<label for="branchcode">Library:</label> |
| 113 |
<select id="branchcode" name="branchcode"> |
| 114 |
<option value="">All libraries</option> |
| 115 |
[% FOREACH branch IN Branches.all( selected => branchcode ) %] |
| 116 |
[% IF ( branch.selected ) %] |
| 117 |
<option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
| 118 |
[% ELSE %] |
| 119 |
<option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
| 120 |
[% END %] |
| 121 |
[% END %] |
| 122 |
</select> |
| 123 |
</li> |
| 124 |
<li> |
| 125 |
<label for="letter_code">Notice:</label> |
| 126 |
<select id="letter_code" name="letter_code"> |
| 127 |
<option value="">All notices</option> |
| 128 |
[% FOREACH letter IN letters %] |
| 129 |
[% IF ( letter.code == letter_code ) %] |
| 130 |
<option selected="selected" value="[% letter.code | html %]">[% letter.name | html %] ([% letter.code | html %])</option> |
| 131 |
[% ELSE %] |
| 132 |
<option value="[% letter.code | html %]">[% letter.name | html %] ([% letter.code | html %])</option> |
| 133 |
[% END %] |
| 134 |
[% END %] |
| 135 |
</select> |
| 136 |
</li> |
| 137 |
<li> |
| 138 |
<label for="status">Notice status:</label> |
| 139 |
<select id="status" name="status"> |
| 140 |
<option value="">All statuses</option> |
| 141 |
[% IF status == 'sent' %] |
| 142 |
<option selected="selected" value="sent">Sent</option> |
| 143 |
[% ELSE %] |
| 144 |
<option value="sent">Sent</option> |
| 145 |
[% END %] |
| 146 |
[% IF status == 'sent' %] |
| 147 |
<option selected="selected" value="pending">Pending</option> |
| 148 |
[% ELSE %] |
| 149 |
<option value="pending">Pending</option> |
| 150 |
[% END %] |
| 151 |
[% IF status == 'sent' %] |
| 152 |
<option selected="selected" value="failed">Failed</option> |
| 153 |
[% ELSE %] |
| 154 |
<option value="failed">Failed</option> |
| 155 |
[% END %] |
| 156 |
[% IF status == 'sent' %] |
| 157 |
<option selected="selected" value="deleted">Deleted</option> |
| 158 |
[% ELSE %] |
| 159 |
<option value="deleted">Deleted</option> |
| 160 |
[% END %] |
| 161 |
</select> |
| 162 |
</li> |
| 163 |
<li> |
| 164 |
<fieldset class="brief"> |
| 165 |
<legend>Date queued</legend> |
| 166 |
<ol> |
| 167 |
<li> |
| 168 |
<label for="from">From:</label> |
| 169 |
<input type="text" id="from" name="from" size="10" value="[% from | html %]" class="flatpickr" data-date_to="to" /> |
| 170 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
| 171 |
</li> |
| 172 |
<li> |
| 173 |
<label for="to">To:</label> |
| 174 |
<input type="text" id="to" name="to" size="10" value="[% to | html %]" class="flatpickr" /> |
| 175 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
| 176 |
</li> |
| 177 |
</ol> |
| 178 |
</fieldset> |
| 179 |
</li> |
| 180 |
<li> |
| 181 |
<label for="categorycode">Patron category:</label> |
| 182 |
<select id="categorycode" name="categorycode"> |
| 183 |
<option value="">All patron categories</option> |
| 184 |
[% FOREACH category IN Categories.all %] |
| 185 |
[% IF ( category.categorycode == categorycode ) %] |
| 186 |
<option selected="selected" value="[% category.categorycode | html %]">[% category.description | html %]</option> |
| 187 |
[% ELSE %] |
| 188 |
<option value="[% category.categorycode | html %]">[% category.description | html %]</option> |
| 189 |
[% END %] |
| 190 |
[% END %] |
| 191 |
</select> |
| 192 |
</li> |
| 193 |
</ol> |
| 194 |
<fieldset class="action"> |
| 195 |
<input type="submit" class="btn btn-primary" value="Search"> |
| 196 |
</fieldset> |
| 197 |
</form> |
| 198 |
</fieldset> |
| 199 |
[% INCLUDE 'tools-menu.inc' %] |
| 200 |
</aside> |
| 201 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
| 202 |
</div> <!-- /.row --> |
| 203 |
|
| 204 |
<!-- Modal --> |
| 205 |
<div class="modal" id="noticeModal" tabindex="-1" aria-labelledby="noticeModalLabel" aria-hidden="true"> |
| 206 |
<div class="modal-dialog"> |
| 207 |
<div class="modal-content"> |
| 208 |
<div class="modal-header"> |
| 209 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"> |
| 210 |
<span aria-hidden="true">×</span> |
| 211 |
</button> |
| 212 |
<h5 class="modal-title" id="noticeModalLabel">Notice</h5> |
| 213 |
</div> |
| 214 |
<div class="modal-body"> |
| 215 |
... |
| 216 |
</div> |
| 217 |
<div class="modal-footer"> |
| 218 |
<button type="button" class="btn btn-default deny cancel" data-dismiss="modal"><i class="fa fa-remove"></i> Close</button> |
| 219 |
</div> |
| 220 |
</div> <!-- /.modal-content --> |
| 221 |
</div> <!-- /.modal-dialog --> |
| 222 |
</div> <!-- /.modal --> |
| 223 |
|
| 224 |
[% MACRO jsinclude BLOCK %] |
| 225 |
[% Asset.js("js/tools-menu.js") | $raw %] |
| 226 |
[% INCLUDE 'calendar.inc' %] |
| 227 |
[% INCLUDE 'datatables.inc' %] |
| 228 |
[% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/tools/notices.pl?', redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/tools/notices.pl?', redirect_if_attribute_equal => 'cardnumber' %] |
| 229 |
|
| 230 |
<script> |
| 231 |
table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]; |
| 232 |
$(document).ready(function() { |
| 233 |
$("#notices").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 234 |
"aaSorting": [[ 3, "desc" ]], |
| 235 |
"sPaginationType": "full" |
| 236 |
})); |
| 237 |
|
| 238 |
$("#notices").on("click", ".notice-title", function(e){ |
| 239 |
e.preventDefault(); |
| 240 |
var title = $(this).text(); |
| 241 |
var noticeid = $(this).data("noticeid"); |
| 242 |
var body = $("#notice" + noticeid ).attr("srcdoc"); |
| 243 |
$("#noticeModalLabel").text( title ); |
| 244 |
$("#noticeModal .modal-body").html( body ); |
| 245 |
$("#noticeModal").modal("show"); |
| 246 |
}); |
| 247 |
|
| 248 |
$("#noticeModal").on("hide.bs.modal", function(){ |
| 249 |
$("#noticeModalLabel").text(""); |
| 250 |
$("#noticeModal .modal-body").html(""); |
| 251 |
}); |
| 252 |
|
| 253 |
$("#notices_patronsearch").on("submit", filter); |
| 254 |
[% UNLESS patron %] |
| 255 |
[% IF ( PatronAutoComplete ) %] |
| 256 |
patron_autocomplete($("#search_patron_filter"), { 'link-to': 'notices', 'url-params': '[% url_biblio_params | url %]' }); |
| 257 |
[% END %] |
| 258 |
[% END %] |
| 259 |
}); |
| 260 |
</script> |
| 261 |
|
| 262 |
[% END %] |
| 263 |
|
| 264 |
[% INCLUDE 'intranet-bottom.inc' %] |