3 # $Id: svc_acct_sm.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $
6 # http://server.name/path/svc_acct_sm.cgi
8 # lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled.
10 # ivan@voicenet.com 97-jan-6
12 # enabled modifications
14 # ivan@voicenet.com 97-may-7
16 # fixed removal of cust_svc record on modifications!
17 # ivan@voicenet.com 97-jun-5
19 # rewrite ivan@sisd.com 98-mar-15
21 # Changes to allow page to work at a relative position in server
22 # bmccane@maxbaud.net 98-apr-3
24 # $Log: svc_acct_sm.cgi,v $
25 # Revision 1.1 2001-07-30 07:36:04 ivan
28 # Revision 1.6 1999/02/28 00:03:46 ivan
29 # removed misleading comments
31 # Revision 1.5 1999/02/07 09:59:32 ivan
32 # more mod_perl fixes, and bugfixes Peter Wemm sent via email
34 # Revision 1.4 1999/01/19 05:14:00 ivan
35 # for mod_perl: no more top-level my() variables; use vars instead
36 # also the last s/create/new/;
38 # Revision 1.3 1999/01/18 22:48:01 ivan
39 # s/create/new/g; and use fields('table_name')
41 # Revision 1.2 1998/12/17 08:40:29 ivan
42 # s/CGI::Request/CGI.pm/; etc
46 use vars qw( $cgi $svcnum $old $new $error );
48 use CGI::Carp qw(fatalsToBrowser);
49 use FS::UID qw(cgisuidsetup);
50 use FS::Record qw(qsearchs fields);
52 use FS::CGI qw(popurl);
57 $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
60 $old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum;
62 #unmunge domsvc and domuid
63 #$cgi->param('domsvc',(split(/:/, $cgi->param('domsvc') ))[0] );
64 #$cgi->param('domuid',(split(/:/, $cgi->param('domuid') ))[0] );
66 $new = new FS::svc_acct_sm ( {
68 ($_, scalar($cgi->param($_)));
69 #} qw(svcnum pkgnum svcpart domuser domuid domsvc)
70 } ( fields('svc_acct_sm'), qw( pkgnum svcpart ) )
74 $error = $new->replace($old);
76 $error = $new->insert;
77 $svcnum = $new->getfield('svcnum');
81 $cgi->param('error', $error);
82 print $cgi->redirect(popurl(2). "svc_acct_sm.cgi?". $cgi->query_string );
84 print $cgi->redirect(popurl(3). "view/svc_acct_sm.cgi?$svcnum");