Bug 18736: (follow-up) Fix missing rounding and bad formatting
[koha.git] / C4 / ShelfBrowser.pm
index 923b7fe..ee551d2 100644 (file)
@@ -23,9 +23,9 @@ use strict;
 use warnings;
 
 use C4::Biblio;
-use C4::Branch;
 use C4::Context;
 use C4::Koha;
+use Koha::Libraries;
 
 use vars qw(@ISA @EXPORT @EXPORT_OK);
 
@@ -117,7 +117,6 @@ sub GetNearbyItems {
         if $gap <= $num_each_side;
 
     my $dbh         = C4::Context->dbh;
-    my $branches = GetBranches();
 
     my $sth_get_item_details = $dbh->prepare("SELECT cn_sort,homebranch,location,ccode from items where itemnumber=?");
     $sth_get_item_details->execute($itemnumber);
@@ -129,7 +128,7 @@ sub GetNearbyItems {
     if (C4::Context->preference('ShelfBrowserUsesHomeBranch') && 
        defined($item_details_result->{'homebranch'})) {
         $start_homebranch->{code} = $item_details_result->{'homebranch'};
-        $start_homebranch->{description} = $branches->{$item_details_result->{'homebranch'}}{branchname};
+        $start_homebranch->{description} = Koha::Libraries->find($item_details_result->{'homebranch'})->branchname;
     }
     if (C4::Context->preference('ShelfBrowserUsesLocation') && 
        defined($item_details_result->{'location'})) {
@@ -224,7 +223,7 @@ sub GetShelfInfo {
         my $this_biblio = GetBibData($item->{biblionumber});
         next unless defined $this_biblio;
         $item->{'title'} = $this_biblio->{'title'};
-        my $this_record = GetMarcBiblio($this_biblio->{'biblionumber'});
+        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
         $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
         $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
         $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);