more spelling
[freeside.git] / FS / FS / Report / FCC_477.pm
index 582ddbe..fd08814 100644 (file)
@@ -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 {