Bug 9530 making changes to basket/sendbasket.pl
[koha.git] / basket / basket.pl
index de70a31..7fa915c 100755 (executable)
@@ -24,12 +24,13 @@ use C4::Biblio;
 use C4::Items;
 use C4::Auth;
 use C4::Output;
+use C4::Csv;
 
 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 },
@@ -66,15 +67,15 @@ foreach my $biblionumber ( @bibs ) {
     my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
     my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
     my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
-    my @items            = &GetItemsInfo( $biblionumber, 'opac' );
+    my @items            = GetItemsInfo( $biblionumber );
 
     my $hasauthors = 0;
     if($dat->{'author'} || @$marcauthorsarray) {
       $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'}){
@@ -102,10 +103,10 @@ foreach my $biblionumber ( @bibs ) {
     $dat->{MARCURLS}    = $marcurlsarray;
     $dat->{HASAUTHORS}  = $hasauthors;
 
-    if ( C4::Context->preference("BiblioDefaultView") eq "normal" ) {
+    if ( C4::Context->preference("IntranetBiblioDefaultView") eq "normal" ) {
         $dat->{dest} = "/cgi-bin/koha/catalogue/detail.pl";
     }
-    elsif ( C4::Context->preference("BiblioDefaultView") eq "marc" ) {
+    elsif ( C4::Context->preference("IntranetBiblioDefaultView") eq "marc" ) {
         $dat->{dest} = "/cgi-bin/koha/catalogue/MARCdetail.pl";
     }
     else {
@@ -120,6 +121,8 @@ my $resultsarray = \@results;
 
 $template->param(
     BIBLIO_RESULTS => $resultsarray,
+    csv_profiles => GetCsvProfilesLoop('marc'),
+    bib_list => $bib_list,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;