3 # $Id: cancel_pkg.cgi,v 1.5 1999-02-28 00:03:49 ivan Exp $
5 # Usage: cancel_pkg.cgi pkgnum
6 # http://server.name/path/cancel_pkg.cgi pkgnum
8 # IT DOESN'T RUN THE APPROPRIATE PROGRAMS YET!!!!
10 # probably should generalize this to do cancels, suspensions, unsuspensions, etc.
12 # ivan@voicenet.com 97-jan-2
14 # still kludgy, but now runs /dbin/cancel $pkgnum
15 # ivan@voicenet.com 97-feb-27
17 # doesn't run if pkgnum doesn't match regex
18 # ivan@voicenet.com 97-mar-6
20 # now redirects to enter comments
21 # ivan@voicenet.com 97-may-8
24 # ivan@voicenet.com 97-jul-21
26 # Changes to allow page to work at a relative position in server
27 # bmccane@maxbaud.net 98-apr-3
29 # $Log: cancel_pkg.cgi,v $
30 # Revision 1.5 1999-02-28 00:03:49 ivan
31 # removed misleading comments
33 # Revision 1.4 1999/01/19 05:14:04 ivan
34 # for mod_perl: no more top-level my() variables; use vars instead
35 # also the last s/create/new/;
37 # Revision 1.3 1998/12/23 03:02:54 ivan
38 # $cgi->keywords instead of $cgi->query_string
40 # Revision 1.2 1998/12/17 09:12:43 ivan
41 # s/CGI::(Request|Base)/CGI.pm/;
45 use vars qw ( $cgi $query $pkgnum $cust_pkg $error );
47 use CGI::Carp qw(fatalsToBrowser);
48 use FS::UID qw(cgisuidsetup);
49 use FS::CGI qw(eidiot popurl);
50 use FS::Record qw(qsearchs);
57 ($query) = $cgi->keywords;
58 $query =~ /^(\d+)$/ || die "Illegal pkgnum";
61 $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
63 $error = $cust_pkg->cancel;
64 eidiot($error) if $error;
66 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));