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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt (-3 / +3 lines)
Lines 21-27 Link Here
21
                        <fieldset>
21
                        <fieldset>
22
                            [% IF ( batche.label_ids ) %]
22
                            [% IF ( batche.label_ids ) %]
23
                                <legend>[% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %]</legend>
23
                                <legend>[% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %]</legend>
24
                                <a class="document pdf" href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=0&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %]&amp;from=[% batche.from | html %]&amp;to=[% batche.to | html %]&amp;range=[% batche.range | html %]">Download as PDF</a>
24
                                <a class="document pdf" href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=0&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %]&amp;from=[% batche.from | html %]&amp;to=[% batche.to | html %]&amp;barcode_length=[% batche.barcode_length| html %]">Download as PDF</a>
25
25
26
                                    <p><a class="document csv" href="/cgi-bin/koha/labels/label-create-csv.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %][% batche.label_ids | html %]">Download as CSV</a></p>
26
                                    <p><a class="document csv" href="/cgi-bin/koha/labels/label-create-csv.pl?batch_id=[% batche.batch_id | html %]&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %][% batche.label_ids | html %]">Download as CSV</a></p>
27
27
Lines 45-51 Link Here
45
                            [% ELSIF (batche.from && batche.to) %]
45
                            [% ELSIF (batche.from && batche.to) %]
46
                            <legend>Barcodes from [% batche.from | html %] to [% batche.to | html %]</legend>
46
                            <legend>Barcodes from [% batche.from | html %] to [% batche.to | html %]</legend>
47
                            <p>
47
                            <p>
48
                                <a class="document pdf" href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=0&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %]&amp;from=[% batche.from | html %]&amp;to=[% batche.to | html %]&amp;range=[% batche.range | html %]">Download as PDF</a>
48
                                <a class="document pdf" href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=0&amp;template_id=[% batche.template_id | html %]&amp;layout_id=[% batche.layout_id | html %]&amp;start_label=[% batche.start_label | html %]&amp;from=[% batche.from | html %]&amp;to=[% batche.to | html %]&amp;barcode_length=[% batche.barcode_length | html %]">Download as PDF</a>
49
                            </p>
49
                            </p>
50
                            [% END %]
50
                            [% END %]
51
                        </fieldset>
51
                        </fieldset>
Lines 78-84 Link Here
78
                [% END %]
78
                [% END %]
79
                <input type="hidden" name="from" value="[% txt_from | html %]" />
79
                <input type="hidden" name="from" value="[% txt_from | html %]" />
80
                <input type="hidden" name="to" value="[% txt_to | html %]" />
80
                <input type="hidden" name="to" value="[% txt_to | html %]" />
81
                <input type="hidden" name="range" value="[% range | html %]" />
81
                <input type="hidden" name="barcode_length" value="[% barcode_length | html %]" />
82
                <fieldset class="rows">
82
                <fieldset class="rows">
83
                    <ol>
83
                    <ol>
84
                        <li>
84
                        <li>
(-)a/labels/label-create-pdf.pl (-13 / +4 lines)
Lines 45-51 my $start_label = $cgi->param('start_label') || 1; Link Here
45
@item_numbers  = $cgi->multi_param('item_number') if $cgi->param('item_number');
45
@item_numbers  = $cgi->multi_param('item_number') if $cgi->param('item_number');
46
my $from = $cgi->param('from') || undef;
46
my $from = $cgi->param('from') || undef;
47
my $to = $cgi->param('to') || undef;
47
my $to = $cgi->param('to') || undef;
48
my $range = $cgi->param('range') || undef;
48
my $barcode_length = $cgi->param('barcode_length');
49
49
50
my $items = undef;
50
my $items = undef;
51
51
Lines 117-134 elsif (@item_numbers) { Link Here
117
    } @item_numbers;
117
    } @item_numbers;
118
}
118
}
119
elsif ($from and $to) {
119
elsif ($from and $to) {
120
    for (my $i = $from; $i <= $to; $i++) {
120
    for my $i ( $from .. $to ) {
121
        my $compare_range = $range - length($i);
121
        my $padding = '0' x ( $barcode_length - length($i) );
122
        if ($compare_range == 0){
122
        push @$items, { item_number => $padding . $i };
123
            push @{$items}, {'item_number' => $i};
124
        } else {
125
            my $a = '';
126
            for (my $j = 1; $j <= $compare_range; $j++){
127
                $a .= '0';
128
            }
129
            $a .= $i;
130
            push @{$items}, {'item_number' => $a};
131
        }
132
    }
123
    }
133
}
124
}
134
else {
125
else {
(-)a/labels/label-print.pl (-4 / +3 lines)
Lines 55-61 my $txt_from = $cgi->param('from') || undef; Link Here
55
my $txt_to = $cgi->param('to') || undef;
55
my $txt_to = $cgi->param('to') || undef;
56
my $from = int($txt_from) || undef;
56
my $from = int($txt_from) || undef;
57
my $to = int($txt_to) || undef;
57
my $to = int($txt_to) || undef;
58
my $range = length($txt_from) || undef;
58
my $barcode_length = length($txt_from) || undef;
59
59
60
my $layouts = undef;
60
my $layouts = undef;
61
my $templates = undef;
61
my $templates = undef;
Lines 127-133 if ($op eq 'export') { Link Here
127
        push (@batches, {create_script   => 'label-create-pdf.pl',
127
        push (@batches, {create_script   => 'label-create-pdf.pl',
128
                 from            => $from,
128
                 from            => $from,
129
                 to              => $to,
129
                 to              => $to,
130
                 range           => $range,
130
                 barcode_length  => $barcode_length,
131
                 template_id     => $template_id,
131
                 template_id     => $template_id,
132
                 layout_id       => $layout_id,
132
                 layout_id       => $layout_id,
133
                 start_label     => $start_label,
133
                 start_label     => $start_label,
Lines 161-167 elsif ($op eq 'none') { Link Here
161
                    referer                     => $referer,
161
                    referer                     => $referer,
162
                    from                        => $from,
162
                    from                        => $from,
163
                    to                          => $to,
163
                    to                          => $to,
164
                    range                       => $range,
164
                    barcode_length              => $barcode_length,
165
                    txt_from                    => $txt_from,
165
                    txt_from                    => $txt_from,
166
                    txt_to                      => $txt_to
166
                    txt_to                      => $txt_to
167
                    );
167
                    );
168
- 

Return to bug 26340