kohabug 2374 Corrects autoBarcode behavior in additem.pl
authorChris Nighswonger <chris.nighswonger@liblime.com>
Tue, 22 Jul 2008 18:43:34 +0000 (13:43 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 22 Jul 2008 20:50:30 +0000 (15:50 -0500)
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>
cataloguing/additem.pl

index ce5cb4c..da09dd0 100755 (executable)
@@ -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");