changed from email address, import email addresses to eq_elder, flush temp files...
authorOwen Leonard <owen@balawis.leonard.fam>
Thu, 9 Sep 2010 07:05:45 +0000 (01:05 -0600)
committerOwen Leonard <owen@balawis.leonard.fam>
Fri, 10 Sep 2010 05:07:32 +0000 (23:07 -0600)
bin/import_ward_data
doc/install.txt
inc/class.eq.inc.php
mls/EQ Prospective Elders.mls [new file with mode: 0644]
mls/mlstrimmer.py
mls/windowsGUI/MLSFileTrimmer/MLSRequiredFields.xml

index b3696616902b888348a922fb2d6067058a5a78cf..37fb24869615dcbad74fd17a69be1b442c64559b 100755 (executable)
@@ -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);
index 114ebaa99135ee72374e7ed0fc5c83ba79752fec..11f272801c159f03a40062a14f5f042af456dd3a 100644 (file)
@@ -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.
+
index c7601008cc1bcb0f13c2cba2fcc2598999e22d81..921c142ca88a4bcadc5858172d4bba5ba75b21fb 100644 (file)
@@ -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 (file)
index 0000000..a0472b9
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<customReport name="EQ Prospective Elders" description="" isPortrait="false" groupOption="NONE" splitGroups="false">
+  <query string="2,7,18,true,-1" />
+  <query string="1,0,1,true,-1" />
+  <query string="15,0,3,true,-1" />
+  <query string="11,1,1,true,-1" />
+  <column typeID="27" width="50" />
+  <column typeID="31" width="50" />
+</customReport>
+
+
index ccd55e314a2a02df8ee12f8c2cc98cde0f32b9d3..8ea12d9f64331640a768342e153f4580631f889c 100755 (executable)
@@ -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()
                
index 1c2ea735d5ac1a4f45b09680c0ea74c292bc5d46..d2958f4cc91d7f2bab22db55e8fad0d55b3e265a 100644 (file)
@@ -14,6 +14,8 @@
       <MLSField>Full Name</MLSField>\r
       <MLSField>Priesthood</MLSField>\r
       <MLSField>HH Position</MLSField>\r
+      <MLSField>Household E-mail</MLSField>\r
+      <MLSField>Individual E-mail</MLSField>\r
     </MLSFile>\r
 \r
     <MLSFile Name="HomeTeaching.csv">\r
       <Extension>csv</Extension>\r
       <MLSField>*</MLSField>\r
     </MLSFile>\r
+\r
+    <MLSFile Name="EQ Prospective Elders.csv">\r
+      <Description>A list of prospective elders in the EQ stewardship</Description>\r
+      <Extension>csv</Extension>\r
+      <MLSField>*</MLSField>\r
+    </MLSFile>\r
   </CSVFiles>\r
 </ThirdCouncelorMLSFiles>\r