Browse Source

re-indenting + redirecting to subscription-detail.pl after a renewal.

3.0.x
toins 17 years ago
parent
commit
acf832a8f2
  1. 67
      serials/subscription-renew.pl

67
serials/subscription-renew.pl

@ -45,7 +45,6 @@ Id of the subscription this script has to renew
=cut =cut
use strict; use strict;
require Exporter; require Exporter;
use CGI; use CGI;
@ -59,38 +58,48 @@ use C4::Output;
use C4::Serials; use C4::Serials;
my $query = new CGI; my $query = new CGI;
my $dbh = C4::Context->dbh; my $dbh = C4::Context->dbh;
my $op = $query->param('op'); my $op = $query->param('op');
my $subscriptionid = $query->param('subscriptionid'); my $subscriptionid = $query->param('subscriptionid');
my $done = 0; # for after form has been submitted my $done = 0; # for after form has been submitted
my ($template, $loggedinuser, $cookie) my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
= get_template_and_user({template_name => "serials/subscription-renew.tmpl", {
query => $query, template_name => "serials/subscription-renew.tmpl",
type => "intranet", query => $query,
authnotrequired => 0, type => "intranet",
flagsrequired => {serials => 1}, authnotrequired => 0,
debug => 1, flagsrequired => { serials => 1 },
}); debug => 1,
if ($op eq "renew") { }
ReNewSubscription($subscriptionid,$loggedinuser,$query->param('startdate'),$query->param('numberlength'),$query->param('weeklength'),$query->param('monthlength'),$query->param('note')); );
$done = 1;
if ( $op eq "renew" ) {
ReNewSubscription(
$subscriptionid, $loggedinuser,
$query->param('startdate'), $query->param('numberlength'),
$query->param('weeklength'), $query->param('monthlength'),
$query->param('note')
);
$query->redirect('/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid='.$subscriptionid);
exit;
} }
my $subscription= GetSubscription($subscriptionid); my $subscription = GetSubscription($subscriptionid);
$template->param(startdate => format_date(GetExpirationDate($subscriptionid)||POSIX::strftime("%Y-%m-%d",localtime)), $template->param(
numberlength => $subscription->{numberlength}, startdate => format_date(
weeklength => $subscription->{weeklength}, GetExpirationDate($subscriptionid)
monthlength => $subscription->{monthlength}, || POSIX::strftime( "%Y-%m-%d", localtime )
subscriptionid => $subscriptionid, ),
bibliotitle => $subscription->{bibliotitle}, numberlength => $subscription->{numberlength},
$op => 1, weeklength => $subscription->{weeklength},
done => $done, monthlength => $subscription->{monthlength},
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), subscriptionid => $subscriptionid,
intranetstylesheet => C4::Context->preference("intranetstylesheet"), bibliotitle => $subscription->{bibliotitle},
IntranetNav => C4::Context->preference("IntranetNav"), $op => 1,
); done => $done,
);
# Print the page # Print the page
output_html_with_http_headers $query, $cookie, $template->output; output_html_with_http_headers $query, $cookie, $template->output;

Loading…
Cancel
Save