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=orderacquisition">Order acquisition</a></li>
116 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=members">Patrons</a></li>
117 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=serial">Serials (new issue)</a></li>
118 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=suggestions">Suggestions</a></li>
119 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=pos">Point of sale</a></li>
122 </div> <!-- /#toolbar -->
125 <p>You searched for <strong>[% searchfield | html %]</strong></p>
128 [% IF ( letter && !independant_branch) %]
129 [% select_for_copy = BLOCK %]
130 <select name="branchcode">
131 [% FOREACH l IN Branches.all() %]
132 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
146 <th class="title-string">Last updated</th>
147 <th class="nosort">Copy notice</th>
148 <th class="nosort">Actions</th>
152 [% FOREACH lette IN letter %]
153 [% can_edit = lette.branchcode || !independant_branch %]
156 [% IF lette.branchname %]
157 [% lette.branchname | html %]
163 [% SWITCH lette.module %]
164 [% CASE 'acquisition' %]<span>Acquisition</span>
165 [% CASE 'catalogue' %]<span>Catalog</span>
166 [% CASE 'circulation' %]<span>Circulation</span>
167 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
168 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
169 [% CASE 'claimissues' %]<span>Claim serial issue</span>
170 [% CASE 'reserves' %]<span>Holds</span>
171 [% CASE 'members' %]<span>Patrons</span>
172 [% CASE 'serial' %]<span>Serials (new issue)</span>
173 [% CASE 'suggestions' %]<span>Suggestions</span>
174 [% CASE 'pos' %]<span>Point of sale</span>
175 [% CASE %]<span>[% lette.module | html %]</span>
178 <td>[% lette.code | html %]</td>
179 <td>[% lette.name | html %]</td>
180 <td><span title="[% lette.updated_on | $KohaDates with_hours = 1 %]">[% lette.updated_on | $KohaDates with_hours = 1 %]</span></td>
182 [% IF !independant_branch || !lette.branchcode %]
183 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
184 <input type="hidden" name="op" value="copy_form" />
185 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
186 <input type="hidden" name="module" value="[% lette.module | html %]" />
187 <input type="hidden" name="code" value="[% lette.code | html %]" />
188 [% IF independant_branch %]
189 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
191 [% select_for_copy | $raw %]
193 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
195 [% END # /IF !independent_branch %]
199 <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>
201 [% IF !lette.protected && can_edit %]
202 <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>
206 [% END # /FOREACH lette %]
208 </table> <!-- /#lettert -->
209 [% ELSE # IF lette %]
210 <div class="dialog message">
211 [% IF ( branchcode ) %]
212 <p>There are no notices for this library.</p>
214 <p>There are no notices.</p>
217 [% END # /IF lette %]
218 [% END # /IF no_op_set %]
220 [% IF add_form or copy_form %]
221 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
223 <div id="toolbar" class="btn-toolbar">
224 <div class="btn-group">
225 <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
226 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
227 <span class="caret"></span>
229 <ul class="dropdown-menu">
230 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
233 <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
234 </div> <!-- /#toolbar -->
236 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
238 <input type="hidden" name="op" id="op" value="add_validate" />
240 <input type="hidden" name="op" id="op" value="copy_validate" />
243 <input type="hidden" name="checked" value="0" />
246 <input type="hidden" name="add" value="0" />
248 <input type="hidden" name="add" value="1" />
251 <fieldset class="rows">
252 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
253 [% IF independant_branch %]
254 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
260 <label for="branch">Library:</label>
261 <select name="branchcode" id="branch" style="width:20em;">
262 <option value="">All libraries</option>
263 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
266 <span class="label">Library:</span>
267 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
268 [% IF ( branchcode ) %]
269 [% Branches.GetName( branchcode ) | html %]
275 [% END # /IF independant_branch %]
277 <label for="module">Koha module:</label>
278 <input type="hidden" name="oldmodule" value="[% module | html %]" />
280 <select name="module" id="newmodule">
282 <select name="module" id="module">
284 [% IF ( module == "acquisition" ) %]
285 <option value="acquisition" selected="selected">Acquisition</option>
287 <option value="acquisition" >Acquisition</option>
289 [% IF ( module == "catalogue" ) %]
290 <option value="catalogue" selected="selected">Catalog</option>
292 <option value="catalogue" >Catalog</option>
294 [% IF ( module == "circulation" ) %]
295 <option value="circulation" selected="selected">Circulation</option>
297 <option value="circulation">Circulation</option>
299 [% IF ( module == "orderacquisition" ) %]
300 <option value="orderacquisition" selected="selected">Order acquisition</option>
302 <option value="orderacquisition">Order acquisition</option>
304 [% IF ( module == "claimacquisition" ) %]
305 <option value="claimacquisition" selected="selected">Claim acquisition</option>
307 <option value="claimacquisition">Claim acquisition</option>
309 [% IF ( module == "claimissues" ) %]
310 <option value="claimissues" selected="selected">Claim serial issue</option>
312 <option value="claimissues">Claim serial issue</option>
314 [% IF ( module == "reserves" ) %]
315 <option value="reserves" selected="selected">Holds</option>
317 <option value="reserves">Holds</option>
319 [% IF ( module == "members" ) %]
320 <option value="members" selected="selected">Patrons</option>
322 <option value="members">Patrons</option>
324 [% IF ( module == "serial" ) %]
325 <option value="serial" selected="selected">Serials (new issue)</option>
327 <option value="serial">Serials (new issue)</option>
329 [% IF ( module == "suggestions" ) %]
330 <option value="suggestions" selected="selected">Suggestions</option>
332 <option value="suggestions">Suggestions</option>
334 [% IF ( module == "pos" ) %]
335 <option value="pos" selected="selected">Point of sale</option>
337 <option value="pos">Point of sale</option>
343 <label for="code" class="required">Code:</label>
344 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
345 <span class="required">Required</span>
347 <span class="label">Code:</span>
348 <input type="hidden" id="code" name="code" value="[% code | html %]" />
353 <label for="name" class="required">Name:</label>
354 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
355 <span class="required">Required</span>
357 [% IF code and preview_is_available%]
359 <label for="name">Data for preview:</label>
362 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
363 [% CASE 'CHECKOUT' %]
364 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
365 [% CASE 'HOLD_SLIP' %]
366 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
373 </fieldset> <!-- /#add_notice -->
375 [% IF Koha.Preference('TranslateNotices') %]
376 <div style="clear:both"></div>
379 <li><a href="#lang_default">Default</a></li>
380 [% FOR language IN languages %]
381 [% FOR sublanguage IN language.sublanguages_loop %]
382 [% IF language.plural %]
383 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
385 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
390 [% END # /IF TranslateNotices %]
392 [% FOREACH lang IN letters.keys %]
393 <div id="lang_[% lang | html %]">
394 <div class="transport-types" style="clear:both">
395 [% FOR mtt IN letters.$lang.templates.keys.sort %]
396 [% SET letter = letters.$lang.templates.$mtt %]
397 [% NEXT IF letter.message_transport_type == "itiva" && !Koha.Preference('TalkingTechItivaPhoneNotification') %]
398 [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %]
400 [% SWITCH letter.message_transport_type %]
414 [% letter.message_transport_type | html %]
417 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
418 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
419 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
421 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
424 [% IF ( letter.updated_on ) %]
426 <label for="updated_on_[% letter.message_transport_type | html %]_[% lang | html %]">Last updated:</label>
427 [% letter.updated_on | $KohaDates with_hours = 1 %]
431 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
432 <input type="hidden" name="lang" value="[% lang | html %]" />
433 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
434 [% IF letter.is_html %]
435 <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" />
437 <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" />
441 <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 %]" />
444 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
445 [% IF letter.message_transport_type == 'sms' %]
446 <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>
451 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
452 [% FOREACH SQLfieldname IN SQLfieldnames %]
453 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
458 <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>
461 <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>
466 [% IF preview_is_available %]
468 <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>
472 </fieldset> <!-- /.rows.mtt -->
475 </div> <!-- / #transport-types -->
476 [% END # /FOREACH lang %]
478 [% IF Koha.Preference('TranslateNotices') %]
482 <input type="hidden" id="redirect" name="redirect" value="" />
483 <input type="hidden" id="section" name="section" value="[% section | html %]" />
484 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
485 </form> <!-- /#add_notice -->
486 [% END # /IF add_form %]
488 [% IF ( add_validate or copy_validate) %]
490 <form action="[% action | html %]" method="post">
491 <input type="submit" value="OK" />
495 [% IF ( delete_confirm ) %]
496 <div class="dialog alert">
497 <h3>Delete notice?</h3>
508 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
509 <td>[% letter.module | html %]</td>
510 <td>[% letter.code | html %]</td>
511 <td>[% letter.name | html %]</td>
514 <form action="[% action | html %]" method="post">
515 <input type="hidden" name="op" value="delete_confirmed">
516 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
517 <input type="hidden" name="code" value="[% letter.code | html %]" />
518 <input type="hidden" name="module" value="[% letter.module | html %]" />
519 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
522 <form action="[% action | html %]" method="get">
523 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
526 [% END # /IF delete_confirm %]
528 [% IF ( delete_confirmed ) %]
530 <form action="[% action | html %]" method="post">
531 <input type="submit" value="OK" />
535 [% IF add_form or copy_form %]
536 </div> <!-- /.col-md-8 -->
537 </div> <!-- /.row -->
540 </div> <!-- /.col-sm-10.col-sm-push-2 -->
542 <div class="col-sm-2 col-sm-pull-10">
544 [% INCLUDE 'tools-menu.inc' %]
546 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
547 </div> <!-- /.row -->
550 [% MACRO jsinclude BLOCK %]
551 [% Asset.js("js/tools-menu.js") | $raw %]
552 [% INCLUDE 'datatables.inc' %]
553 [% INCLUDE 'columns_settings.inc' %]
554 [% Asset.js("lib/hc-sticky.js") | $raw %]
555 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
557 var no_op_set = '[% no_op_set | html %]';
558 var interface = '[% interface | html %]';
559 var theme = '[% theme | html %]';
560 var add_form = '[% add_form | html %]';
561 var copy_form = '[% copy_form | html %]';
562 var code = '[% code | html %]';
563 var new_lettercode = '[% new_lettercode | html %]';
564 var new_branchcode = '[% new_branchcode | html %]';
565 var columns_settings = [% TablesSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
567 [% Asset.js("js/letter.js") | $raw %]
570 [% INCLUDE 'intranet-bottom.inc' %]