Bug 24019: Patron batch modification based on borrowernumber
[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 <style>#preview_template .modal-dialog { width : 80%; } .spinner { display: none; } @media (max-width: 767px) { #preview_template { margin: 0; width : auto; } }</style>
26 </head>
27
28 <body id="tools_letter" class="tools">
29     [% INCLUDE 'header.inc' %]
30     [% INCLUDE 'letters-search.inc' %]
31
32     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
33         <ol>
34             <li>
35                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
36             </li>
37             <li>
38                 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
39             </li>
40
41             [% IF ( add_form or copy_form) %]
42                 [% IF ( modify ) %]
43                     <li>
44                         <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
45                     </li>
46                     <li>
47                         <a href="#" aria-current="page">
48                             Modify notice
49                         </a>
50                     </li>
51                 [% ELSE %]
52                     <li>
53                         <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
54                     </li>
55                     <li>
56                         <a href="#" aria-current="page">
57                             Add notice
58                         </a>
59                     </li>
60                 [% END %]
61             [% ELSE %]
62                 [% IF ( add_validate or copy_validate) %]
63                     <li>
64                         <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
65                     </li>
66                     <li>
67                         <a href="#" aria-current="page">
68                             Notice added
69                         </a>
70                     </li>
71                 [% ELSE %]
72                     [% IF ( delete_confirm ) %]
73                         <li>
74                             <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a>
75                         </li>
76                         <li>
77                             <a href="#" aria-current="page">
78                                 Confirm deletion
79                             </a>
80                         </li>
81                     [% ELSE %]
82                         <li>
83                             <a href="#" aria-current="page">
84                                 Notices &amp; slips
85                             </a>
86                         </li>
87                     [% END %]
88                 [% END %]
89             [% END %]
90         </ol>
91     </nav> <!-- /#breadcrumbs -->
92
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>
99                 </div>
100                 <div class="modal-body">
101                     <div id="loading">
102                         <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading
103                     </div>
104                 </div>
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>
108                 </div>
109             </div> <!-- /.modal-content -->
110         </div> <!-- /.modal-dialog -->
111     </div> <!-- /#preview_template -->
112
113     [% IF add_form or copy_form %]
114         <div class="main container-fluid">
115             <div class="row">
116                 <div class="col-md-8 col-md-offset-2">
117     [% ELSE %]
118         <div class="main container-fluid">
119             <div class="row">
120                 <div class="col-sm-10 col-sm-push-2">
121                     <main>
122     [% END %]
123
124                 [% IF ( no_op_set ) %]
125                     <h1>Notices &amp; 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 %]
129                             <p>
130                                 Select a library:
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 ) %]
134                                 </select>
135                             </p>
136                         [% END %]
137                     </form> <!-- /#selectlibrary -->
138
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&amp;module=acquisition">Acquisition</a></li>
144                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=catalogue">Catalog</a></li>
145                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=circulation">Circulation</a></li>
146                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=claimacquisition">Claim acquisition</a></li>
147                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=claimissues">Claim serial issue</a></li>
148                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=reserves">Holds</a></li>
149                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=ill">Interlibrary loans</a></li>
150                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=orderacquisition">Order acquisition</a></li>
151                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=members">Patrons</a></li>
152                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=serial">Serials (new issue)</a></li>
153                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=suggestions">Suggestions</a></li>
154                                 <li><a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;module=pos">Point of sale</a></li>
155                             </ul>
156                         </div>
157                     </div> <!-- /#toolbar -->
158
159                     [% IF ( search ) %]
160                         <p>You searched for <strong>[% searchfield | html %]</strong></p>
161                     [% END %]
162
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>
168                                 [% END %]
169                             </select>
170                         [% END %]
171                     [% END %]
172
173                     [% IF letter %]
174                         <table id="lettert">
175                             <thead>
176                                 <tr>
177                                     <th>Library</th>
178                                     <th>Module</th>
179                                     <th>Code</th>
180                                     <th>Name</th>
181                                     <th>Last updated</th>
182                                     <th class="NoSort noExport">Copy notice</th>
183                                     <th class="NoSort noExport">Actions</th>
184                                 </tr>
185                             </thead>
186                             <tbody>
187                                 [% FOREACH lette IN letter %]
188                                     [% can_edit = lette.branchcode || !independant_branch %]
189                                     <tr>
190                                         <td>
191                                             [% IF lette.branchname %]
192                                                 [% lette.branchname | html %]
193                                             [% ELSE %]
194                                                 (All libraries)
195                                             [% END %]
196                                         </td>
197                                         <td>
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>
212                                             [% END %]
213                                         </td>
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>
217                                         <td class="actions">
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 %]" />
226                                                     [% ELSE %]
227                                                         [% select_for_copy | $raw %]
228                                                     [% END %]
229                                                     <button class="btn btn-default btn-xs"><i class="fa fa-clone"></i> Copy</button>
230                                                 </form>
231                                             [% END # /IF !independent_branch %]
232                                         </td>
233                                         <td class="actions">
234                                             [% IF can_edit %]
235                                                 <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>
236                                             [% END %]
237                                             [% IF !lette.protected && can_edit %]
238                                                 <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>
239                                             [% END %]
240                                         </td>
241                                     </tr>
242                                 [% END # /FOREACH lette %]
243                             </tbody>
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>
249                             [% ELSE %]
250                                 <p>There are no notices.</p>
251                             [% END %]
252                         </div>
253                     [% END # /IF lette %]
254                 [% END # /IF no_op_set %]
255
256                 [% IF add_form or copy_form %]
257                     <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
258
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>
264                             </button>
265                             <ul class="dropdown-menu">
266                                 <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
267                             </ul>
268                         </div>
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 -->
271
272                     <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
273                         [% IF add_form %]
274                             <input type="hidden" name="op" id="op" value="add_validate" />
275                         [% ELSE %]
276                             <input type="hidden" name="op" id="op" value="copy_validate" />
277                         [% END %]
278
279                         <input type="hidden" name="checked" value="0" />
280
281                         [% IF ( modify ) %]
282                             <input type="hidden" name="add" value="0" />
283                         [% ELSE %]
284                             <input type="hidden" name="add" value="1" />
285                         [% END %]
286
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 %]" />
291                                 <ol>
292                             [% ELSE %]
293                                 <ol>
294                                     <li>
295                                         [% IF adding %]
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 ) %]
300                                             </select>
301                                         [% ELSE %]
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 %]
306                                             [% ELSE %]
307                                                 All libraries
308                                             [% END %]
309                                         [% END %]
310                                     </li>
311                             [% END # /IF independant_branch %]
312                                 <li>
313                                     <label for="module">Koha module:</label>
314                                     <input type="hidden" name="oldmodule" value="[% module | html %]" />
315                                     [% IF adding  %]
316                                         <select name="module" id="newmodule">
317                                     [% ELSE %]
318                                         <select name="module" id="module">
319                                     [% END %]
320                                     [% IF ( module == "acquisition" ) %]
321                                         <option value="acquisition" selected="selected">Acquisition</option>
322                                     [% ELSE %]
323                                         <option value="acquisition" >Acquisition</option>
324                                     [% END %]
325                                     [% IF ( module == "catalogue" ) %]
326                                         <option value="catalogue" selected="selected">Catalog</option>
327                                     [% ELSE %]
328                                         <option value="catalogue" >Catalog</option>
329                                     [% END %]
330                                     [% IF ( module == "circulation" ) %]
331                                         <option value="circulation" selected="selected">Circulation</option>
332                                     [% ELSE %]
333                                         <option value="circulation">Circulation</option>
334                                     [% END %]
335                                     [% IF ( module == "orderacquisition" ) %]
336                                         <option value="orderacquisition" selected="selected">Order acquisition</option>
337                                     [% ELSE %]
338                                         <option value="orderacquisition">Order acquisition</option>
339                                     [% END %]
340                                     [% IF ( module == "claimacquisition" ) %]
341                                         <option value="claimacquisition" selected="selected">Claim acquisition</option>
342                                     [% ELSE %]
343                                         <option value="claimacquisition">Claim acquisition</option>
344                                     [% END %]
345                                     [% IF ( module == "claimissues" ) %]
346                                         <option value="claimissues" selected="selected">Claim serial issue</option>
347                                     [% ELSE %]
348                                         <option value="claimissues">Claim serial issue</option>
349                                     [% END %]
350                                     [% IF ( module == "reserves" ) %]
351                                         <option value="reserves" selected="selected">Holds</option>
352                                     [% ELSE %]
353                                         <option value="reserves">Holds</option>
354                                     [% END %]
355                                     [% IF ( module == "ill" ) %]
356                                       <option value="ill" selected="selected">Interlibrary loans</option>
357                                     [% ELSE %]
358                                       <option value="ill">Interlibrary loans</option>
359                                     [% END %]
360                                     [% IF ( module == "members" ) %]
361                                         <option value="members" selected="selected">Patrons</option>
362                                     [% ELSE %]
363                                         <option value="members">Patrons</option>
364                                     [% END %]
365                                     [% IF ( module == "serial" ) %]
366                                         <option value="serial" selected="selected">Serials (new issue)</option>
367                                     [% ELSE %]
368                                         <option value="serial">Serials (new issue)</option>
369                                     [% END %]
370                                     [% IF ( module == "suggestions" ) %]
371                                         <option value="suggestions" selected="selected">Suggestions</option>
372                                     [% ELSE %]
373                                         <option value="suggestions">Suggestions</option>
374                                     [% END %]
375                                     [% IF ( module == "pos" ) %]
376                                         <option value="pos" selected="selected">Point of sale</option>
377                                     [% ELSE %]
378                                         <option value="pos">Point of sale</option>
379                                     [% END %]
380                                 </select>
381                             </li>
382                             <li>
383                                 [% IF adding %]
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>
387                                 [% ELSE %]
388                                     <span class="label">Code:</span>
389                                     <input type="hidden" id="code" name="code" value="[% code | html %]" />
390                                     [% code | html %]
391                                 [% END %]
392                             </li>
393                             <li>
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>
397                             </li>
398                             [% IF code and preview_is_available%]
399                                 <li>
400                                     <label for="name">Data for preview:</label>
401                                     [% SWITCH code %]
402                                         [% CASE 'CHECKIN' %]
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" />
408                                         [% CASE %]
409                                             Not supported yet.
410                                     [% END %]
411                                     </li>
412                             [% END # /IF code %]
413                         </ol>
414                     </fieldset> <!-- /#add_notice -->
415
416                     [% IF Koha.Preference('TranslateNotices') %]
417                         <div style="clear:both"></div>
418                         <div id="tabs">
419                             <ul>
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>
425                                         [% ELSE %]
426                                             <li><a href="#lang_[% sublanguage.rfc4646_subtag | uri %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</a></li>
427                                         [% END %]
428                                     [% END %]
429                                 [% END %]
430                             </ul>
431                     [% END # /IF TranslateNotices %]
432
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') %]
440                                     <h3>
441                                         [% SWITCH letter.message_transport_type %]
442                                             [% CASE 'email' %]
443                                               Email
444                                             [% CASE 'print' %]
445                                               Print
446                                             [% CASE 'sms' %]
447                                               SMS
448                                             [% CASE 'feed' %]
449                                               Feed
450                                             [% CASE 'itiva' %]
451                                               Phone ( Itiva )
452                                             [% CASE 'phone' %]
453                                                 Phone
454                                             [% CASE %]
455                                               [% letter.message_transport_type | html %]
456                                         [% END %]
457                                     </h3>
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>
461                                     [% ELSE %]
462                                         <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
463                                     [% END %]
464                                         <ol>
465                                             [% IF ( letter.updated_on ) %]
466                                                 <li>
467                                                     <label for="updated_on_[% letter.message_transport_type | html %]_[% lang | html %]">Last updated:</label>
468                                                     [% letter.updated_on | $KohaDates with_hours = 1 %]
469                                                 </li>
470                                             [% END %]
471                                             <li>
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" />
477                                                 [% ELSE %]
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" />
479                                                 [% END %]
480                                             </li>
481                                             <li>
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 %]" />
483                                             </li>
484                                             <li>
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>
488                                                 [% END %]
489                                                 <table>
490                                                     <tr>
491                                                         <td>
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>
495                                                                 [% END %]
496                                                             </select>
497                                                         </td>
498                                                         <td class="actions">
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>
500                                                         </td>
501                                                         <td>
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>
503                                                         </td>
504                                                     </tr>
505                                                 </table>
506                                             </li>
507                                             [% IF preview_is_available %]
508                                                 <li>
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>
510                                                 </li>
511                                             [% END %]
512                                         </ol>
513                                     </fieldset> <!-- /.rows.mtt -->
514                                 [% END # /FOR mtt %]
515                             </div>
516                         </div> <!-- / #transport-types -->
517                     [% END # /FOREACH lang %]
518
519                     [% IF Koha.Preference('TranslateNotices') %]
520                         </div>
521                     [% END %]
522
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 %]
528
529                 [% IF ( add_validate or copy_validate) %]
530                     Data recorded
531                     <form action="[% action | html %]" method="post">
532                         <input type="submit" value="OK" />
533                     </form>
534                 [% END %]
535
536                 [% IF ( delete_confirm ) %]
537                     <div class="dialog alert">
538                         <h3>Delete notice?</h3>
539                         <table>
540                             <thead>
541                             <tr>
542                                 <th>Library</th>
543                                 <th>Module</th>
544                                 <th>Code</th>
545                                 <th>Name</th>
546                             </tr>
547                             </thead>
548                             <tr>
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>
553                             </tr>
554                         </table>
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>
561                         </form>
562
563                         <form action="[% action | html %]" method="get">
564                             <button type="submit" class="deny"><i class="fa fa-times"></i> No, do not delete</button>
565                         </form>
566                     </div>
567                 [% END # /IF delete_confirm %]
568
569                 [% IF ( delete_confirmed ) %]
570                     Data deleted
571                     <form action="[% action | html %]" method="post">
572                     <input type="submit" value="OK" />
573                     </form>
574                 [% END %]
575
576     [% IF add_form or copy_form %]
577             </div> <!-- /.col-md-8 -->
578         </div> <!-- /.row -->
579     [% ELSE %]
580                 </main>
581             </div> <!-- /.col-sm-10.col-sm-push-2 -->
582
583             <div class="col-sm-2 col-sm-pull-10">
584                 <aside>
585                     [% INCLUDE 'tools-menu.inc' %]
586                 </aside>
587             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
588         </div> <!-- /.row -->
589     [% END %]
590
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 %]
597     <script>
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 %];
607      </script>
608     [% Asset.js("js/letter.js") | $raw %]
609 [% END %]
610
611 [% INCLUDE 'intranet-bottom.inc' %]