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=ill">Interlibrary loans</a></li>
116 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=orderacquisition">Order acquisition</a></li>
117 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=members">Patrons</a></li>
118 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=serial">Serials (new issue)</a></li>
119 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=suggestions">Suggestions</a></li>
120 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=pos">Point of sale</a></li>
123 </div> <!-- /#toolbar -->
126 <p>You searched for <strong>[% searchfield | html %]</strong></p>
129 [% IF ( letter && !independant_branch) %]
130 [% select_for_copy = BLOCK %]
131 <select name="branchcode">
132 [% FOREACH l IN Branches.all() %]
133 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
147 <th class="title-string">Last updated</th>
148 <th class="NoSort noExport">Copy notice</th>
149 <th class="NoSort noExport">Actions</th>
153 [% FOREACH lette IN letter %]
154 [% can_edit = lette.branchcode || !independant_branch %]
157 [% IF lette.branchname %]
158 [% lette.branchname | html %]
164 [% SWITCH lette.module %]
165 [% CASE 'acquisition' %]<span>Acquisition</span>
166 [% CASE 'catalogue' %]<span>Catalog</span>
167 [% CASE 'circulation' %]<span>Circulation</span>
168 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
169 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
170 [% CASE 'claimissues' %]<span>Claim serial issue</span>
171 [% CASE 'reserves' %]<span>Holds</span>
172 [% CASE 'ill' %]<span>Interlibrary loans</span>
173 [% CASE 'members' %]<span>Patrons</span>
174 [% CASE 'serial' %]<span>Serials (new issue)</span>
175 [% CASE 'suggestions' %]<span>Suggestions</span>
176 [% CASE 'pos' %]<span>Point of sale</span>
177 [% CASE %]<span>[% lette.module | html %]</span>
180 <td>[% lette.code | html %]</td>
181 <td>[% lette.name | html %]</td>
182 <td><span title="[% lette.updated_on | $KohaDates with_hours = 1 %]">[% lette.updated_on | $KohaDates with_hours = 1 %]</span></td>
184 [% IF !independant_branch || !lette.branchcode %]
185 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
186 <input type="hidden" name="op" value="copy_form" />
187 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
188 <input type="hidden" name="module" value="[% lette.module | html %]" />
189 <input type="hidden" name="code" value="[% lette.code | html %]" />
190 [% IF independant_branch %]
191 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
193 [% select_for_copy | $raw %]
195 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
197 [% END # /IF !independent_branch %]
201 <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>
203 [% IF !lette.protected && can_edit %]
204 <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>
208 [% END # /FOREACH lette %]
210 </table> <!-- /#lettert -->
211 [% ELSE # IF lette %]
212 <div class="dialog message">
213 [% IF ( branchcode ) %]
214 <p>There are no notices for this library.</p>
216 <p>There are no notices.</p>
219 [% END # /IF lette %]
220 [% END # /IF no_op_set %]
222 [% IF add_form or copy_form %]
223 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
225 <div id="toolbar" class="btn-toolbar">
226 <div class="btn-group">
227 <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
228 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
229 <span class="caret"></span>
231 <ul class="dropdown-menu">
232 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
235 <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
236 </div> <!-- /#toolbar -->
238 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
240 <input type="hidden" name="op" id="op" value="add_validate" />
242 <input type="hidden" name="op" id="op" value="copy_validate" />
245 <input type="hidden" name="checked" value="0" />
248 <input type="hidden" name="add" value="0" />
250 <input type="hidden" name="add" value="1" />
253 <fieldset class="rows">
254 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
255 [% IF independant_branch %]
256 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
262 <label for="branch">Library:</label>
263 <select name="branchcode" id="branch" style="width:20em;">
264 <option value="">All libraries</option>
265 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
268 <span class="label">Library:</span>
269 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
270 [% IF ( branchcode ) %]
271 [% Branches.GetName( branchcode ) | html %]
277 [% END # /IF independant_branch %]
279 <label for="module">Koha module:</label>
280 <input type="hidden" name="oldmodule" value="[% module | html %]" />
282 <select name="module" id="newmodule">
284 <select name="module" id="module">
286 [% IF ( module == "acquisition" ) %]
287 <option value="acquisition" selected="selected">Acquisition</option>
289 <option value="acquisition" >Acquisition</option>
291 [% IF ( module == "catalogue" ) %]
292 <option value="catalogue" selected="selected">Catalog</option>
294 <option value="catalogue" >Catalog</option>
296 [% IF ( module == "circulation" ) %]
297 <option value="circulation" selected="selected">Circulation</option>
299 <option value="circulation">Circulation</option>
301 [% IF ( module == "orderacquisition" ) %]
302 <option value="orderacquisition" selected="selected">Order acquisition</option>
304 <option value="orderacquisition">Order acquisition</option>
306 [% IF ( module == "claimacquisition" ) %]
307 <option value="claimacquisition" selected="selected">Claim acquisition</option>
309 <option value="claimacquisition">Claim acquisition</option>
311 [% IF ( module == "claimissues" ) %]
312 <option value="claimissues" selected="selected">Claim serial issue</option>
314 <option value="claimissues">Claim serial issue</option>
316 [% IF ( module == "reserves" ) %]
317 <option value="reserves" selected="selected">Holds</option>
319 <option value="reserves">Holds</option>
321 [% IF ( module == "ill" ) %]
322 <option value="ill" selected="selected">Interlibrary loans</option>
324 <option value="ill">Interlibrary loans</option>
326 [% IF ( module == "members" ) %]
327 <option value="members" selected="selected">Patrons</option>
329 <option value="members">Patrons</option>
331 [% IF ( module == "serial" ) %]
332 <option value="serial" selected="selected">Serials (new issue)</option>
334 <option value="serial">Serials (new issue)</option>
336 [% IF ( module == "suggestions" ) %]
337 <option value="suggestions" selected="selected">Suggestions</option>
339 <option value="suggestions">Suggestions</option>
341 [% IF ( module == "pos" ) %]
342 <option value="pos" selected="selected">Point of sale</option>
344 <option value="pos">Point of sale</option>
350 <label for="code" class="required">Code:</label>
351 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
352 <span class="required">Required</span>
354 <span class="label">Code:</span>
355 <input type="hidden" id="code" name="code" value="[% code | html %]" />
360 <label for="name" class="required">Name:</label>
361 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
362 <span class="required">Required</span>
364 [% IF code and preview_is_available%]
366 <label for="name">Data for preview:</label>
369 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
370 [% CASE 'CHECKOUT' %]
371 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
372 [% CASE 'HOLD_SLIP' %]
373 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
380 </fieldset> <!-- /#add_notice -->
382 [% IF Koha.Preference('TranslateNotices') %]
383 <div style="clear:both"></div>
386 <li><a href="#lang_default">Default</a></li>
387 [% FOR language IN languages %]
388 [% FOR sublanguage IN language.sublanguages_loop %]
389 [% IF language.plural %]
390 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
392 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
397 [% END # /IF TranslateNotices %]
399 [% FOREACH lang IN letters.keys %]
400 <div id="lang_[% lang | html %]">
401 <div class="transport-types" style="clear:both">
402 [% FOR mtt IN letters.$lang.templates.keys.sort %]
403 [% SET letter = letters.$lang.templates.$mtt %]
404 [% NEXT IF letter.message_transport_type == "itiva" && !Koha.Preference('TalkingTechItivaPhoneNotification') %]
405 [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %]
407 [% SWITCH letter.message_transport_type %]
421 [% letter.message_transport_type | html %]
424 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
425 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
426 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
428 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
431 [% IF ( letter.updated_on ) %]
433 <label for="updated_on_[% letter.message_transport_type | html %]_[% lang | html %]">Last updated:</label>
434 [% letter.updated_on | $KohaDates with_hours = 1 %]
438 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
439 <input type="hidden" name="lang" value="[% lang | html %]" />
440 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
441 [% IF letter.is_html %]
442 <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" />
444 <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" />
448 <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 %]" />
451 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
452 [% IF letter.message_transport_type == 'sms' %]
453 <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>
458 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
459 [% FOREACH SQLfieldname IN SQLfieldnames %]
460 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
465 <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>
468 <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>
473 [% IF preview_is_available %]
475 <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>
479 </fieldset> <!-- /.rows.mtt -->
482 </div> <!-- / #transport-types -->
483 [% END # /FOREACH lang %]
485 [% IF Koha.Preference('TranslateNotices') %]
489 <input type="hidden" id="redirect" name="redirect" value="" />
490 <input type="hidden" id="section" name="section" value="[% section | html %]" />
491 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
492 </form> <!-- /#add_notice -->
493 [% END # /IF add_form %]
495 [% IF ( add_validate or copy_validate) %]
497 <form action="[% action | html %]" method="post">
498 <input type="submit" value="OK" />
502 [% IF ( delete_confirm ) %]
503 <div class="dialog alert">
504 <h3>Delete notice?</h3>
515 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
516 <td>[% letter.module | html %]</td>
517 <td>[% letter.code | html %]</td>
518 <td>[% letter.name | html %]</td>
521 <form action="[% action | html %]" method="post">
522 <input type="hidden" name="op" value="delete_confirmed">
523 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
524 <input type="hidden" name="code" value="[% letter.code | html %]" />
525 <input type="hidden" name="module" value="[% letter.module | html %]" />
526 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
529 <form action="[% action | html %]" method="get">
530 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
533 [% END # /IF delete_confirm %]
535 [% IF ( delete_confirmed ) %]
537 <form action="[% action | html %]" method="post">
538 <input type="submit" value="OK" />
542 [% IF add_form or copy_form %]
543 </div> <!-- /.col-md-8 -->
544 </div> <!-- /.row -->
547 </div> <!-- /.col-sm-10.col-sm-push-2 -->
549 <div class="col-sm-2 col-sm-pull-10">
551 [% INCLUDE 'tools-menu.inc' %]
553 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
554 </div> <!-- /.row -->
557 [% MACRO jsinclude BLOCK %]
558 [% Asset.js("js/tools-menu.js") | $raw %]
559 [% INCLUDE 'datatables.inc' %]
560 [% INCLUDE 'columns_settings.inc' %]
561 [% Asset.js("lib/hc-sticky.js") | $raw %]
562 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
564 var no_op_set = '[% no_op_set | html %]';
565 var interface = '[% interface | html %]';
566 var theme = '[% theme | html %]';
567 var add_form = '[% add_form | html %]';
568 var copy_form = '[% copy_form | html %]';
569 var code = '[% code | html %]';
570 var new_lettercode = '[% new_lettercode | html %]';
571 var new_branchcode = '[% new_branchcode | html %]';
572 var columns_settings = [% TablesSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
574 [% Asset.js("js/letter.js") | $raw %]
577 [% INCLUDE 'intranet-bottom.inc' %]