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 22-27 Link Here
22
            [% IF ( batches ) %]
22
            [% IF ( batches ) %]
23
            <form>
23
            <form>
24
                <h3>Click on the following links to download the exported batch(es).</h3>
24
                <h3>Click on the following links to download the exported batch(es).</h3>
25
                [% IF warn_empty_range %]
26
                <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>
27
                [% END %]
25
                        [% FOREACH batche IN batches %]
28
                        [% FOREACH batche IN batches %]
26
                        <fieldset>
29
                        <fieldset>
27
                            [% IF ( batche.label_ids ) %]
30
                            [% IF ( batche.label_ids ) %]
(-)a/labels/label-print.pl (-1 / +13 lines)
Lines 23-28 use warnings; Link Here
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use Data::Dumper;
24
use Data::Dumper;
25
25
26
use C4::Context;
26
use C4::Auth qw(get_template_and_user);
27
use C4::Auth qw(get_template_and_user);
27
use C4::Output qw(output_html_with_http_headers);
28
use C4::Output qw(output_html_with_http_headers);
28
use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats);
29
use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats);
Lines 111-116 if ($op eq 'export') { Link Here
111
                        );
112
                        );
112
    }
113
    }
113
    elsif ($from and $to) {
114
    elsif ($from and $to) {
115
        my $dbh = C4::Context->dbh;
116
117
        my $sth = $dbh->prepare('SELECT COUNT(*) AS has_barcode FROM creator_layouts WHERE printing_type LIKE("%BAR%") AND layout_id = ?;');
118
        $sth->execute($layout_id);
119
        if ($sth->fetchrow_hashref->{'has_barcode'} == 0) {
120
            $sth = $dbh->prepare('SELECT COUNT(*) AS existing_count FROM items WHERE CAST(barcode AS unsigned) BETWEEN ? AND ?;');
121
            $sth->execute($from, $to);
122
            if ($sth->fetchrow_hashref->{'existing_count'} < ($to - $from + 1)) {
123
                $template->param( warn_empty_range => 1 )
124
            }
125
        }
126
114
        push (@batches, {create_script   => 'label-create-pdf.pl',
127
        push (@batches, {create_script   => 'label-create-pdf.pl',
115
                 from            => $from,
128
                 from            => $from,
116
                 to              => $to,
129
                 to              => $to,
117
- 

Return to bug 7468