X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FReport%2FFCC_477.pm;h=fd088148b5e24d5db95420620fe212a296d2b92e;hb=63973c641c4be00765fa27e55c57cc5b9aa4da19;hp=582ddbee47e7cee2fa956add0f021959f2ddc087;hpb=150756fc304002a15fee61d622c230494f814ba6;p=freeside.git diff --git a/FS/FS/Report/FCC_477.pm b/FS/FS/Report/FCC_477.pm index 582ddbee4..fd088148b 100644 --- a/FS/FS/Report/FCC_477.pm +++ b/FS/FS/Report/FCC_477.pm @@ -22,31 +22,31 @@ Documentation. =cut @upload = qw( - <200kpbs - 200-768kpbs + <200kbps + 200-768kbps 768kbps-1.5mbps 1.5-3mpbs 3-6mbps 6-10mbps 10-25mbps 25-100mbps - >100bmps + >100mbps ); @download = qw( - 200-768kpbs + 200-768kbps 768kbps-1.5mbps - 1.5-3mpbs + 1.5-3mbps 3-6mbps 6-10mbps 10-25mbps 25-100mbps - >100bmps + >100mbps ); @technology = ( - 'Asymetric xDSL', - 'Symetric xDSL', + 'Asymmetric xDSL', + 'Symmetric xDSL', 'Other Wireline', 'Cable Modem', 'Optical Carrier', @@ -142,25 +142,44 @@ Documentation. ); sub restore_fcc477map { - my $key = shift; - FS::Record::scalar_sql('',"select formvalue from fcc477map where formkey = ?",$key); + 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; - - ''; + my $key = shift; + my $value = shift; + + local $SIG{HUP} = 'IGNORE'; + local $SIG{INT} = 'IGNORE'; + local $SIG{QUIT} = 'IGNORE'; + local $SIG{TERM} = 'IGNORE'; + local $SIG{TSTP} = 'IGNORE'; + local $SIG{PIPE} = 'IGNORE'; + + my $oldAutoCommit = $FS::UID::AutoCommit; + local $FS::UID::AutoCommit = 0; + my $dbh = dbh; + + # lame (should be normal FS::Record access) + + my $sql = "delete from fcc477map where formkey = ?"; + my $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute($key) or do { + warn "WARNING: Error removing FCC 477 form defaults: " . $sth->errstr; + $dbh->rollback if $oldAutoCommit; + }; + + $sql = "insert into fcc477map (formkey,formvalue) values (?,?)"; + $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute($key,$value) or do { + warn "WARNING: Error setting FCC 477 form defaults: " . $sth->errstr; + $dbh->rollback if $oldAutoCommit; + }; + + $dbh->commit or die $dbh->errstr if $oldAutoCommit; + + ''; } sub parse_technology_option {