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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt (+3 lines)
Lines 11-16 Link Here
11
        [% IF ( batches ) %]
11
        [% IF ( batches ) %]
12
            <form>
12
            <form>
13
                <h3>Click on the following links to download the exported batch(es).</h3>
13
                <h3>Click on the following links to download the exported batch(es).</h3>
14
                [% IF warn_empty_range %]
15
                <div style="color: red; font-weight: bold;">Some or all of the barcodes in the range you have selected have no corresponding items. Because you are using a layout without barcodes, this may result in missing entries or a blank page.</div>
16
                [% END %]
14
                        [% FOREACH batche IN batches %]
17
                        [% FOREACH batche IN batches %]
15
                        <fieldset>
18
                        <fieldset>
16
                            [% IF ( batche.label_ids ) %]
19
                            [% IF ( batche.label_ids ) %]
(-)a/labels/label-print.pl (-1 / +13 lines)
Lines 22-27 use Modern::Perl; Link Here
22
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
23
use Data::Dumper;
23
use Data::Dumper;
24
24
25
use C4::Context;
25
use C4::Auth qw(get_template_and_user);
26
use C4::Auth qw(get_template_and_user);
26
use C4::Output qw(output_html_with_http_headers);
27
use C4::Output qw(output_html_with_http_headers);
27
use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats);
28
use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats);
Lines 110-115 if ($op eq 'export') { Link Here
110
                        );
111
                        );
111
    }
112
    }
112
    elsif ($from and $to) {
113
    elsif ($from and $to) {
114
        my $dbh = C4::Context->dbh;
115
116
        my $sth = $dbh->prepare('SELECT COUNT(*) AS has_barcode FROM creator_layouts WHERE printing_type LIKE("%BAR%") AND layout_id = ?;');
117
        $sth->execute($layout_id);
118
        if ($sth->fetchrow_hashref->{'has_barcode'} == 0) {
119
            $sth = $dbh->prepare('SELECT COUNT(*) AS existing_count FROM items WHERE CAST(barcode AS unsigned) BETWEEN ? AND ?;');
120
            $sth->execute($from, $to);
121
            if ($sth->fetchrow_hashref->{'existing_count'} < ($to - $from + 1)) {
122
                $template->param( warn_empty_range => 1 )
123
            }
124
        }
125
113
        push (@batches, {create_script   => 'label-create-pdf.pl',
126
        push (@batches, {create_script   => 'label-create-pdf.pl',
114
                 from            => $from,
127
                 from            => $from,
115
                 to              => $to,
128
                 to              => $to,
116
- 

Return to bug 7468