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 ) %]
63 <div id="toolbar" class="btn-toolbar">
64 <div class="btn-group">
65 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New notice <span class="caret"></span></button>
66 <ul class="dropdown-menu">
67 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=acquisition">Acquisition</a></li>
68 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=catalogue">Catalog</a></li>
69 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation">Circulation</a></li>
70 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimacquisition">Claim acquisition</a></li>
71 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues">Claim serial issue</a></li>
72 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=reserves">Holds</a></li>
73 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=orderacquisition">Order acquisition</a></li>
74 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=members">Patrons</a></li>
75 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=serial">Serials (new issue)</a></li>
76 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=suggestions">Suggestions</a></li>
83 <p>You searched for <b>[% searchfield | html %]</b></p>
85 [% IF ( letter && !independant_branch) %]
86 [% select_for_copy = BLOCK %]
87 <select name="branchcode">
88 [% FOREACH l IN Branches.all() %]
89 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
102 <th class="nosort">Copy notice</th>
103 <th class="nosort">Actions</th>
107 [% FOREACH lette IN letter %]
108 [% can_edit = lette.branchcode || !independant_branch %]
110 <td>[% IF lette.branchname %][% lette.branchname | html %][% ELSE %](All libraries)[% END %]</td>
112 [% SWITCH lette.module %]
113 [% CASE 'acquisition' %]<span>Acquisition</span>
114 [% CASE 'catalogue' %]<span>Catalog</span>
115 [% CASE 'circulation' %]<span>Circulation</span>
116 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
117 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
118 [% CASE 'claimissues' %]<span>Claim serial issue</span>
119 [% CASE 'reserves' %]<span>Holds</span>
120 [% CASE 'members' %]<span>Patrons</span>
121 [% CASE 'serial' %]<span>Serials (new issue)</span>
122 [% CASE 'suggestions' %]<span>Suggestions</span>
123 [% CASE %]<span>[% lette.module | html %]</span>
126 <td>[% lette.code | html %]</td>
127 <td>[% lette.name | html %]</td>
129 [% IF !independant_branch || !lette.branchcode %]
130 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
131 <input type="hidden" name="op" value="copy_form" />
132 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
133 <input type="hidden" name="module" value="[% lette.module | html %]" />
134 <input type="hidden" name="code" value="[% lette.code | html %]" />
135 [% IF independant_branch %]
136 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
138 [% select_for_copy | $raw %]
140 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
146 <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>
148 [% IF !lette.protected && can_edit %]
149 <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>
157 <div class="dialog message">
158 [% IF ( branchcode ) %]
159 <p>There are no notices for this library.</p>
161 <p>There are no notices.</p>
167 [% IF add_form or copy_form %]
168 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
170 <div id="toolbar" class="btn-toolbar">
171 <div class="btn-group">
172 <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
173 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
174 <span class="caret"></span>
176 <ul class="dropdown-menu">
177 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
180 <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
183 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
185 <input type="hidden" name="op" id="op" value="add_validate" />
187 <input type="hidden" name="op" id="op" value="copy_validate" />
190 <input type="hidden" name="checked" value="0" />
192 <input type="hidden" name="add" value="0" />
194 <input type="hidden" name="add" value="1" />
196 <fieldset class="rows">
197 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
199 [% IF independant_branch %]
200 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
205 <label for="branch">Library:</label>
206 <select name="branchcode" id="branch" style="width:20em;">
207 <option value="">All libraries</option>
208 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
211 <span class="label">Library:</span>
212 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
213 [% IF ( branchcode ) %]
214 [% Branches.GetName( branchcode ) | html %]
222 <label for="module">Koha module:</label>
223 <input type="hidden" name="oldmodule" value="[% module | html %]" />
225 <select name="module" id="newmodule">
227 <select name="module" id="module">
229 [% IF ( module == "acquisition" ) %]
230 <option value="acquisition" selected="selected">Acquisition</option>
232 <option value="acquisition" >Acquisition</option>
234 [% IF ( module == "catalogue" ) %]
235 <option value="catalogue" selected="selected">Catalog</option>
237 <option value="catalogue" >Catalog</option>
239 [% IF ( module == "circulation" ) %]
240 <option value="circulation" selected="selected">Circulation</option>
242 <option value="circulation">Circulation</option>
244 [% IF ( module == "orderacquisition" ) %]
245 <option value="orderacquisition" selected="selected">Order acquisition</option>
247 <option value="orderacquisition">Order acquisition</option>
249 [% IF ( module == "claimacquisition" ) %]
250 <option value="claimacquisition" selected="selected">Claim acquisition</option>
252 <option value="claimacquisition">Claim acquisition</option>
254 [% IF ( module == "claimissues" ) %]
255 <option value="claimissues" selected="selected">Claim serial issue</option>
257 <option value="claimissues">Claim serial issue</option>
259 [% IF ( module == "reserves" ) %]
260 <option value="reserves" selected="selected">Holds</option>
262 <option value="reserves">Holds</option>
264 [% IF ( module == "members" ) %]
265 <option value="members" selected="selected">Patrons</option>
267 <option value="members">Patrons</option>
269 [% IF ( module == "serial" ) %]
270 <option value="serial" selected="selected">Serials (new issue)</option>
272 <option value="serial">Serials (new issue)</option>
274 [% IF ( module == "suggestions" ) %]
275 <option value="suggestions" selected="selected">Suggestions</option>
277 <option value="suggestions">Suggestions</option>
283 <label for="code" class="required">Code:</label>
284 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
285 <span class="required">Required</span>
287 <span class="label">Code:</span>
288 <input type="hidden" id="code" name="code" value="[% code | html %]" />
293 <label for="name" class="required">Name:</label>
294 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
295 <span class="required">Required</span>
297 [% IF code and preview_is_available%]
299 <label for="name">Data for preview:</label>
302 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
303 [% CASE 'CHECKOUT' %]
304 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
305 [% CASE 'HOLD_SLIP' %]
306 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
314 [% IF Koha.Preference('TranslateNotices') %]
315 <div style="clear:both"></div>
318 <li><a href="#lang_default">Default</a></li>
319 [% FOR language IN languages %]
320 [% FOR sublanguage IN language.sublanguages_loop %]
321 [% IF language.plural %]
322 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
324 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
331 [% FOREACH lang IN letters.keys %]
332 <div id="lang_[% lang | html %]">
333 <div class="transport-types" style="clear:both">
334 [% FOR mtt IN letters.$lang.templates.keys.sort %]
335 [% SET letter = letters.$lang.templates.$mtt %]
337 [% SWITCH letter.message_transport_type %]
349 [% letter.message_transport_type | html %]
352 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
353 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
354 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
355 [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
356 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
357 <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
359 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
363 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
364 <input type="hidden" name="lang" value="[% lang | html %]" />
365 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
366 [% IF letter.is_html %]
367 <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" />
369 <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" />
373 <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 %]" />
376 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
377 [% IF letter.message_transport_type == 'sms' %]
378 <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>
383 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
384 [% FOREACH SQLfieldname IN SQLfieldnames %]
385 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
390 <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>
392 <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>
396 [% IF preview_is_available %]
398 <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>
405 </div> <!-- / #transport-types -->
407 [% IF Koha.Preference('TranslateNotices') %]
411 <input type="hidden" id="redirect" name="redirect" value="" />
412 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
416 [% IF ( add_validate or copy_validate) %]
418 <form action="[% action | html %]" method="post">
419 <input type="submit" value="OK" />
423 [% IF ( delete_confirm ) %]
424 <div class="dialog alert">
425 <h3>Delete notice?</h3>
436 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
437 <td>[% letter.module | html %]</td>
438 <td>[% letter.code | html %]</td>
439 <td>[% letter.name | html %]</td>
442 <form action="[% action | html %]" method="post">
443 <input type="hidden" name="op" value="delete_confirmed">
444 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
445 <input type="hidden" name="code" value="[% letter.code | html %]" />
446 <input type="hidden" name="module" value="[% letter.module | html %]" />
447 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
450 <form action="[% action | html %]" method="get">
451 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
456 [% IF ( delete_confirmed ) %]
458 <form action="[% action | html %]" method="post">
459 <input type="submit" value="OK" />
463 [% IF add_form or copy_form %]
464 </div> <!-- /.col-md-8 -->
465 </div> <!-- /.row -->
468 </div> <!-- /.col-sm-10.col-sm-push-2 -->
470 <div class="col-sm-2 col-sm-pull-10">
472 [% INCLUDE 'tools-menu.inc' %]
474 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
475 </div> <!-- /.row -->
478 [% MACRO jsinclude BLOCK %]
479 [% Asset.js("js/tools-menu.js") | $raw %]
480 [% INCLUDE 'datatables.inc' %]
481 [% INCLUDE 'columns_settings.inc' %]
482 [% Asset.js("lib/hc-sticky.js") | $raw %]
483 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
485 var no_op_set = '[% no_op_set | html %]';
486 var interface = '[% interface | html %]';
487 var theme = '[% theme | html %]';
488 var add_form = '[% add_form | html %]';
489 var copy_form = '[% copy_form | html %]';
490 var code = '[% code | html %]';
491 var new_lettercode = '[% new_lettercode | html %]';
492 var new_branchcode = '[% new_branchcode | html %]';
493 var MSG_CODE_EXISTS = _("A default letter with the code '%s' already exists.");
494 var MSG_CODE_EXISTS_FOR_LIBRARY = _("A letter with the code '%s' already exists for '%s'.");
495 var MSG_EMPTY_TITLE_AND_CONTENT = _("Please specify title and content for %s");
496 var MSG_EMPTY_TEMPLATES = _("Please fill at least one template.");
497 var MSG_LOADING = _("Loading");
498 var MSG_NO_NOTICE_FOUND = _("No matching notices found");
499 var columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
501 [% Asset.js("js/letter.js") | $raw %]
504 [% INCLUDE 'intranet-bottom.inc' %]