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

(-)a/C4/Creators/Layout.pm (+2 lines)
Lines 33-38 sub _check_params { Link Here
33
        'printing_type',
33
        'printing_type',
34
        'layout_name',
34
        'layout_name',
35
        'guidebox',
35
        'guidebox',
36
        'oblique_title',
36
        'font',
37
        'font',
37
        'font_size',
38
        'font_size',
38
        'callnum_split',
39
        'callnum_split',
Lines 78-83 sub new { Link Here
78
            printing_type   =>      'BAR',
79
            printing_type   =>      'BAR',
79
            layout_name     =>      'DEFAULT',
80
            layout_name     =>      'DEFAULT',
80
            guidebox        =>      0,
81
            guidebox        =>      0,
82
            oblique_title   =>      1,
81
            font            =>      'TR',
83
            font            =>      'TR',
82
            font_size       =>      3,
84
            font_size       =>      3,
83
            callnum_split   =>      0,
85
            callnum_split   =>      0,
(-)a/C4/Labels/Label.pm (-2 / +14 lines)
Lines 35-40 sub _check_params { Link Here
35
        'barcode_type',
35
        'barcode_type',
36
        'printing_type',
36
        'printing_type',
37
        'guidebox',
37
        'guidebox',
38
        'oblique_title',
38
        'font',
39
        'font',
39
        'font_size',
40
        'font_size',
40
        'callnum_split',
41
        'callnum_split',
Lines 326-331 sub new { Link Here
326
        barcode_type            => $params{'barcode_type'},
327
        barcode_type            => $params{'barcode_type'},
327
        printing_type           => $params{'printing_type'},
328
        printing_type           => $params{'printing_type'},
328
        guidebox                => $params{'guidebox'},
329
        guidebox                => $params{'guidebox'},
330
        oblique_title           => $params{'oblique_title'},
329
        font                    => $params{'font'},
331
        font                    => $params{'font'},
330
        font_size               => $params{'font_size'},
332
        font_size               => $params{'font_size'},
331
        callnum_split           => $params{'callnum_split'},
333
        callnum_split           => $params{'callnum_split'},
Lines 408-415 sub draw_label_text { Link Here
408
        else {
410
        else {
409
            $field->{'data'} = _get_barcode_data($field->{'code'},$item,$record);
411
            $field->{'data'} = _get_barcode_data($field->{'code'},$item,$record);
410
        }
412
        }
411
        #FIXME: We should not force the title to oblique; this should be selectible in the layout configuration
413
        # Find apropriate font it oblique title selected, except main font is oblique
412
        ($field->{'code'} eq 'title') ? (($font =~ /T/) ? ($font = 'TI') : ($font = ($font . 'O'))) : ($font = $font);
414
        if ( ( $field->{'code'} eq 'title' ) and ( $self->{'oblique_title'} == 1 ) ) {
415
            if ( $font =~ /^TB$/ ) {
416
                $font .= 'I';
417
            }
418
            elsif ( $font =~ /^TR$/ ) {
419
                $font = 'TI';
420
            }
421
            elsif ( $font !~ /^T/ and $font !~ /O$/ ) {
422
                $font .= 'O';
423
            }
424
        }
413
        my $field_data = $field->{'data'};
425
        my $field_data = $field->{'data'};
414
        if ($field_data) {
426
        if ($field_data) {
415
            $field_data =~ s/\n//g;
427
            $field_data =~ s/\n//g;
(-)a/installer/data/mysql/atomicupdate/bug-12194-add-column-oblique_title.sql (+10 lines)
Line 0 Link Here
1
ALTER TABLE creator_layouts ADD COLUMN oblique_title INT(1) NULL DEFAULT 1 AFTER guidebox;
2
3
-- $DBversion = "3.21.00.XXX";
4
-- if ( CheckVersion($DBversion) ) {
5
--     $dbh->do(q|
6
--         ALTER TABLE creator_layouts ADD COLUMN oblique_title INT(1) NULL DEFAULT 1 AFTER guidebox
7
--     |);
8
--     print "Upgrade to $DBversion done (Bug 12194: Add column oblique_title to layouts)\n";
9
--     SetVersion($DBversion);
10
-- }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt (-1 / +18 lines)
Lines 25-30 Link Here
25
                    $('#layout_string').hide();
25
                    $('#layout_string').hide();
26
                }
26
                }
27
            }
27
            }
28
            function checkOblique() {
29
                var font = document.getElementById("font");
30
                var selectedfont = font.options[font.selectedIndex].value;
31
                if ( selectedfont.match("I$") || selectedfont.match("O$") ) {
32
                    document.getElementById("oblique_title").disabled = true;
33
                } else {
34
                    document.getElementById("oblique_title").disabled = false;
35
                }
36
            }
28
        //]]>
37
        //]]>
29
    </script>
38
    </script>
30
</head>
39
</head>
Lines 164-170 Link Here
164
                                </li>
173
                                </li>
165
                                <li>
174
                                <li>
166
                                    <label for="font">Font: </label>
175
                                    <label for="font">Font: </label>
167
                                    <select name="font" id="font">
176
                                    <select name="font" id="font" onchange="checkOblique()">
168
                                        [% FOREACH font_type IN font_types %]
177
                                        [% FOREACH font_type IN font_types %]
169
                                        [% IF ( font_type.selected ) %]
178
                                        [% IF ( font_type.selected ) %]
170
                                        <option value="[% font_type.type %]" selected="selected">[% font_type.name %]</option>
179
                                        <option value="[% font_type.type %]" selected="selected">[% font_type.name %]</option>
Lines 178-183 Link Here
178
                                    <label for="font_size">Font size: </label>
187
                                    <label for="font_size">Font size: </label>
179
                                    <input type="text" name="font_size" id="font_size" size="2" value="[% font_size |html %]" />
188
                                    <input type="text" name="font_size" id="font_size" size="2" value="[% font_size |html %]" />
180
                                </li>
189
                                </li>
190
                                <li>
191
                                    <label for="font">Oblique title: </label>
192
                                    [% IF ( oblique_title ) %]
193
                                    <input type="checkbox" name="oblique_title" id="oblique_title" value="1"  checked="checked" />
194
                                    [% ELSE %]
195
                                    <input type="checkbox" name="oblique_title" id="oblique_title" value="1" />
196
                                    [% END %]
197
                                </li>
181
                            </ol>
198
                            </ol>
182
                        </fieldset>
199
                        </fieldset>
183
                        <fieldset class="action">
200
                        <fieldset class="action">
(-)a/labels/label-create-pdf.pl (+3 lines)
Lines 139-144 foreach my $item (@{$items}) { Link Here
139
                                        barcode_type        => $layout->get_attr('barcode_type'),
139
                                        barcode_type        => $layout->get_attr('barcode_type'),
140
                                        printing_type       => 'BIB',
140
                                        printing_type       => 'BIB',
141
                                        guidebox            => $layout->get_attr('guidebox'),
141
                                        guidebox            => $layout->get_attr('guidebox'),
142
                                        oblique_title       => $layout->get_attr('oblique_title'),
142
                                        font                => $layout->get_attr('font'),
143
                                        font                => $layout->get_attr('font'),
143
                                        font_size           => $layout->get_attr('font_size'),
144
                                        font_size           => $layout->get_attr('font_size'),
144
                                        callnum_split       => $layout->get_attr('callnum_split'),
145
                                        callnum_split       => $layout->get_attr('callnum_split'),
Lines 162-167 foreach my $item (@{$items}) { Link Here
162
                                        barcode_type        => $layout->get_attr('barcode_type'),
163
                                        barcode_type        => $layout->get_attr('barcode_type'),
163
                                        printing_type       => 'BAR',
164
                                        printing_type       => 'BAR',
164
                                        guidebox            => $layout->get_attr('guidebox'),
165
                                        guidebox            => $layout->get_attr('guidebox'),
166
                                        oblique_title       => $layout->get_attr('oblique_title'),
165
                                        font                => $layout->get_attr('font'),
167
                                        font                => $layout->get_attr('font'),
166
                                        font_size           => $layout->get_attr('font_size'),
168
                                        font_size           => $layout->get_attr('font_size'),
167
                                        callnum_split       => $layout->get_attr('callnum_split'),
169
                                        callnum_split       => $layout->get_attr('callnum_split'),
Lines 188-193 foreach my $item (@{$items}) { Link Here
188
                                        barcode_type        => $layout->get_attr('barcode_type'),
190
                                        barcode_type        => $layout->get_attr('barcode_type'),
189
                                        printing_type       => $layout->get_attr('printing_type'),
191
                                        printing_type       => $layout->get_attr('printing_type'),
190
                                        guidebox            => $layout->get_attr('guidebox'),
192
                                        guidebox            => $layout->get_attr('guidebox'),
193
                                        oblique_title       => $layout->get_attr('oblique_title'),
191
                                        font                => $layout->get_attr('font'),
194
                                        font                => $layout->get_attr('font'),
192
                                        font_size           => $layout->get_attr('font_size'),
195
                                        font_size           => $layout->get_attr('font_size'),
193
                                        callnum_split       => $layout->get_attr('callnum_split'),
196
                                        callnum_split       => $layout->get_attr('callnum_split'),
(-)a/labels/label-edit-layout.pl (-1 / +2 lines)
Lines 107-112 elsif ($op eq 'save') { Link Here
107
                    printing_type   => $cgi->param('printing_type') || 'BAR',
107
                    printing_type   => $cgi->param('printing_type') || 'BAR',
108
                    layout_name     => $cgi->param('layout_name') || 'DEFAULT',
108
                    layout_name     => $cgi->param('layout_name') || 'DEFAULT',
109
                    guidebox        => ($cgi->param('guidebox') ? 1 : 0),
109
                    guidebox        => ($cgi->param('guidebox') ? 1 : 0),
110
                    oblique_title   => ($cgi->param('oblique_title') ? 1 : 0),
110
                    font            => $cgi->param('font') || 'TR',
111
                    font            => $cgi->param('font') || 'TR',
111
                    font_size       => $cgi->param('font_size') || 3,
112
                    font_size       => $cgi->param('font_size') || 3,
112
                    callnum_split   => ($cgi->param('callnum_split') ? 1 : 0),
113
                    callnum_split   => ($cgi->param('callnum_split') ? 1 : 0),
Lines 145-150 $template->param( Link Here
145
        layout_id       => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '',
146
        layout_id       => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '',
146
        layout_name     => $layout->get_attr('layout_name'),
147
        layout_name     => $layout->get_attr('layout_name'),
147
        guidebox        => $layout->get_attr('guidebox'),
148
        guidebox        => $layout->get_attr('guidebox'),
149
        oblique_title   => $layout->get_attr('oblique_title'),
148
        font_size       => $layout->get_attr('font_size'),
150
        font_size       => $layout->get_attr('font_size'),
149
        callnum_split   => $layout->get_attr('callnum_split'),
151
        callnum_split   => $layout->get_attr('callnum_split'),
150
        format_string   => $layout->get_attr('format_string'),
152
        format_string   => $layout->get_attr('format_string'),
151
- 

Return to bug 12194