kohabug 2374 Corrects autoBarcode behavior in additem.pl

There should be a documenation change at least for 3.0 to the effect that on systems
not running JavaScript, 'incremental' is the only option available for autoBarcode
although other options appear. A fix for this will hopefully appear in 3.2.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Nighswonger 2008-07-22 13:43:34 -05:00 committed by Joshua Ferraro
parent 40f09c8166
commit 8f55696a4d

View file

@ -96,8 +96,10 @@ if ($op eq "additem") {
my @indicator = $input->param('indicator');
my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag, 'ITEM');
my $record=MARC::Record::new_from_xml($xml, 'UTF-8');
# if autoBarcode is ON, calculate barcode...
if (C4::Context->preference('autoBarcode')) {
# if autoBarcode is set to 'incremental', calculate barcode...
# NOTE: This code is subject to change in 3.2 with the implemenation of ajax based autobarcode code
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
if (C4::Context->preference('autoBarcode') eq 'incremental') {
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode);
unless ($record->field($tagfield)->subfield($tagsubfield)) {
my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items");