summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorlevinse <levinse>2011-04-25 04:00:03 +0000
committerlevinse <levinse>2011-04-25 04:00:03 +0000
commit1d15c6930650f2cceb13f7ae9da4acea5213643f (patch)
treedbd34e86992b610d658eb336f7b84195bac66853 /FS
parent6dcdca7cc0f9bcda9b8f1217114c28c2894386a5 (diff)
FCC form 477 report improvements, RT12089
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Report/FCC_477.pm26
-rw-r--r--FS/FS/Schema.pm10
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', '', '', '', '',