View | Details | Raw Unified | Return to bug 17981
Collapse All | Expand All

(-)a/C4/Letters.pm (-1 / +1 lines)
Lines 881-887 sub _parseletter { Link Here
881
    my $values = $values_in ? { %$values_in } : {};
881
    my $values = $values_in ? { %$values_in } : {};
882
882
883
    if ( $table eq 'borrowers' && $values->{'dateexpiry'} ){
883
    if ( $table eq 'borrowers' && $values->{'dateexpiry'} ){
884
        $values->{'dateexpiry'} = format_sqldatetime( $values->{'dateexpiry'} );
884
        $values->{'dateexpiry'} = output_pref({ str => $values->{dateexpiry}, dateonly => 1 });
885
    }
885
    }
886
886
887
    if ( $table eq 'reserves' && $values->{'waitingdate'} ) {
887
    if ( $table eq 'reserves' && $values->{'waitingdate'} ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (-6 / +96 lines)
Lines 112-117 $(document).ready(function() { Link Here
112
    })
112
    })
113
113
114
    $("#tabs").tabs();
114
    $("#tabs").tabs();
115
116
    $("body").on("click", ".preview_template", function(e){
117
        e.preventDefault();
118
        var mtt = $(this).data("mtt");
119
        var lang = $(this).data("lang");
120
121
        var code = $("#code").val();
122
        var content = $("#content_"+mtt+"_"+lang).val();
123
        var title = $("#title_"+mtt+"_"+lang).val();
124
125
        var is_html = $("#is_html_"+mtt+"_"+lang).val();
126
        var page = $(this).attr("href");
127
        var data_preview = $("#data_preview").val();
128
        page += '?code='+encodeURIComponent(code);
129
        page += '&title='+encodeURIComponent(title);
130
        page += '&content='+encodeURIComponent(content);
131
        page += '&data_preview='+encodeURIComponent(data_preview);
132
        page += '&is_html='+encodeURIComponent(is_html);
133
        $("#preview_template .modal-body").load(page + " div");
134
        $('#preview_template').modal('show');
135
        $("#preview_template_button").attr("href", "/cgi-bin/koha/svc/letters/convert?module="+module+"&code="+code+"&mtt="+mtt+"&lang="+lang);
136
    });
137
    $("#preview_template").on("hidden", function(){
138
        $("#preview_template_label").html("");
139
        $("#preview_template .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
140
    });
141
    $("body").on("click", "#convert_template", function(e){
142
        e.preventDefault();
143
        var mtt = $(this).data("mtt");
144
        var lang = $(this).data("lang");
145
146
        var code = $("#code").val();
147
        var content = $("#content_"+mtt+"_"+lang).val();
148
        var title = $("#title_"+mtt+"_"+lang).val();
149
150
        var is_html = $("#is_html_"+mtt+"_"+lang).val();
151
        var page = $(this).attr("href");
152
        var data_preview = $("#data_preview").val();
153
        page += '?code='+encodeURIComponent(code);
154
        page += '&title='+encodeURIComponent(title);
155
        page += '&content='+encodeURIComponent(content);
156
        page += '&data_preview='+encodeURIComponent(data_preview);
157
        page += '&is_html='+encodeURIComponent(is_html);
158
        $("#preview_template .modal-body").load(page + " div");
159
        $('#preview_template').modal('show');
160
        $("#preview_template_button").attr("href", "/cgi-bin/koha/svc/letters/convert?module="+module+"&code="+code+"&branchcode="+branchcode+"&mtt="+mtt+"&lang="+lang);
161
    });
162
    $("#convert_template").on("hidden", function(){
163
        $("#convert_template_label").html("");
164
        $("#convert_template .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
165
    });
166
115
});
167
});
116
[% IF add_form or copy_form %]
168
[% IF add_form or copy_form %]
117
	
169
	
Lines 161-166 $(document).ready(function() { Link Here
161
213
162
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF ( add_form or copy_form) %][% IF ( modify ) %]<a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Modify notice[% ELSE %] <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Add notice[% END %][% ELSE %][% IF ( add_validate or copy_validate) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Notice added[% ELSE %][% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Confirm deletion[% ELSE %]Notices &amp; Slips[% END %][% END %][% END %]</div>
214
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF ( add_form or copy_form) %][% IF ( modify ) %]<a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Modify notice[% ELSE %] <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Add notice[% END %][% ELSE %][% IF ( add_validate or copy_validate) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Notice added[% ELSE %][% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; Slips</a> &rsaquo; Confirm deletion[% ELSE %]Notices &amp; Slips[% END %][% END %][% END %]</div>
163
215
216
<div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
217
    <div class="modal-dialog modal-lg">
218
    <div class="modal-content">
219
    <div class="modal-header">
220
        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
221
        <h3 id="preview_template_label">Preview notice template</h3>
222
    </div>
223
    <div class="modal-body">
224
        <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
225
    </div>
226
    <div class="modal-footer">
227
        <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
228
        <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
229
    </div>
230
    </div>
231
    </div>
232
</div>
233
164
[% IF add_form or copy_form %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
234
[% IF add_form or copy_form %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
165
   
235
   
166
   <div id="bd">
236
   <div id="bd">
Lines 374-379 $(document).ready(function() { Link Here
374
              <input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" />
444
              <input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" />
375
              <span class="required">Required</span>
445
              <span class="required">Required</span>
376
            </li>
446
            </li>
447
            [% IF code and preview_is_available%]
448
                <li>
449
                    <label for="name">Data for preview:</label>
450
                    [% SWITCH code %]
451
                    [% CASE 'CHECKIN' %]
452
                        <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
453
                    [% CASE 'CHECKOUT' %]
454
                        <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
455
                    [% CASE 'HOLD_SLIP' %]
456
                        <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
457
                    [% CASE %]
458
                        Not supported yet.
459
                    [% END %]
460
                    </li>
461
            [% END %]
377
        </ol>
462
        </ol>
378
    </fieldset>
463
    </fieldset>
379
        [% IF Koha.Preference('TranslateNotices') %]
464
        [% IF Koha.Preference('TranslateNotices') %]
Lines 429-451 $(document).ready(function() { Link Here
429
                  <input type="hidden" name="lang" value="[% lang %]" />
514
                  <input type="hidden" name="lang" value="[% lang %]" />
430
                  <label for="is_html_[% letter.message_transport_type %]">HTML message:</label>
515
                  <label for="is_html_[% letter.message_transport_type %]">HTML message:</label>
431
                  [% IF letter.is_html %]
516
                  [% IF letter.is_html %]
432
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" checked="checked" />
517
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]_[% lang %]" value="1" checked="checked" />
433
                  [% ELSE %]
518
                  [% ELSE %]
434
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" />
519
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]_[% lang %]" value="1" />
435
                  [% END %]
520
                  [% END %]
436
                </li>
521
                </li>
437
                <li>
522
                <li>
438
                  <label for="title_[% letter.message_transport_type %]">Message subject:</label><input type="text" id="title_[% letter.message_transport_type %]" name="title" size="60" value="[% letter.title %]" />
523
                  <label for="title_[% letter.message_transport_type %]_[% lang %]">Message subject:</label><input type="text" id="title_[% letter.message_transport_type %]_[% lang %]" name="title" size="60" value="[% letter.title %]" />
439
                </li>
524
                </li>
440
                <li>
525
                <li>
441
                  <label for="SQLfieldname_[% letter.message_transport_type %]">Message body:</label>
526
                  <label for="SQLfieldname_[% letter.message_transport_type %]_[% lang %]">Message body:</label>
442
                  [% IF letter.message_transport_type == 'sms' %]
527
                  [% IF letter.message_transport_type == 'sms' %]
443
                    <span id="sms_counter">[% IF letter.content && letter.content.length > 0 %][% letter.content.length %][% ELSE %]0[% END %]/160 characters</span>
528
                    <span id="sms_counter">[% IF letter.content && letter.content.length > 0 %][% letter.content.length %][% ELSE %]0[% END %]/160 characters</span>
444
                  [% END %]
529
                  [% END %]
445
                  <table>
530
                  <table>
446
                    <tr>
531
                    <tr>
447
                      <td>
532
                      <td>
448
                        <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type %]" multiple="multiple" size="9">
533
                        <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type %]_[% lang %]" multiple="multiple" size="9">
449
                          [% FOREACH SQLfieldname IN SQLfieldnames %]
534
                          [% FOREACH SQLfieldname IN SQLfieldnames %]
450
                            <option value="[% SQLfieldname.value %]">[% SQLfieldname.text %]</option>
535
                            <option value="[% SQLfieldname.value %]">[% SQLfieldname.text %]</option>
451
                          [% END %]
536
                          [% END %]
Lines 454-463 $(document).ready(function() { Link Here
454
                        <td class="actions">
539
                        <td class="actions">
455
                            <button type="button" data-containerid="[% letter.message_transport_type %]_[% lang %]" class="btn btn-default btn-sm insert">Insert <i class="fa fa-long-arrow-right"></i></button>
540
                            <button type="button" data-containerid="[% letter.message_transport_type %]_[% lang %]" class="btn btn-default btn-sm insert">Insert <i class="fa fa-long-arrow-right"></i></button>
456
                        </td>
541
                        </td>
457
                      <td><textarea name="content" id="content_[% letter.message_transport_type %]" cols="80" rows="15">[% letter.content %]</textarea></td>
542
                      <td><textarea name="content" id="content_[% letter.message_transport_type %]_[% lang %]" cols="80" rows="15">[% letter.content %]</textarea></td>
458
                    </tr>
543
                    </tr>
459
                  </table>
544
                  </table>
460
                </li>
545
                </li>
546
                [% IF preview_is_available %]
547
                    <li>
548
                        <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 %]" data-lang="[% lang %]"><i class="fa fa-eye"></i> Preview</a>
549
                    </li>
550
                [% END %]
461
              </ol>
551
              </ol>
462
            </fieldset>
552
            </fieldset>
463
            [% END %]
553
            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/preview_letter.tt (+52 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Tools &rsaquo; Preview notice template</title>
3
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
    </head>
5
    <body id="preview_letter" class="catalog">
6
        <div id="main">
7
            [% FOR m IN messages %]
8
                [%# FIXME The message block does not appear at the top of the modal! %]
9
                <div class="dialog [% m.type %]">
10
                    [% SWITCH m.code %]
11
                    [% CASE 'no_data_for_preview' %]You did not specify data for preview.
12
                    [% CASE 'preview_not_available' %]Preview is not available for letters '[% m.letter_code %]'.
13
                    [% CASE 'not_checked_in_yet' %]Do not forget that the issue has not been checked in yet.
14
                    [% CASE 'not_checked_out_yet' %]Do not forget that the issue has not been checked out yet.
15
                    [% CASE %][% m.code %]
16
                    [% END %]
17
                </div>
18
            [% END %]
19
            [% IF rendered_message %]
20
                <fieldset class="brief">
21
                    <legend>Original version</legend>
22
                    <pre>[% original_content | html %]</pre>
23
                </fieldset>
24
25
                <fieldset class="brief">
26
                    <legend>Rendered message:</legend>
27
                    <pre>[% rendered_message.content | html %]</pre>
28
                </fieldset>
29
            [% END %]
30
31
            [% IF tt_content %]
32
                <fieldset class="brief">
33
                    <legend>Converted version</legend>
34
                    <pre>[% tt_content | html %]</pre>
35
                </fieldset>
36
37
                <fieldset class="brief">
38
                    <legend>Rendered message:</legend>
39
                    <pre>[% rendered_tt_message.content | html %]</pre>
40
                </fieldset>
41
            [% END %]
42
        </div>
43
44
        [% IF tt_content %]
45
            [% IF messages_are_similar %]
46
                <div class="dialog message">The generated notices are exactly the same!</div>
47
            [% ELSE %]
48
                <div class="dialog alert">The generated notices are different!</div>
49
            [% END %]
50
        [% END %]
51
    </body>
52
</html>
(-)a/svc/letters/preview (+248 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2016 Koha Development Team
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
use CGI qw( -utf8 );
22
use C4::Auth;
23
use C4::Context;
24
use C4::Output;
25
use C4::Circulation;
26
use C4::Letters;
27
use Koha::Checkouts;
28
use Koha::Items;
29
use Koha::Patrons;
30
31
my $input = new CGI;
32
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
    {
35
        template_name   => "tools/preview_letter.tt",
36
        query           => $input,
37
        type            => "intranet",
38
        authnotrequired => 0,
39
        flagsrequired   => { tools => 'edit_notices' },
40
        debug           => 1,
41
    }
42
);
43
44
my @messages;
45
my $code         = $input->param('code');
46
my $content      = $input->param('content');
47
my $title        = $input->param('title');
48
my $is_html      = $input->param('is_html');
49
my $data_preview = $input->param('data_preview');
50
51
unless ( $data_preview ) {
52
    $template->param( messages => [{ code => 'no_data_for_preview', type => 'error' }]);
53
    output_html_with_http_headers $input, $cookie, $template->output;
54
    exit;
55
}
56
57
my $fake_letter = { content => $content, title => $title, is_html => $is_html };
58
59
my ( $tt_content, $fake_tt_letter );
60
if ( $content =~ m/[^\n]*<<.*>>[^\n]*/so ) {
61
    $tt_content = $content;
62
63
    my $table_mapping = {
64
        biblio                 => 'biblio',
65
        borrowers              => 'borrower',
66
        branches               => 'branch',
67
        items                  => 'item',
68
        opac_news              => 'news',
69
        aqorders               => 'orders',
70
        reserves               => 'hold',
71
        serial                 => 'serial',
72
        subscription           => 'subscription',
73
        suggestions            => 'suggestion',
74
        issues                 => 'checkout',
75
        old_issues             => 'old_checkout',
76
        overdues               => 'overdue',
77
        borrower_modifications => 'patron_modification',
78
    };
79
80
    # Today
81
    $tt_content =~ s#<<today>>#[% today| \$KohaDates with_hours => 1 %]#sg;
82
83
84
    for my $date_field ( qw(
85
            borrowers.dateofbirth
86
            borrowers.dateenrolled
87
            borrowers.dateexpiry
88
            borrowers.debarred
89
            items.dateaccessioned
90
            items.datelastborrowed
91
            items.datelastseen
92
            items.onloan
93
            serials.planneddate
94
            serials.publisheddate
95
            serials.claimdate
96
            reserves.reservedate
97
            reserves.waitingdate
98
            reserves.expirationdate
99
            suggestions.suggesteddate
100
            suggestions.manageddate
101
            suggestions.accepteddate
102
            suggestions.rejecteddate
103
            aqorders.entrydate
104
            aqorders.datereceived
105
            aqorders.datecancellationprinted
106
            aqorders.budgetdate
107
            aqorders.claimed_date
108
    ) ) {
109
        my ( $table, $field ) = split '\.', $date_field;
110
        my $new_field =
111
          exists $table_mapping->{$table}
112
          ? $table_mapping->{$table} . ".$field"
113
          : "$table.$field";
114
        $tt_content =~ s#<<$table\.$field>>#[% $new_field | \$KohaDates %]#sg;
115
        $tt_content =~ s#<<$table\.$field\s*|\s*dateonly>>#[% $new_field | \$KohaDates %]#sg;
116
    }
117
118
    for my $datetime_field ( qw(
119
            items.itemlost_on
120
            items.withdrawn_on
121
            issues.date_due
122
            issues.returndate
123
            issues.lastreneweddate
124
            issues.issuedate
125
            reserves.suspend_until
126
    ) ) {
127
        my ( $table, $field ) = split '\.', $datetime_field;
128
        my $new_field =
129
          exists $table_mapping->{$table}
130
          ? $table_mapping->{$table} . ".$field"
131
          : "$table.$field";
132
        $tt_content =~ s#<<$table\.$field>>#[% $new_field | \$KohaDates with_hours => 1 %]#sg;
133
        $tt_content =~ s#<<$table\.$field\s*|\s*dateonly>>#[% $new_field | \$KohaDates %]#sg;
134
    }
135
136
137
138
    while ( my ( $key, $value ) = each %$table_mapping ) {
139
        $tt_content =~ s|<<$key\.|<<$value.|sg;
140
    }
141
142
    $tt_content =~ s|<<|[% |sg;
143
    $tt_content =~ s|>>| %]|sg;
144
    $fake_tt_letter =
145
      { content => $tt_content, title => $title, is_html => $is_html };
146
}
147
148
my ( $rendered_message, $rendered_tt_message ) = (q||) x 2;
149
my $messages_are_similar;
150
my $letter_params = {};
151
if ( $code eq 'CHECKIN' ) {
152
    my $item = Koha::Items->find( { barcode => $data_preview } );
153
    my $checkout = Koha::Checkouts->find( { itemnumber => $item->itemnumber } );
154
    if ($checkout) {
155
        my $patron = Koha::Patrons->find( $checkout->borrowernumber );
156
        my $branchcode =
157
          C4::Circulation::_GetCircControlBranch( $item->unblessed,
158
            $patron->unblessed );
159
        $letter_params = {
160
            tables => {
161
                issues      => $item->itemnumber,
162
                items       => $item->itemnumber,
163
                biblio      => $item->biblionumber,
164
                biblioitems => $item->biblionumber,
165
                issues      => $patron->borrowernumber,
166
                branches    => $branchcode,
167
            }
168
        };
169
        push @messages, { code => 'not_checked_in_yet', type => 'message' };
170
    }
171
    else {
172
        warn "No checkout";
173
    }
174
}
175
elsif ( $code eq 'CHECKOUT' ) {
176
    my ( $barcode, $borrowernumber ) = split '\|', $data_preview;
177
    my $item = Koha::Items->find( { barcode => $barcode } );
178
    my $patron = Koha::Patrons->find( $borrowernumber );
179
    if ($item and $patron) {
180
        my $branchcode =
181
          C4::Circulation::_GetCircControlBranch( $item->unblessed,
182
            $patron->unblessed );
183
        $letter_params = {
184
            tables => {
185
                issues      => $item->itemnumber,
186
                items       => $item->itemnumber,
187
                biblio      => $item->biblionumber,
188
                biblioitems => $item->biblionumber,
189
                issues      => $patron->borrowernumber,
190
                branches    => $branchcode,
191
            }
192
        };
193
        push @messages, { code => 'not_checked_out_yet', type => 'message' };
194
    }
195
    else {
196
        warn "No item or no patron";
197
    }
198
}
199
elsif ( $code eq 'HOLD_SLIP' ) {
200
    my ( $biblionumber, $borrowernumber ) = split '\|', $data_preview;
201
    my $hold = Koha::Holds->find( { borrowernumber => $borrowernumber, biblionumber => $biblionumber } );
202
    if ($hold) {
203
        $letter_params = {
204
            tables => {
205
                reserves    => $hold->unblessed,
206
                branches    => $hold->branchcode,
207
                borrowers   => $hold->borrowernumber,
208
                biblio      => $hold->biblionumber,
209
                biblioitems => $hold->biblionumber,
210
                items       => $hold->itemnumber,
211
            }
212
        };
213
    }
214
    else {
215
        warn "No hold placed by this patron on this bibliographic record.";
216
    }
217
}
218
else {
219
    warn "Preview for letter code $code is not available";
220
    push @messages, { type => 'alert', code => 'preview_not_available', letter_code => $code, };
221
}
222
223
if ( %$letter_params ) {
224
    # FIXME Be case here GetPreparedLetter modify $fake_letter
225
    $rendered_message = C4::Letters::GetPreparedLetter(
226
        letter => $fake_letter,
227
        %$letter_params,
228
    );
229
    if ($tt_content) {
230
        $rendered_tt_message = C4::Letters::GetPreparedLetter(
231
            letter => $fake_tt_letter,
232
            %$letter_params,
233
        );
234
    }
235
    $messages_are_similar =
236
      $rendered_message->{content} eq $rendered_tt_message->{content};
237
}
238
239
$template->param(
240
    original_content     => $content,
241
    rendered_message     => $rendered_message,
242
    tt_content           => $tt_content,
243
    rendered_tt_message  => $rendered_tt_message,
244
    messages_are_similar => $messages_are_similar,
245
    messages             => \@messages,
246
);
247
248
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/tools/letter.pl (-1 / +4 lines)
Lines 262-271 sub add_form { Link Here
262
        }
262
        }
263
    }
263
    }
264
264
265
    my $preview_is_available = grep {/^$code$/} qw(
266
        CHECKIN CHECKOUT HOLD_SLIP
267
    );
265
    $template->param(
268
    $template->param(
266
        module     => $module,
269
        module     => $module,
267
        SQLfieldnames => $field_selection,
270
        SQLfieldnames => $field_selection,
268
        branchcode => $branchcode,
271
        branchcode => $branchcode,
272
        preview_is_available => $preview_is_available,
269
    );
273
    );
270
    return;
274
    return;
271
}
275
}
272
- 

Return to bug 17981