Bug 23991: (follow-up) Silence useless warnings
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / letter.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE TablesSettings %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>
10     [% IF ( add_form or copy_form ) %]
11         [% IF ( modify ) %]
12             Modify notice &rsaquo; [% ELSE %]
13             Add notice &rsaquo; [% END %]
14     [% END %]
15
16     [% IF ( add_validate or copy_validate) %]
17         Notice added &rsaquo; [% END %]
18
19     [% IF ( delete_confirm ) %]
20         Confirm deletion &rsaquo; [% END %]
21
22     Notices &rsaquo; Tools &rsaquo; Koha
23 </title>
24 [% INCLUDE 'doc-head-close.inc' %]
25 [% FILTER collapse %]
26     <style>
27         #preview_template .modal-dialog {
28             width : 80%;
29         }
30         .spinner {
31             display: none;
32         }
33         @media (max-width: 767px) {
34             #preview_template {
35                 margin: 0; width : auto;
36             }
37         }
38         .panel-body fieldset.rows {
39             border: 0;
40             background: transparent none;
41             margin: 0 0 .5em 0;
42         }
43         #tabs,
44         .panel-group {
45             margin-top: 3px;
46         }
47     </style>
48 [% END %]
49 </head>
50
51 <body id="tools_letter" class="tools">
52     [% INCLUDE 'header.inc' %]
53     [% INCLUDE 'letters-search.inc' %]
54
55     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
56         <ol>
57             <li>
58                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
59             </li>
60             <li>
61                 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
62             </li>
63
64             [% IF ( add_form or copy_form) %]
65                 [% IF ( modify ) %]
66                     <li>
67                         <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
68                     </li>
69                     <li>
70                         <a href="#" aria-current="page">
71                             Modify notice
72                         </a>
73                     </li>
74                 [% ELSE %]
75                     <li>
76                         <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
77                     </li>
78                     <li>
79                         <a href="#" aria-current="page">
80                             Add notice
81                         </a>
82                     </li>
83                 [% END %]
84             [% ELSE %]
85                 [% IF ( add_validate or copy_validate) %]
86                     <li>
87                         <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
88                     </li>
89                     <li>
90                         <a href="#" aria-current="page">
91                             Notice added
92                         </a>
93                     </li>
94                 [% ELSE %]
95                     [% IF ( delete_confirm ) %]
96                         <li>
97                             <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
98                         </li>
99                         <li>
100                             <a href="#" aria-current="page">
101                                 Confirm deletion
102                             </a>
103                         </li>
104                     [% ELSE %]
105                         <li>
106                             <a href="#" aria-current="page">
107                                 Notices &amp; slips
108                             </a>
109                         </li>
110                     [% END %]
111                 [% END %]
112             [% END %]
113         </ol>
114     </nav> <!-- /#breadcrumbs -->
115
116     <div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
117         <div class="modal-dialog modal-lg">
118             <div class="modal-content">
119                 <div class="modal-header">
120                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
121                     <h3 id="preview_template_label">Preview notice template</h3>
122                 </div>
123                 <div class="modal-body">
124                     <div id="loading">
125                         <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading
126                     </div>
127                 </div>
128                 <div class="modal-footer">
129                     <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
130                     <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
131                 </div>
132             </div> <!-- /.modal-content -->
133         </div> <!-- /.modal-dialog -->
134     </div> <!-- /#preview_template -->
135
136     [% IF add_form or copy_form %]
137         <div class="main container-fluid">
138             <div class="row">
139                 <div class="col-md-8 col-md-offset-2">
140     [% ELSE %]
141         <div class="main container-fluid">
142             <div class="row">
143                 <div class="col-sm-10 col-sm-push-2">
144                     <main>
145     [% END %]
146
147                 [% IF ( no_op_set ) %]
148                     <h1>Notices &amp; slips</h1>
149                     <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
150                         <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
151                         [% UNLESS independant_branch %]
152                             <p>
153                                 Select a library:
154                                 <select name="branchcode" id="branch" style="width:20em;">
155                                     <option value="*">All libraries</option>
156                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
157                                 </select>
158                             </p>
159                         [% END %]
160                     </form> <!-- /#selectlibrary -->
161
162                     <div id="toolbar" class="btn-toolbar">
163                         <div class="btn-group">
164                             <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New notice <span class="caret"></span></button>
165                             <ul class="dropdown-menu">
166                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=acquisition">Acquisition</a></li>
167                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=catalogue">Catalog</a></li>
168                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=circulation">Circulation</a></li>
169                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=claimacquisition">Claim acquisition</a></li>
170                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=claimissues">Claim serial issue</a></li>
171                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=reserves">Holds</a></li>
172                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=ill">Interlibrary loans</a></li>
173                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=orderacquisition">Order acquisition</a></li>
174                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=members">Patrons</a></li>
175                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=serial">Serials (new issue)</a></li>
176                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=suggestions">Suggestions</a></li>
177                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=pos">Point of sale</a></li>
178                             </ul>
179                         </div>
180                     </div> <!-- /#toolbar -->
181
182                     [% IF ( search ) %]
183                         <p>You searched for <strong>[% searchfield | html %]</strong></p>
184                     [% END %]
185
186                     [% IF ( letter && !independant_branch) %]
187                         [% select_for_copy = BLOCK %]
188                             <select name="branchcode">
189                                 [% FOREACH l IN Branches.all() %]
190                                     <option value="[% l.branchcode | html %]">Copy to [% l.branchname | html %]</option>
191                                 [% END %]
192                             </select>
193                         [% END %]
194                     [% END %]
195
196                     [% IF letter %]
197                         <table id="lettert">
198                             <thead>
199                                 <tr>
200                                     <th>Library</th>
201                                     <th>Module</th>
202                                     <th>Code</th>
203                                     <th>Name</th>
204                                     <th>Last updated</th>
205                                     <th class="NoSort noExport">Copy notice</th>
206                                     <th class="NoSort noExport">Actions</th>
207                                 </tr>
208                             </thead>
209                             <tbody>
210                                 [% FOREACH lette IN letter %]
211                                     [% can_edit = lette.branchcode || !independant_branch %]
212                                     <tr>
213                                         <td>
214                                             [% IF lette.branchname %]
215                                                 [% lette.branchname | html %]
216                                             [% ELSE %]
217                                                 <span>(All libraries)</span>
218                                             [% END %]
219                                         </td>
220                                         <td>
221                                             [% SWITCH lette.module %]
222                                                 [% CASE 'acquisition' %]<span>Acquisition</span>
223                                                 [% CASE 'catalogue' %]<span>Catalog</span>
224                                                 [% CASE 'circulation' %]<span>Circulation</span>
225                                                 [% CASE 'orderacquisition' %]<span>Order acquisition</span>
226                                                 [% CASE 'claimacquisition' %]<span>Claim acquisition</span>
227                                                 [% CASE 'claimissues' %]<span>Claim serial issue</span>
228                                                 [% CASE 'reserves' %]<span>Holds</span>
229                                                 [% CASE 'ill' %]<span>Interlibrary loans</span>
230                                                 [% CASE 'members' %]<span>Patrons</span>
231                                                 [% CASE 'serial' %]<span>Serials (new issue)</span>
232                                                 [% CASE 'suggestions' %]<span>Suggestions</span>
233                                                 [% CASE 'pos' %]<span>Point of sale</span>
234                                                 [% CASE %]<span>[% lette.module | html %]</span>
235                                             [% END %]
236                                         </td>
237                                         <td>[% lette.code | html %]</td>
238                                         <td>[% lette.name | html %]</td>
239                                         <td data-order="[% lette.updated_on | html %]">[% lette.updated_on | $KohaDates with_hours = 1 %]</td>
240                                         <td class="actions">
241                                             [% IF !independant_branch || !lette.branchcode %]
242                                                 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
243                                                     <input type="hidden" name="op" value="copy_form" />
244                                                     <input type="hidden" name="oldbranchcode" value="[% lette.branchcode | html %]" />
245                                                     <input type="hidden" name="module" value="[% lette.module | html %]" />
246                                                     <input type="hidden" name="code" value="[% lette.code | html %]" />
247                                                     [% IF independant_branch %]
248                                                         <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
249                                                     [% ELSE %]
250                                                         [% select_for_copy | $raw %]
251                                                     [% END %]
252                                                     <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
253                                                 </form>
254                                             [% END # /IF !independent_branch %]
255                                         </td>
256                                         <td class="actions">
257                                             [% IF can_edit %]
258                                                 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;branchcode=[% lette.branchcode | html %]&amp;module=[% lette.module | html %]&amp;code=[% lette.code | html %]"><i class="fa fa-pencil"></i> Edit</a>
259                                             [% END %]
260                                             [% IF !lette.protected && can_edit %]
261                                                 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/letter.pl?op=delete_confirm&amp;branchcode=[% lette.branchcode | html %]&amp;module=[% lette.module | html %]&amp;code=[% lette.code | html %]"><i class="fa fa-trash"></i> Delete</a>
262                                             [% END %]
263                                         </td>
264                                     </tr>
265                                 [% END # /FOREACH lette %]
266                             </tbody>
267                         </table> <!-- /#lettert -->
268                     [% ELSE # IF lette %]
269                         <div class="dialog message">
270                             [% IF ( branchcode ) %]
271                                 <p>There are no notices for this library.</p>
272                             [% ELSE %]
273                                 <p>There are no notices.</p>
274                             [% END %]
275                         </div>
276                     [% END # /IF lette %]
277                 [% END # /IF no_op_set %]
278
279                 [% IF add_form or copy_form %]
280                     <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
281
282                     <div id="toolbar" class="btn-toolbar">
283                         <div class="btn-group">
284                             <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
285                             <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
286                             <span class="caret"></span>
287                             </button>
288                             <ul class="dropdown-menu">
289                                 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
290                             </ul>
291                         </div>
292                         <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
293                     </div> <!-- /#toolbar -->
294
295                     <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
296                         [% IF add_form %]
297                             <input type="hidden" name="op" id="op" value="add_validate" />
298                         [% ELSE %]
299                             <input type="hidden" name="op" id="op" value="copy_validate" />
300                         [% END %]
301
302                         <input type="hidden" name="checked" value="0" />
303
304                         [% IF ( modify ) %]
305                             <input type="hidden" name="add" value="0" />
306                         [% ELSE %]
307                             <input type="hidden" name="add" value="1" />
308                         [% END %]
309
310                         <fieldset class="rows">
311                             <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
312                             [% IF independant_branch %]
313                                 <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
314                                 <ol>
315                             [% ELSE %]
316                                 <ol>
317                                     <li>
318                                         [% IF adding %]
319                                             <label for="branch">Library:</label>
320                                             <select name="branchcode" id="branch" style="width:20em;">
321                                                 <option value="">All libraries</option>
322                                                 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
323                                             </select>
324                                         [% ELSE %]
325                                             <span class="label">Library:</span>
326                                             <input type="hidden" id="branch" name="branchcode" value="[% branchcode | html %]" />
327                                             [% IF ( branchcode ) %]
328                                                [% Branches.GetName( branchcode ) | html %]
329                                             [% ELSE %]
330                                                 <span>All libraries</span>
331                                             [% END %]
332                                         [% END %]
333                                     </li>
334                             [% END # /IF independant_branch %]
335                                 <li>
336                                     <label for="module">Koha module:</label>
337                                     <input type="hidden" name="oldmodule" value="[% module | html %]" />
338                                     [% IF adding  %]
339                                         <select name="module" id="newmodule">
340                                     [% ELSE %]
341                                         <select name="module" id="module">
342                                     [% END %]
343                                     [% IF ( module == "acquisition" ) %]
344                                         <option value="acquisition" selected="selected">Acquisition</option>
345                                     [% ELSE %]
346                                         <option value="acquisition" >Acquisition</option>
347                                     [% END %]
348                                     [% IF ( module == "catalogue" ) %]
349                                         <option value="catalogue" selected="selected">Catalog</option>
350                                     [% ELSE %]
351                                         <option value="catalogue" >Catalog</option>
352                                     [% END %]
353                                     [% IF ( module == "circulation" ) %]
354                                         <option value="circulation" selected="selected">Circulation</option>
355                                     [% ELSE %]
356                                         <option value="circulation">Circulation</option>
357                                     [% END %]
358                                     [% IF ( module == "orderacquisition" ) %]
359                                         <option value="orderacquisition" selected="selected">Order acquisition</option>
360                                     [% ELSE %]
361                                         <option value="orderacquisition">Order acquisition</option>
362                                     [% END %]
363                                     [% IF ( module == "claimacquisition" ) %]
364                                         <option value="claimacquisition" selected="selected">Claim acquisition</option>
365                                     [% ELSE %]
366                                         <option value="claimacquisition">Claim acquisition</option>
367                                     [% END %]
368                                     [% IF ( module == "claimissues" ) %]
369                                         <option value="claimissues" selected="selected">Claim serial issue</option>
370                                     [% ELSE %]
371                                         <option value="claimissues">Claim serial issue</option>
372                                     [% END %]
373                                     [% IF ( module == "reserves" ) %]
374                                         <option value="reserves" selected="selected">Holds</option>
375                                     [% ELSE %]
376                                         <option value="reserves">Holds</option>
377                                     [% END %]
378                                     [% IF ( module == "ill" ) %]
379                                       <option value="ill" selected="selected">Interlibrary loans</option>
380                                     [% ELSE %]
381                                       <option value="ill">Interlibrary loans</option>
382                                     [% END %]
383                                     [% IF ( module == "members" ) %]
384                                         <option value="members" selected="selected">Patrons</option>
385                                     [% ELSE %]
386                                         <option value="members">Patrons</option>
387                                     [% END %]
388                                     [% IF ( module == "serial" ) %]
389                                         <option value="serial" selected="selected">Serials (new issue)</option>
390                                     [% ELSE %]
391                                         <option value="serial">Serials (new issue)</option>
392                                     [% END %]
393                                     [% IF ( module == "suggestions" ) %]
394                                         <option value="suggestions" selected="selected">Suggestions</option>
395                                     [% ELSE %]
396                                         <option value="suggestions">Suggestions</option>
397                                     [% END %]
398                                     [% IF ( module == "pos" ) %]
399                                         <option value="pos" selected="selected">Point of sale</option>
400                                     [% ELSE %]
401                                         <option value="pos">Point of sale</option>
402                                     [% END %]
403                                 </select>
404                             </li>
405                             <li>
406                                 [% IF adding %]
407                                     <label for="code" class="required">Code:</label>
408                                     <input type="text" id="code" name="code" size="20" maxlength="20" value="" required="required"/>
409                                     <span class="required">Required</span>
410                                 [% ELSE %]
411                                     <span class="label">Code:</span>
412                                     <input type="hidden" id="code" name="code" value="[% code | html %]" />
413                                     [% code | html %]
414                                 [% END %]
415                             </li>
416                             <li>
417                                 <label for="name" class="required">Name:</label>
418                                 <input type="text" id="name" name="name" size="60" value="[% letter_name | html %]" required="required" />
419                                 <span class="required">Required</span>
420                             </li>
421                             [% IF code and preview_is_available%]
422                                 <li>
423                                     <label for="name">Data for preview:</label>
424                                     [% SWITCH code %]
425                                         [% CASE 'CHECKIN' %]
426                                             <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
427                                         [% CASE 'CHECKOUT' %]
428                                             <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
429                                         [% CASE 'HOLD_SLIP' %]
430                                             <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
431                                         [% CASE %]
432                                             Not supported yet.
433                                     [% END %]
434                                     </li>
435                             [% END # /IF code %]
436                         </ol>
437                     </fieldset> <!-- /#add_notice -->
438
439                     [% IF Koha.Preference('TranslateNotices') %]
440                         <div style="clear:both"></div>
441                         <div id="tabs">
442                             <!-- Nav tabs -->
443                             <ul class="nav nav-tabs" role="tablist">
444                                 <li role="presentation">
445                                     <a href="#lang_default" aria-controls="lang_default" role="tab" data-toggle="tab">Default</a>
446                                 </li>
447                                 [% FOR language IN languages %]
448                                     [% FOR sublanguage IN language.sublanguages_loop %]
449                                         [% IF language.plural %]
450                                             <li role="presentation">
451                                                 <a href="#lang_[% sublanguage.rfc4646_subtag | uri %]" aria-controls="lang_[% sublanguage.rfc4646_subtag | uri %]" role="tab" data-toggle="tab">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a>
452                                             </li>
453                                         [% ELSE %]
454                                             <li role="presentation">
455                                                 <a href="#lang_[% sublanguage.rfc4646_subtag | uri %]" aria-controls="lang_[% sublanguage.rfc4646_subtag | uri %]" role="tab" data-toggle="tab">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a>
456                                             </li>
457                                         [% END %]
458                                     [% END %]
459                                 [% END %]
460                             </ul>
461                             <div class="tab-content">
462                     [% ELSE %]
463                         <div style="clear:both"></div>
464                     [% END # /IF TranslateNotices %]
465
466                     [% FOREACH lang IN letters.keys %]
467                         <div role="tabpanel" class="tab-pane" id="lang_[% lang | html %]">
468                             <div class="panel-group" id="group_[% lang | html %]" role="tablist" aria-multiselectable="true">
469                             [% FOR mtt IN letters.$lang.templates.keys.sort %]
470                                 [% SET letter = letters.$lang.templates.$mtt %]
471                                 [% NEXT IF letter.message_transport_type == "itiva" && !Koha.Preference('TalkingTechItivaPhoneNotification') %]
472                                 [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %]
473                                 <div class="panel panel-default">
474                                     <div class="panel-heading" role="tab" id="[% letter.message_transport_type | html %]_[% lang | html %]Heading">
475                                         <h3 class="panel-title">
476                                             <a role="button" class="collapsed" data-toggle="collapse" data-parent="#group_[% lang | html %]" href="#[% letter.message_transport_type | html %]_[% lang | html %]" aria-expanded="false" aria-controls="[% letter.message_transport_type | html %]_[% lang | html %]">
477                                                 [% SWITCH letter.message_transport_type %]
478                                                     [% CASE 'email' %]<span>Email</span>
479                                                     [% CASE 'print' %]<span>Print</span>
480                                                     [% CASE 'sms' %]<span>SMS</span>
481                                                     [% CASE 'feed' %]<span>Feed</span>
482                                                     [% CASE 'itiva' %]<span>Phone ( Itiva )</span>
483                                                     [% CASE 'phone' %]<span>Phone</span>
484                                                     [% CASE %]<span>[% letter.message_transport_type | html %]</span>
485                                                 [% END %]
486                                             </a>
487                                         </h3>
488                                     </div> <!-- /.panel-heading -->
489                                     <div id="[% letter.message_transport_type | html %]_[% lang | html %]" class="panel-collapse collapse" role="tabpanel" aria-labelledby="[% letter.message_transport_type | html %]_[% lang | html %]Heading">
490                                         <div class="panel-body">
491                                             [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
492                                                 <fieldset class="rows mtt" disabled="disabled">
493                                                     <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
494                                             [% ELSE %]
495                                                 <fieldset class="rows mtt">
496                                             [% END %]
497                                                 <ol>
498                                                     [% IF ( letter.updated_on ) %]
499                                                         <li>
500                                                             <span class="label">Last updated:</span>
501                                                             [% letter.updated_on | $KohaDates with_hours = 1 %]
502                                                         </li>
503                                                     [% END %]
504                                                     <li>
505                                                         <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
506                                                         <input type="hidden" name="lang" value="[% lang | html %]" />
507                                                         <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
508                                                         [% IF letter.is_html %]
509                                                             <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" />
510                                                         [% ELSE %]
511                                                             <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" />
512                                                         [% END %]
513                                                     </li>
514                                                     <li>
515                                                         <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 %]" />
516                                                     </li>
517                                                     <li>
518                                                         <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
519                                                         [% IF letter.message_transport_type == 'sms' %]
520                                                             <span class="sms_counter" id="sms_counter_[% lang | html %]">
521                                                                 [% IF letter.content && letter.content.length > 0 %]
522                                                                     [% letter.content.length | html %]
523                                                                 [% ELSE %]
524                                                                     0
525                                                                 [% END %]/160 characters</span>
526                                                         [% END %]
527                                                         <table>
528                                                             <tr>
529                                                                 <td>
530                                                                     <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
531                                                                         [% FOREACH SQLfieldname IN SQLfieldnames %]
532                                                                             <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
533                                                                         [% END %]
534                                                                     </select>
535                                                                 </td>
536                                                                 <td class="actions">
537                                                                     <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>
538                                                                 </td>
539                                                                 <td>
540                                                                     <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>
541                                                                 </td>
542                                                             </tr>
543                                                         </table>
544                                                     </li>
545                                                     [% IF preview_is_available %]
546                                                         <li>
547                                                             <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>
548                                                         </li>
549                                                     [% END %]
550                                                 </ol>
551                                             </fieldset> <!-- /.rows.mtt -->
552                                         </div> <!-- /.panel-body -->
553                                     </div> <!-- /.panel-collapse -->
554                                 </div> <!-- /.panel.panel-default -->
555                             [% END # /FOR mtt %]
556                         </div> <!-- /.panel-group#lang_[% lang | html %] -->
557                     </div> <!-- /.tab-panel -->
558                     [% END # /FOREACH lang %]
559
560                     [% IF Koha.Preference('TranslateNotices') %]
561                             </div> <!-- /.tab-content -->
562                         </div> <!-- /#tabs -->
563                     [% END %]
564
565                         <input type="hidden" id="redirect" name="redirect" value="" />
566                         <input type="hidden" id="section" name="section" value="[% section | html %]" />
567                         <input type="hidden" id="langtab" name="langtab" value="[% langtab | html %]" />
568                         <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
569                     </form> <!-- /#add_notice -->
570                 [% END # /IF add_form %]
571
572                 [% IF ( add_validate or copy_validate) %]
573                     Data recorded
574                     <form action="[% action | html %]" method="post">
575                         <input type="submit" value="OK" />
576                     </form>
577                 [% END %]
578
579                 [% IF ( delete_confirm ) %]
580                     <div class="dialog alert">
581                         <h1>Delete notice?</h1>
582                         <table>
583                             <thead>
584                             <tr>
585                                 <th>Library</th>
586                                 <th>Module</th>
587                                 <th>Code</th>
588                                 <th>Name</th>
589                             </tr>
590                             </thead>
591                             <tr>
592                                 <td>[% IF letter.branchcode %][% Branches.GetName( letter.branchcode ) | html %][% ELSE %]<span>(All libraries)</span>[% END %]</td>
593                                 <td>[% letter.module | html %]</td>
594                                 <td>[% letter.code | html %]</td>
595                                 <td>[% letter.name | html %]</td>
596                             </tr>
597                         </table>
598                         <form action="[% action | html %]" method="post">
599                             <input type="hidden" name="op" value="delete_confirmed">
600                             <input type="hidden" name="branchcode" value="[% letter.branchcode | html %]" />
601                             <input type="hidden" name="code" value="[% letter.code | html %]" />
602                             <input type="hidden" name="module" value="[% letter.module | html %]" />
603                             <button type="submit" class="approve"><i class="fa fa-check"></i> Yes, delete</button>
604                         </form>
605
606                         <form action="[% action | html %]" method="get">
607                             <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
608                         </form>
609                     </div>
610                 [% END # /IF delete_confirm %]
611
612                 [% IF ( delete_confirmed ) %]
613                     <span>Data deleted</span>
614                     <form action="[% action | html %]" method="post">
615                     <input type="submit" value="OK" />
616                     </form>
617                 [% END %]
618
619     [% IF add_form or copy_form %]
620             </div> <!-- /.col-md-8 -->
621         </div> <!-- /.row -->
622     [% ELSE %]
623                 </main>
624             </div> <!-- /.col-sm-10.col-sm-push-2 -->
625
626             <div class="col-sm-2 col-sm-pull-10">
627                 <aside>
628                     [% INCLUDE 'tools-menu.inc' %]
629                 </aside>
630             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
631         </div> <!-- /.row -->
632     [% END %]
633
634 [% MACRO jsinclude BLOCK %]
635     [% Asset.js("js/tools-menu.js") | $raw %]
636     [% INCLUDE 'datatables.inc' %]
637     [% INCLUDE 'columns_settings.inc' %]
638     [% Asset.js("lib/hc-sticky.js") | $raw %]
639     [% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") | $raw %]
640     <script>
641         var no_op_set = '[% no_op_set | html %]';
642         var interface = '[% interface | html %]';
643         var theme = '[% theme | html %]';
644         var add_form = '[% add_form | html %]';
645         var copy_form = '[% copy_form | html %]';
646         var code = '[% code | html %]';
647         var new_lettercode = '[% new_lettercode | html %]';
648         var new_branchcode = '[% new_branchcode | html %]';
649         var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'notices', 'lettert', 'json' ) | $raw %];
650      </script>
651     [% Asset.js("js/letter.js") | $raw %]
652 [% END %]
653
654 [% INCLUDE 'intranet-bottom.inc' %]