6 [% USE TablesSettings %]
8 [% INCLUDE 'doc-head-open.inc' %]
10 [% IF ( add_form or copy_form ) %]
12 Modify notice › [% ELSE %]
13 Add notice › [% END %]
16 [% IF ( add_validate or copy_validate) %]
17 Notice added › [% END %]
19 [% IF ( delete_confirm ) %]
20 Confirm deletion › [% END %]
22 Notices › Tools › Koha
24 [% INCLUDE 'doc-head-close.inc' %]
25 <style>#preview_template .modal-dialog { width : 80%; } .spinner { display: none; } @media (max-width: 767px) { #preview_template { margin: 0; width : auto; } }</style>
28 <body id="tools_letter" class="tools">
29 [% INCLUDE 'header.inc' %]
30 [% INCLUDE 'letters-search.inc' %]
32 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
35 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
38 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
41 [% IF ( add_form or copy_form) %]
44 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
47 <a href="#" aria-current="page">
53 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
56 <a href="#" aria-current="page">
62 [% IF ( add_validate or copy_validate) %]
64 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
67 <a href="#" aria-current="page">
72 [% IF ( delete_confirm ) %]
74 <a href="/cgi-bin/koha/tools/letter.pl">Notices & slips</a>
77 <a href="#" aria-current="page">
83 <a href="#" aria-current="page">
91 </nav> <!-- /#breadcrumbs -->
93 <div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
94 <div class="modal-dialog modal-lg">
95 <div class="modal-content">
96 <div class="modal-header">
97 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
98 <h3 id="preview_template_label">Preview notice template</h3>
100 <div class="modal-body">
102 <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading
105 <div class="modal-footer">
106 <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
107 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
109 </div> <!-- /.modal-content -->
110 </div> <!-- /.modal-dialog -->
111 </div> <!-- /#preview_template -->
113 [% IF add_form or copy_form %]
114 <div class="main container-fluid">
116 <div class="col-md-8 col-md-offset-2">
118 <div class="main container-fluid">
120 <div class="col-sm-10 col-sm-push-2">
124 [% IF ( no_op_set ) %]
125 <h1>Notices & slips</h1>
126 <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
127 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
128 [% UNLESS independant_branch %]
131 <select name="branchcode" id="branch" style="width:20em;">
132 <option value="*">All libraries</option>
133 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
137 </form> <!-- /#selectlibrary -->
139 <div id="toolbar" class="btn-toolbar">
140 <div class="btn-group">
141 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New notice <span class="caret"></span></button>
142 <ul class="dropdown-menu">
143 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=acquisition">Acquisition</a></li>
144 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=catalogue">Catalog</a></li>
145 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation">Circulation</a></li>
146 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimacquisition">Claim acquisition</a></li>
147 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues">Claim serial issue</a></li>
148 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=reserves">Holds</a></li>
149 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=ill">Interlibrary loans</a></li>
150 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=orderacquisition">Order acquisition</a></li>
151 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=members">Patrons</a></li>
152 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=serial">Serials (new issue)</a></li>
153 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=suggestions">Suggestions</a></li>
154 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=pos">Point of sale</a></li>
157 </div> <!-- /#toolbar -->
160 <p>You searched for <strong>[% searchfield | html %]</strong></p>
163 [% IF ( letter && !independant_branch) %]
164 [% select_for_copy = BLOCK %]
165 <select name="branchcode">
166 [% FOREACH l IN Branches.all() %]
167 <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
181 <th>Last updated</th>
182 <th class="NoSort noExport">Copy notice</th>
183 <th class="NoSort noExport">Actions</th>
187 [% FOREACH lette IN letter %]
188 [% can_edit = lette.branchcode || !independant_branch %]
191 [% IF lette.branchname %]
192 [% lette.branchname | html %]
198 [% SWITCH lette.module %]
199 [% CASE 'acquisition' %]<span>Acquisition</span>
200 [% CASE 'catalogue' %]<span>Catalog</span>
201 [% CASE 'circulation' %]<span>Circulation</span>
202 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
203 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
204 [% CASE 'claimissues' %]<span>Claim serial issue</span>
205 [% CASE 'reserves' %]<span>Holds</span>
206 [% CASE 'ill' %]<span>Interlibrary loans</span>
207 [% CASE 'members' %]<span>Patrons</span>
208 [% CASE 'serial' %]<span>Serials (new issue)</span>
209 [% CASE 'suggestions' %]<span>Suggestions</span>
210 [% CASE 'pos' %]<span>Point of sale</span>
211 [% CASE %]<span>[% lette.module | html %]</span>
214 <td>[% lette.code | html %]</td>
215 <td>[% lette.name | html %]</td>
216 <td data-order="[% lette.updated_on | html %]">[% lette.updated_on | $KohaDates with_hours = 1 %]</td>
218 [% IF !independant_branch || !lette.branchcode %]
219 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
220 <input type="hidden" name="op" value="copy_form" />
221 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
222 <input type="hidden" name="module" value="[% lette.module | html %]" />
223 <input type="hidden" name="code" value="[% lette.code | html %]" />
224 [% IF independant_branch %]
225 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
227 [% select_for_copy | $raw %]
229 <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
231 [% END # /IF !independent_branch %]
235 <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>
237 [% IF !lette.protected && can_edit %]
238 <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>
242 [% END # /FOREACH lette %]
244 </table> <!-- /#lettert -->
245 [% ELSE # IF lette %]
246 <div class="dialog message">
247 [% IF ( branchcode ) %]
248 <p>There are no notices for this library.</p>
250 <p>There are no notices.</p>
253 [% END # /IF lette %]
254 [% END # /IF no_op_set %]
256 [% IF add_form or copy_form %]
257 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
259 <div id="toolbar" class="btn-toolbar">
260 <div class="btn-group">
261 <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
262 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
263 <span class="caret"></span>
265 <ul class="dropdown-menu">
266 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
269 <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
270 </div> <!-- /#toolbar -->
272 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
274 <input type="hidden" name="op" id="op" value="add_validate" />
276 <input type="hidden" name="op" id="op" value="copy_validate" />
279 <input type="hidden" name="checked" value="0" />
282 <input type="hidden" name="add" value="0" />
284 <input type="hidden" name="add" value="1" />
287 <fieldset class="rows">
288 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
289 [% IF independant_branch %]
290 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
296 <label for="branch">Library:</label>
297 <select name="branchcode" id="branch" style="width:20em;">
298 <option value="">All libraries</option>
299 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
302 <span class="label">Library:</span>
303 <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
304 [% IF ( branchcode ) %]
305 [% Branches.GetName( branchcode ) | html %]
311 [% END # /IF independant_branch %]
313 <label for="module">Koha module:</label>
314 <input type="hidden" name="oldmodule" value="[% module | html %]" />
316 <select name="module" id="newmodule">
318 <select name="module" id="module">
320 [% IF ( module == "acquisition" ) %]
321 <option value="acquisition" selected="selected">Acquisition</option>
323 <option value="acquisition" >Acquisition</option>
325 [% IF ( module == "catalogue" ) %]
326 <option value="catalogue" selected="selected">Catalog</option>
328 <option value="catalogue" >Catalog</option>
330 [% IF ( module == "circulation" ) %]
331 <option value="circulation" selected="selected">Circulation</option>
333 <option value="circulation">Circulation</option>
335 [% IF ( module == "orderacquisition" ) %]
336 <option value="orderacquisition" selected="selected">Order acquisition</option>
338 <option value="orderacquisition">Order acquisition</option>
340 [% IF ( module == "claimacquisition" ) %]
341 <option value="claimacquisition" selected="selected">Claim acquisition</option>
343 <option value="claimacquisition">Claim acquisition</option>
345 [% IF ( module == "claimissues" ) %]
346 <option value="claimissues" selected="selected">Claim serial issue</option>
348 <option value="claimissues">Claim serial issue</option>
350 [% IF ( module == "reserves" ) %]
351 <option value="reserves" selected="selected">Holds</option>
353 <option value="reserves">Holds</option>
355 [% IF ( module == "ill" ) %]
356 <option value="ill" selected="selected">Interlibrary loans</option>
358 <option value="ill">Interlibrary loans</option>
360 [% IF ( module == "members" ) %]
361 <option value="members" selected="selected">Patrons</option>
363 <option value="members">Patrons</option>
365 [% IF ( module == "serial" ) %]
366 <option value="serial" selected="selected">Serials (new issue)</option>
368 <option value="serial">Serials (new issue)</option>
370 [% IF ( module == "suggestions" ) %]
371 <option value="suggestions" selected="selected">Suggestions</option>
373 <option value="suggestions">Suggestions</option>
375 [% IF ( module == "pos" ) %]
376 <option value="pos" selected="selected">Point of sale</option>
378 <option value="pos">Point of sale</option>
384 <label for="code" class="required">Code:</label>
385 <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
386 <span class="required">Required</span>
388 <span class="label">Code:</span>
389 <input type="hidden" id="code" name="code" value="[% code | html %]" />
394 <label for="name" class="required">Name:</label>
395 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
396 <span class="required">Required</span>
398 [% IF code and preview_is_available%]
400 <label for="name">Data for preview:</label>
403 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
404 [% CASE 'CHECKOUT' %]
405 <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
406 [% CASE 'HOLD_SLIP' %]
407 <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
414 </fieldset> <!-- /#add_notice -->
416 [% IF Koha.Preference('TranslateNotices') %]
417 <div style="clear:both"></div>
420 <li><a href="#lang_default">Default</a></li>
421 [% FOR language IN languages %]
422 [% FOR sublanguage IN language.sublanguages_loop %]
423 [% IF language.plural %]
424 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
426 <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
431 [% END # /IF TranslateNotices %]
433 [% FOREACH lang IN letters.keys %]
434 <div id="lang_[% lang | html %]">
435 <div class="transport-types" style="clear:both">
436 [% FOR mtt IN letters.$lang.templates.keys.sort %]
437 [% SET letter = letters.$lang.templates.$mtt %]
438 [% NEXT IF letter.message_transport_type == "itiva" && !Koha.Preference('TalkingTechItivaPhoneNotification') %]
439 [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %]
441 [% SWITCH letter.message_transport_type %]
455 [% letter.message_transport_type | html %]
458 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
459 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
460 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
462 <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
465 [% IF ( letter.updated_on ) %]
467 <label for="updated_on_[% letter.message_transport_type | html %]_[% lang | html %]">Last updated:</label>
468 [% letter.updated_on | $KohaDates with_hours = 1 %]
472 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
473 <input type="hidden" name="lang" value="[% lang | html %]" />
474 <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
475 [% IF letter.is_html %]
476 <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" />
478 <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" />
482 <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 %]" />
485 <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
486 [% IF letter.message_transport_type == 'sms' %]
487 <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>
492 <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
493 [% FOREACH SQLfieldname IN SQLfieldnames %]
494 <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
499 <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>
502 <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>
507 [% IF preview_is_available %]
509 <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>
513 </fieldset> <!-- /.rows.mtt -->
516 </div> <!-- / #transport-types -->
517 [% END # /FOREACH lang %]
519 [% IF Koha.Preference('TranslateNotices') %]
523 <input type="hidden" id="redirect" name="redirect" value="" />
524 <input type="hidden" id="section" name="section" value="[% section | html %]" />
525 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
526 </form> <!-- /#add_notice -->
527 [% END # /IF add_form %]
529 [% IF ( add_validate or copy_validate) %]
531 <form action="[% action | html %]" method="post">
532 <input type="submit" value="OK" />
536 [% IF ( delete_confirm ) %]
537 <div class="dialog alert">
538 <h3>Delete notice?</h3>
549 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %](All libraries)[% END %]</td>
550 <td>[% letter.module | html %]</td>
551 <td>[% letter.code | html %]</td>
552 <td>[% letter.name | html %]</td>
555 <form action="[% action | html %]" method="post">
556 <input type="hidden" name="op" value="delete_confirmed">
557 <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
558 <input type="hidden" name="code" value="[% letter.code | html %]" />
559 <input type="hidden" name="module" value="[% letter.module | html %]" />
560 <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
563 <form action="[% action | html %]" method="get">
564 <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
567 [% END # /IF delete_confirm %]
569 [% IF ( delete_confirmed ) %]
571 <form action="[% action | html %]" method="post">
572 <input type="submit" value="OK" />
576 [% IF add_form or copy_form %]
577 </div> <!-- /.col-md-8 -->
578 </div> <!-- /.row -->
581 </div> <!-- /.col-sm-10.col-sm-push-2 -->
583 <div class="col-sm-2 col-sm-pull-10">
585 [% INCLUDE 'tools-menu.inc' %]
587 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
588 </div> <!-- /.row -->
591 [% MACRO jsinclude BLOCK %]
592 [% Asset.js("js/tools-menu.js") | $raw %]
593 [% INCLUDE 'datatables.inc' %]
594 [% INCLUDE 'columns_settings.inc' %]
595 [% Asset.js("lib/hc-sticky.js") | $raw %]
596 [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
598 var no_op_set = '[% no_op_set | html %]';
599 var interface = '[% interface | html %]';
600 var theme = '[% theme | html %]';
601 var add_form = '[% add_form | html %]';
602 var copy_form = '[% copy_form | html %]';
603 var code = '[% code | html %]';
604 var new_lettercode = '[% new_lettercode | html %]';
605 var new_branchcode = '[% new_branchcode | html %]';
606 var columns_settings = [% TablesSettings.GetColumns( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
608 [% Asset.js("js/letter.js") | $raw %]
611 [% INCLUDE 'intranet-bottom.inc' %]