Bug 20310: Redirect article record without items for article requests
[koha-ffzg.git] / opac / opac-addbybiblionumber.pl
index ddebf4f..3563dfc 100755 (executable)
@@ -25,9 +25,10 @@ use C4::Biblio;
 use C4::Output;
 use C4::Auth;
 
+use Koha::Biblios;
 use Koha::Virtualshelves;
 
-my $query           = new CGI;
+my $query           = CGI->new;
 my @biblionumbers   = $query->multi_param('biblionumber');
 my $selectedshelf   = $query->param('selectedshelf');
 my $newshelf        = $query->param('newshelf');
@@ -51,7 +52,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {   template_name   => "opac-addbybiblionumber.tt",
         query           => $query,
         type            => "opac",
-        authnotrequired => 0,
     }
 );
 
@@ -142,12 +142,16 @@ if ($newvirtualshelf) {
 
 if ($authorized) {
     for my $biblionumber (@biblionumbers) {
-        my $data = GetBiblioData($biblionumber);
+        my $biblio = Koha::Biblios->find( $biblionumber );
         push(
             @biblios,
             {   biblionumber => $biblionumber,
-                title        => $data->{'title'},
-                author       => $data->{'author'},
+                title        => $biblio->title,
+                subtitle     => $biblio->subtitle,
+                medium       => $biblio->medium,
+                part_number  => $biblio->part_number,
+                part_name    => $biblio->part_name,
+                author       => $biblio->author,
             }
         );
     }
@@ -163,4 +167,4 @@ if ($authorized) {
     );
 }
 $template->param( authorized => $authorized, errcode => $errcode, );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };