templates!!!
[freeside.git] / httemplate / misc / susp_pkg.cgi
1 <%
2 #
3 # $Id: susp_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $
4 #
5 # Usage: susp_pkg.cgi pkgnum
6 #        http://server.name/path/susp_pkg.cgi pkgnum
7 #
8 # probably should generalize this to do cancels, suspensions, unsuspensions, etc.
9 #
10 # ivan@voicenet.com 97-feb-27
11 #
12 # now redirects to enter comments
13 # ivan@voicenet.com 97-may-8
14 #
15 # rewrote for new API
16 # ivan@voicenet.com 97-jul-21
17 #
18 # FS::Search -> FS::Record ivan@sisd.com 98-mar-17
19 #
20 # Changes to allow page to work at a relative position in server
21 #       bmccane@maxbaud.net     98-apr-3
22 #
23 # $Log: susp_pkg.cgi,v $
24 # Revision 1.1  2001-07-30 07:36:04  ivan
25 # templates!!!
26 #
27 # Revision 1.6  1999/04/08 10:35:02  ivan
28 # import necessary subroutines from FS::CGI
29 #
30 # Revision 1.5  1999/02/28 00:03:52  ivan
31 # removed misleading comments
32 #
33 # Revision 1.4  1999/01/19 05:14:08  ivan
34 # for mod_perl: no more top-level my() variables; use vars instead
35 # also the last s/create/new/;
36 #
37 # Revision 1.3  1998/12/23 03:04:56  ivan
38 # $cgi->keywords instead of $cgi->query_string
39 #
40 # Revision 1.2  1998/12/17 09:12:48  ivan
41 # s/CGI::(Request|Base)/CGI.pm/;
42 #
43
44 use strict;
45 use vars qw( $cgi $query $pkgnum $cust_pkg $error );
46 use CGI;
47 use CGI::Carp qw(fatalsToBrowser);
48 use FS::UID qw(cgisuidsetup);
49 use FS::Record qw(qsearchs);
50 use FS::CGI qw(popurl eidiot);
51 use FS::cust_pkg;
52
53 $cgi = new CGI;
54 &cgisuidsetup($cgi);
55  
56 #untaint pkgnum
57 ($query) = $cgi->keywords;
58 $query =~ /^(\d+)$/ || die "Illegal pkgnum";
59 $pkgnum = $1;
60
61 $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
62
63 $error = $cust_pkg->suspend;
64 &eidiot($error) if $error;
65
66 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
67
68 %>