diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Report/FCC_477.pm | 26 | ||||
-rw-r--r-- | FS/FS/Schema.pm | 10 |
2 files changed, 36 insertions, 0 deletions
diff --git a/FS/FS/Report/FCC_477.pm b/FS/FS/Report/FCC_477.pm index 518b9f0e1..453cf8dd8 100644 --- a/FS/FS/Report/FCC_477.pm +++ b/FS/FS/Report/FCC_477.pm @@ -3,6 +3,7 @@ package FS::Report::FCC_477; use strict; use vars qw( @ISA @upload @download @technology @part2aoption @part2boption ); use FS::Report; +use FS::Record qw( dbh ); @ISA = qw( FS::Report ); @@ -76,12 +77,37 @@ Documentation. 'other broadband', ); +sub restore_fcc477map { + my $key = shift; + FS::Record::scalar_sql('',"select formvalue from fcc477map where formkey = ?",$key); +} + +sub save_fcc477map { + my $key = shift; + my $value = shift; + + # lame, particularly lack of transactions + + my $sql = "delete from fcc477map where formkey = ?"; + my $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute($key) or die "Error removing FCC 477 form defaults: " . $sth->errstr; + + $sql = "insert into fcc477map (formkey,formvalue) values (?,?)"; + $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute($key,$value) or die "Error setting FCC 477 form defaults: " . $sth->errstr; + + ''; +} + sub parse_technology_option { my $cgi = shift; + my $save = shift; my @result = (); my $i = 0; for (my $i = 0; $i < scalar(@technology); $i++) { my $value = $cgi->param("part1_technology_option_$i"); #lame + save_fcc477map("part1_technology_option_$i",$value) + if $save && $value =~ /^\d+$/; push @result, $value =~ /^\d+$/ ? $value : 0; } return (@result); diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 0b6ea0d2b..deb3995d2 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1406,6 +1406,16 @@ sub tables_hashref { 'index' => [ ['batchnum'], ['invnum'], ['custnum'] ], }, + 'fcc477map' => { + 'columns' => [ + 'formkey', 'varchar', '', '', '', '', + 'formvalue', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'formkey', + 'unique' => [], + 'index' => [], + }, + 'cust_pkg' => { 'columns' => [ 'pkgnum', 'serial', '', '', '', '', |