blob: 75b89c88f08ff3f3e9788aebe5a63c989531e5e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
%if ( $error ) {
% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string ) %>
%} else {
<% $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi") %>
%}
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $popnum = $cgi->param('popnum');
my $old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum;
my $new = new FS::svc_acct_pop ( {
map {
$_, scalar($cgi->param($_));
} fields('svc_acct_pop')
} );
my $error = '';
if ( $popnum ) {
$error = $new->replace($old);
} else {
$error = $new->insert;
$popnum=$new->getfield('popnum');
}
</%init>
|