Problem: - barcode width scale is always set to 0.8 of the total width - barcode height scale is always set to 0.01 of total height - happens in 3.8.X, 3.10.X and master code Solution: - create a system preference to control width scale name BarcodeWidthScale (default: 0.8) - create a system preference to control height scale name BarcodeHeightScale (default: 0.01) - change Patroncard.pm to use the variables instead of the default values (if the sysprefs are empty uses the default values).
Created attachment 14812 [details] [review] Bug 9480: Set barcode width and height configurable with system preferences in patron card creator Problem: - barcode width scale is always set to 0.8 of the total width - barcode height scale is always set to 0.01 of total height - happens in 3.8.X, 3.10.X and master code Test plan: - Apply patch - Check if your patron cards still prints normally - Change the sysprefs BarcodeWidthScale and BarcodeHeightScale (double values) and see the barcode change - Remove the sysprefs value (empty) and your patron cards should print normally (uses the default values) Sponsored-by: KEEP SOLUTIONS
I don't know much about the patron card creator, but is there a reason why these values belong in a system preference rather than as part of a layout?
Hi Owen, They are in a system preference because they are fixed in the code and can't be changed in the layout. So I created tão system preferences for the barcode height and width scale.
I understand that the values are fixed in the code at the moment. My question is whether these values are something that should be added to the layout configuration form: /cgi-bin/koha/patroncards/edit-layout.pl?op=edit&element_id=20. That form lets you choose font settings, barcode offset, etc. Shouldn't barcode height and width be configured there?
Hi Owen, The height and width of barcode are automatically calculated by Koha.
Vitor, I'm not sure you understood Owen's question correctly. We think that instead of the height and width being set at the system wide level, they should be set in the same place you set font settings, barcode offset, etc. ( that is, in patroncards/edit-layout.pl ). I agree with Owen that this would be a better solution. (In reply to comment #5) > Hi Owen, > > The height and width of barcode are automatically calculated by Koha.
I agree too - these settings should be set within the tool and not as a global preference.
Bug 14107 exposes the scaling values in the layout editor.
*** This bug has been marked as a duplicate of bug 14107 ***