From 5b6a77efbd41b615baf86ca2222e3b1c08fe106f Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Thu, 9 Sep 2010 22:10:16 -0600 Subject: [PATCH] Changed hard coded areacode number into a configurable variable --- bin/import_ward_data | 6 +++--- setup/db_config | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/import_ward_data b/bin/import_ward_data index bf970a2..ef7eac4 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -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 "") { diff --git a/setup/db_config b/setup/db_config index 485df6c..085075f 100644 --- a/setup/db_config +++ b/setup/db_config @@ -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"; -- 2.34.1