3 # $Id: susp_pkg.cgi,v 1.2 1998-12-17 09:12:48 ivan Exp $
5 # Usage: susp_pkg.cgi pkgnum
6 # http://server.name/path/susp_pkg.cgi pkgnum
8 # Note: Should be run setuid freeside as user nobody
10 # probably should generalize this to do cancels, suspensions, unsuspensions, etc.
12 # ivan@voicenet.com 97-feb-27
14 # now redirects to enter comments
15 # ivan@voicenet.com 97-may-8
18 # ivan@voicenet.com 97-jul-21
20 # FS::Search -> FS::Record ivan@sisd.com 98-mar-17
22 # Changes to allow page to work at a relative position in server
23 # bmccane@maxbaud.net 98-apr-3
25 # $Log: susp_pkg.cgi,v $
26 # Revision 1.2 1998-12-17 09:12:48 ivan
27 # s/CGI::(Request|Base)/CGI.pm/;
32 use CGI::Carp qw(fatalsToBrowser);
33 use FS::UID qw(cgisuidsetup);
34 use FS::Record qw(qsearchs);
41 $cgi->query_string =~ /^(\d+)$/ || die "Illegal pkgnum";
44 my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
46 my($error)=$cust_pkg->suspend;
47 &eidiot($error) if $error;
49 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));