Changed hard coded areacode number into a configurable variable
authorAlan J. Pippin <ajp@pippins.net>
Fri, 10 Sep 2010 04:10:16 +0000 (22:10 -0600)
committerAlan J. Pippin <ajp@pippins.net>
Fri, 10 Sep 2010 04:10:16 +0000 (22:10 -0600)
bin/import_ward_data
setup/db_config

index bf970a2565b17e1cc9834e838fb4586c4976517a..ef7eac4a6cb403645fe1692e92cfb50bb80af0bd 100755 (executable)
@@ -97,7 +97,7 @@ sub update_eq_aaronic_table
                $membership_data{$index}{$key} =~ /^Priest\s*$/i)) {
                $aaronic_name = $membership_data{$index}{'Preferred Name'};
                $phone = $membership_data{$index}{'Phone 1'};
-               if($phone =~ /(\d\d\d-\d\d\d\d)/) { $phone = "970-$1"; }
+               if($phone =~ /(\d\d\d-\d\d\d\d)/) { $phone = "$areacode-$1"; }
                if($phone =~ /^\(\d\d\d\) (\d\d\d-\d\d\d\d)/) { $phone = "$1-$2"; }
                $sth = $dbh->prepare("select * from eq_aaronic where name='$aaronic_name'");
                $sth->execute or die "-E- DB error: $DBI::errstr\n";
@@ -165,7 +165,7 @@ sub update_eq_elder_table
                   ($organization =~ /Sunday School/) ||
                   ($organization =~ /Primary/)
                   ) { $attending = 1; }
-               if($phone =~ /(\d\d\d-\d\d\d\d)/) { $phone = "970-$1"; }
+               if($phone =~ /(\d\d\d-\d\d\d\d)/) { $phone = "$areacode-$1"; }
                if($phone =~ /^\(\d\d\d\) (\d\d\d-\d\d\d\d)/) { $phone = "$1-$2"; }
                $sth = $dbh->prepare("select * from eq_elder where name='$elder_name'");
                $sth->execute or die "-E- DB error: $DBI::errstr\n";
@@ -497,7 +497,7 @@ sub update_eq_parent_table
                $hofh_id = $membership_data{$index}{'HofH ID'};
                $id = $membership_data{$index}{'Indiv ID'};
                $phone = $membership_data{$index}{'Phone 1'};
-               if($phone =~ /(\d\d\d-\d\d\d\d)/) { $phone = "970-$1"; }
+               if($phone =~ /(\d\d\d-\d\d\d\d)/) { $phone = "$areacode-$1"; }
                if($phone =~ /^\(\d\d\d\) (\d\d\d-\d\d\d\d)/) { $phone = "$1-$2"; }
                $address = $membership_data{$index}{'Street 1'};
                if($membership_data{$index}{'Street 2'} ne "") { 
index 485df6cc1aa8d429430965434bd73413831b595a..085075fcd650c21ffde63aa275310f049d8148b5 100644 (file)
@@ -10,4 +10,5 @@ $dbhost = "192.168.0.4"; # This can be an IP address or name
 $dbport = 3306;
 $dbuser = "phpgroupware"; # This may require an additional '\@localhost'
 $dbpass = "phpgroupware";
+$areacode = "970";