Bug 9978: Replace license header with the correct license (GPLv3+)
[srvgit] / basket / basket.pl
index d33216c..83440fd 100755 (executable)
@@ -18,7 +18,7 @@
 
 use strict;
 use warnings;
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Koha;
 use C4::Biblio;
 use C4::Items;
@@ -30,7 +30,7 @@ my $query = new CGI;
 
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
     {
-        template_name   => "basket/basket.tmpl",
+        template_name   => "basket/basket.tt",
         query           => $query,
         type            => "intranet",
         flagsrequired   => { borrow => 1 },
@@ -61,6 +61,7 @@ foreach my $biblionumber ( @bibs ) {
     $template->param( biblionumber => $biblionumber );
 
     my $dat              = &GetBiblioData($biblionumber);
+    next unless $dat;
     my $record           = &GetMarcBiblio($biblionumber);
     my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
     my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
@@ -74,8 +75,8 @@ foreach my $biblionumber ( @bibs ) {
       $hasauthors = 1;
     }
        
-    my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
-    my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
+    my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'});
+    my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'});
 
        for my $itm (@items) {
            if ($itm->{'location'}){
@@ -121,7 +122,7 @@ my $resultsarray = \@results;
 
 $template->param(
     BIBLIO_RESULTS => $resultsarray,
-    csv_profiles => GetCsvProfilesLoop(),
+    csv_profiles => GetCsvProfilesLoop('marc'),
     bib_list => $bib_list,
 );