Bug 3873: follow-up for all other pages
[srvgit] / opac / opac-basket.pl
index cf75eb7..b374f3c 100755 (executable)
@@ -18,7 +18,7 @@
 
 use strict;
 use warnings;
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Koha;
 use C4::Biblio;
 use C4::Branch;
@@ -31,7 +31,7 @@ my $query = new CGI;
 
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
     {
-        template_name   => "opac-basket.tmpl",
+        template_name   => "opac-basket.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
@@ -63,6 +63,7 @@ foreach my $biblionumber ( @bibs ) {
     $template->param( biblionumber => $biblionumber );
 
     my $dat              = &GetBiblioData($biblionumber);
+    next unless $dat;
     my $record           = &GetMarcBiblio($biblionumber);
     next unless $record;
     my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
@@ -78,6 +79,7 @@ foreach my $biblionumber ( @bibs ) {
       $hasauthors = 1;
     }
     my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
+    my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
 
        # COinS format FIXME: for books Only
         my $coins_format;
@@ -92,6 +94,9 @@ foreach my $biblionumber ( @bibs ) {
 
 my $branches = GetBranches();
     for my $itm (@items) {
+        if ($itm->{'location'}){
+            $itm->{'location_opac'} = $shelflocations->{$itm->{'location'} };
+        }
         my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
         if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
              $itm->{transfertwhen} = $transfertwhen;