=cut
-use strict;
-use warnings;
+use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Koha;
-use C4::Auth;
-use C4::Output;
-use C4::Acquisition;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_and_exit output_html_with_http_headers );
use C4::Context;
-use C4::Members;
-use C4::Serials;
+use C4::Serials qw( GetSubscription delroutingmember addroutingmember getroutinglist GetSerials GetLatestSerials check_routing );
use Koha::Patrons;
use URI::Escape;
-my $query = new CGI;
+my $query = CGI->new;
my $subscriptionid = $query->param('subscriptionid');
my $serialseq = $query->param('serialseq');
my $routingid = $query->param('routingid');
$date_selected ||= q{};
my $dbh = C4::Context->dbh;
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => 'serials/routing.tt',
+ query => $query,
+ type => 'intranet',
+ flagsrequired => { serials => 'routing' },
+ }
+);
+
+my $subs = GetSubscription($subscriptionid);
+
+output_and_exit( $query, $cookie, $template, 'unknown_subscription')
+ unless $subs;
+
if($op eq 'delete'){
delroutingmember($routingid,$subscriptionid);
}
}
my @routinglist = getroutinglist($subscriptionid);
-my $subs = GetSubscription($subscriptionid);
+
my ($count,@serials) = GetSerials($subscriptionid);
my $serialdates = GetLatestSerials($subscriptionid,$count);
push @{$dates}, $d;
}
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => 'serials/routing.tt',
- query => $query,
- type => 'intranet',
- authnotrequired => 0,
- flagsrequired => {serials => 'routing'},
- debug => 1,
- });
-
my $member_loop = [];
for my $routing ( @routinglist ) {
my $member = Koha::Patrons->find( $routing->{borrowernumber} )->unblessed;