From a58cb12cfe9a89076a37b96afbecb25d1c6eb5dd Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Tue, 12 Feb 2008 20:58:54 -0700 Subject: [PATCH 01/16] Completed the rest of the support needed for the new monthly_hometeaching_interview mode. --- inc/class.eq.inc.php | 57 ++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 5b1679d..747a9a5 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -80,6 +80,7 @@ class eq $this->default_vis_num_years = 1; $this->max_num_districts = 4; $this->time_drop_down_lists = 1; + $this->monthly_hometeaching_interviews = 0; $this->time_drop_down_list_inc = 15; $this->default_visit_appt_duration = 45; $this->default_ppi_appt_duration = 30; @@ -2714,15 +2715,25 @@ class eq $total_companionships += $num_companionships; $stat_data = "$num_companionships Companionships
Interview Quarterly Totals:
"; - for($m=$num_months; $m >=0; $m--) { - $month = $current_month - $m; - if(($month % 3) == 1) { $quarter_total = $ints[$m]; } - else { $quarter_total += $ints[$m]; } - $percent = ceil(($quarter_total / $num_companionships)*100); - $stat_data .= "$quarter_total
$percent%
"; + // Print the hometeaching interview stats + if($this->monthly_hometeaching_interviews == 0) { //Quarterly + for($m=$num_months; $m >=0; $m--) { + $month = $current_month - $m; + if(($month % 3) == 1) { $quarter_total = $ints[$m]; } + else { $quarter_total += $ints[$m]; } + $percent = ceil(($quarter_total / $num_companionships)*100); + $stat_data .= "$quarter_total
$percent%
"; + } + $stat_data .= ""; } - $stat_data .= ""; - + else { // Monthly + for($m=$num_months; $m >=0; $m--) { + $percent = ceil(($ints[$m] / $num_companionships)*100); + $stat_data .= "$ints[$m]
$percent%
"; + } + $stat_data .= ""; + } + $this->t->set_var('table_width',$table_width); $this->t->set_var('header_row',$header_row); $this->t->set_var('table_data',$table_data); @@ -2730,17 +2741,27 @@ class eq $this->t->fp('list','district_list',True); } - // Display the totals, cummulative per quarter - $quarter_total = 0; - $totals = "$total_companionships Total Comps
Interview Quarterly Totals:
"; - for($m=$num_months; $m >=0; $m--) { - $month = $current_month - $m; - if(($month % 3) == 1) { $quarter_total = $total_ints[$m]; } - else { $quarter_total += $total_ints[$m]; } - $percent = ceil(($quarter_total / $total_companionships)*100); - $totals .= "$quarter_total
$percent%
"; + // Display the totals + if($this->monthly_hometeaching_interviews == 0) { //Quarterly + $quarter_total = 0; + $totals = "$total_companionships Total Comps
Interview Quarterly Totals:
"; + for($m=$num_months; $m >=0; $m--) { + $month = $current_month - $m; + if(($month % 3) == 1) { $quarter_total = $total_ints[$m]; } + else { $quarter_total += $total_ints[$m]; } + $percent = ceil(($quarter_total / $total_companionships)*100); + $totals .= "$quarter_total
$percent%
"; + } + $totals .= ""; + } + else { //Monthly + $totals = "$total_companionships Total Comps
Interview Monthly Totals:
"; + for($m=$num_months; $m >=0; $m--) { + $percent = ceil(($total_ints[$m] / $total_companionships)*100); + $totals .= "$total_ints[$m]
$percent%
"; + } + $totals .= ""; } - $totals .= ""; $this->t->set_var('totals',$totals); $this->t->pfp('out','int_view_t'); -- 2.34.1 From f8471406db3eb0232775ac452db2ef2691387334 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Tue, 12 Feb 2008 21:58:01 -0700 Subject: [PATCH 02/16] Added new "Yearly PPI" checkbox to PPI or interview entry/edit form. --- inc/class.eq.inc.php | 45 ++++++++++++++++++-------------- templates/default/int_update.tpl | 5 ++-- templates/default/ppi_update.tpl | 3 ++- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 747a9a5..ed9b2c4 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -1921,7 +1921,7 @@ class eq $link_data['elder'] = $id; $link_data['aaronic'] = 0; $link_data['name'] = $name; - $link_data['interview'] = ''; + $link_data['ppi'] = ''; $link_data['action'] = 'add'; $link_data['interviewer'] = $districts[$d]['supervisor']; $link = $GLOBALS['phpgw']->link('/eq/index.php',$link_data); @@ -1953,7 +1953,7 @@ class eq $link_data['elder'] = $this->db2->f('elder'); $link_data['aaronic'] = $this->db2->f('aaronic'); $link_data['name'] = $name; - $link_data['interview'] = $this->db2->f('int'); + $link_data['ppi'] = $this->db2->f('ppi'); $link_data['action'] = 'view'; $link = $GLOBALS['phpgw']->link('/eq/index.php',$link_data); $comps_with_quarterly_int++; @@ -2386,7 +2386,7 @@ class eq $year = date('Y') - $m; $year_start = $year - 1 . "-12-31"; $year_end = $year + 1 . "-01-01"; $sql = "SELECT * FROM eq_ppi WHERE date > '$year_start' AND date < '$year_end' ". - "AND elder=" . $id; + "AND elder=" . $id . " AND eqpresppi=1"; $this->db2->query($sql,__LINE__,__FILE__); if(!$total_ppis[$m]) { $total_ppis[$m] = 0; } @@ -2456,6 +2456,7 @@ class eq $interviewer_name = $this->db2->f('name'); $this->t->set_var('interviewer',$interviewer . ' selected'); $this->t->set_var('interviewer_name',$interviewer_name); + $this->t->set_var('eqpresppi_checked',''); $this->t->fp('int_list','interviewer_list',True); if($action == 'save') @@ -2494,6 +2495,7 @@ class eq $this->t->set_var('date',''); $this->t->set_var('notes',''); $this->t->set_var('eqpresppi',$eqpresppi); + $this->t->set_var('eqpresppi_checked','checked'); $this->t->set_var('lang_done','Cancel'); $this->t->set_var('lang_action','Adding New PPI'); $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.ppi_update&ppi=' @@ -2512,6 +2514,7 @@ class eq $this->t->set_var('date',$this->db->f('date')); $this->t->set_var('notes',$this->db->f('notes')); $this->t->set_var('eqpresppi',$this->db->f('eqpresppi')); + if($this->db->f('eqpresppi') == 1) { $this->t->set_var('eqpresppi_checked','checked'); } } if($action == 'edit') @@ -2665,7 +2668,7 @@ class eq $link_data['elder'] = $elder_id; $link_data['aaronic'] = $aaronic_id; $link_data['name'] = $name; - $link_data['interview'] = ''; + $link_data['ppi'] = ''; $link_data['action'] = 'add'; $link = $GLOBALS['phpgw']->link('/eq/index.php',$link_data); $table_data.= "$name"; @@ -2696,7 +2699,7 @@ class eq $link_data['elder'] = $elder_id; $link_data['aaronic'] = $aaronic_id; $link_data['name'] = $name; - $link_data['interview'] = $this->db2->f('interview'); + $link_data['ppi'] = $this->db2->f('ppi'); $link_data['action'] = 'view'; $date = $this->db2->f('date'); $date_array = explode("-",$date); @@ -2778,16 +2781,18 @@ class eq $this->t->set_var('done_action',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.int_view')); $this->t->set_var('readonly',''); $this->t->set_var('disabled',''); + $this->t->set_var('eqpresppi_checked',''); $action = get_var('action',array('GET','POST')); $companionship = get_var('companionship',array('GET','POST')); $interviewer = get_var('interviewer',array('GET','POST')); $name = get_var('name',array('GET','POST')); - $interview = get_var('interview',array('GET','POST')); + $ppi = get_var('ppi',array('GET','POST')); $elder = get_var('elder',array('GET','POST')); $aaronic = get_var('aaronic',array('GET','POST')); $date = get_var('date',array('GET','POST')); $notes = get_var('notes',array('GET','POST')); + $eqpresppi = get_var('eqpresppi',array('GET','POST')); $sql = "SELECT * FROM eq_district where valid=1 ORDER BY district ASC"; $this->db->query($sql,__LINE__,__FILE__); @@ -2812,13 +2817,14 @@ class eq { $notes = get_var('notes',array('POST')); $this->db->query("UPDATE eq_ppi set " . - " ppi='" . $interview . "'" . + " ppi='" . $ppi . "'" . ", interviewer='" . $interviewer . "'" . ", elder='" . $elder . "'" . ", aaronic='" . $aaronic . "'" . ", date='" . $date . "'" . ", notes='" . $notes . "'" . - " WHERE ppi=" . $interview,__LINE__,__FILE__); + ", eqpresppi='" . $eqpresppi . "'" . + " WHERE ppi=" . $ppi,__LINE__,__FILE__); $this->int_view(); return false; } @@ -2826,9 +2832,9 @@ class eq if($action == 'insert') { $notes = get_var('notes',array('POST')); - $this->db->query("INSERT INTO eq_ppi (interviewer,elder,aaronic,date,notes) " + $this->db->query("INSERT INTO eq_ppi (interviewer,elder,aaronic,date,notes,eqpresppi) " . "VALUES ('" . $interviewer . "','" . $elder . "','" . $aaronic . "','" - . $date . "','" . $notes ."')",__LINE__,__FILE__); + . $date . "','" . $notes ."','" . $eqpresppi . "')",__LINE__,__FILE__); $this->int_view(); return false; } @@ -2836,7 +2842,7 @@ class eq if($action == 'add') { $this->t->set_var('cal_date',$this->jscal->input('date','','','','','','',$this->cal_options)); - $this->t->set_var('interview', ''); + $this->t->set_var('ppi', ''); $this->t->set_var('interviewer', $interviewer); $this->t->set_var('name',$name); $this->t->set_var('elder',$elder); @@ -2845,22 +2851,23 @@ class eq $this->t->set_var('notes',''); $this->t->set_var('lang_done','Cancel'); $this->t->set_var('lang_action','Adding New Interview'); - $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.int_update&interview=' - . $interview . '&action=' . 'insert')); + $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.int_update&ppi=' + . $ppi . '&action=' . 'insert')); } if($action == 'edit' || $action == 'view') { - $sql = "SELECT * FROM eq_ppi WHERE ppi=".$interview; + $sql = "SELECT * FROM eq_ppi WHERE ppi=".$ppi; $this->db->query($sql,__LINE__,__FILE__); $this->db->next_record(); - $this->t->set_var('interview',$interview); + $this->t->set_var('ppi',$ppi); $this->t->set_var('name',$name); $this->t->set_var('interviewer', $this->db->f('interviewer')); $this->t->set_var('elder',$this->db->f('elder')); $this->t->set_var('aaronic',$this->db->f('aaronic')); $this->t->set_var('date',$this->db->f('date')); $this->t->set_var('notes',$this->db->f('notes')); + if($this->db->f('eqpresppi') == 1) { $this->t->set_var('eqpresppi_checked','checked'); } } if($action == 'edit') @@ -2868,8 +2875,8 @@ class eq $this->t->set_var('cal_date',$this->jscal->input('date',$date,'','','','','',$this->cal_options)); $this->t->set_var('lang_done','Cancel'); $this->t->set_var('lang_action','Editing Interview'); - $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.int_update&interview=' - . $interview . '&action=' . 'save')); + $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.int_update&ppi=' + . $ppi . '&action=' . 'save')); } if($action == 'view') @@ -2880,8 +2887,8 @@ class eq $this->t->set_var('disabled','DISABLED'); $this->t->set_var('lang_done','Done'); $this->t->set_var('lang_action','Viewing Interview'); - $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.int_update&interview=' - . $interview . '&action=' . 'edit')); + $this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/eq/index.php','menuaction=eq.eq.int_update&ppi=' + . $ppi . '&action=' . 'edit')); } $this->t->set_var('lang_reset','Clear Form'); diff --git a/templates/default/int_update.tpl b/templates/default/int_update.tpl index 4faa790..74ee469 100644 --- a/templates/default/int_update.tpl +++ b/templates/default/int_update.tpl @@ -6,7 +6,6 @@ - @@ -17,11 +16,13 @@
{lang_action}: {name}
Interviewer:  - +   + Yearly PPI
Date:  diff --git a/templates/default/ppi_update.tpl b/templates/default/ppi_update.tpl index 4faa790..f6b6817 100644 --- a/templates/default/ppi_update.tpl +++ b/templates/default/ppi_update.tpl @@ -6,7 +6,6 @@ - @@ -22,6 +21,8 @@ +   + Yearly PPI "; // Print the hometeaching interview stats - if($this->monthly_hometeaching_interviews == 0) { //Quarterly + if($this->monthly_hometeaching_interview_stats == 0) { //Quarterly for($m=$num_months; $m >=0; $m--) { $month = $current_month - $m; if(($month % 3) == 1) { $quarter_total = $ints[$m]; } @@ -2745,7 +2735,7 @@ class eq } // Display the totals - if($this->monthly_hometeaching_interviews == 0) { //Quarterly + if($this->monthly_hometeaching_interview_stats == 0) { //Quarterly $quarter_total = 0; $totals = ""; for($m=$num_months; $m >=0; $m--) { diff --git a/setup/db_config b/setup/db_config new file mode 100644 index 0000000..b6d6cb3 --- /dev/null +++ b/setup/db_config @@ -0,0 +1,13 @@ +################################################################################ +# This is a perl module included by the perl scripts for this EQ application. +# You must modify these values to match your system configuration. +# Save the resulting file as "db_config.local" in this setup dir. +# This will prevent your settings from being overwritten by future code updates. +################################################################################ + +$dbname = "phpgroupware"; +$dbhost = "192.168.0.2"; # This can be an IP address or name +$dbport = 3306; +$dbuser = "phpgroupware"; # This may require an additional '\@localhost' +$dbpass = "phpgroupware"; + diff --git a/setup/eq_config b/setup/eq_config new file mode 100644 index 0000000..5baf6c6 --- /dev/null +++ b/setup/eq_config @@ -0,0 +1,60 @@ +upload_target_path = "/home/users/eqpres/eq_data"; + +// The full path to the installation location of this module +$this->application_path = "/usr/local/www/data-dist/phpgroupware/eq"; + +// Use drop down lists when specifying times in the scheduling tools. +// If set to 0, free form text fields for the hour and minutes will be used instead. +// If set to 1, drop down lists will be used for the hour and minute fields +$this->time_drop_down_lists = 1; + +// Compute hometeaching interview stats per month or per quarter +// If set to 0, stats will be computed per quarter. +// If set to 1, stats will be computed per month. +$this->monthly_hometeaching_interview_stats = 0; + +// Specify the minute interval increment to use in the time drop down lists +$this->time_drop_down_list_inc = 15; + +// The default visit appointment duration in minutes +$this->default_visit_appt_duration = 45; + +// The default ppi appointment duration in minutes +$this->default_ppi_appt_duration = 30; + +// The default number of months of hometeaching history to show +$this->default_ht_num_months = 3; + +// The default number of months of ppi history to show +$this->default_ppi_num_months = 3; + +// The default number of years of ppi history to show +$this->default_ppi_num_years = 0; + +// The default number of quarters of hometeaching interviews to show +$this->default_int_num_quarters = 1; + +// The default number of years of hometeaching interviews to show +$this->default_int_num_years = 0; + +// The default number of quarters of attendance to show +$this->default_att_num_quarters = 1; + +// The default nubmer of years of visits to show +$this->default_vis_num_years = 1; + +// The maximum number of districts you will ever need to create +$this->max_num_districts = 4; + +?> -- 2.34.1 From 96aa338c7566eb9eec4e2200140358166b223790 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Wed, 13 Feb 2008 00:47:35 -0700 Subject: [PATCH 04/16] Added path local variable for unzip and added "update" option to unzip command. Root caused hometeaching issue with changing visited status in the past for a family that has moved to a new companionship. Added comments for the fix, but I'm not ready to enforce the fix yet. --- bin/import_ward_data | 10 ++++++++++ inc/class.eq.inc.php | 14 +++----------- setup/eq_config | 3 +++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/bin/import_ward_data b/bin/import_ward_data index 0e04f05..9b830aa 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -447,6 +447,16 @@ sub update_eq_family_table $companionship = $hometeaching_data{$index}{'Comp ID'}; $sth = $dbh->prepare("update eq_family set companionship='$companionship' where name_id='$name_id'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; + + # In addition to changing the hometeaching assignment, update the eq_visit table + # so that all previous visits made by the old hometeaching companionship, get + # updated with the id of the new companionship. This will allow us to go in and + # edit the history as needed for the family being hometaught under their new + # companionship. Otherwise, we will not be able to update this history. + #$family_id = $data[0]->{family}; + #print " update eq_visit set companionship='$companionship' where family='$family_id' and companionship!='0'\n"; + #$sth = $dbh->prepare("update eq_visit set companionship='$companionship' where companionship='$old_companionship'"); + #$sth->execute or die "-E- DB error: $DBI::errstr\n"; } } } diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 5ac7c0a..2af40b1 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -400,16 +400,9 @@ class eq } for ($j=0; $j < count($unique_companionships); $j++) { - // FIXME: We won't be able to go back and edit history on families that have been - // reassigned to a different companionship. The following delete command will not delete - // the history of visits under an older companionship, only the ones for the existing - // companionship. This will lead to duplicate visits being entered for an older - // month for the same family, making it impossible to change the past history once - // a family is reassigned. However, you will be able to view the history just fine. - //$comp=$unique_companionships[$j]['companionship']; //print "deleting from eq_visit where companionship=$comp and date=$date and district=$district
"; - // Delete all the visits that have taken place for all families for this month + // Delete all the visits that have taken place for all families for this companionsthip for this month $this->db->query("DELETE from eq_visit where companionship=" . $unique_companionships[$j]['companionship'] . " AND " . "date='" . $date . "'",__LINE__,__FILE__); } @@ -3879,12 +3872,11 @@ class eq # unzip the data into this directory print "-> Unzipping the data
\n"; - $data_file = $data_dir . ''; - exec('unzip ' . $data_dir . '/*.zip -d ' . $data_dir . ' 2>&1', $result, $return_code); + exec($this->unzip_path .' -u '. $data_dir . '/*.zip -d ' . $data_dir . ' 2>&1', $result, $return_code); if($return_code != 0) { print implode('\n',$result) . "
"; print ""; - print "-E- Unable to unzip the uploaded file into the data dir. Aborting import."; + print "-E- Unable to unzip the uploaded file into the data dir: $data_dir. Aborting import."; print ""; return 0; } diff --git a/setup/eq_config b/setup/eq_config index 5baf6c6..eadd5b4 100644 --- a/setup/eq_config +++ b/setup/eq_config @@ -14,6 +14,9 @@ $this->upload_target_path = "/home/users/eqpres/eq_data"; // The full path to the installation location of this module $this->application_path = "/usr/local/www/data-dist/phpgroupware/eq"; +// The full path to the unzip application +$this->unzip_path = "/usr/local/bin/unzip"; + // Use drop down lists when specifying times in the scheduling tools. // If set to 0, free form text fields for the hour and minutes will be used instead. // If set to 1, drop down lists will be used for the hour and minute fields -- 2.34.1 From c57e6e155b11fb24d9e2a9e29763db98b7d4bf21 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Wed, 13 Feb 2008 08:06:55 -0700 Subject: [PATCH 05/16] Fixed bug related to not being able to edit hometeaching history for a family once they had been reassigned to a new companionship. --- bin/import_ward_data | 10 ---------- inc/class.eq.inc.php | 29 ++++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/bin/import_ward_data b/bin/import_ward_data index 9b830aa..0e04f05 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -447,16 +447,6 @@ sub update_eq_family_table $companionship = $hometeaching_data{$index}{'Comp ID'}; $sth = $dbh->prepare("update eq_family set companionship='$companionship' where name_id='$name_id'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; - - # In addition to changing the hometeaching assignment, update the eq_visit table - # so that all previous visits made by the old hometeaching companionship, get - # updated with the id of the new companionship. This will allow us to go in and - # edit the history as needed for the family being hometaught under their new - # companionship. Otherwise, we will not be able to update this history. - #$family_id = $data[0]->{family}; - #print " update eq_visit set companionship='$companionship' where family='$family_id' and companionship!='0'\n"; - #$sth = $dbh->prepare("update eq_visit set companionship='$companionship' where companionship='$old_companionship'"); - #$sth->execute or die "-E- DB error: $DBI::errstr\n"; } } } diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 2af40b1..4574d4b 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -294,12 +294,24 @@ class eq $month_start = "$year"."-"."$month"."-"."01"; $month_end = "$year"."-"."$month"."-"."31"; $month = "$month"."/"."$year"; + //print "m: $m month: $month year: $year month_start: $month_start month_end: $month_end
"; // Add this to the query to filter on only visits made by this companionship: // " AND companionship=" . $unique_companionships[$j]['companionship']. + + // First check to see if the currently assigned companionship has visited them $sql = "SELECT * FROM eq_visit WHERE date >= '$month_start' AND date <= '$month_end' ". - " AND companionship!=0". - " AND family=". $family_id; + " AND companionship=".$unique_companionships[$j]['companionship']. + " AND family=". $family_id; + $query_id = $this->db2->query($sql,__LINE__,__FILE__); + if($this->db2->num_rows($query_id) == 0) { + // We did not find any visits made by the currently assigned companionship, + // look for visits made by any other companionship other than 0. (0 == EQ Presidency Visit) + $sql = "SELECT * FROM eq_visit WHERE date >= '$month_start' AND date <= '$month_end' ". + " AND companionship!=0". + " AND family=". $family_id; + $query_id = $this->db2->query($sql,__LINE__,__FILE__); + } $this->db2->query($sql,__LINE__,__FILE__); $link_data['menuaction'] = 'eq.eq.ht_update'; $link_data['date'] = $month_start; @@ -507,10 +519,21 @@ class eq $table_data.="
"; $header_row=""; + + // First check to see if the currently assigned companionship has visited them $sql = "SELECT * FROM eq_visit WHERE date >= '$month_start' AND date <= '$month_end' ". + " AND companionship=".$unique_companionships[$j]['companionship']. + " AND family=". $family_id; + $query_id = $this->db2->query($sql,__LINE__,__FILE__); + if($this->db2->num_rows($query_id) == 0) { + // We did not find any visits made by the currently assigned companionship, + // look for visits made by any other companionship other than 0. (0 == EQ Presidency Visit) + $sql = "SELECT * FROM eq_visit WHERE date >= '$month_start' AND date <= '$month_end' ". " AND companionship!=0". " AND family=". $family_id; - $this->db2->query($sql,__LINE__,__FILE__); + $query_id = $this->db2->query($sql,__LINE__,__FILE__); + } + $value = $family_id . "/" . $unique_companionships[$j]['companionship'] . "/" . $date; $header_row .= ""; if(!$total_visits) { $total_visits = 0; } -- 2.34.1 From 3aafb000f5af124b974a8a89dd862b73905f8d1f Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Wed, 13 Feb 2008 08:38:51 -0700 Subject: [PATCH 06/16] Rolled version number to 2.0 --- eq.spec | 3 +-- setup/setup.inc.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eq.spec b/eq.spec index a86bfbb..a1e16b6 100644 --- a/eq.spec +++ b/eq.spec @@ -51,7 +51,6 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/%{phpgwdirname} %changelog -* Sat May 19 2001 Dan Kuykendall 0.0.1.00 -- Created eq app +- EQ App Update # end of file diff --git a/setup/setup.inc.php b/setup/setup.inc.php index 6e75304..9c64406 100644 --- a/setup/setup.inc.php +++ b/setup/setup.inc.php @@ -14,7 +14,7 @@ /* Basic information about this app */ $setup_info['eq']['name'] = 'eq'; $setup_info['eq']['title'] = 'Elders Quorum Tools'; - $setup_info['eq']['version'] = '0.0.1.001'; + $setup_info['eq']['version'] = '0.2.0'; $setup_info['eq']['app_order'] = 8; $setup_info['eq']['enable'] = 1; -- 2.34.1 From ea29c3b622ddc720e51ea456ec3758c881caea2d Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Wed, 13 Feb 2008 08:42:26 -0700 Subject: [PATCH 07/16] Fixed changelog message --- eq.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eq.spec b/eq.spec index a86bfbb..a1e16b6 100644 --- a/eq.spec +++ b/eq.spec @@ -51,7 +51,6 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/%{phpgwdirname} %changelog -* Sat May 19 2001 Dan Kuykendall 0.0.1.00 -- Created eq app +- EQ App Update # end of file -- 2.34.1 From 906ddcdefef59450b288742b9efd806d0755e00f Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Wed, 13 Feb 2008 08:50:28 -0700 Subject: [PATCH 08/16] Updated path to direct download of module --- doc/install.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install.txt b/doc/install.txt index 406126e..8958160 100644 --- a/doc/install.txt +++ b/doc/install.txt @@ -13,7 +13,7 @@ Getting and Installing Downloading Can be downloaded from: - https://eq.pippins.net/eq.tar + https://eq.pippins.net/eq.zip It can also be obtained via the GIT revision control system by pulling from here: http://git.pippins.net/eq/.git -- 2.34.1 From b74dbe53448ab77b7ff14bae31ea9a2b2e56ab38 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Fri, 15 Feb 2008 19:56:23 -0700 Subject: [PATCH 09/16] Changed monthly_hometeaching_interview_stats config variable to mean every X months. It now represents the frequency of hometeaching interview stats in months. Example Values: Monthly=1 Quarterly=3 Yearly=12 --- inc/class.eq.inc.php | 59 +++++++++++++++++--------------------------- setup/eq_config | 8 +++--- 2 files changed, 26 insertions(+), 41 deletions(-) diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 4574d4b..68bc93d 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -2722,26 +2722,19 @@ class eq $table_data .= ""; } $total_companionships += $num_companionships; - $stat_data = ""; + $stat_data = ""; // Print the hometeaching interview stats - if($this->monthly_hometeaching_interview_stats == 0) { //Quarterly - for($m=$num_months; $m >=0; $m--) { - $month = $current_month - $m; - if(($month % 3) == 1) { $quarter_total = $ints[$m]; } - else { $quarter_total += $ints[$m]; } - $percent = ceil(($quarter_total / $num_companionships)*100); - $stat_data .= ""; - } - $stat_data .= ""; - } - else { // Monthly - for($m=$num_months; $m >=0; $m--) { - $percent = ceil(($ints[$m] / $num_companionships)*100); - $stat_data .= ""; - } - $stat_data .= ""; + for($m=$num_months; $m >=0; $m--) { + $month = $current_month - $m; + $month_begins = $month % $this->monthly_hometeaching_interview_stats; + if($this->monthly_hometeaching_interview_stats == 1) { $month_begins = 1; } + if(($month_begins) == 1) { $total = $ints[$m]; } + else { $total += $ints[$m]; } + $percent = ceil(($total / $num_companionships)*100); + $stat_data .= ""; } + $stat_data .= ""; $this->t->set_var('table_width',$table_width); $this->t->set_var('header_row',$header_row); @@ -2751,27 +2744,19 @@ class eq } // Display the totals - if($this->monthly_hometeaching_interview_stats == 0) { //Quarterly - $quarter_total = 0; - $totals = ""; - for($m=$num_months; $m >=0; $m--) { - $month = $current_month - $m; - if(($month % 3) == 1) { $quarter_total = $total_ints[$m]; } - else { $quarter_total += $total_ints[$m]; } - $percent = ceil(($quarter_total / $total_companionships)*100); - $totals .= ""; - } - $totals .= ""; - } - else { //Monthly - $totals = ""; - for($m=$num_months; $m >=0; $m--) { - $percent = ceil(($total_ints[$m] / $total_companionships)*100); - $totals .= ""; - } - $totals .= ""; + $total = 0; + $totals = ""; + for($m=$num_months; $m >=0; $m--) { + $month = $current_month - $m; + $month_begins = $month % $this->monthly_hometeaching_interview_stats; + if($this->monthly_hometeaching_interview_stats == 1) { $month_begins = 1; } + if(($month_begins) == 1) { $total = $total_ints[$m]; } + else { $total += $total_ints[$m]; } + $percent = ceil(($total / $total_companionships)*100); + $totals .= ""; } - + $totals .= ""; + $this->t->set_var('totals',$totals); $this->t->pfp('out','int_view_t'); $this->save_sessiondata(); diff --git a/setup/eq_config b/setup/eq_config index eadd5b4..54b8d4a 100644 --- a/setup/eq_config +++ b/setup/eq_config @@ -22,10 +22,10 @@ $this->unzip_path = "/usr/local/bin/unzip"; // If set to 1, drop down lists will be used for the hour and minute fields $this->time_drop_down_lists = 1; -// Compute hometeaching interview stats per month or per quarter -// If set to 0, stats will be computed per quarter. -// If set to 1, stats will be computed per month. -$this->monthly_hometeaching_interview_stats = 0; +// Frequency of hometeaching interview stats in months +// This number must evenly divide 12. +// Examples: Monthly=1 Quarterly=3 Yearly=12 +$this->monthly_hometeaching_interview_stats = 3; // Specify the minute interval increment to use in the time drop down lists $this->time_drop_down_list_inc = 15; -- 2.34.1 From ff9fe56b29ea1d02844bc54d8a9864c120ff5c17 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Fri, 15 Feb 2008 20:02:18 -0700 Subject: [PATCH 10/16] Fixed "interview total" bug when pulling up previous quarters of history. --- inc/class.eq.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 68bc93d..e8b0fa4 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -2727,7 +2727,9 @@ class eq // Print the hometeaching interview stats for($m=$num_months; $m >=0; $m--) { $month = $current_month - $m; + if($month < 0) { $month = 12 + $month; } // Handle going backwards over a year boundary $month_begins = $month % $this->monthly_hometeaching_interview_stats; + //print "$month % $this->monthly_hometeaching_interview_stats = $month_begins
"; if($this->monthly_hometeaching_interview_stats == 1) { $month_begins = 1; } if(($month_begins) == 1) { $total = $ints[$m]; } else { $total += $ints[$m]; } @@ -2748,6 +2750,7 @@ class eq $totals = "
"; for($m=$num_months; $m >=0; $m--) { $month = $current_month - $m; + if($month < 0) { $month = 12 + $month; } // Handle going backwards over a year boundary $month_begins = $month % $this->monthly_hometeaching_interview_stats; if($this->monthly_hometeaching_interview_stats == 1) { $month_begins = 1; } if(($month_begins) == 1) { $total = $total_ints[$m]; } -- 2.34.1 From d0fe650e8a63864d8fd593aec3429abdec5eac95 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Sun, 17 Feb 2008 21:07:43 -0700 Subject: [PATCH 11/16] Changed include syntax to be a full path instead of a relative path. Renamed db upgrade command to better fit the naming convention I want to follow long term. --- ...rge_eq_ppi_eq_interview_tables => upgrade_1_0_to_2_0} | 0 inc/class.eq.inc.php | 9 +++++---- 2 files changed, 5 insertions(+), 4 deletions(-) rename bin/{merge_eq_ppi_eq_interview_tables => upgrade_1_0_to_2_0} (100%) diff --git a/bin/merge_eq_ppi_eq_interview_tables b/bin/upgrade_1_0_to_2_0 similarity index 100% rename from bin/merge_eq_ppi_eq_interview_tables rename to bin/upgrade_1_0_to_2_0 diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index e8b0fa4..b3730dd 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -68,12 +68,13 @@ class eq function eq() { - if(file_exists('setup/eq_config.local')) { - include('setup/eq_config.local'); + $base_path = $_SERVER['DOCUMENT_ROOT']; + if(file_exists("$base_path/eq/setup/eq_config.local")) { + include("$base_path/eq/setup/eq_config.local"); } else { - include('setup/eq_config'); + include("$base_path/eq/setup/eq_config"); } - + $this->script_path = "$this->application_path"."/bin"; $this->max_presidency_members = 99; $this->max_appointments = 32768; -- 2.34.1 From c98a532f9ec4c806eda3e0a91ebbf7da6886102e Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Sun, 17 Feb 2008 21:14:58 -0700 Subject: [PATCH 12/16] Undid the change of the include path. It was better the way it was. --- inc/class.eq.inc.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index b3730dd..a5cc2b4 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -68,11 +68,10 @@ class eq function eq() { - $base_path = $_SERVER['DOCUMENT_ROOT']; - if(file_exists("$base_path/eq/setup/eq_config.local")) { - include("$base_path/eq/setup/eq_config.local"); + if(file_exists("setup/eq_config.local")) { + include("setup/eq_config.local"); } else { - include("$base_path/eq/setup/eq_config"); + include("setup/eq_config"); } $this->script_path = "$this->application_path"."/bin"; -- 2.34.1 From 9669dcdc3925b624aa7ec47114da7905d3159318 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Sun, 17 Feb 2008 21:31:07 -0700 Subject: [PATCH 13/16] Added new script to check the syntax of the config files --- bin/check_config_syntax | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/check_config_syntax diff --git a/bin/check_config_syntax b/bin/check_config_syntax new file mode 100755 index 0000000..246dc38 --- /dev/null +++ b/bin/check_config_syntax @@ -0,0 +1,6 @@ +#!/bin/bash + +perl ../setup/db_config +[ $? == 0 ] && echo "No syntax errors detected in ../setup/db_config" +php -l ../setup/eq_config + -- 2.34.1 From 9de544c8650d61079b2f66e0ecad699674449e15 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Sun, 17 Feb 2008 21:34:34 -0700 Subject: [PATCH 14/16] Updated docs to reference new check_config_syntax script --- doc/install.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/install.txt b/doc/install.txt index 8958160..eb2181e 100644 --- a/doc/install.txt +++ b/doc/install.txt @@ -30,9 +30,11 @@ Installing Enable it for each user by going to Site Admin -> User Accounts -> -> edit Make sure the "eq" application has a checkmark next to it under "Permissions this user has" 4) Copy the setup/db_config to setup/db_config.local and change the values in .local appropriately. + Check for syntax errors by running eq/bin/check_config_syntax 5) Copy the setup/eq_config to setup/eq_config.local and change the values in .local appropriately. Make sure you update the path locations for your specific installation locations: upload_target_path & application_path + Check for syntax errors by running eq/bin/check_config_syntax 6) Try to run eq/bin/import_ward_data & parse_ward_data scripts from the commandline to check for any missing perl library dependencies and mysql connection. Just run them without command line args. -- 2.34.1 From 87fe12720f10a6ef93f81726ccb90b812393d599 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Tue, 11 Mar 2008 16:57:40 -0600 Subject: [PATCH 15/16] Changed the way hometeaching stats are calculated. If a family has a blank as a hometeaching visit status, that family will not count for the total homteaching percentages. Only families marked with Y or N will now count for the hometeaching percentages. --- inc/class.eq.inc.php | 45 ++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index a5cc2b4..ca6b809 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -223,9 +223,9 @@ class eq $aaronic[$aaronic_id]['name'] = $this->db->f('name'); $aaronic[$aaronic_id]['phone'] = $this->db->f('phone'); } - - $total_families = 0; + $this->nextmatchs->template_alternate_row_color(&$this->t); + for($m=$num_months; $m >= 0; $m--) { $total_families[$m]=0; } for ($i=0; $i < count($districts); $i++) { $this->t->set_var('district_number',$districts[$i]['district']); $this->t->set_var('district_name',$districts[$i]['name']); @@ -243,8 +243,8 @@ class eq } $comp_width=450; $visit_width=25; $table_width=$comp_width + $num_months*$visit_width; - $table_data=""; $num_companionships = 0; $num_families = 0; - for($m=$num_months; $m >= 0; $m--) { $visits[$m] = 0; } + $table_data=""; $num_companionships = 0; + for($m=$num_months; $m >= 0; $m--) { $visits[$m]=0; $num_families[$m]=0; } for ($j=0; $j < count($unique_companionships); $j++) { $companion_table_entry = ""; // Select all the companions in each companionship @@ -278,7 +278,6 @@ class eq $k=0; while ($this->db->next_record()) { - $num_families++; $total_families++; $family_name = $this->db->f('name'); $family_id = $this->db->f('family'); $this->nextmatchs->template_alternate_row_color(&$this->t); @@ -326,19 +325,21 @@ class eq if(!$total_visits[$m]) { $total_visits[$m] = 0; } if($this->db2->next_record()) { if($this->db2->f('visited') == 'y') { - $visits[$m]++; $total_visits[$m]++; + $visits[$m]++; $total_visits[$m]++; + $num_families[$m]++; $total_families[$m]++; $table_data .= ''; } else if($this->db2->f('visited') == 'n') { + $num_families[$m]++; $total_families[$m]++; $table_data .= ''; } else { - $visits[$m]++; $total_visits[$m]++; + //$visits[$m]++; $total_visits[$m]++; $table_data .= ""; } } else { - $visits[$m]++; $total_visits[$m]++; + //$visits[$m]++; $total_visits[$m]++; $table_data .= ""; } } @@ -348,11 +349,15 @@ class eq $table_data .= ""; } $table_data .= ""; - $stat_data = ""; + $stat_data = ""; for($m=$num_months; $m >=0; $m--) { - $percent = ceil(($visits[$m] / $num_families)*100); - $stat_data .= ""; + if($num_families[$m] > 0) { + $percent = ceil(($visits[$m] / $num_families[$m])*100); + } else { + $percent = 0; + } + $stat_data .= ""; } $stat_data .= ""; @@ -363,10 +368,14 @@ class eq $this->t->fp('list','district_list',True); } - $totals = ""; + $totals = ""; for($m=$num_months; $m >=0; $m--) { - $percent = ceil(($total_visits[$m] / $total_families)*100); - $totals .= ""; + if($total_families[$m] > 0) { + $percent = ceil(($total_visits[$m] / $total_families[$m])*100); + } else { + $percent = 0; + } + $totals .= ""; } $totals .= ""; @@ -512,7 +521,6 @@ class eq $this->db->query($sql,__LINE__,__FILE__); while ($this->db->next_record()) { - $num_families++; $total_families++; $family_name = $this->db->f('name'); $family_id = $this->db->f('family'); $this->nextmatchs->template_alternate_row_color(&$this->t); @@ -539,13 +547,14 @@ class eq if(!$total_visits) { $total_visits = 0; } if($this->db2->next_record()) { if($this->db2->f('visited') == 'y') { - $visits++; $total_visits++; + $visits++; $total_visits++; $num_families++; $table_data .= ''; } else if($this->db2->f('visited') == 'n') { + $num_families++; $table_data .= '"; } $table_data .= ""; - $stat_data = ""; + $stat_data = ""; $percent = ceil(($visits / $num_families)*100); - $stat_data .= ""; + $stat_data .= ""; $stat_data .= ""; $this->t->set_var('table_width',$table_width); -- 2.34.1 From 3319d1f2ac9bd7dec6753458db0506cdd6c54957 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Sun, 16 Mar 2008 20:43:42 -0600 Subject: [PATCH 16/16] Fixed yearly ppi scheduling tool bug which caused non eqpresppi's to count as yearly PPIs. --- inc/class.eq.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index ca6b809..3cbb028 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -1570,7 +1570,7 @@ class eq // If this elder has had a yearly PPI this year, don't show him on the schedule list $year_start = $year - 1 . "-12-31"; $year_end = $year + 1 . "-01-01"; $sql = "SELECT * FROM eq_ppi WHERE date > '$year_start' AND date < '$year_end' ". - "AND elder=" . $id; + "AND elder=" . $id . " AND eqpresppi=1"; $this->db2->query($sql,__LINE__,__FILE__); if(!$this->db2->next_record()) { -- 2.34.1
{lang_action}: {name}
Date:  -- 2.34.1 From 63574045f42044601bfc460bf844ea82387f421f Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Tue, 12 Feb 2008 22:57:48 -0700 Subject: [PATCH 03/16] Changes required to implement config files that can be overridden locally. This enables an end user to make .local config files, and edit them as appropriate, preventing future code upgrades from blowing away their site specific settings. --- bin/import_ward_data | 12 ++---- bin/merge_eq_ppi_eq_interview_tables | 12 ++---- bin/parse_ward_data | 12 ++---- doc/install.txt | 21 +++++----- inc/class.eq.inc.php | 28 +++++-------- setup/db_config | 13 ++++++ setup/eq_config | 60 ++++++++++++++++++++++++++++ 7 files changed, 104 insertions(+), 54 deletions(-) create mode 100644 setup/db_config create mode 100644 setup/eq_config diff --git a/bin/import_ward_data b/bin/import_ward_data index 53a3c3d..0e04f05 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -3,14 +3,10 @@ use DBI; use Getopt::Std; -################################################### -# GLOBALS -$dbname = "phpgroupware"; -$dbhost = "192.168.0.2"; # This can be an IP address or name -$dbport = 3306; -$dbuser = "phpgroupware"; # This may require an additional '\@localhost' -$dbpass = "phpgroupware"; -################################################### +$mydir = `cd \$(dirname $0) 2>/dev/null; pwd`; chomp($mydir); +unshift @INC,("$mydir/../setup"); +if( -f "$mydir/../setup/db_config.local") { require "db_config.local"; } +else { require "db_config"; } %hometeaching_data = (); %membership_data = (); diff --git a/bin/merge_eq_ppi_eq_interview_tables b/bin/merge_eq_ppi_eq_interview_tables index c53ed4f..cd7484b 100755 --- a/bin/merge_eq_ppi_eq_interview_tables +++ b/bin/merge_eq_ppi_eq_interview_tables @@ -3,14 +3,10 @@ use DBI; use Getopt::Std; -################################################### -# GLOBALS -$dbname = "phpgroupware"; -$dbhost = "192.168.0.2"; # This can be an IP address or name -$dbport = 3306; -$dbuser = "phpgroupware"; # This may require an additional '\@localhost' -$dbpass = "phpgroupware"; -################################################### +$mydir = `cd \$(dirname $0) 2>/dev/null; pwd`; chomp($mydir); +unshift @INC,("$mydir/../setup"); +if( -f "$mydir/../setup/db_config.local") { require "db_config.local"; } +else { require "db_config"; } ################################################### # Connect to the database diff --git a/bin/parse_ward_data b/bin/parse_ward_data index 7a3c072..e6d94fb 100755 --- a/bin/parse_ward_data +++ b/bin/parse_ward_data @@ -3,14 +3,10 @@ use DBI; use Getopt::Std; -################################################### -# GLOBALS -$dbname = "phpgroupware"; -$dbhost = "192.168.0.2"; # This can be an IP address or a name -$dbport = 3306; -$dbuser = "phpgroupware"; # This may require an additional '\@localhost' -$dbpass = "phpgroupware"; -################################################### +$mydir = `cd \$(dirname $0) 2>/dev/null; pwd`; chomp($mydir); +unshift @INC,("$mydir/../setup"); +if( -f "$mydir/../setup/db_config.local") { require "db_config.local"; } +else { require "db_config"; } %hometeaching_data = (); %membership_data = (); diff --git a/doc/install.txt b/doc/install.txt index 4521caa..406126e 100644 --- a/doc/install.txt +++ b/doc/install.txt @@ -16,7 +16,7 @@ Downloading https://eq.pippins.net/eq.tar It can also be obtained via the GIT revision control system by pulling from here: - http://git.pippins.net/eq/ + http://git.pippins.net/eq/.git Installing @@ -29,23 +29,22 @@ Installing need to assign this app to the users you want to have be able to use it. Enable it for each user by going to Site Admin -> User Accounts -> -> edit Make sure the "eq" application has a checkmark next to it under "Permissions this user has" - 4) Edit the LOCAL CONFIGURATION section of eq/inc/class.eq.inc.php - Make sure you update the path locations for your specific: - upload_target_path & script_path - 5) Edit the GLOBALS section of the eq/bin/import_ward_data script and fix the permissions - 6) Edit the GLOBALS section of the eq/bin/parse_ward_data script and fix the permissions - 7) Try to run eq/bin/import_ward_data & parse_ward_data scripts from the commandline + 4) Copy the setup/db_config to setup/db_config.local and change the values in .local appropriately. + 5) Copy the setup/eq_config to setup/eq_config.local and change the values in .local appropriately. + Make sure you update the path locations for your specific installation locations: + upload_target_path & application_path + 6) Try to run eq/bin/import_ward_data & parse_ward_data scripts from the commandline to check for any missing perl library dependencies and mysql connection. Just run them without command line args. Install the right perl modules until the scripts run without any errors. - 8) A graphical representation of the mysql schema used by this application can + 7) A graphical representation of the mysql schema used by this application can be found here: eq/sql/eq.jpg - 9) Click on the Admin tool in the EQ app to import your initial set of ward data + 8) Click on the Admin tool in the EQ app to import your initial set of ward data obtained from MLS into the EQ application. - 10) Click on the Admin tool and update the EQ Presidency Table appropriately. + 9) Click on the Admin tool and update the EQ Presidency Table appropriately. The most important thing at this point is to get your district leaders added for each district you have in your quorum. - 11) I highly recommend installing phpmyadmin to view/edit/debug mysql tables related to this tool. + 10) I highly recommend installing phpmyadmin to view/edit/debug mysql tables related to this tool. Requirements diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index ed9b2c4..5ac7c0a 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -68,25 +68,15 @@ class eq function eq() { - // LOCAL CONFIGURATION. PLEASE UPDATE AS APPROPRIATE. - $this->upload_target_path = "/home/users/eqpres/eq_data"; - $this->script_path = "/usr/share/phpgroupware/eq/bin"; - $this->default_ht_num_months = 3; - $this->default_ppi_num_months = 3; - $this->default_ppi_num_years = 0; - $this->default_int_num_quarters = 1; - $this->default_int_num_years = 0; - $this->default_att_num_quarters = 1; - $this->default_vis_num_years = 1; - $this->max_num_districts = 4; - $this->time_drop_down_lists = 1; - $this->monthly_hometeaching_interviews = 0; - $this->time_drop_down_list_inc = 15; - $this->default_visit_appt_duration = 45; - $this->default_ppi_appt_duration = 30; + if(file_exists('setup/eq_config.local')) { + include('setup/eq_config.local'); + } else { + include('setup/eq_config'); + } + + $this->script_path = "$this->application_path"."/bin"; $this->max_presidency_members = 99; $this->max_appointments = 32768; - // END LOCAL CONFIGURATION $this->db = $GLOBALS['phpgw']->db; $this->db2 = $this->db; @@ -2719,7 +2709,7 @@ class eq $stat_data = "
$num_companionships Companionships
Interview Quarterly Totals:
$total_companionships Total Comps
Interview Quarterly Totals:
$family_name FamilyFamilies$month

$num_companionships Companionships
Interview Quarterly Totals:
$num_companionships Companionships
Interview Totals:
$quarter_total
$percent%
$ints[$m]
$percent%
$total
$percent%
$total_companionships Total Comps
Interview Quarterly Totals:
$quarter_total
$percent%
$total_companionships Total Comps
Interview Monthly Totals:
$total_ints[$m]
$percent%
$total_companionships Total Comps
Interview Totals:
$total
$percent%
$total_companionships Total Comps
Interview Totals:
  

$num_families Families
Visit Totals:
Families Hometaught:
Hometeaching Percentage:
$visits[$m]
$percent%
$visits[$m] / $num_families[$m]
$percent%
$total_families Total Families
Visit Totals:
Total Families Hometaught:
Total Hometeaching Percentage:
$total_visits[$m]
$percent%
$total_visits[$m] / $total_families[$m]
$percent%
'; $table_data .= 'Y'; $table_data .= 'N'; $table_data .= ' '; $table_data .= ''; $table_data .= 'Y'; $table_data .= 'N'; @@ -572,10 +581,10 @@ class eq $table_data .= "

$num_families Families
Visit Totals:
Families Hometaught:
Hometeaching Percentage:
$visits
$percent%
$visits / $num_families
$percent%