From 8720abcdfd49bddf12b95383e558525efd8fed72 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 9 Sep 2010 01:05:45 -0600 Subject: [PATCH] changed from email address, import email addresses to eq_elder, flush temp files in mlstrimmer.py so we don't keep losing data --- bin/import_ward_data | 7 ++++++- doc/install.txt | 8 ++++++++ inc/class.eq.inc.php | 7 +++---- mls/EQ Prospective Elders.mls | 11 +++++++++++ mls/mlstrimmer.py | 1 + mls/windowsGUI/MLSFileTrimmer/MLSRequiredFields.xml | 8 ++++++++ 6 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 mls/EQ Prospective Elders.mls diff --git a/bin/import_ward_data b/bin/import_ward_data index b369661..37fb248 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -199,6 +199,8 @@ sub update_eq_elder_table ) { $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}{'Individual E-mail'}; + if ($email eq "") { $email = $membership_data{$index}{'Household E-mail'}; } $sth = $dbh->prepare("select * from eq_elder where name='$elder_name'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; my @data = (); @@ -207,7 +209,7 @@ sub update_eq_elder_table if($rows == 0) { # No existing records found for this elder, make a new entry print " Adding new Elder: $elder_name\n"; - $sth = $dbh->prepare("insert into eq_elder values (NULL,'$id','$elder_name','$phone','','1','','1','',$attending,1)"); + $sth = $dbh->prepare("insert into eq_elder values (NULL,'$id','$elder_name','$phone','$email','1','','1','',$attending,1)"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; } elsif($rows == 1) { # An existing record was found for this elder, update it @@ -224,6 +226,8 @@ sub update_eq_elder_table $sth->execute or die "-E- DB error: $DBI::errstr\n"; $sth = $dbh->prepare("update eq_elder set indiv_id='$id' where name='$elder_name'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; + $sth = $dbh->prepare("update eq_elder set email='$email' where name='$elder_name'"); + $sth->execute or die "-E- DB error: $DBI::errstr\n"; } else { # More than one record was found. Error! This shouldn't happen. print " -E- More than one record found ($rows) for Elder: $elder_name\n"; @@ -841,6 +845,7 @@ print "\n-> Processing all ward data files in $datadir\n"; ################################################### # Parse Ward Data Files +#&optional_csv_to_hash("$datadir/EQ\ Prospective\ Elders.csv", \%prospective_elder_data); &csv_to_hash("$datadir/Membership.csv",\%membership_data); &csv_to_hash("$datadir/HomeTeaching.csv",\%hometeaching_data); &csv_to_hash("$datadir/Organization.csv",\%organization_data); diff --git a/doc/install.txt b/doc/install.txt index 114ebaa..11f2728 100644 --- a/doc/install.txt +++ b/doc/install.txt @@ -73,6 +73,8 @@ Requirements Full Name Priesthood HH Position + Household E-mail + Individual E-mail Hometeaching.csv: Home Teacher 1 @@ -91,5 +93,11 @@ Requirements Org Seq Sustained + EQ Prospective Elders.csv + (optional file that lists the prospective elders for which the EQ has stewardship. + Use this file if you want them listed in the PPI list + import mls/EQ\ Prospective\ Elders.mls as a new report into MLS to create the csv file.) + Home Teacher per Companionship.csv (optional file that lists home teaching stats - use all fields) import mls/Home\ Teacher\ per\ Companionship.mls as a new report into MLS to create the csv file. + diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index c760100..921c142 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -4424,10 +4424,6 @@ class eq $dtstart = gmdate("Ymd"."\T"."His"."\Z", mktime($hour,$minute,$seconds,$month,$day,$year)); $dtstartstr = date("l, F d, o g:i A", mktime($hour,$minute,$seconds,$month,$day,$year)); - // Set the email address of the person making the appointment - $from = $GLOBALS['phpgw_info']['user']['fullname'] . "<" . - $GLOBALS['phpgw_info']['user']['preferences']['email']['address'] . ">"; - $sql = "SELECT * FROM eq_presidency where presidency='$presidency'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { @@ -4435,6 +4431,9 @@ class eq $interviewer = $this->db2->f('name'); } + // Set the email address of the interviewer + $from = $email; + if($elder > 0) { $sql = "SELECT * FROM eq_elder where elder='$elder'"; $this->db2->query($sql,__LINE__,__FILE__); diff --git a/mls/EQ Prospective Elders.mls b/mls/EQ Prospective Elders.mls new file mode 100644 index 0000000..a0472b9 --- /dev/null +++ b/mls/EQ Prospective Elders.mls @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/mls/mlstrimmer.py b/mls/mlstrimmer.py index ccd55e3..8ea12d9 100755 --- a/mls/mlstrimmer.py +++ b/mls/mlstrimmer.py @@ -53,6 +53,7 @@ def ParseFile(xmlNode, zipfile): if options.verbose: print lineToWrite tf.write(lineToWrite + "\n") #if options.verbose: print line + tf.flush() zipfile.write(tf.name, xmlNode.getAttribute("Name")) tf.close() diff --git a/mls/windowsGUI/MLSFileTrimmer/MLSRequiredFields.xml b/mls/windowsGUI/MLSFileTrimmer/MLSRequiredFields.xml index 1c2ea73..d2958f4 100644 --- a/mls/windowsGUI/MLSFileTrimmer/MLSRequiredFields.xml +++ b/mls/windowsGUI/MLSFileTrimmer/MLSRequiredFields.xml @@ -14,6 +14,8 @@ Full Name Priesthood HH Position + Household E-mail + Individual E-mail @@ -44,5 +46,11 @@ csv * + + + A list of prospective elders in the EQ stewardship + csv + * + -- 2.34.1