From 16a35155af3b43b55fd53907e5c816017034aee3 Mon Sep 17 00:00:00 2001 From: Charles Farmer Date: Wed, 8 Aug 2018 15:15:35 -0400 Subject: [PATCH] Bug 19325: (QA follow-up) Remove a syspref, change the backend accordingly --- C4/Labels/Label.pm | 3 +-- .../data/mysql/atomicupdate/Bug19325-BarcodePadding.syspref.sql | 5 ++--- .../intranet-tmpl/prog/en/modules/admin/preferences/tools.pref | 8 ++------ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm index 3738d2a..462731b 100644 --- a/C4/Labels/Label.pm +++ b/C4/Labels/Label.pm @@ -503,14 +503,13 @@ sub barcode { $params{'barcode_data'} = _get_label_item($self->{'item_number'}, 1) if !$params{'barcode_data'}; $params{'barcode_type'} = $self->{'barcode_type'} if !$params{'barcode_type'}; - my $enableBarcodePadding = C4::Context->preference("BarcodePaddingEnable"); my $paddingCharacter = C4::Context->preference("BarcodePaddingCharacter") || 0; my $paddingLength = C4::Context->preference("BarcodePaddingLength") || 0; if (length($paddingCharacter) > 1) { $paddingCharacter = substr $paddingCharacter, 0, 1; } - if ($enableBarcodePadding and length($params{'barcode_data'}) < $paddingLength) { + if (length($params{'barcode_data'}) < $paddingLength) { $params{'barcode_data'} = ($paddingCharacter x ($paddingLength - length($params{'barcode_data'}))) . $params{'barcode_data'}; } diff --git a/installer/data/mysql/atomicupdate/Bug19325-BarcodePadding.syspref.sql b/installer/data/mysql/atomicupdate/Bug19325-BarcodePadding.syspref.sql index bb342a0..d058ce8 100644 --- a/installer/data/mysql/atomicupdate/Bug19325-BarcodePadding.syspref.sql +++ b/installer/data/mysql/atomicupdate/Bug19325-BarcodePadding.syspref.sql @@ -1,4 +1,3 @@ INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES -('BarcodePaddingEnable','0','Enables padding the barcode when printing to PDF',NULL,'YesNo'), -('BarcodePaddingLength','0','The total length of the padded barcode',NULL,'Integer'), -('BarcodePaddingCharacter','0','The character to use when padding. Only string[0] is used.',NULL,'string'); \ No newline at end of file +('BarcodePaddingLength','0','The total length of the padded barcode. Padding is disabled when this value equals 0.',NULL,'Integer'), +('BarcodePaddingCharacter','0','The character to use when padding. Only string[0] is used.',NULL,'string'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref index 97219dc..f36443b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref @@ -40,14 +40,10 @@ Tools: - reports on the Saved Reports page. Labels: - - - pref: BarcodePaddingEnable - choices: - yes: "Enable" - no: "Disable" - - "padding the length of printed barcodes up to length" + - "Pads the length of printed barcodes up to a width of" - pref: BarcodePaddingLength class: integer - " with the character " - pref: BarcodePaddingCharacter class: integer - - " This has no effect if the barcode is longer than length. Length and character default to 0 if fields are empty." + - "
Length and character default to 0 if fields are empty. This preference has no effect if the original barcode is longer than BarcodePaddingLength." -- 2.7.4