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 <div id="breadcrumbs">
34 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
35 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
36 [% IF ( add_form or copy_form) %]
38 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> ›
41 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> ›
45 [% IF ( add_validate or copy_validate) %]
46 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> ›
49 [% IF ( delete_confirm ) %]
50 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> ›
57 </div> <!-- /#breadcrumbs -->
59 <div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
60 <div class="modal-dialog modal-lg">
61 <div class="modal-content">
62 <div class="modal-header">
63 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
64 <h3 id="preview_template_label">Preview notice template</h3>
66 <div class="modal-body">
68 <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading
71 <div class="modal-footer">
72 <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
73 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
75 </div> <!-- /.modal-content -->
76 </div> <!-- /.modal-dialog -->
77 </div> <!-- /#preview_template -->
79 [% IF add_form or copy_form %]
80 <div class="main container-fluid">
82 <div class="col-md-8 col-md-offset-2">
84 <div class="main container-fluid">
86 <div class="col-sm-10 col-sm-push-2">
90 [% IF ( no_op_set ) %]
91 <h1>Notices & slips</h1>
92 <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
93 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
94 [% UNLESS independant_branch %]
97 <select name="branchcode" id="branch" style="width:20em;">
98 <option value="*">All libraries</option>
99 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
103 </form> <!-- /#selectlibrary -->
105 <div id="toolbar" class="btn-toolbar">
106 <div class="btn-group">
107 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New notice <span class="caret"></span></button>
108 <ul class="dropdown-menu">
109 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=acquisition">Acquisition</a></li>
110 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=catalogue">Catalog</a></li>
111 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation">Circulation</a></li>
112 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimacquisition">Claim acquisition</a></li>
113 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues">Claim serial issue</a></li>
114 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=reserves">Holds</a></li>
115 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=orderacquisition">Order acquisition</a></li>
116 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=members">Patrons</a></li>
117 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=serial">Serials (new issue)</a></li>
118 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=suggestions">Suggestions</a></li>
119 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=pos">Point of sale</a></li>
122 </div> <!-- /#toolbar -->
125 <p>You searched for <strong>[% searchfield | html %]</strong></p>
128 [% IF ( letter && !independant_branch) %]
129 [% select_for_copy = BLOCK %]
130 <select name="branchcode">
131 [% FOREACH l IN Branches.all() %]
132 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
146 <th class="title-string">Last updated</th>
147 <th class="nosort">Copy notice</th>
148 <th class="nosort">Actions</th>
152 [% FOREACH lette IN letter %]
153 [% can_edit = lette.branchcode || !independant_branch %]
156 [% IF lette.branchname %]
157 [% lette.branchname | html %]
163 [% SWITCH lette.module %]
164 [% CASE 'acquisition' %]<span>Acquisition</span>
165 [% CASE 'catalogue' %]<span>Catalog</span>
166 [% CASE 'circulation' %]<span>Circulation</span>
167 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
168 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
169 [% CASE 'claimissues' %]<span>Claim serial issue</span>
170 [% CASE 'reserves' %]<span>Holds</span>
171 [% CASE 'members' %]<span>Patrons</span>
172 [% CASE 'serial' %]<span>Serials (new issue)</span>
173 [% CASE 'suggestions' %]<span>Suggestions</span>
174 [% CASE 'pos' %]<span>Point of sale</span>
175 [% CASE %]<span>[% lette.module | html %]</span>
178 <td>[% lette.code | html %]</td>
179 <td>[% lette.name | html %]</td>
180 <td><span title="[% lette.updated_on | $KohaDates with_hours = 1 %]">[% lette.updated_on | $KohaDates with_hours = 1 %]</span></td>
182 [% IF !independant_branch || !lette.branchcode %]
183 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
184 <input type="hidden" name="op" value="copy_form" />
185 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
186 <input type="hidden" name="module" value="[% lette.module | html %]" />
187 <input type="hidden" name="code" value="[% lette.code | html %]" />
188 [% IF independant_branch %]
189 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
191 [% select_for_copy | $raw %]
193 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
195 [% END # /IF !independent_branch %]
199 <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>
201 [% IF !lette.protected && can_edit %]
202 <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>
206 [% END # /FOREACH lette %]
208 </table> <!-- /#lettert -->
209 [% ELSE # IF lette %]
210 <div class="dialog message">
211 [% IF ( branchcode ) %]
212 <p>There are no notices for this library.</p>
214 <p>There are no notices.</p>
217 [% END # /IF lette %]
218 [% END # /IF no_op_set %]
220 [% IF add_form or copy_form %]
221 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
223 <div id="toolbar" class="btn-toolbar">
224 <div class="btn-group">
225 <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
226 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
227 <span class="caret"></span>
229 <ul class="dropdown-menu">
230 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
233 <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
234 </div> <!-- /#toolbar -->
236 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
238 <input type="hidden" name="op" id="op" value="add_validate" />
240 <input type="hidden" name="op" id="op" value="copy_validate" />
243 <input type="hidden" name="checked" value="0" />
246 <input type="hidden" name="add" value="0" />
248 <input type="hidden" name="add" value="1" />
251 <fieldset class="rows">
252 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
253 [% IF independant_branch %]
254 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
260 <label for="branch">Library:</label>
261 <select name="branchcode" id="branch" style="width:20em;">
262 <option value="">All libraries</option>
263 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
266 <span class="label">Library:</span>
267 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
268 [% IF ( branchcode ) %]
269 [% Branches.GetName( branchcode ) | html %]
275 [% END # /IF independant_branch %]
277 <label for="module">Koha module:</label>
278 <input type="hidden" name="oldmodule" value="[% module | html %]" />
280 <select name="module" id="newmodule">
282 <select name="module" id="module">
284 [% IF ( module == "acquisition" ) %]
285 <option value="acquisition" selected="selected">Acquisition</option>
287 <option value="acquisition" >Acquisition</option>
289 [% IF ( module == "catalogue" ) %]
290 <option value="catalogue" selected="selected">Catalog</option>
292 <option value="catalogue" >Catalog</option>
294 [% IF ( module == "circulation" ) %]
295 <option value="circulation" selected="selected">Circulation</option>
297 <option value="circulation">Circulation</option>
299 [% IF ( module == "orderacquisition" ) %]
300 <option value="orderacquisition" selected="selected">Order acquisition</option>
302 <option value="orderacquisition">Order acquisition</option>
304 [% IF ( module == "claimacquisition" ) %]
305 <option value="claimacquisition" selected="selected">Claim acquisition</option>
307 <option value="claimacquisition">Claim acquisition</option>
309 [% IF ( module == "claimissues" ) %]
310 <option value="claimissues" selected="selected">Claim serial issue</option>
312 <option value="claimissues">Claim serial issue</option>
314 [% IF ( module == "reserves" ) %]
315 <option value="reserves" selected="selected">Holds</option>
317 <option value="reserves">Holds</option>
319 [% IF ( module == "members" ) %]
320 <option value="members" selected="selected">Patrons</option>
322 <option value="members">Patrons</option>
324 [% IF ( module == "serial" ) %]
325 <option value="serial" selected="selected">Serials (new issue)</option>
327 <option value="serial">Serials (new issue)</option>
329 [% IF ( module == "suggestions" ) %]
330 <option value="suggestions" selected="selected">Suggestions</option>
332 <option value="suggestions">Suggestions</option>
334 [% IF ( module == "pos" ) %]
335 <option value="pos" selected="selected">Point of sale</option>
337 <option value="pos">Point of sale</option>
343 <label for="code" class="required">Code:</label>
344 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
345 <span class="required">Required</span>
347 <span class="label">Code:</span>
348 <input type="hidden" id="code" name="code" value="[% code | html %]" />
353 <label for="name" class="required">Name:</label>
354 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
355 <span class="required">Required</span>
357 [% IF code and preview_is_available%]
359 <label for="name">Data for preview:</label>
362 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
363 [% CASE 'CHECKOUT' %]
364 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
365 [% CASE 'HOLD_SLIP' %]
366 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
373 </fieldset> <!-- /#add_notice -->
375 [% IF Koha.Preference('TranslateNotices') %]
376 <div style="clear:both"></div>
379 <li><a href="#lang_default">Default</a></li>
380 [% FOR language IN languages %]
381 [% FOR sublanguage IN language.sublanguages_loop %]
382 [% IF language.plural %]
383 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
385 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
390 [% END # /IF TranslateNotices %]
392 [% FOREACH lang IN letters.keys %]
393 <div id="lang_[% lang | html %]">
394 <div class="transport-types" style="clear:both">
395 [% FOR mtt IN letters.$lang.templates.keys.sort %]
396 [% SET letter = letters.$lang.templates.$mtt %]
398 [% SWITCH letter.message_transport_type %]
410 [% letter.message_transport_type | html %]
413 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
414 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
415 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
416 [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
417 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
418 <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
420 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
423 [% IF ( letter.updated_on ) %]
425 <label for="updated_on_[% letter.message_transport_type | html %]_[% lang | html %]">Last updated:</label>
426 [% letter.updated_on | $KohaDates with_hours = 1 %]
430 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
431 <input type="hidden" name="lang" value="[% lang | html %]" />
432 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
433 [% IF letter.is_html %]
434 <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" />
436 <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" />
440 <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 %]" />
443 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
444 [% IF letter.message_transport_type == 'sms' %]
445 <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>
450 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
451 [% FOREACH SQLfieldname IN SQLfieldnames %]
452 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
457 <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>
460 <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>
465 [% IF preview_is_available %]
467 <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>
471 </fieldset> <!-- /.rows.mtt -->
474 </div> <!-- / #transport-types -->
475 [% END # /FOREACH lang %]
477 [% IF Koha.Preference('TranslateNotices') %]
481 <input type="hidden" id="redirect" name="redirect" value="" />
482 <input type="hidden" id="section" name="section" value="[% section | html %]" />
483 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
484 </form> <!-- /#add_notice -->
485 [% END # /IF add_form %]
487 [% IF ( add_validate or copy_validate) %]
489 <form action="[% action | html %]" method="post">
490 <input type="submit" value="OK" />
494 [% IF ( delete_confirm ) %]
495 <div class="dialog alert">
496 <h3>Delete notice?</h3>
507 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
508 <td>[% letter.module | html %]</td>
509 <td>[% letter.code | html %]</td>
510 <td>[% letter.name | html %]</td>
513 <form action="[% action | html %]" method="post">
514 <input type="hidden" name="op" value="delete_confirmed">
515 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
516 <input type="hidden" name="code" value="[% letter.code | html %]" />
517 <input type="hidden" name="module" value="[% letter.module | html %]" />
518 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
521 <form action="[% action | html %]" method="get">
522 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
525 [% END # /IF delete_confirm %]
527 [% IF ( delete_confirmed ) %]
529 <form action="[% action | html %]" method="post">
530 <input type="submit" value="OK" />
534 [% IF add_form or copy_form %]
535 </div> <!-- /.col-md-8 -->
536 </div> <!-- /.row -->
539 </div> <!-- /.col-sm-10.col-sm-push-2 -->
541 <div class="col-sm-2 col-sm-pull-10">
543 [% INCLUDE 'tools-menu.inc' %]
545 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
546 </div> <!-- /.row -->
549 [% MACRO jsinclude BLOCK %]
550 [% Asset.js("js/tools-menu.js") | $raw %]
551 [% INCLUDE 'datatables.inc' %]
552 [% INCLUDE 'columns_settings.inc' %]
553 [% Asset.js("lib/hc-sticky.js") | $raw %]
554 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
556 var no_op_set = '[% no_op_set | html %]';
557 var interface = '[% interface | html %]';
558 var theme = '[% theme | html %]';
559 var add_form = '[% add_form | html %]';
560 var copy_form = '[% copy_form | html %]';
561 var code = '[% code | html %]';
562 var new_lettercode = '[% new_lettercode | html %]';
563 var new_branchcode = '[% new_branchcode | html %]';
564 var columns_settings = [% TablesSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
566 [% Asset.js("js/letter.js") | $raw %]
569 [% INCLUDE 'intranet-bottom.inc' %]