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 / +95 lines)
Lines 123-128 $(document).ready(function() { Link Here
123
        $("#submit_form").click();
123
        $("#submit_form").click();
124
    });
124
    });
125
125
126
    $("body").on("click", ".preview_template", function(e){
127
        e.preventDefault();
128
        var mtt = $(this).data("mtt");
129
        var lang = $(this).data("lang");
130
131
        var code = $("#code").val();
132
        var content = $("#content_"+mtt+"_"+lang).val();
133
        var title = $("#title_"+mtt+"_"+lang).val();
134
135
        var is_html = $("#is_html_"+mtt+"_"+lang).val();
136
        var page = $(this).attr("href");
137
        var data_preview = $("#data_preview").val();
138
        page += '?code='+encodeURIComponent(code);
139
        page += '&title='+encodeURIComponent(title);
140
        page += '&content='+encodeURIComponent(content);
141
        page += '&data_preview='+encodeURIComponent(data_preview);
142
        page += '&is_html='+encodeURIComponent(is_html);
143
        $("#preview_template .modal-body").load(page + " div");
144
        $('#preview_template').modal('show');
145
        $("#preview_template_button").attr("href", "/cgi-bin/koha/svc/letters/convert?module="+module+"&code="+code+"&mtt="+mtt+"&lang="+lang);
146
    });
147
    $("#preview_template").on("hidden", function(){
148
        $("#preview_template_label").html("");
149
        $("#preview_template .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
150
    });
151
    $("body").on("click", "#convert_template", function(e){
152
        e.preventDefault();
153
        var mtt = $(this).data("mtt");
154
        var lang = $(this).data("lang");
155
156
        var code = $("#code").val();
157
        var content = $("#content_"+mtt+"_"+lang).val();
158
        var title = $("#title_"+mtt+"_"+lang).val();
159
160
        var is_html = $("#is_html_"+mtt+"_"+lang).val();
161
        var page = $(this).attr("href");
162
        var data_preview = $("#data_preview").val();
163
        page += '?code='+encodeURIComponent(code);
164
        page += '&title='+encodeURIComponent(title);
165
        page += '&content='+encodeURIComponent(content);
166
        page += '&data_preview='+encodeURIComponent(data_preview);
167
        page += '&is_html='+encodeURIComponent(is_html);
168
        $("#preview_template .modal-body").load(page + " div");
169
        $('#preview_template').modal('show');
170
        $("#preview_template_button").attr("href", "/cgi-bin/koha/svc/letters/convert?module="+module+"&code="+code+"&branchcode="+branchcode+"&mtt="+mtt+"&lang="+lang);
171
    });
172
    $("#convert_template").on("hidden", function(){
173
        $("#convert_template_label").html("");
174
        $("#convert_template .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
175
    });
176
126
});
177
});
127
[% IF add_form or copy_form %]
178
[% IF add_form or copy_form %]
128
	
179
	
Lines 172-177 $(document).ready(function() { Link Here
172
223
173
<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>
224
<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>
174
225
226
<div id="preview_template" class="modal in" tabindex="-1" role="dialog" aria-labelledby="preview_template_label" aria-hidden="true">
227
    <div class="modal-dialog modal-lg">
228
    <div class="modal-content">
229
    <div class="modal-header">
230
        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
231
        <h3 id="preview_template_label">Preview notice template</h3>
232
    </div>
233
    <div class="modal-body">
234
        <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
235
    </div>
236
    <div class="modal-footer">
237
        <!-- TODO <a href="#" class="btn btn-default" id="preview_template_button" role="button" data-toggle="modal">Convert using the Template Toolkit syntax</a>-->
238
        <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
239
    </div>
240
    </div>
241
    </div>
242
</div>
243
175
[% IF add_form or copy_form %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
244
[% IF add_form or copy_form %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
176
   
245
   
177
   <div id="bd">
246
   <div id="bd">
Lines 399-404 $(document).ready(function() { Link Here
399
              <input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" />
468
              <input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" />
400
              <span class="required">Required</span>
469
              <span class="required">Required</span>
401
            </li>
470
            </li>
471
            [% IF code and preview_is_available%]
472
                <li>
473
                    <label for="name">Data for preview:</label>
474
                    [% SWITCH code %]
475
                    [% CASE 'CHECKIN' %]
476
                        <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode" />
477
                    [% CASE 'CHECKOUT' %]
478
                        <input type="text" id="data_preview" name="data_preview" value="" placeholder="barcode|borrowernumber" />
479
                    [% CASE 'HOLD_SLIP' %]
480
                        <input type="text" id="data_preview" name="data_preview" value="" placeholder="biblionumber|borrowernumber" />
481
                    [% CASE %]
482
                        Not supported yet.
483
                    [% END %]
484
                    </li>
485
            [% END %]
402
        </ol>
486
        </ol>
403
    </fieldset>
487
    </fieldset>
404
        [% IF Koha.Preference('TranslateNotices') %]
488
        [% IF Koha.Preference('TranslateNotices') %]
Lines 454-476 $(document).ready(function() { Link Here
454
                  <input type="hidden" name="lang" value="[% lang %]" />
538
                  <input type="hidden" name="lang" value="[% lang %]" />
455
                  <label for="is_html_[% letter.message_transport_type %]">HTML message:</label>
539
                  <label for="is_html_[% letter.message_transport_type %]">HTML message:</label>
456
                  [% IF letter.is_html %]
540
                  [% IF letter.is_html %]
457
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" checked="checked" />
541
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]_[% lang %]" value="1" checked="checked" />
458
                  [% ELSE %]
542
                  [% ELSE %]
459
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" />
543
                    <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]_[% lang %]" value="1" />
460
                  [% END %]
544
                  [% END %]
461
                </li>
545
                </li>
462
                <li>
546
                <li>
463
                  <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 %]" />
547
                  <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 %]" />
464
                </li>
548
                </li>
465
                <li>
549
                <li>
466
                  <label for="SQLfieldname_[% letter.message_transport_type %]">Message body:</label>
550
                  <label for="SQLfieldname_[% letter.message_transport_type %]_[% lang %]">Message body:</label>
467
                  [% IF letter.message_transport_type == 'sms' %]
551
                  [% IF letter.message_transport_type == 'sms' %]
468
                    <span id="sms_counter">[% IF letter.content && letter.content.length > 0 %][% letter.content.length %][% ELSE %]0[% END %]/160 characters</span>
552
                    <span id="sms_counter">[% IF letter.content && letter.content.length > 0 %][% letter.content.length %][% ELSE %]0[% END %]/160 characters</span>
469
                  [% END %]
553
                  [% END %]
470
                  <table>
554
                  <table>
471
                    <tr>
555
                    <tr>
472
                      <td>
556
                      <td>
473
                        <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type %]" multiple="multiple" size="9">
557
                        <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type %]_[% lang %]" multiple="multiple" size="9">
474
                          [% FOREACH SQLfieldname IN SQLfieldnames %]
558
                          [% FOREACH SQLfieldname IN SQLfieldnames %]
475
                            <option value="[% SQLfieldname.value %]">[% SQLfieldname.text %]</option>
559
                            <option value="[% SQLfieldname.value %]">[% SQLfieldname.text %]</option>
476
                          [% END %]
560
                          [% END %]
Lines 479-488 $(document).ready(function() { Link Here
479
                        <td class="actions">
563
                        <td class="actions">
480
                            <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>
564
                            <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>
481
                        </td>
565
                        </td>
482
                      <td><textarea name="content" id="content_[% letter.message_transport_type %]" cols="80" rows="15">[% letter.content %]</textarea></td>
566
                      <td><textarea name="content" id="content_[% letter.message_transport_type %]_[% lang %]" cols="80" rows="15">[% letter.content %]</textarea></td>
483
                    </tr>
567
                    </tr>
484
                  </table>
568
                  </table>
485
                </li>
569
                </li>
570
                [% IF preview_is_available %]
571
                    <li>
572
                        <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>
573
                    </li>
574
                [% END %]
486
              </ol>
575
              </ol>
487
            </fieldset>
576
            </fieldset>
488
            [% END %]
577
            [% 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 268-277 sub add_form { Link Here
268
        }
268
        }
269
    }
269
    }
270
270
271
    my $preview_is_available = grep {/^$code$/} qw(
272
        CHECKIN CHECKOUT HOLD_SLIP
273
    );
271
    $template->param(
274
    $template->param(
272
        module     => $module,
275
        module     => $module,
273
        SQLfieldnames => $field_selection,
276
        SQLfieldnames => $field_selection,
274
        branchcode => $branchcode,
277
        branchcode => $branchcode,
278
        preview_is_available => $preview_is_available,
275
    );
279
    );
276
    return;
280
    return;
277
}
281
}
278
- 

Return to bug 17981