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

(-)a/C4/Patroncards/Patroncard.pm (-2 / +4 lines)
Lines 53-60 sub new { Link Here
53
sub draw_barcode {
53
sub draw_barcode {
54
    my ($self, $pdf) = @_;
54
    my ($self, $pdf) = @_;
55
#FIXME: We do some scaling foo on the barcode here which probably should be done by the one invoking draw_barcode
55
#FIXME: We do some scaling foo on the barcode here which probably should be done by the one invoking draw_barcode
56
    my $barcode_width = 0.8 * $self->{'width'};                         # this scales the barcode width to 80% of the label width
56
    my $barcode_width_scale = C4::Context->preference('BarcodeWidthScale') ? C4::Context->preference('BarcodeWidthScale') : 0.8;
57
    my $barcode_y_scale_factor = 0.01 * $self->{'height'};              # this scales the barcode height to 1% of the label height
57
    my $barcode_height_scale = C4::Context->preference('BarcodeHeightScale') ? C4::Context->preference('BarcodeHeightScale') : 0.01;
58
    my $barcode_width = $barcode_width_scale * $self->{'width'};
59
    my $barcode_y_scale_factor = $barcode_height_scale * $self->{'height'};
58
    _draw_barcode(      $self,
60
    _draw_barcode(      $self,
59
                        llx     => $self->{'llx'} + $self->{'layout'}->{'barcode'}->[0]->{'llx'},
61
                        llx     => $self->{'llx'} + $self->{'layout'}->{'barcode'}->[0]->{'llx'},
60
                        lly     => $self->{'lly'} + $self->{'layout'}->{'barcode'}->[0]->{'lly'},
62
                        lly     => $self->{'lly'} + $self->{'layout'}->{'barcode'}->[0]->{'lly'},
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 406-408 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
409
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('BarcodeWidthScale','0.8', NULL, 'Patron cards barcode width scale', 'Double');
410
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('BarcodeHeightScale','0.01', NULL, 'Patron cards barcode height scale', 'Double');
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 6339-6344 if ( CheckVersion($DBversion) ) { Link Here
6339
   SetVersion ($DBversion);
6339
   SetVersion ($DBversion);
6340
}
6340
}
6341
6341
6342
$DBversion = "3.11.00.XXX";
6343
if ( CheckVersion($DBversion) ) {
6344
   $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('BarcodeWidthScale','0.8', NULL, 'Patron cards barcode width scale', 'Double')");
6345
   $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('BarcodeHeightScale','0.01', NULL, 'Patron cards barcode height scale', 'Double')");
6346
   print "Upgrade to $DBversion done (Bug 9480: Set barcode width and height configurable with system preferences in patron card creator)\n";
6347
   SetVersion ($DBversion);
6348
}
6349
6342
=head1 FUNCTIONS
6350
=head1 FUNCTIONS
6343
6351
6344
=head2 TableExists($table)
6352
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/creators.pref (-1 / +8 lines)
Lines 5-7 Creators: Link Here
5
            - pref: ImageLimit
5
            - pref: ImageLimit
6
              class: Integer
6
              class: Integer
7
            - images.
7
            - images.
8
- 
8
        -
9
            - Use the following scale for barcode width in patron cards creator
10
            - pref: BarcodeWidthScale
11
              class: Double
12
        -
13
            - Use the following scale for barcode height in patron cards creator
14
            - pref: BarcodeHeightScale
15
              class: Double

Return to bug 9480