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

(-)a/C4/Creators/Layout.pm (+4 lines)
Lines 31-36 sub _check_params { Link Here
31
        'oblique_title',
31
        'oblique_title',
32
        'font',
32
        'font',
33
        'font_size',
33
        'font_size',
34
        'scale_width',
35
        'scale_height',
34
        'callnum_split',
36
        'callnum_split',
35
        'text_justify',
37
        'text_justify',
36
        'format_string',
38
        'format_string',
Lines 77-82 sub new { Link Here
77
            oblique_title   =>      1,
79
            oblique_title   =>      1,
78
            font            =>      'TR',
80
            font            =>      'TR',
79
            font_size       =>      3,
81
            font_size       =>      3,
82
            scale_width     =>      0.8,
83
            scale_height    =>      0.02,
80
            callnum_split   =>      0,
84
            callnum_split   =>      0,
81
            text_justify    =>      'L',
85
            text_justify    =>      'L',
82
            format_string   =>      join(', ', @{ PRESET_FIELDS() }),
86
            format_string   =>      join(', ', @{ PRESET_FIELDS() }),
(-)a/C4/Labels/Label.pm (-6 / +10 lines)
Lines 36-41 sub _check_params { Link Here
36
        'oblique_title',
36
        'oblique_title',
37
        'font',
37
        'font',
38
        'font_size',
38
        'font_size',
39
        'scale_width',
40
        'scale_height',
39
        'callnum_split',
41
        'callnum_split',
40
        'justify',
42
        'justify',
41
        'format_string',
43
        'format_string',
Lines 224-231 sub _BAR { Link Here
224
    my $self = shift;
226
    my $self = shift;
225
    my $barcode_llx = $self->{'llx'} + $self->{'left_text_margin'};     # this places the bottom left of the barcode the left text margin distance to right of the left edge of the label ($llx)
227
    my $barcode_llx = $self->{'llx'} + $self->{'left_text_margin'};     # this places the bottom left of the barcode the left text margin distance to right of the left edge of the label ($llx)
226
    my $barcode_lly = $self->{'lly'} + $self->{'top_text_margin'};      # this places the bottom left of the barcode the top text margin distance above the bottom of the label ($lly)
228
    my $barcode_lly = $self->{'lly'} + $self->{'top_text_margin'};      # this places the bottom left of the barcode the top text margin distance above the bottom of the label ($lly)
227
    my $barcode_width = 0.8 * $self->{'width'};                         # this scales the barcode width to 80% of the label width
229
    my $barcode_width = $self->{'scale_width'} * $self->{'width'};      # You can choose the width of barcode, default value is 0.8 : 80% of the label width
228
    my $barcode_y_scale_factor = 0.01 * $self->{'height'};              # this scales the barcode height to 10% of the label height
230
    my $barcode_y_scale_factor = $self->{'scale_height'} * $self->{'height'};      # You can choose the height of barcode, default value is 0.01 : 10% of the label height
229
    return 0, 0, 0, $barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor;
231
    return 0, 0, 0, $barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor;
230
}
232
}
231
233
Lines 233-240 sub _BIBBAR { Link Here
233
    my $self = shift;
235
    my $self = shift;
234
    my $barcode_llx = $self->{'llx'} + $self->{'left_text_margin'};     # this places the bottom left of the barcode the left text margin distance to right of the left edge of the label ($self->{'llx'})
236
    my $barcode_llx = $self->{'llx'} + $self->{'left_text_margin'};     # this places the bottom left of the barcode the left text margin distance to right of the left edge of the label ($self->{'llx'})
235
    my $barcode_lly = $self->{'lly'} + $self->{'top_text_margin'};      # this places the bottom left of the barcode the top text margin distance above the bottom of the label ($lly)
237
    my $barcode_lly = $self->{'lly'} + $self->{'top_text_margin'};      # this places the bottom left of the barcode the top text margin distance above the bottom of the label ($lly)
236
    my $barcode_width = 0.8 * $self->{'width'};                         # this scales the barcode width to 80% of the label width
238
    my $barcode_width = $self->{'scale_width'} * $self->{'width'};      # You can choose the width of barcode, default value is 0.8 : 80% of the label width
237
    my $barcode_y_scale_factor = 0.01 * $self->{'height'};              # this scales the barcode height to 10% of the label height
239
    my $barcode_y_scale_factor = $self->{'scale_height'} * $self->{'height'};       # You can choose the height of barcode, default value is 0.01 : 10% of the label height
238
    my $line_spacer = ($self->{'font_size'} * 1);       # number of pixels between text rows (This is actually leading: baseline to baseline minus font size. Recommended starting point is 20% of font size.).
240
    my $line_spacer = ($self->{'font_size'} * 1);       # number of pixels between text rows (This is actually leading: baseline to baseline minus font size. Recommended starting point is 20% of font size.).
239
    my $text_lly = ($self->{'lly'} + ($self->{'height'} - $self->{'top_text_margin'}));
241
    my $text_lly = ($self->{'lly'} + ($self->{'height'} - $self->{'top_text_margin'}));
240
    return $self->{'llx'}, $text_lly, $line_spacer, $barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor;
242
    return $self->{'llx'}, $text_lly, $line_spacer, $barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor;
Lines 244-251 sub _BARBIB { Link Here
244
    my $self = shift;
246
    my $self = shift;
245
    my $barcode_llx = $self->{'llx'} + $self->{'left_text_margin'};                             # this places the bottom left of the barcode the left text margin distance to right of the left edge of the label ($self->{'llx'})
247
    my $barcode_llx = $self->{'llx'} + $self->{'left_text_margin'};                             # this places the bottom left of the barcode the left text margin distance to right of the left edge of the label ($self->{'llx'})
246
    my $barcode_lly = ($self->{'lly'} + $self->{'height'}) - $self->{'top_text_margin'};        # this places the bottom left of the barcode the top text margin distance below the top of the label ($self->{'lly'})
248
    my $barcode_lly = ($self->{'lly'} + $self->{'height'}) - $self->{'top_text_margin'};        # this places the bottom left of the barcode the top text margin distance below the top of the label ($self->{'lly'})
247
    my $barcode_width = 0.8 * $self->{'width'};                                                 # this scales the barcode width to 80% of the label width
249
    my $barcode_width = $self->{'scale_width'} * $self->{'width'};                              # You can choose the width of barcode, default value is 0.8 : 80% of the label width
248
    my $barcode_y_scale_factor = 0.01 * $self->{'height'};                                      # this scales the barcode height to 10% of the label height
250
    my $barcode_y_scale_factor = $self->{'scale_height'} * $self->{'height'};                   # You can choose the height of barcode, default value is 0.01 : 10% of the label height
249
    my $line_spacer = ($self->{'font_size'} * 1);                               # number of pixels between text rows (This is actually leading: baseline to baseline minus font size. Recommended starting point is 20% of font size.).
251
    my $line_spacer = ($self->{'font_size'} * 1);                               # number of pixels between text rows (This is actually leading: baseline to baseline minus font size. Recommended starting point is 20% of font size.).
250
    my $text_lly = (($self->{'lly'} + $self->{'height'}) - $self->{'top_text_margin'} - (($self->{'lly'} + $self->{'height'}) - $barcode_lly));
252
    my $text_lly = (($self->{'lly'} + $self->{'height'}) - $self->{'top_text_margin'} - (($self->{'lly'} + $self->{'height'}) - $barcode_lly));
251
    return $self->{'llx'}, $text_lly, $line_spacer, $barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor;
253
    return $self->{'llx'}, $text_lly, $line_spacer, $barcode_llx, $barcode_lly, $barcode_width, $barcode_y_scale_factor;
Lines 269-274 sub new { Link Here
269
        oblique_title           => $params{'oblique_title'},
271
        oblique_title           => $params{'oblique_title'},
270
        font                    => $params{'font'},
272
        font                    => $params{'font'},
271
        font_size               => $params{'font_size'},
273
        font_size               => $params{'font_size'},
274
        scale_width             => $params{'scale_width'},
275
        scale_height            => $params{'scale_height'},
272
        callnum_split           => $params{'callnum_split'},
276
        callnum_split           => $params{'callnum_split'},
273
        justify                 => $params{'justify'},
277
        justify                 => $params{'justify'},
274
        format_string           => $params{'format_string'},
278
        format_string           => $params{'format_string'},
(-)a/installer/data/mysql/atomicupdate/update-BZ_10762.pl (+23 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "10762",
5
    description => "Add 2 columns in 'creator_layouts' which define the width and height of barcodes",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless ( column_exists ( 'creator_layouts', 'scale_width' )) {
10
            $dbh->do( q {
11
                ALTER TABLE creator_layouts
12
                    ADD COLUMN scale_width FLOAT default 0.8 NOT NULL AFTER font_size      
13
            });
14
        }
15
        unless ( column_exists ( 'creator_layouts', 'scale_height')) {
16
            $dbh->do( q {
17
                ALTER TABLE creator_layouts
18
                    ADD COLUMN scale_height FLOAT default 0.01 NOT NULL AFTER scale_width
19
            });
20
        }
21
        say $out "Table creator_layouts updated with 2 new columns";
22
    },
23
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt (+8 lines)
Lines 191-196 Link Here
191
                                    <label for="font_size">Font size: </label>
191
                                    <label for="font_size">Font size: </label>
192
                                    <input type="text" name="font_size" id="font_size" size="2" value="[% font_size | html %]" />
192
                                    <input type="text" name="font_size" id="font_size" size="2" value="[% font_size | html %]" />
193
                                </li>
193
                                </li>
194
                                <li>
195
                                    <label for="scale_width">Barcode width: </label>
196
                                    <input type="text" name="scale_width" id="scale_width" size="2" value="[% scale_width | html %]" />
197
                                </li>
198
                                <li>
199
                                    <label for="scale_height">Barcode height: </label>
200
                                    <input type="text" name="scale_height" id="scale_height" size="2" value="[% scale_height | html %]" />
201
                                </li>
194
                                <li>
202
                                <li>
195
                                    <label for="oblique_title">Oblique title: </label>
203
                                    <label for="oblique_title">Oblique title: </label>
196
                                    [% IF ( oblique_title ) %]
204
                                    [% IF ( oblique_title ) %]
(-)a/labels/label-create-pdf.pl (+6 lines)
Lines 145-150 foreach my $item (@{$items}) { Link Here
145
                                        oblique_title       => $layout->get_attr('oblique_title'),
145
                                        oblique_title       => $layout->get_attr('oblique_title'),
146
                                        font                => $layout->get_attr('font'),
146
                                        font                => $layout->get_attr('font'),
147
                                        font_size           => $layout->get_attr('font_size'),
147
                                        font_size           => $layout->get_attr('font_size'),
148
                                        scale_width         => $layout->get_attr('scale_width'),
149
                                        scale_height        => $layout->get_attr('scale_height'),
148
                                        callnum_split       => $layout->get_attr('callnum_split'),
150
                                        callnum_split       => $layout->get_attr('callnum_split'),
149
                                        justify             => $layout->get_attr('text_justify'),
151
                                        justify             => $layout->get_attr('text_justify'),
150
                                        format_string       => $layout->get_attr('format_string'),
152
                                        format_string       => $layout->get_attr('format_string'),
Lines 169-174 foreach my $item (@{$items}) { Link Here
169
                                        oblique_title       => $layout->get_attr('oblique_title'),
171
                                        oblique_title       => $layout->get_attr('oblique_title'),
170
                                        font                => $layout->get_attr('font'),
172
                                        font                => $layout->get_attr('font'),
171
                                        font_size           => $layout->get_attr('font_size'),
173
                                        font_size           => $layout->get_attr('font_size'),
174
                                        scale_width         => $layout->get_attr('scale_width'),
175
                                        scale_height        => $layout->get_attr('scale_height'),
172
                                        callnum_split       => $layout->get_attr('callnum_split'),
176
                                        callnum_split       => $layout->get_attr('callnum_split'),
173
                                        justify             => $layout->get_attr('text_justify'),
177
                                        justify             => $layout->get_attr('text_justify'),
174
                                        format_string       => $layout->get_attr('format_string'),
178
                                        format_string       => $layout->get_attr('format_string'),
Lines 196-201 foreach my $item (@{$items}) { Link Here
196
                                        oblique_title       => $layout->get_attr('oblique_title'),
200
                                        oblique_title       => $layout->get_attr('oblique_title'),
197
                                        font                => $layout->get_attr('font'),
201
                                        font                => $layout->get_attr('font'),
198
                                        font_size           => $layout->get_attr('font_size'),
202
                                        font_size           => $layout->get_attr('font_size'),
203
                                        scale_width         => $layout->get_attr('scale_width'),
204
                                        scale_height        => $layout->get_attr('scale_height'),
199
                                        callnum_split       => $layout->get_attr('callnum_split'),
205
                                        callnum_split       => $layout->get_attr('callnum_split'),
200
                                        justify             => $layout->get_attr('text_justify'),
206
                                        justify             => $layout->get_attr('text_justify'),
201
                                        format_string       => $layout->get_attr('format_string'),
207
                                        format_string       => $layout->get_attr('format_string'),
(-)a/labels/label-edit-layout.pl (-1 / +4 lines)
Lines 112-117 elsif ($op eq 'save') { Link Here
112
                    oblique_title   => ($cgi->param('oblique_title') ? 1 : 0),
112
                    oblique_title   => ($cgi->param('oblique_title') ? 1 : 0),
113
                    font            => scalar $cgi->param('font') || 'TR',
113
                    font            => scalar $cgi->param('font') || 'TR',
114
                    font_size       => scalar $cgi->param('font_size') || 3,
114
                    font_size       => scalar $cgi->param('font_size') || 3,
115
                    scale_width     => scalar $cgi->param('scale_width') || 0.8,
116
                    scale_height    => scalar $cgi->param('scale_height') || 0.01,
115
                    callnum_split   => ($cgi->param('callnum_split') ? 1 : 0),
117
                    callnum_split   => ($cgi->param('callnum_split') ? 1 : 0),
116
                    text_justify    => scalar $cgi->param('text_justify') || 'L',
118
                    text_justify    => scalar $cgi->param('text_justify') || 'L',
117
                    format_string   => scalar $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, itemcallnumber',
119
                    format_string   => scalar $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, itemcallnumber',
Lines 150-155 $template->param( Link Here
150
        guidebox        => $layout->get_attr('guidebox'),
152
        guidebox        => $layout->get_attr('guidebox'),
151
        oblique_title   => $layout->get_attr('oblique_title'),
153
        oblique_title   => $layout->get_attr('oblique_title'),
152
        font_size       => $layout->get_attr('font_size'),
154
        font_size       => $layout->get_attr('font_size'),
155
        scale_width     => $layout->get_attr('scale_width'),
156
        scale_height    => $layout->get_attr('scale_height'),
153
        callnum_split   => $layout->get_attr('callnum_split'),
157
        callnum_split   => $layout->get_attr('callnum_split'),
154
        format_string   => $layout->get_attr('format_string'),
158
        format_string   => $layout->get_attr('format_string'),
155
        layout_string   => 1,   # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN
159
        layout_string   => 1,   # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN
156
- 

Return to bug 10762