[Koha-patches] [PATCH 41/54] Biblio.pm : fix isbd syspref and default location

paul.poulain at biblibre.com paul.poulain at biblibre.com
Thu Dec 16 11:54:35 CET 2010


From: Paul Poulain <paul.poulain at biblibre.com>

- the systempreference is isbd, not ISBD
- when preparing the ItemRecord (for acq or serials recieving), there was no default value calculated for location. Fixing that
---
 C4/Biblio.pm |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index c3a3094..9562d12 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -747,7 +747,7 @@ sub GetISBDView {
     my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype );
     my $tagslib = &GetMarcStructure( 1, $itemtype );
 
-    my $ISBD = C4::Context->preference('ISBD');
+    my $ISBD = C4::Context->preference('isbd');
     my $bloc = $ISBD;
     my $res;
     my $blocres;
@@ -2258,6 +2258,14 @@ sub PrepareItemrecordDisplay {
                         $defaultvalue = $defaultvalues->{branchcode} if $defaultvalues;
                     }
                 }
+                if (   ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.location' )
+                    && $defaultvalues
+                    && $defaultvalues->{'location'} ) {
+                    my $temp = $itemrecord->field($subfield) if ($itemrecord);
+                    unless ($temp) {
+                        $defaultvalue = $defaultvalues->{location} if $defaultvalues;
+                    }
+                }
                 if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
                     my @authorised_values;
                     my %authorised_lib;
-- 
1.7.1



More information about the Koha-patches mailing list