diff options
author | khoff <khoff> | 2002-09-09 23:05:30 +0000 |
---|---|---|
committer | khoff <khoff> | 2002-09-09 23:05:30 +0000 |
commit | 44398c83f25bf4e43838df9f39331c29fdeff19d (patch) | |
tree | 963837373a3b621ee2140adad0eb0b44e12c75e6 /httemplate/edit/process | |
parent | 91292eadb6254740a9b72e5dc95f575593f6a35d (diff) |
svc_broadband merge
Diffstat (limited to 'httemplate/edit/process')
-rwxr-xr-x | httemplate/edit/process/ac.cgi | 28 | ||||
-rwxr-xr-x | httemplate/edit/process/ac_block.cgi | 21 | ||||
-rwxr-xr-x | httemplate/edit/process/ac_field.cgi | 21 | ||||
-rwxr-xr-x | httemplate/edit/process/ac_type.cgi | 28 | ||||
-rwxr-xr-x | httemplate/edit/process/part_ac_field.cgi | 21 | ||||
-rwxr-xr-x | httemplate/edit/process/part_svc.cgi | 2 | ||||
-rw-r--r-- | httemplate/edit/process/svc_broadband.cgi | 45 |
7 files changed, 165 insertions, 1 deletions
diff --git a/httemplate/edit/process/ac.cgi b/httemplate/edit/process/ac.cgi new file mode 100755 index 000000000..fc434a807 --- /dev/null +++ b/httemplate/edit/process/ac.cgi @@ -0,0 +1,28 @@ +<% + +my $acnum = $cgi->param('acnum'); + +my $old = qsearchs('ac',{'acnum'=>$acnum}) if $acnum; + +my $new = new FS::ac ( { + map { + $_, scalar($cgi->param($_)); + } fields('ac') +} ); + +my $error = ''; +if ( $acnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $acnum=$new->getfield('acnum'); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "ac.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/ac.cgi"); +} + +%> diff --git a/httemplate/edit/process/ac_block.cgi b/httemplate/edit/process/ac_block.cgi new file mode 100755 index 000000000..b1c3c726b --- /dev/null +++ b/httemplate/edit/process/ac_block.cgi @@ -0,0 +1,21 @@ +<% + +my $new = new FS::ac_block ( { + map { + $_, scalar($cgi->param($_)); + } fields('ac_block') +} ); + +my $error = ''; +$error = $new->check; + +unless ( $error ) { $error = $new->insert; } + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "ac.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(2). "ac.cgi?". $cgi->param('acnum')); +} + +%> diff --git a/httemplate/edit/process/ac_field.cgi b/httemplate/edit/process/ac_field.cgi new file mode 100755 index 000000000..2bfe3312f --- /dev/null +++ b/httemplate/edit/process/ac_field.cgi @@ -0,0 +1,21 @@ +<% + +my $new = new FS::ac_field ( { + map { + $_, scalar($cgi->param($_)); + } fields('ac_field') +} ); + +my $error = ''; +$error = $new->check; + +unless ( $error ) { $error = $new->insert; } + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "ac.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(2). "ac.cgi?". $cgi->param('acnum')); +} + +%> diff --git a/httemplate/edit/process/ac_type.cgi b/httemplate/edit/process/ac_type.cgi new file mode 100755 index 000000000..ca232ba58 --- /dev/null +++ b/httemplate/edit/process/ac_type.cgi @@ -0,0 +1,28 @@ +<% + +my $actypenum = $cgi->param('actypenum'); + +my $old = qsearchs('ac_type',{'actypenum'=>$actypenum}) if $actypenum; + +my $new = new FS::ac_type ( { + map { + $_, scalar($cgi->param($_)); + } fields('ac_type') +} ); + +my $error = ''; +if ( $actypenum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $actypenum=$new->getfield('actypenum'); +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "ac_type.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/ac_type.cgi"); +} + +%> diff --git a/httemplate/edit/process/part_ac_field.cgi b/httemplate/edit/process/part_ac_field.cgi new file mode 100755 index 000000000..38ad586f7 --- /dev/null +++ b/httemplate/edit/process/part_ac_field.cgi @@ -0,0 +1,21 @@ +<% + +my $new = new FS::part_ac_field ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_ac_field') +} ); + +my $error = ''; +$error = $new->check; + +unless ( $error ) { $error = $new->insert; } + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "ac_type.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(2). "ac_type.cgi?". $cgi->param('actypenum')); +} + +%> diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi index 859670b17..69e8ac2fa 100755 --- a/httemplate/edit/process/part_svc.cgi +++ b/httemplate/edit/process/part_svc.cgi @@ -17,7 +17,7 @@ my $new = new FS::part_svc ( { push @fields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } @fields; } grep defined( $FS::Record::dbdef->table($_) ), - qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) + qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www svc_broadband ) ) } ); diff --git a/httemplate/edit/process/svc_broadband.cgi b/httemplate/edit/process/svc_broadband.cgi new file mode 100644 index 000000000..fd7ba20d5 --- /dev/null +++ b/httemplate/edit/process/svc_broadband.cgi @@ -0,0 +1,45 @@ +<% + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +my $svcnum = $1; + +my $old; +if ( $svcnum ) { + $old = qsearchs('svc_broadband', { 'svcnum' => $svcnum } ) + or die "fatal: can't find broadband service (svcnum $svcnum)!"; +} else { + $old = ''; +} + +my $new = new FS::svc_broadband ( { + map { + ($_, scalar($cgi->param($_))); + } ( fields('svc_broadband'), qw( pkgnum svcpart ) ) +} ); + +unless ( $new->ip_addr ) { + $new->ip_addr(join('.', (map $cgi->param('ip_addr_'.$_), (a..d)))); +} + +unless ( $new->mac_addr) { + $new->mac_addr(join(':', (map $cgi->param('mac_addr_'.$_), (a..f)))); +} + +my $error; +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->svcnum; +} + +if ( $error ) { + $cgi->param('error', $error); + $cgi->param('ip_addr', $new->ip_addr); + $cgi->param('mac_addr', $new->mac_addr); + print $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum ); +} + +%> |