From 355decc5cec577acbcbafe58d335b2d1523c9e71 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sun, 19 Sep 2010 22:39:16 -0600 Subject: [PATCH] Fixed import script so it sets "attending" correctly so that attendance gets prepopulated. --- bin/import_ward_data | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/import_ward_data b/bin/import_ward_data index c61f2a6..6fbb96b 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -138,22 +138,22 @@ sub update_tc_individual_table $phone = $membership_data{$index}{'Household Phone'}; $priesthood = $membership_data{$index}{'Priesthood'}; $hhposition = $membership_data{$index}{'HH Position'}; - $steward = ""; # This will be set later - # Default to the "Elders" quorum if the Organization data per member isn't available + $steward = ""; # This will be set later + # Default to the "Elders" quorum if the Organization data per member isn't available # Only add "Elders" to the quorum since we don't have any other data availalbe to us to make a call # TODO: make steward flexible with a setting in the config file - if((! -e "$datadir/Organization\ class\ per\ member.csv") && ($priesthood =~ /Elder/i)) { + if((! -e "$datadir/Organization\ class\ per\ member.csv") && ($priesthood =~ /Elder/i)) { $steward = "Elder"; $organization = "Elders"; } - # Preferred method is to pull organization data from the csv file + # Preferred method is to pull organization data from the csv file else { $organization = $organization_by_id{$id}; } $attending = 0; if(($organization =~ /Elders/) || ($organization =~ /Young Men/) || ($organization =~ /Sunday School/) || ($organization =~ /Primary/) - ) { $attending = 1; } + ) { $attending = 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"; } $email = $membership_data{$index}{'indiv E-mail'}; @@ -230,6 +230,7 @@ sub update_tc_calling_table() $name =~ s/\'/\\'/g; #' $organization = $organization_data{$index}{'Organization'}; $organization_by_name{$name} = $organization; + $indiv_id = $organization_data{$index}{'Indiv ID'}; $organization_by_id{$indiv_id} = $organization; $position = $organization_data{$index}{'Position'}; $sustained = $organization_data{$index}{'Sustained'}; -- 2.34.1