From eb061f5119325e666f0dff40d4089e5c1df58e17 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Sun, 16 Mar 2008 19:58:34 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'TRIXBOX_2_6'. --- httemplate/misc/process/cancel_pkg.html | 79 --------------------------------- 1 file changed, 79 deletions(-) delete mode 100755 httemplate/misc/process/cancel_pkg.html (limited to 'httemplate/misc/process/cancel_pkg.html') diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html deleted file mode 100755 index d265c1849..000000000 --- a/httemplate/misc/process/cancel_pkg.html +++ /dev/null @@ -1,79 +0,0 @@ -<% header("Package $past{$method}") %> - - - -<%once> - -my %past = ( 'cancel' => 'cancelled', - 'expire' => 'expired', - 'suspend' => 'suspended', - 'adjourn' => 'adjourned', - ); - -#i'm sure this is false laziness with somewhere, at least w/misc/cancel_pkg.html -my %right = ( 'cancel' => 'Cancel customer package immediately', - 'expire' => 'Cancel customer package later', - 'suspend' => 'Suspend customer package', - 'adjourn' => 'Suspend customer package later', - ); - - -<%init> - -#untaint method -my $method = $cgi->param('method'); -$method =~ /^(cancel|expire|suspend|adjourn)$/ or die "Illegal method"; -$method = $1; - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right($right{$method}); - -#untaint pkgnum -my $pkgnum = $cgi->param('pkgnum'); -$pkgnum =~ /^(\d+)$/ or die "Illegal pkgnum"; -$pkgnum = $1; - -#untaint reasonnum -my $reasonnum = $cgi->param('reasonnum'); -$reasonnum =~ /^(-?\d+)$/ or die "Illegal reasonnum"; -$reasonnum = $1; - -my $date = time; -if ($method eq 'expire' || $method eq 'adjourn'){ - #untaint date - $date = $cgi->param('date'); - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date = $1; -} - -my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); - -#my $otaker = $FS::CurrentUser::CurrentUser->name; -#$otaker = $FS::CurrentUser::CurrentUser->username -# if ($otaker eq "User, Legacy"); - -if ($reasonnum == -1) { - $reasonnum = { - 'typenum' => scalar( $cgi->param('newreasonnumT') ), - 'reason' => scalar( $cgi->param('newreasonnum' ) ), - }; -} - -my $error; -if ($method eq 'expire' || $method eq 'adjourn'){ - my %hash = $cust_pkg->hash; - $hash{$method} = $date; - my $new = new FS::cust_pkg \%hash; - $error = $new->replace($cust_pkg, 'reason' => $reasonnum); -} else { - $error = $cust_pkg->$method( 'reason' => $reasonnum ); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cancel_pkg.html?". $cgi->query_string ); -} - - -- cgit v1.2.1