[Koha-patches] [PATCH] remove hardcoded ccode & loc authorized values from opac-detail.

Ryan Higgins rch at balrog.liblime.com
Thu Apr 10 20:19:08 CEST 2008


---
 opac/opac-detail.pl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index 4056472..e9394e9 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -80,6 +80,8 @@ if ( $itemtype ) {
     $dat->{'imageurl'}    = $imgdir."/".$itemtypes->{$itemtype}->{'imageurl'};
     $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
 }
+my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'});
+my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'} );
 
 #coping with subscriptions
 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
@@ -121,8 +123,9 @@ for my $itm (@items) {
     $itm->{datelastseen} = format_date($itm->{datelastseen});
 
     #get collection code description, too
-    $itm->{'ccode'}  = GetAuthorisedValueDesc('','',   $itm->{'ccode'} ,'','','CCODE');
-    $itm->{'location_description'} = GetAuthorisedValueDesc('','',   $itm->{'location'} ,'','','LOC');
+	my $ccode= $itm->{'ccode'};
+	$itm->{'ccode'} = $collections->{$ccode} if(defined($collections) && exists($collections->{$ccode}));
+    $itm->{'location_description'} = $shelflocations->{$itm->{'location'} };
     $itm->{'imageurl'}    = $imgdir."/".$itemtypes->{ $itm->{itype} }->{'imageurl'};     
     $itm->{'description'} = $itemtypes->{$itemtype}->{'description'};
 	$itemfields{ccode} = 1 if($itm->{ccode});
-- 
1.5.4.2




More information about the Koha-patches mailing list