X-Git-Url: http://git.pippins.net/embedvideo/.git/static/images/x.gif?a=blobdiff_plain;f=inc%2Fclass.tc.inc.php;h=6d40fdccb08d082010f6b2372e3ff76ff88bc087;hb=379c1e9a8ade7cc17db21a5f8edf7455e9411ce5;hp=f07b9b936a2f0d12ca5b4f19ae71170ebe06fd33;hpb=e5086ad471f964105838ad01cc3d0214f5521e35;p=eq%2F.git
diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php
index f07b9b9..6d40fdc 100644
--- a/inc/class.tc.inc.php
+++ b/inc/class.tc.inc.php
@@ -35,6 +35,7 @@ class tc
var $script_path;
var $max_appointments;
var $max_presidency_members;
+ var $ppi_frequency_label;
var $public_functions = array
(
@@ -105,6 +106,18 @@ class tc
$this->current_month = $this->current_month-0; // Make it numeric
$this->current_year = `date '+%Y'`;
$this->current_year = $this->current_year-0; // Make it numeric
+
+ if ($this->ppi_frequency == 12) {
+ $this->ppi_frequency_label = "Annual";
+ } else if ($this->ppi_frequency == 6) {
+ $this->ppi_frequency_label = "Semi-Annual";
+ } else if ($this->ppi_frequency == 3) {
+ $this->ppi_frequency_label = "Quarterly";
+ } else if ($this->ppi_frequency == 1) {
+ $this->ppi_frequency_label = "Monthly";
+ } else {
+ $this->ppi_frequency_label = "Periodic";
+ }
echo parse_navbar();
$this->display_app_header();
@@ -825,7 +838,7 @@ class tc
$this->t->set_var('assignment_data',$assignment_data);
// Create individual selection boxes
- $sql = "SELECT * FROM tc_individual WHERE steward='$this->default_stewardship'";
+ $sql = "SELECT * FROM tc_individual";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
@@ -1338,30 +1351,32 @@ class tc
$this->t->set_file(array('ppi_sched_t' => 'ppi_sched.tpl'));
$this->t->set_block('ppi_sched_t','individual_list','indivlist');
$this->t->set_block('ppi_sched_t','appt_list','apptlist');
- $action = get_var('action',array('GET','POST'));
+ $action = get_var('action',array('GET','POST'));
$this->t->set_var('lang_save','Save Appt / Pri / Notes');
$this->t->set_var('lang_reset','Clear Changes');
$this->t->set_var('ppi_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_view'));
- $this->t->set_var('ppi_link_title','Yearly PPIs');
+ $this->t->set_var('ppi_link_title',$this->ppi_frequency_label . ' PPIs');
$this->t->set_var('schedule_ppi_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_sched'));
- $this->t->set_var('schedule_ppi_link_title','Schedule Yearly PPIs');
+ $this->t->set_var('schedule_ppi_link_title','Schedule ' . $this->ppi_frequency_label . ' PPIs');
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_sched&action=save'));
- $this->t->set_var('title','Yearly PPI Scheduler');
+ $this->t->set_var('title',$this->ppi_frequency_label . ' PPI Scheduler');
- $indiv_width=500; $phone_width=25; $pri_width=10; $notes_width=128; $ppi_date_width=20;
- $table_width=$indiv_width + $phone_width + $pri_width + $notes_width + $ppi_date_width;
- $header_row = "
individual Name | ";
- $header_row.= "Phone | ";
- $header_row.= "Priority | ";
- $header_row.= "Last PPI | ";
- $header_row.= "Scheduling Notes | ";
+ $header_row = "Individual Name | ";
+ $header_row.= "Phone | ";
+ $header_row.= "Priority | ";
+ $header_row.= "Last PPI | ";
+ $header_row.= "Scheduling Notes | ";
$table_data=""; $completed_data=""; $totals_data="";
$year = date('Y');
+ $month = date('m');
+ $period = intval(($month-1)/$this->ppi_frequency) + 1;
+ $start_of_period = ($period-1)*$this->ppi_frequency + 1;
+ $end_of_period = $period * $this->ppi_frequency;
if($action == 'save') {
// Save any changes made to the appointment table
@@ -1425,12 +1440,10 @@ class tc
array_multisort($indiv_name, $individual);
// APPOINTMENT TABLE
- $date_width=250; $time_width=100; $indiv_width=200; $location_width=100;
- $appt_table_width=$date_width + $time_width + $indiv_width + $location_width;
- $appt_header_row = "Date | ";
- $appt_header_row.= "Time | ";
- $appt_header_row.= "Individual | ";
- $appt_header_row.= "Location | ";
+ $appt_header_row = "Date | ";
+ $appt_header_row.= "Time | ";
+ $appt_header_row.= "Individual | ";
+ $appt_header_row.= "Location | ";
$appt_table_data = "";
$table_data="";
@@ -1452,11 +1465,9 @@ class tc
$appt_table_data = "";
// Display a scheduling table for this presidency member
- $district_number = '*';
- $district_name = $presidency_name;
- $table_title = "District ".$district_number.": ".$district_name.": All indivs with Yearly PPI Not Completed";
- $appt_table_title = "District ".$district_number.": ".$district_name.": Yearly PPI Appointment Slots";
- $this->t->set_var('table_title',$table_title);
+ $not_completed_table_title = "All individuals with " . $this->ppi_frequency_label . " PPI Not Completed";
+ $appt_table_title = $presidency_name . ": " . $this->ppi_frequency_label." PPI Appointment Slots";
+ $this->t->set_var('not_completed_table_title',$not_completed_table_title);
$this->t->set_var('appt_table_title',$appt_table_title);
// query the database for all the appointments
@@ -1506,7 +1517,6 @@ class tc
}
$this->t->set_var('appt_table_data',$appt_table_data);
$this->t->set_var('appt_header_row',$appt_header_row);
- $this->t->set_var('appt_table_width',$appt_table_width);
$this->t->set_var('lang_save','Save Appts for ' . $presidency_name);
$this->t->fp('apptlist','appt_list',True);
@@ -1529,7 +1539,7 @@ class tc
}
$max = count($individual);
-
+
for($i=0; $i < $max; $i++) {
$id = $individual[$i];
$name = $indiv_name[$i];
@@ -1537,9 +1547,10 @@ class tc
$priority = $indiv_priority[$id];
$notes = $indiv_notes[$id];
- // If this individual 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 tc_interview WHERE date > '$year_start' AND date < '$year_end' ".
+ // If this individual has had a PPI this period, don't show him on the schedule list
+ $year_start = $year . "-" . $start_of_period . "-01";
+ $year_end = $year . "-" . $end_of_period . "-31";
+ $sql = "SELECT * FROM tc_interview WHERE date >= '$year_start' AND date <= '$year_end' ".
"AND individual=" . $id . " AND interview_type='ppi' ORDER BY date DESC";
$this->db2->query($sql,__LINE__,__FILE__);
@@ -1605,28 +1616,24 @@ class tc
}
} // End for individuals Loop
- $name_width=175; $phone_width=100; $date_width=100; $notes_width=300;
- $completed_table_width=$name_width + $phone_width + $date_width + $notes_width;
- $completed_header_row = "Individual | ";
- $completed_header_row.= "Phone | ";
- $completed_header_row.= "Date | ";
- $completed_header_row.= "PPI Notes | ";
+ $completed_table_title = "All individuals with " . $this->ppi_frequency_label . " PPI Completed";
+ $completed_header_row = "Individual | ";
+ $completed_header_row.= "Phone | ";
+ $completed_header_row.= "Date | ";
+ $completed_header_row.= "PPI Notes | ";
- $this->t->set_var('table_width',$table_width);
+ $this->t->set_var('completed_table_title',$completed_table_title);
$this->t->set_var('header_row',$header_row);
$this->t->set_var('table_data',$table_data);
$this->t->set_var('completed_header_row',$completed_header_row);
- $this->t->set_var('completed_table_width',$completed_table_width);
$this->t->set_var('completed',$completed_data);
$this->t->set_var('lang_save','Save Pri / Notes');
$this->t->fp('indivlist','individual_list',True);
- $indivs_width=300; $totals_width=100;
- $totals_table_width=$indivs_width + $totals_width;
- $totals_header_row = "Individuals | ";
- $totals_header_row.= "$year | ";
+ $totals_header_row = "Individuals | ";
+ $totals_header_row.= "$year | ";
$totals_data.= "";
- $totals_data.= "Total Individuals with yearly PPIs completed: | ";
+ $totals_data.= "Total Individuals with " . $this->ppi_frequency_label . " PPIs completed: | ";
$totals_data.= "$indivs_with_yearly_ppi / $total_indivs | ";
$percent = ceil(($indivs_with_yearly_ppi / $total_indivs)*100);
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
@@ -1638,7 +1645,7 @@ class tc
$this->t->set_var('totals',$totals_data);
$this->t->set_var('totals_header_row',$totals_header_row);
- $this->t->set_var('totals_table_width',$totals_table_width);
+ $this->t->set_var('ppi_frequency_label',$this->ppi_frequency_label);
$this->t->pfp('out','ppi_sched_t');
$this->save_sessiondata();
@@ -1652,7 +1659,6 @@ class tc
$this->t->set_block('int_sched_t','appt_list','apptlist');
$action = get_var('action',array('GET','POST'));
- $this->t->set_var('lang_save','Save Appt / Pri / Notes');
$this->t->set_var('lang_reset','Clear Changes');
$this->t->set_var('int_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_view'));
@@ -1664,13 +1670,11 @@ class tc
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_sched&action=save'));
$this->t->set_var('title','Hometeaching Interviews Scheduler');
- $indiv_width=500; $phone_width=25; $pri_width=10; $notes_width=128; $int_date_width=20;
- $table_width=$indiv_width + $phone_width + $pri_width + $notes_width + $int_date_width;
- $header_row = "Individual | ";
- $header_row.= "Phone | ";
- $header_row.= "Priority | ";
- $header_row.= "Last Interview | ";
- $header_row.= "Scheduling Notes | ";
+ $header_row = "Individual | ";
+ $header_row.= "Phone | ";
+ $header_row.= "Priority | ";
+ $header_row.= "Last Interview | ";
+ $header_row.= "Scheduling Notes | ";
$table_data=""; $completed_data=""; $totals_data="";
$year = date('Y');
@@ -1783,12 +1787,10 @@ class tc
// APPOINTMENT TABLE
$district = 1;
- $date_width=250; $time_width=100; $indiv_width=200; $location_width=100;
- $appt_table_width=$date_width + $time_width + $indiv_width + $location_width;
- $appt_header_row = "Date | ";
- $appt_header_row.= "Time | ";
- $appt_header_row.= "Individual | ";
- $appt_header_row.= "Location | ";
+ $appt_header_row = "Date | ";
+ $appt_header_row.= "Time | ";
+ $appt_header_row.= "Individual | ";
+ $appt_header_row.= "Location | ";
$appt_table_data = "";
$total_comps=0; $comps_with_quarterly_int=0;
@@ -1861,7 +1863,6 @@ class tc
$this->t->set_var('appt_table_data',$appt_table_data);
$this->t->set_var('appt_header_row',$appt_header_row);
- $this->t->set_var('appt_table_width',$appt_table_width);
// INTERVIEW SCHEDULING TABLE
@@ -1974,28 +1975,24 @@ class tc
}
}
- $name_width=175; $phone_width=100; $date_width=100; $notes_width=300;
- $completed_table_width=$name_width + $phone_width + $date_width + $notes_width;
- $completed_header_row = "Individual | ";
- $completed_header_row.= "Phone | ";
- $completed_header_row.= "Date | ";
- $completed_header_row.= "Interview Notes | ";
+ $completed_header_row = "Individual | ";
+ $completed_header_row.= "Phone | ";
+ $completed_header_row.= "Date | ";
+ $completed_header_row.= "Interview Notes | ";
- $this->t->set_var('table_width',$table_width);
$this->t->set_var('header_row',$header_row);
$this->t->set_var('table_data',$table_data);
$this->t->set_var('completed_header_row',$completed_header_row);
- $this->t->set_var('completed_table_width',$completed_table_width);
$this->t->set_var('completed',$completed_data);
+ $this->t->set_var('lang_save_appt','Save Appts for ' . $districts[$d]['name']);
+ $this->t->set_var('lang_save_pri_notes','Save Pri / Notes for '. $districts[$d]['name']);
$this->t->fp('indivlist','individual_list',True);
} // End for each district loop
- $indivs_width=300; $totals_width=100;
- $totals_table_width=$indivs_width + $totals_width;
- $totals_header_row = "Individuals | ";
- $totals_header_row.= "$year | ";
+ $totals_header_row = "Individuals | ";
+ $totals_header_row.= "$year | ";
$totals_data.= "
";
$totals_data.= "Total Companionships with interviews completed: | ";
$totals_data.= "$comps_with_quarterly_int / $total_comps | ";
@@ -2009,7 +2006,6 @@ class tc
$this->t->set_var('totals',$totals_data);
$this->t->set_var('totals_header_row',$totals_header_row);
- $this->t->set_var('totals_table_width',$totals_table_width);
$this->t->pfp('out','int_sched_t');
$this->save_sessiondata();
@@ -2318,12 +2314,12 @@ class tc
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_view'));
$this->t->set_var('ppi_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_view'));
- $this->t->set_var('ppi_link_title','Yearly PPIs');
+ $this->t->set_var('ppi_link_title',$this->ppi_frequency_label . ' PPIs');
$this->t->set_var('schedule_ppi_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_sched'));
- $this->t->set_var('schedule_ppi_link_title','Schedule Yearly PPIs');
+ $this->t->set_var('schedule_ppi_link_title','Schedule ' . $this->ppi_frequency_label . ' PPIs');
- $this->t->set_var('title','Yearly PPIs');
+ $this->t->set_var('title',$this->ppi_frequency_label . ' PPIs');
$num_months = get_var('num_months',array('GET','POST'));
if($num_months == '') { $num_months = $this->default_ppi_num_years; }
$this->t->set_var('num_months',$num_months);
@@ -3518,7 +3514,7 @@ class tc
$this->t->set_var('schedule_int_link_title','Schedule Hometeaching Interviews');
$this->t->set_var('schedule_ppi_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_sched'));
- $this->t->set_var('schedule_ppi_link_title','Schedule Yearly PPIs');
+ $this->t->set_var('schedule_ppi_link_title','Schedule ' . $this->ppi_frequency_label . ' PPIs');
$date_width=160; $time_width=220; $indiv_width=170; $family_width=180; $location_width=100;
$table_width=$date_width + $time_width + $indiv_width + $family_width + $location_width;