From: Owen Leonard Date: Wed, 15 Sep 2010 06:42:33 +0000 (-0600) Subject: changed int_notes to hti_notes and int_pri to hti_pri in the tc_indiv table X-Git-Tag: release_1_0_0~39 X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=commitdiff_plain;h=8abee5d598cfb1b52e0d1b929db6dc6c33f5bddd;p=eq%2F.git changed int_notes to hti_notes and int_pri to hti_pri in the tc_indiv table --- diff --git a/bin/import_ward_data b/bin/import_ward_data index da32a0d..70f500e 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -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 | | #+-------------+------------------+------+-----+---------+----------------+ diff --git a/bin/upgrade_4_0_to_5_0 b/bin/upgrade_4_0_to_5_0 index 085fa1e..8f6d7e6 100755 --- a/bin/upgrade_4_0_to_5_0 +++ b/bin/upgrade_4_0_to_5_0 @@ -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"; diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php index 13fd2d5..b578561 100644 --- a/inc/class.tc.inc.php +++ b/inc/class.tc.inc.php @@ -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
"; + $hti_pri = $entry['pri']; + //print "hti_notes: $hti_notes indiv_name: $indiv_name
"; // 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.= "$name"; $completed_data.= "$phone"; $completed_data.= "$date"; - $completed_data.= "$int_notes"; + $completed_data.= "$hti_notes"; $completed_data.= ''; $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.= "$name"; $table_data.= "$phone"; $table_data.= ""; - $table_data.= ''; 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.= ''; $table_data.= "$date"; - $table_data.= ''; - $table_data.= ''; - $table_data.= ''; + $table_data.= ''; + $table_data.= ''; + $table_data.= ''; $table_data.= ''; $table_data.= ''."\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.= "$name"; $completed_data.= "$phone"; $completed_data.= "$date"; - $completed_data.= "$int_notes"; + $completed_data.= "$hti_notes"; $completed_data.= ''; } } diff --git a/sql/schema.dot b/sql/schema.dot index fa99b9a..b189159 100644 --- a/sql/schema.dot +++ b/sql/schema.dot @@ -7,7 +7,7 @@ digraph schema { shape = "record" ]; indiv [ - label = " indiv|| indiv_id| name| address|

phone| email| family| hh position| priesthood| steward| prospective| ppi_pri| ppi_notes| int_pri| int_notes| attending| valid" + label = " indiv|| indiv_id| name| address|

phone| email| family| hh position| priesthood| steward| prospective| ppi_pri| ppi_notes| hti_pri| hti_notes| attending| valid" shape = "record" ]; companionship [ diff --git a/sql/tc.jpg b/sql/tc.jpg index d771d39..487cdfa 100644 Binary files a/sql/tc.jpg and b/sql/tc.jpg differ diff --git a/sql/tc.sql b/sql/tc.sql index 5d2ba99..2306721 100644 --- a/sql/tc.sql +++ b/sql/tc.sql @@ -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`)