Lines 61-67
my $dbh = C4::Context->dbh;
Link Here
|
61 |
|
61 |
|
62 |
my $mode = $query->param('mode'); |
62 |
my $mode = $query->param('mode'); |
63 |
my $op = $query->param('op') || q{}; |
63 |
my $op = $query->param('op') || q{}; |
64 |
my $subscriptionid = $query->param('subscriptionid'); |
64 |
my @subscriptionid = $query->param('subscriptionid'); |
|
|
65 |
my $date = $query->param('date'); |
65 |
my $done = 0; # for after form has been submitted |
66 |
my $done = 0; # for after form has been submitted |
66 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
67 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
67 |
{ |
68 |
{ |
Lines 75-91
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
75 |
); |
76 |
); |
76 |
if ( $op eq "renew" ) { |
77 |
if ( $op eq "renew" ) { |
77 |
ReNewSubscription( |
78 |
ReNewSubscription( |
78 |
$subscriptionid, $loggedinuser, |
79 |
@subscriptionid, $loggedinuser, |
79 |
C4::Dates->new($query->param('startdate'))->output('iso'), $query->param('numberlength'), |
80 |
C4::Dates->new($query->param('startdate'))->output('iso'), $query->param('numberlength'), |
80 |
$query->param('weeklength'), $query->param('monthlength'), |
81 |
$query->param('weeklength'), $query->param('monthlength'), |
81 |
$query->param('note') |
82 |
$query->param('note') |
82 |
); |
83 |
); |
83 |
} |
84 |
} |
84 |
|
85 |
|
85 |
my $subscription = GetSubscription($subscriptionid); |
86 |
my $subid; |
|
|
87 |
if ( $op eq "renewall" ) { |
88 |
foreach $subid (@subscriptionid){ |
89 |
next unless $subid; |
90 |
my $data = GetSubscription($subid); |
91 |
my $length = $data->{numberlength}; |
92 |
my $weeklength = $data->{weeklength}; |
93 |
my $monthlength = $data->{monthlength}; |
94 |
my $note = $data->{note}; |
95 |
my $startdate = $data->{enddate} || POSIX::strftime( "%Y-%m-%d", localtime ); |
96 |
ReNewSubscription( $subid,$loggedinuser,$startdate,$length,$weeklength, $monthlength, $note); |
97 |
} |
98 |
print $query->redirect("/cgi-bin/koha/serials/checkexpiration.pl?date=$date"); |
99 |
} |
100 |
|
101 |
my $subscription = GetSubscription(@subscriptionid); |
86 |
if ($subscription->{'cannotedit'}){ |
102 |
if ($subscription->{'cannotedit'}){ |
87 |
carp "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; |
103 |
carp "Attempt to renew subscription @subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; |
88 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
104 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=@subscriptionid"); |
89 |
} |
105 |
} |
90 |
|
106 |
|
91 |
$template->param( |
107 |
$template->param( |
Lines 96-102
$template->param(
Link Here
|
96 |
numberlength => $subscription->{numberlength}, |
112 |
numberlength => $subscription->{numberlength}, |
97 |
weeklength => $subscription->{weeklength}, |
113 |
weeklength => $subscription->{weeklength}, |
98 |
monthlength => $subscription->{monthlength}, |
114 |
monthlength => $subscription->{monthlength}, |
99 |
subscriptionid => $subscriptionid, |
115 |
subscriptionid => @subscriptionid, |
100 |
bibliotitle => $subscription->{bibliotitle}, |
116 |
bibliotitle => $subscription->{bibliotitle}, |
101 |
$op => 1, |
117 |
$op => 1, |
102 |
popup => ($query->param('mode')eq "popup"), |
118 |
popup => ($query->param('mode')eq "popup"), |
103 |
- |
|
|