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 [% Asset.css("css/datatables.css") | $raw %]
11 <style>#preview_template .modal-dialog { width : 80%; } .spinner { display: none; } @media (max-width: 767px) { #preview_template { margin: 0; width : auto; } }</style>
14 <body id="tools_letter" class="tools">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'letters-search.inc' %]
18 <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>
20 <div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
21 <div class="modal-dialog modal-lg">
22 <div class="modal-content">
23 <div class="modal-header">
24 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
25 <h3 id="preview_template_label">Preview notice template</h3>
27 <div class="modal-body">
28 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
30 <div class="modal-footer">
31 <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
32 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
38 [% IF add_form or copy_form %]
39 <div class="main container-fluid">
41 <div class="col-md-8 col-md-offset-2">
43 <div class="main container-fluid">
45 <div class="col-sm-10 col-sm-push-2">
49 [% IF ( no_op_set ) %]
50 <h1>Notices & slips</h1>
51 <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
52 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
53 [% UNLESS independant_branch %]
56 <select name="branchcode" id="branch" style="width:20em;">
57 <option value="*">All libraries</option>
58 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
62 <div id="toolbar" class="btn-toolbar">
63 <button type="submit" class="btn btn-default btn-sm" id="newnotice"><i class="fa fa-plus"></i> New notice</button>
64 <input type="hidden" id="op" name="op" />
69 <p>You searched for <b>[% searchfield | html %]</b></p>
71 [% IF ( letter && !independant_branch) %]
72 [% select_for_copy = BLOCK %]
73 <select name="branchcode">
74 [% FOREACH l IN Branches.all() %]
75 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
88 <th class="nosort">Copy notice</th>
89 <th class="nosort">Actions</th>
93 [% FOREACH lette IN letter %]
94 [% can_edit = lette.branchcode || !independant_branch %]
96 <td>[% IF lette.branchname %][% lette.branchname | html %][% ELSE %](All libraries)[% END %]</td>
98 [% SWITCH lette.module %]
99 [% CASE 'acquisition' %]<span>Acquisition</span>
100 [% CASE 'catalogue' %]<span>Catalog</span>
101 [% CASE 'circulation' %]<span>Circulation</span>
102 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
103 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
104 [% CASE 'claimissues' %]<span>Claim serial issue</span>
105 [% CASE 'reserves' %]<span>Holds</span>
106 [% CASE 'members' %]<span>Patrons</span>
107 [% CASE 'serial' %]<span>Serials (new issue)</span>
108 [% CASE 'suggestions' %]<span>Suggestions</span>
109 [% CASE %]<span>[% lette.module | html %]</span>
112 <td>[% lette.code | html %]</td>
113 <td>[% lette.name | html %]</td>
115 [% IF !independant_branch || !lette.branchcode %]
116 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
117 <input type="hidden" name="op" value="copy_form" />
118 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
119 <input type="hidden" name="module" value="[% lette.module | html %]" />
120 <input type="hidden" name="code" value="[% lette.code | html %]" />
121 [% IF independant_branch %]
122 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
124 [% select_for_copy | $raw %]
126 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
132 <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>
134 [% IF !lette.protected && can_edit %]
135 <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>
143 <div class="dialog message">
144 [% IF ( branchcode ) %]
145 <p>There are no notices for this library.</p>
147 <p>There are no notices.</p>
154 [% IF add_form or copy_form %]
155 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
157 <div id="toolbar" class="btn-toolbar">
158 <div class="btn-group">
159 <button class="btn btn-default btn-sm" id="submit_form"><i class="fa fa-save"></i> Save</button>
160 <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
161 <span class="caret"></span>
163 <ul class="dropdown-menu">
164 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
167 <a class="btn btn-default btn-sm cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
170 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
172 <input type="hidden" name="op" id="op" value="add_validate" />
174 <input type="hidden" name="op" id="op" value="copy_validate" />
177 <input type="hidden" name="checked" value="0" />
179 <input type="hidden" name="add" value="0" />
181 <input type="hidden" name="add" value="1" />
183 <fieldset class="rows">
184 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
186 [% IF independant_branch %]
187 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
192 <label for="branch">Library:</label>
193 <select name="branchcode" id="branch" style="width:20em;">
194 <option value="">All libraries</option>
195 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
198 <span class="label">Library:</span>
199 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
200 [% IF ( branchcode ) %]
201 [% Branches.GetName( branchcode ) | html %]
209 <label for="module">Koha module:</label>
210 <input type="hidden" name="oldmodule" value="[% module | html %]" />
212 <select name="module" id="newmodule">
214 <select name="module" id="module">
216 [% IF ( module == "acquisition" ) %]
217 <option value="acquisition" selected="selected">Acquisition</option>
219 <option value="acquisition" >Acquisition</option>
221 [% IF ( module == "catalogue" ) %]
222 <option value="catalogue" selected="selected">Catalog</option>
224 <option value="catalogue" >Catalog</option>
226 [% IF ( module == "circulation" ) %]
227 <option value="circulation" selected="selected">Circulation</option>
229 <option value="circulation">Circulation</option>
231 [% IF ( module == "orderacquisition" ) %]
232 <option value="orderacquisition" selected="selected">Order acquisition</option>
234 <option value="orderacquisition">Order acquisition</option>
236 [% IF ( module == "claimacquisition" ) %]
237 <option value="claimacquisition" selected="selected">Claim acquisition</option>
239 <option value="claimacquisition">Claim acquisition</option>
241 [% IF ( module == "claimissues" ) %]
242 <option value="claimissues" selected="selected">Claim serial issue</option>
244 <option value="claimissues">Claim serial issue</option>
246 [% IF ( module == "reserves" ) %]
247 <option value="reserves" selected="selected">Holds</option>
249 <option value="reserves">Holds</option>
251 [% IF ( module == "members" ) %]
252 <option value="members" selected="selected">Patrons</option>
254 <option value="members">Patrons</option>
256 [% IF ( module == "serial" ) %]
257 <option value="serial" selected="selected">Serials (new issue)</option>
259 <option value="serial">Serials (new issue)</option>
261 [% IF ( module == "suggestions" ) %]
262 <option value="suggestions" selected="selected">Suggestions</option>
264 <option value="suggestions">Suggestions</option>
270 <label for="code" class="required">Code:</label>
271 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
272 <span class="required">Required</span>
274 <span class="label">Code:</span>
275 <input type="hidden" id="code" name="code" value="[% code | html %]" />
280 <label for="name" class="required">Name:</label>
281 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
282 <span class="required">Required</span>
284 [% IF code and preview_is_available%]
286 <label for="name">Data for preview:</label>
289 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
290 [% CASE 'CHECKOUT' %]
291 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
292 [% CASE 'HOLD_SLIP' %]
293 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
301 [% IF Koha.Preference('TranslateNotices') %]
302 <div style="clear:both"></div>
305 <li><a href="#lang_default">Default</a></li>
306 [% FOR language IN languages %]
307 [% FOR sublanguage IN language.sublanguages_loop %]
308 [% IF language.plural %]
309 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
311 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
318 [% FOREACH lang IN letters.keys %]
319 <div id="lang_[% lang | html %]">
320 <div class="transport-types" style="clear:both">
321 [% FOR mtt IN letters.$lang.templates.keys.sort %]
322 [% SET letter = letters.$lang.templates.$mtt %]
324 [% SWITCH letter.message_transport_type %]
336 [% letter.message_transport_type | html %]
339 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
340 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
341 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
342 [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
343 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
344 <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
346 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
350 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
351 <input type="hidden" name="lang" value="[% lang | html %]" />
352 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
353 [% IF letter.is_html %]
354 <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" />
356 <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" />
360 <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 %]" />
363 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
364 [% IF letter.message_transport_type == 'sms' %]
365 <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>
370 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
371 [% FOREACH SQLfieldname IN SQLfieldnames %]
372 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
377 <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>
379 <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>
383 [% IF preview_is_available %]
385 <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>
392 </div> <!-- / #transport-types -->
394 [% IF Koha.Preference('TranslateNotices') %]
398 [% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %]
400 <input type="hidden" id="redirect" name="redirect" value="" />
401 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
405 [% IF ( add_validate or copy_validate) %]
407 <form action="[% action | html %]" method="post">
408 <input type="submit" value="OK" />
412 [% IF ( delete_confirm ) %]
413 <div class="dialog alert">
414 <h3>Delete notice?</h3>
425 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
426 <td>[% letter.module | html %]</td>
427 <td>[% letter.code | html %]</td>
428 <td>[% letter.name | html %]</td>
431 <form action="[% action | html %]" method="post">
432 <input type="hidden" name="op" value="delete_confirmed">
433 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
434 <input type="hidden" name="code" value="[% letter.code | html %]" />
435 <input type="hidden" name="module" value="[% letter.module | html %]" />
436 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
439 <form action="[% action | html %]" method="get">
440 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
445 [% IF ( delete_confirmed ) %]
447 <form action="[% action | html %]" method="post">
448 <input type="submit" value="OK" />
452 [% IF add_form or copy_form %]
453 </div> <!-- /.col-md-8 -->
454 </div> <!-- /.row -->
457 </div> <!-- /.col-sm-10.col-sm-push-2 -->
459 <div class="col-sm-2 col-sm-pull-10">
461 [% INCLUDE 'tools-menu.inc' %]
463 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
464 </div> <!-- /.row -->
467 [% MACRO jsinclude BLOCK %]
468 [% Asset.js("js/tools-menu.js") | $raw %]
469 [% INCLUDE 'datatables.inc' %]
470 [% INCLUDE 'columns_settings.inc' %]
471 [% Asset.js("lib/hc-sticky.js") | $raw %]
472 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
474 var no_op_set = '[% no_op_set | html %]';
475 var interface = '[% interface | html %]';
476 var theme = '[% theme | html %]';
477 var add_form = '[% add_form | html %]';
478 var copy_form = '[% copy_form | html %]';
479 var code = '[% code | html %]';
480 var new_lettercode = '[% new_lettercode | html %]';
481 var new_branchcode = '[% new_branchcode | html %]';
482 var MSG_CODE_EXISTS = _("A default letter with the code '%s' already exists.");
483 var MSG_CODE_EXISTS_FOR_LIBRARY = _("A letter with the code '%s' already exists for '%s'.");
484 var MSG_EMPTY_TITLE_AND_CONTENT = _("Please specify title and content for %s");
485 var MSG_EMPTY_TEMPLATES = _("Please fill at least one template.");
486 var MSG_LOADING = _("Loading");
487 var MSG_NO_NOTICE_FOUND = _("No matching notices found");
488 var columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
490 [% Asset.js("js/letter.js") | $raw %]
493 [% INCLUDE 'intranet-bottom.inc' %]