5 [% USE ColumnsSettings %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Tools › Notices[% IF ( add_form or copy_form ) %][% IF ( modify ) %] › Modify notice[% ELSE %] › Add notice[% END %][% END %][% IF ( add_validate or copy_validate) %] › Notice added[% END %][% IF ( delete_confirm ) %] › Confirm deletion[% END %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 <style>#preview_template .modal-dialog { width : 80%; } .spinner { display: none; } @media (max-width: 767px) { #preview_template { margin: 0; width : auto; } }</style>
13 <body id="tools_letter" class="tools">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'letters-search.inc' %]
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF ( add_form or copy_form) %][% IF ( modify ) %]<a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> › Modify notice[% ELSE %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> › Add notice[% END %][% ELSE %][% IF ( add_validate or copy_validate) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> › Notice added[% ELSE %][% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a> › Confirm deletion[% ELSE %]Notices & slips[% END %][% END %][% END %]</div>
19 <div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
20 <div class="modal-dialog modal-lg">
21 <div class="modal-content">
22 <div class="modal-header">
23 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
24 <h3 id="preview_template_label">Preview notice template</h3>
26 <div class="modal-body">
27 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
29 <div class="modal-footer">
30 <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
31 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
37 [% IF add_form or copy_form %]
38 <div class="main container-fluid">
40 <div class="col-md-8 col-md-offset-2">
42 <div class="main container-fluid">
44 <div class="col-sm-10 col-sm-push-2">
48 [% IF ( no_op_set ) %]
49 <h1>Notices & slips</h1>
50 <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
51 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
52 [% UNLESS independant_branch %]
55 <select name="branchcode" id="branch" style="width:20em;">
56 <option value="*">All libraries</option>
57 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
61 <div id="toolbar" class="btn-toolbar">
62 <button type="submit" class="btn btn-default" id="newnotice"><i class="fa fa-plus"></i> New notice</button>
63 <input type="hidden" id="op" name="op" />
68 <p>You searched for <b>[% searchfield | html %]</b></p>
70 [% IF ( letter && !independant_branch) %]
71 [% select_for_copy = BLOCK %]
72 <select name="branchcode">
73 [% FOREACH l IN Branches.all() %]
74 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
87 <th class="nosort">Copy notice</th>
88 <th class="nosort">Actions</th>
92 [% FOREACH lette IN letter %]
93 [% can_edit = lette.branchcode || !independant_branch %]
95 <td>[% IF lette.branchname %][% lette.branchname | html %][% ELSE %](All libraries)[% END %]</td>
97 [% SWITCH lette.module %]
98 [% CASE 'acquisition' %]<span>Acquisition</span>
99 [% CASE 'catalogue' %]<span>Catalog</span>
100 [% CASE 'circulation' %]<span>Circulation</span>
101 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
102 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
103 [% CASE 'claimissues' %]<span>Claim serial issue</span>
104 [% CASE 'reserves' %]<span>Holds</span>
105 [% CASE 'members' %]<span>Patrons</span>
106 [% CASE 'serial' %]<span>Serials (new issue)</span>
107 [% CASE 'suggestions' %]<span>Suggestions</span>
108 [% CASE %]<span>[% lette.module | html %]</span>
111 <td>[% lette.code | html %]</td>
112 <td>[% lette.name | html %]</td>
114 [% IF !independant_branch || !lette.branchcode %]
115 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
116 <input type="hidden" name="op" value="copy_form" />
117 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
118 <input type="hidden" name="module" value="[% lette.module | html %]" />
119 <input type="hidden" name="code" value="[% lette.code | html %]" />
120 [% IF independant_branch %]
121 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
123 [% select_for_copy | $raw %]
125 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
131 <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>
133 [% IF !lette.protected && can_edit %]
134 <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>
142 <div class="dialog message">
143 [% IF ( branchcode ) %]
144 <p>There are no notices for this library.</p>
146 <p>There are no notices.</p>
153 [% IF add_form or copy_form %]
154 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
156 <div id="toolbar" class="btn-toolbar">
157 <div class="btn-group">
158 <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
159 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
160 <span class="caret"></span>
162 <ul class="dropdown-menu">
163 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
166 <a class="btn btn-default btn-sm cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
169 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
171 <input type="hidden" name="op" id="op" value="add_validate" />
173 <input type="hidden" name="op" id="op" value="copy_validate" />
176 <input type="hidden" name="checked" value="0" />
178 <input type="hidden" name="add" value="0" />
180 <input type="hidden" name="add" value="1" />
182 <fieldset class="rows">
183 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
185 [% IF independant_branch %]
186 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
191 <label for="branch">Library:</label>
192 <select name="branchcode" id="branch" style="width:20em;">
193 <option value="">All libraries</option>
194 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
197 <span class="label">Library:</span>
198 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
199 [% IF ( branchcode ) %]
200 [% Branches.GetName( branchcode ) | html %]
208 <label for="module">Koha module:</label>
209 <input type="hidden" name="oldmodule" value="[% module | html %]" />
211 <select name="module" id="newmodule">
213 <select name="module" id="module">
215 [% IF ( module == "acquisition" ) %]
216 <option value="acquisition" selected="selected">Acquisition</option>
218 <option value="acquisition" >Acquisition</option>
220 [% IF ( module == "catalogue" ) %]
221 <option value="catalogue" selected="selected">Catalog</option>
223 <option value="catalogue" >Catalog</option>
225 [% IF ( module == "circulation" ) %]
226 <option value="circulation" selected="selected">Circulation</option>
228 <option value="circulation">Circulation</option>
230 [% IF ( module == "orderacquisition" ) %]
231 <option value="orderacquisition" selected="selected">Order acquisition</option>
233 <option value="orderacquisition">Order acquisition</option>
235 [% IF ( module == "claimacquisition" ) %]
236 <option value="claimacquisition" selected="selected">Claim acquisition</option>
238 <option value="claimacquisition">Claim acquisition</option>
240 [% IF ( module == "claimissues" ) %]
241 <option value="claimissues" selected="selected">Claim serial issue</option>
243 <option value="claimissues">Claim serial issue</option>
245 [% IF ( module == "reserves" ) %]
246 <option value="reserves" selected="selected">Holds</option>
248 <option value="reserves">Holds</option>
250 [% IF ( module == "members" ) %]
251 <option value="members" selected="selected">Patrons</option>
253 <option value="members">Patrons</option>
255 [% IF ( module == "serial" ) %]
256 <option value="serial" selected="selected">Serials (new issue)</option>
258 <option value="serial">Serials (new issue)</option>
260 [% IF ( module == "suggestions" ) %]
261 <option value="suggestions" selected="selected">Suggestions</option>
263 <option value="suggestions">Suggestions</option>
269 <label for="code" class="required">Code:</label>
270 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
271 <span class="required">Required</span>
273 <span class="label">Code:</span>
274 <input type="hidden" id="code" name="code" value="[% code | html %]" />
279 <label for="name" class="required">Name:</label>
280 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
281 <span class="required">Required</span>
283 [% IF code and preview_is_available%]
285 <label for="name">Data for preview:</label>
288 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
289 [% CASE 'CHECKOUT' %]
290 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
291 [% CASE 'HOLD_SLIP' %]
292 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
300 [% IF Koha.Preference('TranslateNotices') %]
301 <div style="clear:both"></div>
304 <li><a href="#lang_default">Default</a></li>
305 [% FOR language IN languages %]
306 [% FOR sublanguage IN language.sublanguages_loop %]
307 [% IF language.plural %]
308 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
310 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
317 [% FOREACH lang IN letters.keys %]
318 <div id="lang_[% lang | html %]">
319 <div class="transport-types" style="clear:both">
320 [% FOR mtt IN letters.$lang.templates.keys.sort %]
321 [% SET letter = letters.$lang.templates.$mtt %]
323 [% SWITCH letter.message_transport_type %]
335 [% letter.message_transport_type | html %]
338 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
339 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
340 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
341 [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
342 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
343 <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
345 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
349 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
350 <input type="hidden" name="lang" value="[% lang | html %]" />
351 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
352 [% IF letter.is_html %]
353 <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" checked="checked" />
355 <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" />
359 <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 %]" />
362 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
363 [% IF letter.message_transport_type == 'sms' %]
364 <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>
369 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
370 [% FOREACH SQLfieldname IN SQLfieldnames %]
371 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
376 <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>
378 <td><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></td>
382 [% IF preview_is_available %]
384 <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>
391 </div> <!-- / #transport-types -->
393 [% IF Koha.Preference('TranslateNotices') %]
397 <input type="hidden" id="redirect" name="redirect" value="" />
398 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
402 [% IF ( add_validate or copy_validate) %]
404 <form action="[% action | html %]" method="post">
405 <input type="submit" value="OK" />
409 [% IF ( delete_confirm ) %]
410 <div class="dialog alert">
411 <h3>Delete notice?</h3>
422 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
423 <td>[% letter.module | html %]</td>
424 <td>[% letter.code | html %]</td>
425 <td>[% letter.name | html %]</td>
428 <form action="[% action | html %]" method="post">
429 <input type="hidden" name="op" value="delete_confirmed">
430 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
431 <input type="hidden" name="code" value="[% letter.code | html %]" />
432 <input type="hidden" name="module" value="[% letter.module | html %]" />
433 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
436 <form action="[% action | html %]" method="get">
437 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
442 [% IF ( delete_confirmed ) %]
444 <form action="[% action | html %]" method="post">
445 <input type="submit" value="OK" />
449 [% IF add_form or copy_form %]
450 </div> <!-- /.col-md-8 -->
451 </div> <!-- /.row -->
454 </div> <!-- /.col-sm-10.col-sm-push-2 -->
456 <div class="col-sm-2 col-sm-pull-10">
458 [% INCLUDE 'tools-menu.inc' %]
460 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
461 </div> <!-- /.row -->
464 [% MACRO jsinclude BLOCK %]
465 [% Asset.js("js/tools-menu.js") | $raw %]
466 [% INCLUDE 'datatables.inc' %]
467 [% INCLUDE 'columns_settings.inc' %]
468 [% Asset.js("lib/hc-sticky.js") | $raw %]
469 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
471 var no_op_set = '[% no_op_set | html %]';
472 var interface = '[% interface | html %]';
473 var theme = '[% theme | html %]';
474 var add_form = '[% add_form | html %]';
475 var copy_form = '[% copy_form | html %]';
476 var code = '[% code | html %]';
477 var new_lettercode = '[% new_lettercode | html %]';
478 var new_branchcode = '[% new_branchcode | html %]';
479 var MSG_CODE_EXISTS = _("A default letter with the code '%s' already exists.");
480 var MSG_CODE_EXISTS_FOR_LIBRARY = _("A letter with the code '%s' already exists for '%s'.");
481 var MSG_EMPTY_TITLE_AND_CONTENT = _("Please specify title and content for %s");
482 var MSG_EMPTY_TEMPLATES = _("Please fill at least one template.");
483 var MSG_LOADING = _("Loading");
484 var MSG_NO_NOTICE_FOUND = _("No matching notices found");
485 var columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
487 [% Asset.js("js/letter.js") | $raw %]
490 [% INCLUDE 'intranet-bottom.inc' %]