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 type="text/css">#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 id="doc3" class="yui-t2">
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 ) %]
64 <div id="toolbar" class="btn-toolbar">
65 <div class="btn-group">
66 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New notice <span class="caret"></span></button>
67 <ul class="dropdown-menu">
68 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=acquisition">Acquisition</a></li>
69 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=catalogue">Catalog</a></li>
70 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation">Circulation</a></li>
71 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimacquisition">Claim acquisition</a></li>
72 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues">Claim serial issue</a></li>
73 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=reserves">Holds</a></li>
74 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=orderacquisition">Order acquisition</a></li>
75 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=members">Patrons</a></li>
76 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=serial">Serials (new issue)</a></li>
77 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=suggestions">Suggestions</a></li>
84 <p>You searched for <b>[% searchfield | html %]</b></p>
86 [% IF ( letter && !independant_branch) %]
87 [% select_for_copy = BLOCK %]
88 <select name="branchcode">
89 [% FOREACH l IN Branches.all() %]
90 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
103 <th class="nosort">Copy notice</th>
104 <th class="nosort">Actions</th>
108 [% FOREACH lette IN letter %]
109 [% can_edit = lette.branchcode || !independant_branch %]
111 <td>[% IF lette.branchname %][% lette.branchname | html %][% ELSE %](All libraries)[% END %]</td>
113 [% SWITCH lette.module %]
114 [% CASE 'acquisition' %]<span>Acquisition</span>
115 [% CASE 'catalogue' %]<span>Catalog</span>
116 [% CASE 'circulation' %]<span>Circulation</span>
117 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
118 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
119 [% CASE 'claimissues' %]<span>Claim serial issue</span>
120 [% CASE 'reserves' %]<span>Holds</span>
121 [% CASE 'members' %]<span>Patrons</span>
122 [% CASE 'serial' %]<span>Serials (new issue)</span>
123 [% CASE 'suggestions' %]<span>Suggestions</span>
124 [% CASE %]<span>[% lette.module | html %]</span>
127 <td>[% lette.code | html %]</td>
128 <td>[% lette.name | html %]</td>
130 [% IF !independant_branch || !lette.branchcode %]
131 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
132 <input type="hidden" name="op" value="copy_form" />
133 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
134 <input type="hidden" name="module" value="[% lette.module | html %]" />
135 <input type="hidden" name="code" value="[% lette.code | html %]" />
136 [% IF independant_branch %]
137 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
139 [% select_for_copy | $raw %]
141 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
147 <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>
149 [% IF !lette.protected && can_edit %]
150 <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>
158 <div class="dialog message">
159 [% IF ( branchcode ) %]
160 <p>There are no notices for this library.</p>
162 <p>There are no notices.</p>
168 [% IF add_form or copy_form %]
169 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
171 <div id="toolbar" class="btn-toolbar">
172 <div class="btn-group">
173 <button class="btn btn-default btn-sm" id="submit_form"><i class="fa fa-save"></i> Save</button>
174 <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
175 <span class="caret"></span>
177 <ul class="dropdown-menu">
178 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
181 <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
184 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
186 <input type="hidden" name="op" id="op" value="add_validate" />
188 <input type="hidden" name="op" id="op" value="copy_validate" />
191 <input type="hidden" name="checked" value="0" />
193 <input type="hidden" name="add" value="0" />
195 <input type="hidden" name="add" value="1" />
197 <fieldset class="rows">
198 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
200 [% IF independant_branch %]
201 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
206 <label for="branch">Library:</label>
207 <select name="branchcode" id="branch" style="width:20em;">
208 <option value="">All libraries</option>
209 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
212 <span class="label">Library:</span>
213 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
214 [% IF ( branchcode ) %]
215 [% Branches.GetName( branchcode ) | html %]
223 <label for="module">Koha module:</label>
224 <input type="hidden" name="oldmodule" value="[% module | html %]" />
226 <select name="module" id="newmodule">
228 <select name="module" id="module">
230 [% IF ( module == "acquisition" ) %]
231 <option value="acquisition" selected="selected">Acquisition</option>
233 <option value="acquisition" >Acquisition</option>
235 [% IF ( module == "catalogue" ) %]
236 <option value="catalogue" selected="selected">Catalog</option>
238 <option value="catalogue" >Catalog</option>
240 [% IF ( module == "circulation" ) %]
241 <option value="circulation" selected="selected">Circulation</option>
243 <option value="circulation">Circulation</option>
245 [% IF ( module == "orderacquisition" ) %]
246 <option value="orderacquisition" selected="selected">Order acquisition</option>
248 <option value="orderacquisition">Order acquisition</option>
250 [% IF ( module == "claimacquisition" ) %]
251 <option value="claimacquisition" selected="selected">Claim acquisition</option>
253 <option value="claimacquisition">Claim acquisition</option>
255 [% IF ( module == "claimissues" ) %]
256 <option value="claimissues" selected="selected">Claim serial issue</option>
258 <option value="claimissues">Claim serial issue</option>
260 [% IF ( module == "reserves" ) %]
261 <option value="reserves" selected="selected">Holds</option>
263 <option value="reserves">Holds</option>
265 [% IF ( module == "members" ) %]
266 <option value="members" selected="selected">Patrons</option>
268 <option value="members">Patrons</option>
270 [% IF ( module == "serial" ) %]
271 <option value="serial" selected="selected">Serials (new issue)</option>
273 <option value="serial">Serials (new issue)</option>
275 [% IF ( module == "suggestions" ) %]
276 <option value="suggestions" selected="selected">Suggestions</option>
278 <option value="suggestions">Suggestions</option>
284 <label for="code" class="required">Code:</label>
285 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
286 <span class="required">Required</span>
288 <span class="label">Code:</span>
289 <input type="hidden" id="code" name="code" value="[% code | html %]" />
294 <label for="name" class="required">Name:</label>
295 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
296 <span class="required">Required</span>
298 [% IF code and preview_is_available%]
300 <label for="name">Data for preview:</label>
303 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
304 [% CASE 'CHECKOUT' %]
305 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
306 [% CASE 'HOLD_SLIP' %]
307 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
315 [% IF Koha.Preference('TranslateNotices') %]
316 <div style="clear:both"></div>
319 <li><a href="#lang_default">Default</a></li>
320 [% FOR language IN languages %]
321 [% FOR sublanguage IN language.sublanguages_loop %]
322 [% IF language.plural %]
323 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
325 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
332 [% FOREACH lang IN letters.keys %]
333 <div id="lang_[% lang | html %]">
334 <div class="transport-types" style="clear:both">
335 [% FOR mtt IN letters.$lang.templates.keys.sort %]
336 [% SET letter = letters.$lang.templates.$mtt %]
338 [% SWITCH letter.message_transport_type %]
350 [% letter.message_transport_type | html %]
353 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
354 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
355 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
356 [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
357 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
358 <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
360 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
364 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
365 <input type="hidden" name="lang" value="[% lang | html %]" />
366 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
367 [% IF letter.is_html %]
368 <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" />
370 <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" />
374 <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 %]" />
377 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
378 [% IF letter.message_transport_type == 'sms' %]
379 <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>
384 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
385 [% FOREACH SQLfieldname IN SQLfieldnames %]
386 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
391 <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>
393 <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>
397 [% IF preview_is_available %]
399 <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>
406 </div> <!-- / #transport-types -->
408 [% IF Koha.Preference('TranslateNotices') %]
412 [% 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 %]
414 <input type="hidden" id="redirect" name="redirect" value="" />
415 <input type="hidden" id="section" name="section" value="[% section | html %]" />
416 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
420 [% IF ( add_validate or copy_validate) %]
422 <form action="[% action | html %]" method="post">
423 <input type="submit" value="OK" />
427 [% IF ( delete_confirm ) %]
428 <div class="dialog alert">
429 <h3>Delete notice?</h3>
440 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
441 <td>[% letter.module | html %]</td>
442 <td>[% letter.code | html %]</td>
443 <td>[% letter.name | html %]</td>
446 <form action="[% action | html %]" method="post">
447 <input type="hidden" name="op" value="delete_confirmed">
448 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
449 <input type="hidden" name="code" value="[% letter.code | html %]" />
450 <input type="hidden" name="module" value="[% letter.module | html %]" />
451 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
454 <form action="[% action | html %]" method="get">
455 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
460 [% IF ( delete_confirmed ) %]
462 <form action="[% action | html %]" method="post">
463 <input type="submit" value="OK" />
469 [% UNLESS add_form or copy_form %]
470 <div class="yui-b noprint">
471 [% INCLUDE 'tools-menu.inc' %]
476 [% MACRO jsinclude BLOCK %]
477 [% Asset.js("js/tools-menu.js") | $raw %]
478 [% INCLUDE 'datatables.inc' %]
479 [% INCLUDE 'columns_settings.inc' %]
480 [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %]
481 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
483 var no_op_set = '[% no_op_set | html %]';
484 var interface = '[% interface | html %]';
485 var theme = '[% theme | html %]';
486 var add_form = '[% add_form | html %]';
487 var copy_form = '[% copy_form | html %]';
488 var code = '[% code | html %]';
489 var new_lettercode = '[% new_lettercode | html %]';
490 var new_branchcode = '[% new_branchcode | html %]';
491 var MSG_CODE_EXISTS = _("A default letter with the code '%s' already exists.");
492 var MSG_CODE_EXISTS_FOR_LIBRARY = _("A letter with the code '%s' already exists for '%s'.");
493 var MSG_EMPTY_TITLE_AND_CONTENT = _("Please specify title and content for %s");
494 var MSG_EMPTY_TEMPLATES = _("Please fill at least one template.");
495 var MSG_LOADING = _("Loading");
496 var MSG_NO_NOTICE_FOUND = _("No matching notices found");
497 var columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
499 [% Asset.js("js/letter.js") | $raw %]
502 [% INCLUDE 'intranet-bottom.inc' %]