From 421794e2a2af09669089d71ed27d177c148d583e Mon Sep 17 00:00:00 2001
From: Amit Gupta
No results for your query
[% END %] diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl index 48861bc..c274781 100755 --- a/serials/subscription-renew.pl +++ b/serials/subscription-renew.pl @@ -61,7 +61,8 @@ my $dbh = C4::Context->dbh; my $mode = $query->param('mode'); my $op = $query->param('op') || q{}; -my $subscriptionid = $query->param('subscriptionid'); +my @subscriptionid = $query->param('subscriptionid'); +my $date = $query->param('date'); my $done = 0; # for after form has been submitted my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -75,17 +76,32 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( ); if ( $op eq "renew" ) { ReNewSubscription( - $subscriptionid, $loggedinuser, + @subscriptionid, $loggedinuser, C4::Dates->new($query->param('startdate'))->output('iso'), $query->param('numberlength'), $query->param('weeklength'), $query->param('monthlength'), $query->param('note') ); } -my $subscription = GetSubscription($subscriptionid); +my $subid; +if ( $op eq "renewall" ) { + foreach $subid (@subscriptionid){ + next unless $subid; + my $data = GetSubscription($subid); + my $length = $data->{numberlength}; + my $weeklength = $data->{weeklength}; + my $monthlength = $data->{monthlength}; + my $note = $data->{note}; + my $startdate = $data->{enddate} || POSIX::strftime( "%Y-%m-%d", localtime ); + ReNewSubscription( $subid,$loggedinuser,$startdate,$length,$weeklength, $monthlength, $note); + } + print $query->redirect("/cgi-bin/koha/serials/checkexpiration.pl?date=$date"); +} + +my $subscription = GetSubscription(@subscriptionid); if ($subscription->{'cannotedit'}){ - carp "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; - print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); + carp "Attempt to renew subscription @subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; + print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=@subscriptionid"); } $template->param( @@ -96,7 +112,7 @@ $template->param( numberlength => $subscription->{numberlength}, weeklength => $subscription->{weeklength}, monthlength => $subscription->{monthlength}, - subscriptionid => $subscriptionid, + subscriptionid => \@subscriptionid, bibliotitle => $subscription->{bibliotitle}, $op => 1, popup => ($query->param('mode')eq "popup"), -- 1.7.7.3