[Koha-cvs] koha/acqui.simple additem.pl [R_2-2-7-1]
paul poulain
paul at koha-fr.org
Tue Feb 27 21:51:34 CET 2007
CVSROOT: /sources/koha
Module name: koha
Branch: R_2-2-7-1
Changes by: paul poulain <tipaul> 07/02/27 20:51:34
Modified files:
acqui.simple : additem.pl
Log message:
BUGFIX (minor) : when itemcallnumber systempref is set, after adding/modifying an item, the default automatic itemcallnumber was not calculated, due to multiple use of $temp variable.
Quick & dirty fix, should probably be better to rewrite this code...
bug probably exist also in 2.2 and in rel_3_0
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui.simple/additem.pl?cvsroot=koha&only_with_tag=R_2-2-7-1&r1=1.27.2.22&r2=1.27.2.22.2.1
Patches:
Index: additem.pl
===================================================================
RCS file: /sources/koha/koha/acqui.simple/Attic/additem.pl,v
retrieving revision 1.27.2.22
retrieving revision 1.27.2.22.2.1
diff -u -b -r1.27.2.22 -r1.27.2.22.2.1
--- additem.pl 12 Sep 2006 09:11:45 -0000 1.27.2.22
+++ additem.pl 27 Feb 2007 20:51:34 -0000 1.27.2.22.2.1
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: additem.pl,v 1.27.2.22 2006/09/12 09:11:45 hdl Exp $
+# $Id: additem.pl,v 1.27.2.22.2.1 2007/02/27 20:51:34 tipaul Exp $
# Copyright 2000-2002 Katipo Communications
#
@@ -284,13 +284,14 @@
# print $input->redirect(".pl?bibid=$bibid") if ($test);
# search for itemcallnumber if applicable
##Lc callnumbers expect 2 subfields like 050ab or 090ab . Modified to accept 2 subfields
- if ($tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' && C4::Context->preference('itemcallnumber')) {
+warn "$value / $tag / $subfield";
+ if (!$value && $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' && C4::Context->preference('itemcallnumber')) {
my $CNtag = substr(C4::Context->preference('itemcallnumber'),0,3);
my $CNsubfield = substr(C4::Context->preference('itemcallnumber'),3,1);
my $CNsubfield2 = substr(C4::Context->preference('itemcallnumber'),4,1);
- my $temp = $record->field($CNtag);
- if ($temp) {
- $value = ($temp->subfield($CNsubfield)).' '.($temp->subfield($CNsubfield2));
+ my $temp2 = $temp->field($CNtag);
+ if ($temp2) {
+ $value = ($temp2->subfield($CNsubfield)).' '.($temp2->subfield($CNsubfield2));
#remove any trailing space incase one subfield is used
$value=~s/^\s+|\s+$//g;
}
More information about the Koha-cvs
mailing list