changed int_notes to hti_notes and int_pri to hti_pri in the tc_indiv table
authorOwen Leonard <owen@balawis.leonard.fam>
Wed, 15 Sep 2010 06:42:33 +0000 (00:42 -0600)
committerOwen Leonard <owen@balawis.leonard.fam>
Wed, 15 Sep 2010 06:42:33 +0000 (00:42 -0600)
bin/import_ward_data
bin/upgrade_4_0_to_5_0
inc/class.tc.inc.php
sql/schema.dot
sql/tc.jpg
sql/tc.sql

index da32a0d873dd05996bf3b58bb9bea2a40bfe8e35..70f500ed260b038452c712f14b3b75317dfab88a 100755 (executable)
@@ -116,8 +116,8 @@ sub print_hash
 #| priesthood  | enum             | YES  |     | NULL    |                |
 #| ppi_pri     | int(10) unsigned | YES  |     | 1       |                |
 #| ppi_notes   | varchar(128)     | YES  |     | NULL    |                |
-#| int_pri     | int(10) unsigned | YES  |     | 1       |                |
-#| int_notes   | varchar(128)     | YES  |     | NULL    |                |
+#| hti_pri     | int(10) unsigned | YES  |     | 1       |                |
+#| hti_notes   | varchar(128)     | YES  |     | NULL    |                |
 #| attending   | tinyint(1)       | YES  |     | 0       |                |
 #| valid       | tinyint(1)       | YES  |     | NULL    |                |
 #+-------------+------------------+------+-----+---------+----------------+
index 085fa1ec53fe4cc2af0866387cb972d7de5d62a0..8f6d7e604cebd3f20ac265b12139734de0e74812 100755 (executable)
@@ -91,6 +91,14 @@ $sth->execute or die "-E- DB error: $DBI::errstr\n";
 $sth = $dbh->prepare("ALTER TABLE `tc_indiv` ADD `steward` ENUM( 'High Priest', 'Elder', '' ) NULL DEFAULT NULL AFTER `priesthood`");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
 
+# Rename int_pri column to hti_pri in the tc_indiv table
+$sth = $dbh->prepare("ALTER TABLE `tc_indiv` CHANGE `int_pri` `hti_pri` INT( 10 ) UNSIGNED NULL DEFAULT '1'");
+$sth->execute or die "-E- DB error: $DBI::errstr\n";
+
+# Rename int_notes column to hti_notes in the tc_indiv table
+$sth = $dbh->prepare("ALTER TABLE `tc_indiv` CHANGE `int_notes` `hti_notes` VARCHAR( 128 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL");
+$sth->execute or die "-E- DB error: $DBI::errstr\n";
+
 # Rename eq_family table to tc_family
 $sth = $dbh->prepare("RENAME TABLE `eq_family` TO `tc_family`");
 $sth->execute or die "-E- DB error: $DBI::errstr\n";
index 13fd2d54c45bc88abb7d19ebde4f1b65db64fcd1..b57856160c79ba01143957b2aad9c8e9db739e0e 100644 (file)
@@ -1748,17 +1748,17 @@ class tc
                        }
 
                        // Save any changes made to the int notes table
-                       $new_data = get_var('int_notes',array('POST'));
+                       $new_data = get_var('hti_notes',array('POST'));
                        foreach ($new_data as $entry) {
-                               $int_notes = $entry['notes'];
+                               $hti_notes = $entry['notes'];
                                $indiv_id = $entry['indiv_id'];
                                $indiv_name = $entry['indiv_name'];
-                               $int_pri = $entry['pri'];
-                               //print "int_notes: $int_notes indiv_name: $indiv_name <Br>";
+                               $hti_pri = $entry['pri'];
+                               //print "hti_notes: $hti_notes indiv_name: $indiv_name <Br>";
                                // Perform database save actions here
                                $this->db->query("UPDATE tc_indiv set " .
-                                                " int_notes='" . $int_notes . "'" .
-                                                ",int_pri='" . $int_pri . "'" .
+                                                " hti_notes='" . $hti_notes . "'" .
+                                                ",hti_pri='" . $hti_pri . "'" .
                                                 " WHERE indiv=" . $indiv_id,__LINE__,__FILE__);
                        }
 
@@ -1902,14 +1902,14 @@ class tc
                                                $indiv_id = $this->db2->f('indiv');
                                                $indiv_name = $this->db2->f('name');
                                                $indiv_phone[$indiv_id] = $this->db2->f('phone');
-                                               $indiv_int_pri[$indiv_id] = $this->db2->f('int_pri');
-                                               $indiv_int_notes[$indiv_id] = $this->db2->f('int_notes');
+                                               $indiv_hti_pri[$indiv_id] = $this->db2->f('hti_pri');
+                                               $indiv_hti_notes[$indiv_id] = $this->db2->f('hti_notes');
                                        }
                                        $id = $indiv_id;
                                        $name = $indiv_name;
                                        $phone = $indiv_phone[$id];
-                                       $int_pri = $indiv_int_pri[$id];
-                                       $int_notes = $indiv_int_notes[$id];
+                                       $hti_pri = $indiv_hti_pri[$id];
+                                       $hti_notes = $indiv_hti_notes[$id];
 
                                        // If the companionship has already had its quarterly interview,
                                        // Skip the other companion in the companionship.
@@ -1917,7 +1917,7 @@ class tc
                                                $completed_data.= "<tr bgcolor=". $this->t->get_var('tr_color2') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
                                                $completed_data.= "<td align=center>$phone</td>";
                                                $completed_data.= "<td align=center><a href=".$link.">$date</a></td>";
-                                               $completed_data.= "<td align=left>$int_notes</td>";
+                                               $completed_data.= "<td align=left>$hti_notes</td>";
                                                $completed_data.= '</tr>';
                                                $tr_color2 = $this->nextmatchs->alternate_row_color($tr_color2);
                                                $this->t->set_var('tr_color2',$tr_color2);
@@ -1948,10 +1948,10 @@ class tc
                                                $table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
                                                $table_data.= "<td align=center>$phone</td>";
                                                $table_data.= "<td align=center>";
-                                               $table_data.= '<select name=int_notes['.$i.'][pri]>';
+                                               $table_data.= '<select name=hti_notes['.$i.'][pri]>';
                                                foreach(range(0,6) as $num) {
                                                        if($num == 0) { $num = 1; } else {$num = $num*5; }
-                                                       if($int_pri == $num) { 
+                                                       if($hti_pri == $num) { 
                                                                $selected[$num] = 'selected="selected"'; 
                                                        } else { 
                                                                $selected[$num] = ''; 
@@ -1960,9 +1960,9 @@ class tc
                                                }
                                                $table_data.= '</select></td>';
                                                $table_data.= "<td align=center>$date</td>";
-                                               $table_data.= '<td><input type=text size="50" maxlength="128" name="int_notes['.$i.'][notes]" value="'.$int_notes.'">';
-                                               $table_data.= '<input type=hidden name="int_notes['.$i.'][indiv_id]" value="'.$id.'">';
-                                               $table_data.= '<input type=hidden name="int_notes['.$i.'][indiv_name]" value="'.$name.'">';
+                                               $table_data.= '<td><input type=text size="50" maxlength="128" name="hti_notes['.$i.'][notes]" value="'.$hti_notes.'">';
+                                               $table_data.= '<input type=hidden name="hti_notes['.$i.'][indiv_id]" value="'.$id.'">';
+                                               $table_data.= '<input type=hidden name="hti_notes['.$i.'][indiv_name]" value="'.$name.'">';
                                                $table_data.= '</td>';
                                                $table_data.= '</tr>'."\n";
                                                $i++;
@@ -1977,12 +1977,12 @@ class tc
                                                $comps_with_quarterly_int++;
                                                $int_completed=1;
                                                $date = $this->db2->f('date');
-                                               $int_notes = $this->db2->f('notes');
-                                               if(strlen($int_notes) > 40) { $int_notes = substr($int_notes,0,40) . "..."; }
+                                               $hti_notes = $this->db2->f('notes');
+                                               if(strlen($hti_notes) > 40) { $hti_notes = substr($hti_notes,0,40) . "..."; }
                                                $completed_data.= "<tr bgcolor=". $this->t->get_var('tr_color2') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
                                                $completed_data.= "<td align=center>$phone</td>";
                                                $completed_data.= "<td align=center><a href=".$link.">$date</a></td>";
-                                               $completed_data.= "<td align=left>$int_notes</td>";
+                                               $completed_data.= "<td align=left>$hti_notes</td>";
                                                $completed_data.= '</tr>';
                                        }
                                }
index fa99b9a0cb2feda823046771b044b42616d4019b..b189159ac8281ee7932ea7383f655a29b783e703 100644 (file)
@@ -7,7 +7,7 @@ digraph schema {
     shape = "record"
   ];
   indiv   [
-    label = "<i> indiv||<id> indiv_id|<n> name|<a> address|<p> phone|<em> email|<f> family|<hh> hh position|<po> priesthood|<st> steward|<pr> prospective|<pp> ppi_pri|<t> ppi_notes|<ip> int_pri|<in> int_notes|<a> attending|<v> valid"
+    label = "<i> indiv||<id> indiv_id|<n> name|<a> address|<p> phone|<em> email|<f> family|<hh> hh position|<po> priesthood|<st> steward|<pr> prospective|<pp> ppi_pri|<t> ppi_notes|<hp> hti_pri|<hn> hti_notes|<a> attending|<v> valid"
     shape = "record"
   ];
   companionship   [
index d771d39641886772c9c07b7e0e8307666e94a621..487cdfa8480359a4bcd83e8a58e8c0615fd0ac1e 100644 (file)
Binary files a/sql/tc.jpg and b/sql/tc.jpg differ
index 5d2ba996d4f5a906bebc539c952486baaca88275..23067212cd69b0cef6f8fc2f73e67aa4ec9b8f86 100644 (file)
@@ -118,8 +118,8 @@ CREATE TABLE `tc_indiv` (
   `steward` enum('High Priest','Elder') DEFAULT NULL,
   `ppi_pri` int(10) unsigned NOT NULL default '1',
   `ppi_notes` varchar(128) default NULL,
-  `int_pri` int(10) unsigned default '1',
-  `int_notes` varchar(128) default NULL,
+  `hti_pri` int(10) unsigned default '1',
+  `hti_notes` varchar(128) default NULL,
   `attending` tinyint(1) default '0',
   `valid` tinyint(1) default NULL,
   PRIMARY KEY  (`indiv`)