Bug 32050: Add 'page-section' to calendar page
[koha-ffzg.git] / serials / subscription-history.pl
index 8b7dd3d..acaf307 100755 (executable)
@@ -30,21 +30,19 @@ Modify subscription history
 use Modern::Perl;
 
 use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
 
-use C4::Biblio;
-use C4::Serials;
-use Koha::DateUtils;
+use C4::Serials qw( ModSubscriptionHistory ModSubscription GetSubscriptionHistoryFromSubscriptionId GetSubscription );
+use Koha::Biblios;
+use Koha::DateUtils qw( output_pref );
 
-my $input = new CGI;
+my $input = CGI->new;
 my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
     template_name   => 'serials/subscription-history.tt',
     query           => $input,
     type            => 'intranet',
-    authnotrequired => 0,
     flagsrequired   => { 'serials' => 'edit_subscription' },
-    debug           => 1,
 } );
 
 my $subscriptionid  = $input->param('subscriptionid');
@@ -72,11 +70,11 @@ if($op && $op eq 'mod') {
     exit;
 } else {
     my $history = GetSubscriptionHistoryFromSubscriptionId($subscriptionid);
-    my $biblio  = GetBiblio($history->{'biblionumber'});
+    my $biblio  = Koha::Biblios->find( $history->{biblionumber} );
 
     $template->param(
         subscriptionid  => $subscriptionid,
-        title           => $biblio->{'title'},
+        title           => $biblio->title,
         histstartdate   => $history->{'histstartdate'},
         histenddate     => $history->{'histenddate'},
         receivedlist    => $history->{'recievedlist'},