3 # cancel_pkg.cgi: Cancel a package
5 # Usage: cancel_pkg.cgi pkgnum
6 # http://server.name/path/cancel_pkg.cgi pkgnum
8 # Note: Should be run setuid freeside as user nobody
10 # IT DOESN'T RUN THE APPROPRIATE PROGRAMS YET!!!!
12 # probably should generalize this to do cancels, suspensions, unsuspensions, etc.
14 # ivan@voicenet.com 97-jan-2
16 # still kludgy, but now runs /dbin/cancel $pkgnum
17 # ivan@voicenet.com 97-feb-27
19 # doesn't run if pkgnum doesn't match regex
20 # ivan@voicenet.com 97-mar-6
22 # now redirects to enter comments
23 # ivan@voicenet.com 97-may-8
26 # ivan@voicenet.com 97-jul-21
28 # Changes to allow page to work at a relative position in server
29 # bmccane@maxbaud.net 98-apr-3
32 use CGI::Base qw(:DEFAULT :CGI); # CGI module
33 use CGI::Carp qw(fatalsToBrowser);
34 use FS::UID qw(cgisuidsetup);
35 use FS::Record qw(qsearchs);
37 use FS::CGI qw(idiot);
39 my($cgi) = new CGI::Base;
44 $QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum";
47 my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
49 bless($cust_pkg,'FS::cust_pkg');
50 my($error)=$cust_pkg->cancel;
51 idiot($error) if $error;
53 $cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum'));