diff options
author | khoff <khoff> | 2002-09-02 22:20:37 +0000 |
---|---|---|
committer | khoff <khoff> | 2002-09-02 22:20:37 +0000 |
commit | 2e18f8bf64d00e74fd221ac503daa718fe85b8bc (patch) | |
tree | bc8f19410ea115347e845bc2888f17dda359eac1 | |
parent | 3db6252cbb0e2178072f08e16f2a0ec0938e78c3 (diff) |
initial svc_broadband changes/additionssvc_broadband
-rwxr-xr-x | FS/FS/part_ac_field.pm | 102 | ||||
-rwxr-xr-x | bin/fs-setup | 72 | ||||
-rw-r--r-- | htetc/global.asa | 6 | ||||
-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/part_ac_field.cgi | 21 | ||||
-rw-r--r-- | httemplate/index.html | 4 |
7 files changed, 246 insertions, 1 deletions
diff --git a/FS/FS/part_ac_field.pm b/FS/FS/part_ac_field.pm new file mode 100755 index 0000000..dcb4452 --- /dev/null +++ b/FS/FS/part_ac_field.pm @@ -0,0 +1,102 @@ +package FS::part_ac_field; + +use strict; +use vars qw( @ISA ); +use FS::Record qw( qsearchs ); +use FS::ac_field; +use FS::ac; + + +@ISA = qw( FS::Record ); + +=head1 NAME + +FS::part_ac_field - Object methods for part_ac_field records + +=head1 SYNOPSIS + + use FS::part_ac_field; + + $record = new FS::part_ac_field \%hash; + $record = new FS::part_ac_field { 'column' => 'value' }; + + $error = $record->insert; + + $error = $new_record->replace($old_record); + + $error = $record->delete; + + $error = $record->check; + +=head1 DESCRIPTION + + +=over 4 + +=item blank + +=back + +=head1 METHODS + +=over 4 + +=item new HASHREF + +Create a new record. To add the record to the database, see L<"insert">. + +=cut + +sub table { 'part_ac_field'; } + +=item insert + +Adds this record to the database. If there is an error, returns the error, +otherwise returns false. + +=item delete + +Deletes this record from the database. If there is an error, returns the +error, otherwise returns false. + +=item replace OLD_RECORD + +Replaces OLD_RECORD with this one in the database. If there is an error, +returns the error, otherwise returns false. + +=item check + +Checks all fields to make sure this is a valid record. If there is an error, +returns the error, otherwise returns false. Called by the insert and replace +methods. + +=cut + +sub check { + my $self = shift; + my $error = ''; + + $self->name =~ /^([a-z0-9_\-\.]{1,15})$/i + or return "Invalid field name for part_ac_field"; + + ''; #no error +} + + +=back + +=head1 VERSION + +$Id: + +=head1 BUGS + +=head1 SEE ALSO + +L<FS::svc_broadband>, L<FS::ac>, L<FS::ac_block>, L<FS::ac_field>, schema.html +from the base documentation. + +=cut + +1; + diff --git a/bin/fs-setup b/bin/fs-setup index 9522ce3..8e6f6f9 100755 --- a/bin/fs-setup +++ b/bin/fs-setup @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: fs-setup,v 1.96 2002-07-06 12:13:49 ivan Exp $ +# $Id: fs-setup,v 1.96.2.1 2002-09-02 22:20:37 khoff Exp $ #to delay loading dbdef until we're ready BEGIN { $FS::Record::setup_hack = 1; } @@ -1023,7 +1023,77 @@ sub tables_hash_hack { 'index' => [], }, + 'ac_type' => { + 'columns' => [ + 'actypenum', 'int', '', '', + 'actypename', 'varchar', '', 15, + ], + 'primary_key' => 'actypenum', + 'unique' => [], + 'index' => [], + }, + + 'ac' => { + 'columns' => [ + 'acnum', 'int', '', '', + 'actypenum', 'int', '', '', + 'acname', 'varchar', '', 15, + ], + 'primary_key' => 'acnum', + 'unique' => [], + 'index' => [], + }, + + 'part_ac_field' => { + 'columns' => [ + 'acfieldpart', 'int', '', '', + 'actypenum', 'int', '', '', + 'name', 'varchar', '', 15, + 'ut_type', 'varchar', '', 15, + ], + 'primary_key' => 'acfieldpart', + 'unique' => [], + 'index' => [], + }, + + 'ac_field' => { + 'columns' => [ + 'acfieldpart', 'int', '', '', + 'acnum', 'int', '', '', + 'value', 'varchar', '', 127, + ], + 'primary_key' => '', + 'unique' => [ [ 'acfieldpart', 'acnum' ] ], + 'index' => [], + }, + + 'ac_block' => { + 'columns' => [ + 'acnum', 'int', '', '', + 'ip_gateway', 'char', '', 15, + 'ip_netmask', 'int', '', '', + ], + 'primary_key' => '', + 'unique' => [], + 'index' => [], + }, + 'svc_broadband' => { + 'columns' => [ + 'svcnum', 'int', '', '', + 'actypenum', 'int', '', '', + 'speed_up', 'int', '', '', + 'speed_down', 'int', '', '', + 'acnum', 'int', '', '', + 'ip_addr', 'char', '', 15, + 'ip_netmask', 'int', '', '', + 'mac_addr', 'char', '', 17, + 'location', 'varchar', '', 127, + ], + 'primary_key' => 'svcnum', + 'unique' => [], + 'index' => [], + }, ); diff --git a/htetc/global.asa b/htetc/global.asa index d04a5ed..3c8380f 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -46,6 +46,12 @@ use FS::svc_acct_sm; use FS::svc_domain; use FS::svc_forward; use FS::svc_www; +use FS::ac_type; +use FS::ac; +use FS::part_ac_field; +use FS::ac_field; +use FS::ac_block; +use FS::svc_broadband; use FS::type_pkgs; use FS::part_export; use FS::part_export_option; diff --git a/httemplate/edit/process/ac_block.cgi b/httemplate/edit/process/ac_block.cgi new file mode 100755 index 0000000..b1c3c72 --- /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 0000000..2bfe331 --- /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/part_ac_field.cgi b/httemplate/edit/process/part_ac_field.cgi new file mode 100755 index 0000000..38ad586 --- /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/index.html b/httemplate/index.html index cd9a203..3721206 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -193,6 +193,10 @@ into counties and assign different tax rates to each. <LI><A HREF="browse/svc_acct_pop.cgi">View/Edit Access Numbers</A> - Points of Presence + <LI><A HREF="browse/ac_type.cgi">View/Edit AC Types</A> + - Broadband service access concentrator types. + <LI><A HREF="browse/ac.cgi">View/Edit AC</A> + - Broadband service access concentrators. <LI><A HREF="browse/part_bill_event.cgi">View/Edit invoice events</A> - Actions for overdue invoices <LI><A HREF="browse/msgcat.cgi">View/Edit message catalog</A> - Change error messages and other customizable labels. </ul> |