6 [% USE TablesSettings %]
8 [% INCLUDE 'doc-head-open.inc' %]
10 Koha › Tools › Notices
11 [% IF ( add_form or copy_form ) %]
13 › Modify notice
18 [% IF ( add_validate or copy_validate) %]
21 [% IF ( delete_confirm ) %]
22 › Confirm deletion
25 [% INCLUDE 'doc-head-close.inc' %]
26 <style>#preview_template .modal-dialog { width : 80%; } .spinner { display: none; } @media (max-width: 767px) { #preview_template { margin: 0; width : auto; } }</style>
29 <body id="tools_letter" class="tools">
30 [% INCLUDE 'header.inc' %]
31 [% INCLUDE 'letters-search.inc' %]
33 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
36 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
39 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
42 [% IF ( add_form or copy_form) %]
45 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
48 <a href="#" aria-current="page">
54 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
57 <a href="#" aria-current="page">
63 [% IF ( add_validate or copy_validate) %]
65 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
68 <a href="#" aria-current="page">
73 [% IF ( delete_confirm ) %]
75 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
78 <a href="#" aria-current="page">
84 <a href="#" aria-current="page">
92 </nav> <!-- /#breadcrumbs -->
94 <div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
95 <div class="modal-dialog modal-lg">
96 <div class="modal-content">
97 <div class="modal-header">
98 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
99 <h3 id="preview_template_label">Preview notice template</h3>
101 <div class="modal-body">
103 <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading
106 <div class="modal-footer">
107 <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
108 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
110 </div> <!-- /.modal-content -->
111 </div> <!-- /.modal-dialog -->
112 </div> <!-- /#preview_template -->
114 [% IF add_form or copy_form %]
115 <div class="main container-fluid">
117 <div class="col-md-8 col-md-offset-2">
119 <div class="main container-fluid">
121 <div class="col-sm-10 col-sm-push-2">
125 [% IF ( no_op_set ) %]
126 <h1>Notices & slips</h1>
127 <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
128 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
129 [% UNLESS independant_branch %]
132 <select name="branchcode" id="branch" style="width:20em;">
133 <option value="*">All libraries</option>
134 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
138 </form> <!-- /#selectlibrary -->
140 <div id="toolbar" class="btn-toolbar">
141 <div class="btn-group">
142 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New notice <span class="caret"></span></button>
143 <ul class="dropdown-menu">
144 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=acquisition">Acquisition</a></li>
145 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=catalogue">Catalog</a></li>
146 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation">Circulation</a></li>
147 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimacquisition">Claim acquisition</a></li>
148 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues">Claim serial issue</a></li>
149 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=reserves">Holds</a></li>
150 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=ill">Interlibrary loans</a></li>
151 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=orderacquisition">Order acquisition</a></li>
152 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=members">Patrons</a></li>
153 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=serial">Serials (new issue)</a></li>
154 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=suggestions">Suggestions</a></li>
155 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=pos">Point of sale</a></li>
158 </div> <!-- /#toolbar -->
161 <p>You searched for <strong>[% searchfield | html %]</strong></p>
164 [% IF ( letter && !independant_branch) %]
165 [% select_for_copy = BLOCK %]
166 <select name="branchcode">
167 [% FOREACH l IN Branches.all() %]
168 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
182 <th>Last updated</th>
183 <th class="NoSort noExport">Copy notice</th>
184 <th class="NoSort noExport">Actions</th>
188 [% FOREACH lette IN letter %]
189 [% can_edit = lette.branchcode || !independant_branch %]
192 [% IF lette.branchname %]
193 [% lette.branchname | html %]
199 [% SWITCH lette.module %]
200 [% CASE 'acquisition' %]<span>Acquisition</span>
201 [% CASE 'catalogue' %]<span>Catalog</span>
202 [% CASE 'circulation' %]<span>Circulation</span>
203 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
204 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
205 [% CASE 'claimissues' %]<span>Claim serial issue</span>
206 [% CASE 'reserves' %]<span>Holds</span>
207 [% CASE 'ill' %]<span>Interlibrary loans</span>
208 [% CASE 'members' %]<span>Patrons</span>
209 [% CASE 'serial' %]<span>Serials (new issue)</span>
210 [% CASE 'suggestions' %]<span>Suggestions</span>
211 [% CASE 'pos' %]<span>Point of sale</span>
212 [% CASE %]<span>[% lette.module | html %]</span>
215 <td>[% lette.code | html %]</td>
216 <td>[% lette.name | html %]</td>
217 <td data-order="[% lette.updated_on | html %]">[% lette.updated_on | $KohaDates with_hours = 1 %]</td>
219 [% IF !independant_branch || !lette.branchcode %]
220 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
221 <input type="hidden" name="op" value="copy_form" />
222 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
223 <input type="hidden" name="module" value="[% lette.module | html %]" />
224 <input type="hidden" name="code" value="[% lette.code | html %]" />
225 [% IF independant_branch %]
226 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
228 [% select_for_copy | $raw %]
230 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
232 [% END # /IF !independent_branch %]
236 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=[% lette.branchcode | html %]&module=[% lette.module | html %]&code=[% lette.code | html %]"><i class="fa fa-pencil"></i> Edit</a>
238 [% IF !lette.protected && can_edit %]
239 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=[% lette.branchcode | html %]&module=[% lette.module | html %]&code=[% lette.code | html %]"><i class="fa fa-trash"></i> Delete</a>
243 [% END # /FOREACH lette %]
245 </table> <!-- /#lettert -->
246 [% ELSE # IF lette %]
247 <div class="dialog message">
248 [% IF ( branchcode ) %]
249 <p>There are no notices for this library.</p>
251 <p>There are no notices.</p>
254 [% END # /IF lette %]
255 [% END # /IF no_op_set %]
257 [% IF add_form or copy_form %]
258 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
260 <div id="toolbar" class="btn-toolbar">
261 <div class="btn-group">
262 <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
263 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
264 <span class="caret"></span>
266 <ul class="dropdown-menu">
267 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
270 <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
271 </div> <!-- /#toolbar -->
273 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
275 <input type="hidden" name="op" id="op" value="add_validate" />
277 <input type="hidden" name="op" id="op" value="copy_validate" />
280 <input type="hidden" name="checked" value="0" />
283 <input type="hidden" name="add" value="0" />
285 <input type="hidden" name="add" value="1" />
288 <fieldset class="rows">
289 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
290 [% IF independant_branch %]
291 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
297 <label for="branch">Library:</label>
298 <select name="branchcode" id="branch" style="width:20em;">
299 <option value="">All libraries</option>
300 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
303 <span class="label">Library:</span>
304 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
305 [% IF ( branchcode ) %]
306 [% Branches.GetName( branchcode ) | html %]
312 [% END # /IF independant_branch %]
314 <label for="module">Koha module:</label>
315 <input type="hidden" name="oldmodule" value="[% module | html %]" />
317 <select name="module" id="newmodule">
319 <select name="module" id="module">
321 [% IF ( module == "acquisition" ) %]
322 <option value="acquisition" selected="selected">Acquisition</option>
324 <option value="acquisition" >Acquisition</option>
326 [% IF ( module == "catalogue" ) %]
327 <option value="catalogue" selected="selected">Catalog</option>
329 <option value="catalogue" >Catalog</option>
331 [% IF ( module == "circulation" ) %]
332 <option value="circulation" selected="selected">Circulation</option>
334 <option value="circulation">Circulation</option>
336 [% IF ( module == "orderacquisition" ) %]
337 <option value="orderacquisition" selected="selected">Order acquisition</option>
339 <option value="orderacquisition">Order acquisition</option>
341 [% IF ( module == "claimacquisition" ) %]
342 <option value="claimacquisition" selected="selected">Claim acquisition</option>
344 <option value="claimacquisition">Claim acquisition</option>
346 [% IF ( module == "claimissues" ) %]
347 <option value="claimissues" selected="selected">Claim serial issue</option>
349 <option value="claimissues">Claim serial issue</option>
351 [% IF ( module == "reserves" ) %]
352 <option value="reserves" selected="selected">Holds</option>
354 <option value="reserves">Holds</option>
356 [% IF ( module == "ill" ) %]
357 <option value="ill" selected="selected">Interlibrary loans</option>
359 <option value="ill">Interlibrary loans</option>
361 [% IF ( module == "members" ) %]
362 <option value="members" selected="selected">Patrons</option>
364 <option value="members">Patrons</option>
366 [% IF ( module == "serial" ) %]
367 <option value="serial" selected="selected">Serials (new issue)</option>
369 <option value="serial">Serials (new issue)</option>
371 [% IF ( module == "suggestions" ) %]
372 <option value="suggestions" selected="selected">Suggestions</option>
374 <option value="suggestions">Suggestions</option>
376 [% IF ( module == "pos" ) %]
377 <option value="pos" selected="selected">Point of sale</option>
379 <option value="pos">Point of sale</option>
385 <label for="code" class="required">Code:</label>
386 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
387 <span class="required">Required</span>
389 <span class="label">Code:</span>
390 <input type="hidden" id="code" name="code" value="[% code | html %]" />
395 <label for="name" class="required">Name:</label>
396 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
397 <span class="required">Required</span>
399 [% IF code and preview_is_available%]
401 <label for="name">Data for preview:</label>
404 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
405 [% CASE 'CHECKOUT' %]
406 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
407 [% CASE 'HOLD_SLIP' %]
408 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
415 </fieldset> <!-- /#add_notice -->
417 [% IF Koha.Preference('TranslateNotices') %]
418 <div style="clear:both"></div>
421 <li><a href="#lang_default">Default</a></li>
422 [% FOR language IN languages %]
423 [% FOR sublanguage IN language.sublanguages_loop %]
424 [% IF language.plural %]
425 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
427 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
432 [% END # /IF TranslateNotices %]
434 [% FOREACH lang IN letters.keys %]
435 <div id="lang_[% lang | html %]">
436 <div class="transport-types" style="clear:both">
437 [% FOR mtt IN letters.$lang.templates.keys.sort %]
438 [% SET letter = letters.$lang.templates.$mtt %]
439 [% NEXT IF letter.message_transport_type == "itiva" && !Koha.Preference('TalkingTechItivaPhoneNotification') %]
440 [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %]
442 [% SWITCH letter.message_transport_type %]
456 [% letter.message_transport_type | html %]
459 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
460 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
461 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
463 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
466 [% IF ( letter.updated_on ) %]
468 <label for="updated_on_[% letter.message_transport_type | html %]_[% lang | html %]">Last updated:</label>
469 [% letter.updated_on | $KohaDates with_hours = 1 %]
473 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
474 <input type="hidden" name="lang" value="[% lang | html %]" />
475 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
476 [% IF letter.is_html %]
477 <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" checked="checked" />
479 <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" />
483 <label for="title_[% letter.message_transport_type | html %]_[% lang | html %]">Message subject:</label><input type="text" id="title_[% letter.message_transport_type | html %]_[% lang | html %]" name="title" size="60" value="[% letter.title | html %]" />
486 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
487 [% IF letter.message_transport_type == 'sms' %]
488 <span class="sms_counter" id="sms_counter_[% lang | html %]">[% IF letter.content && letter.content.length > 0 %][% letter.content.length | html %][% ELSE %]0[% END %]/160 characters</span>
493 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
494 [% FOREACH SQLfieldname IN SQLfieldnames %]
495 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
500 <button type="button" data-containerid="[% letter.message_transport_type | html %]_[% lang | html %]" class="btn btn-default btn-sm insert">Insert <i class="fa fa-long-arrow-right"></i></button>
503 <textarea name="content" data-lang="[% lang | html %]" class="content_[% letter.message_transport_type | html %]" id="content_[% letter.message_transport_type | html %]_[% lang | html %]" cols="80" rows="15">[% letter.content | html %]</textarea>
508 [% IF preview_is_available %]
510 <a href="/cgi-bin/koha/svc/letters/preview" class="preview_template btn btn-default btn-xs" title="Preview this notice template" data-mtt="[% letter.message_transport_type | html %]" data-lang="[% lang | html %]"><i class="fa fa-eye"></i> Preview</a>
514 </fieldset> <!-- /.rows.mtt -->
517 </div> <!-- / #transport-types -->
518 [% END # /FOREACH lang %]
520 [% IF Koha.Preference('TranslateNotices') %]
524 <input type="hidden" id="redirect" name="redirect" value="" />
525 <input type="hidden" id="section" name="section" value="[% section | html %]" />
526 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
527 </form> <!-- /#add_notice -->
528 [% END # /IF add_form %]
530 [% IF ( add_validate or copy_validate) %]
532 <form action="[% action | html %]" method="post">
533 <input type="submit" value="OK" />
537 [% IF ( delete_confirm ) %]
538 <div class="dialog alert">
539 <h3>Delete notice?</h3>
550 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
551 <td>[% letter.module | html %]</td>
552 <td>[% letter.code | html %]</td>
553 <td>[% letter.name | html %]</td>
556 <form action="[% action | html %]" method="post">
557 <input type="hidden" name="op" value="delete_confirmed">
558 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
559 <input type="hidden" name="code" value="[% letter.code | html %]" />
560 <input type="hidden" name="module" value="[% letter.module | html %]" />
561 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
564 <form action="[% action | html %]" method="get">
565 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
568 [% END # /IF delete_confirm %]
570 [% IF ( delete_confirmed ) %]
572 <form action="[% action | html %]" method="post">
573 <input type="submit" value="OK" />
577 [% IF add_form or copy_form %]
578 </div> <!-- /.col-md-8 -->
579 </div> <!-- /.row -->
582 </div> <!-- /.col-sm-10.col-sm-push-2 -->
584 <div class="col-sm-2 col-sm-pull-10">
586 [% INCLUDE 'tools-menu.inc' %]
588 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
589 </div> <!-- /.row -->
592 [% MACRO jsinclude BLOCK %]
593 [% Asset.js("js/tools-menu.js") | $raw %]
594 [% INCLUDE 'datatables.inc' %]
595 [% INCLUDE 'columns_settings.inc' %]
596 [% Asset.js("lib/hc-sticky.js") | $raw %]
597 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
599 var no_op_set = '[% no_op_set | html %]';
600 var interface = '[% interface | html %]';
601 var theme = '[% theme | html %]';
602 var add_form = '[% add_form | html %]';
603 var copy_form = '[% copy_form | html %]';
604 var code = '[% code | html %]';
605 var new_lettercode = '[% new_lettercode | html %]';
606 var new_branchcode = '[% new_branchcode | html %]';
607 var columns_settings = [% TablesSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
609 [% Asset.js("js/letter.js") | $raw %]
612 [% INCLUDE 'intranet-bottom.inc' %]