X-Git-Url: http://git.pippins.net/embedvideo/.git/%27%20%20%20%20.%20%24GLOBALS%5B%27phpgw%27%5D-%3Elink%28%27inc/jquery/jquery.tablesorter.css%27%29.%27?a=blobdiff_plain;f=inc%2Fclass.tc.inc.php;h=c3a2b7971e8d49c6315d9d12ad9d45d74b96871b;hb=e0b83b187067cb6b9b7ecfbdd65387c3fed0c237;hp=9684e8e114691f1970584e306b2a62e9cd3db97d;hpb=67b802629eb336cdec0eb8212a9ca2474377fe8f;p=eq%2F.git
diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php
index 9684e8e..c3a2b79 100644
--- a/inc/class.tc.inc.php
+++ b/inc/class.tc.inc.php
@@ -401,6 +401,7 @@ class tc
function ht_sandbox()
{
$this->t->set_file(array('ht_sandbox_t' => 'ht_sandbox.tpl'));
+ $this->t->set_block('ht_sandbox_t','switch_case_list','sc_list');
$this->t->set_block('ht_sandbox_t','comp_list','c_list');
$this->t->set_block('ht_sandbox_t','district_list','d_list');
$this->t->set_block('ht_sandbox_t','unassigned_ht_list','uht_list');
@@ -426,7 +427,7 @@ class tc
$unassigned_family_list = get_var('unassignedFamilies',array('POST'));
if ($assignedHT_list || $unassignedHT_list) {
- $sql = "INSERT INTO tc_companionship_sandbox (district) VALUES (\"$district\")";
+ $sql = "INSERT INTO tc_companionship_sandbox (tc_companionship,district) VALUES (\"NULL\",\"$district\")";
$this->db2->query($sql,__LINE__,__FILE__);
$companionship_sandbox = mysql_insert_id();
@@ -540,11 +541,11 @@ class tc
while ($this->db->next_record()) {
$companionship = $this->db->f('companionship');
$district = $this->db->f('district');
- $sql = "INSERT INTO tc_companionship_sandbox (district) VALUES (\"$district\")";
+ $sql = "INSERT INTO tc_companionship_sandbox (tc_companionship,district) VALUES (\"$companionship\",\"$district\")";
$this->db2->query($sql,__LINE__,__FILE__);
$companionship_sandbox = mysql_insert_id();
- $sql = "SELECT * FROM tc_companion WHERE companionship=$companionship AND valid=1";
+ $sql = "SELECT * FROM tc_companion AS tc JOIN tc_individual AS ti WHERE tc.individual=ti.individual AND tc.companionship=$companionship AND tc.valid=1 AND ti.valid=1";
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record()) {
$individual = $this->db2->f('individual');
@@ -651,8 +652,16 @@ class tc
$sql = "SELECT DISTINCT companionship FROM tc_companionship_sandbox WHERE district=$districts[$d] ORDER BY companionship ASC";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
+ $switch_case_list = "";
$sandbox_table_data .= "
";
$companionship = $this->db->f('companionship');
+
+ $switch_case_list .= "case '". $companionship ."':\n";
+ $switch_case_list .= " $(\"#district option:selected\").removeAttr(\"selected\");\n";
+ $switch_case_list .= " $(\"#assignedHT option:selected\").removeAttr(\"selected\");\n";
+ $switch_case_list .= " $(\"#assignedFamilies option:selected\").removeAttr(\"selected\");\n";
+ $switch_case_list .= " $(\"#district option[value='".$districts[$d]."']\").attr(\"selected\",true);\n";
+
# get names of companions in this companionship
$sql = "SELECT * FROM tc_companion_sandbox AS tc JOIN tc_individual AS ti WHERE tc.individual=ti.individual AND companionship=$companionship ORDER BY ti.name ASC";
$this->db2->query($sql,__LINE__,__FILE__);
@@ -663,9 +672,13 @@ class tc
} else {
$companion_names .= " / " . $this->db2->f('name');
}
+ $individual = $this->db2->f('individual');
+ $switch_case_list .= " $(\"#assignedHT option[value='".$individual."']\").attr(\"selected\",true);\n";
}
- $sandbox_table_data .= "$companion_names | ";
- $sandbox_table_data .= "";
+ $this->nextmatchs->template_alternate_row_color(&$this->t);
+ $sandbox_table_data .= "";
+ $sandbox_table_data .= "$companion_names | ";
+ $sandbox_table_data .= "";
# get families they visit
$sql = "SELECT * FROM tc_companionship_sandbox AS tcp JOIN (tc_family_sandbox AS tf, tc_individual AS ti) WHERE tcp.companionship=$companionship AND tcp.companionship=tf.companionship AND tf.individual=ti.individual";
@@ -673,11 +686,15 @@ class tc
while ($this->db2->next_record()) {
$family_name = $this->db2->f('name') . " Family";
$family_id = $this->db2->f('tc_family');
- $sandbox_table_data .= "";
- $sandbox_table_data .= "$family_name | ";
-
+ $family = $this->db2->f('family');
+ $tc_companionship = $this->db2->f('tc_companionship');
+ $this->nextmatchs->template_alternate_row_color(&$this->t);
+ $sandbox_table_data .= " ";
+ $sandbox_table_data .= "$family_name | ";
+ $switch_case_list .= " $(\"#assignedFamilies option[value='".$family."']\").attr(\"selected\",true);\n";
+
# get 12 months visit data for given family
- for($m=12; $m >= 0; $m--) {
+ for($m=$this->sandbox_stats_num_months; $m > 0; $m--) {
$month = $this->current_month - $m;
$year = $this->current_year;
if($month <= 0) { $remainder = $month; $month = 12 + $remainder; $year=$year-1; }
@@ -686,7 +703,11 @@ class tc
$month_end = "$year"."-"."$month"."-"."31";
$month = "$month"."/"."$year";
- $sql = "SELECT * FROM tc_visit WHERE date >= '$month_start' AND date <= '$month_end' AND companionship!=0 AND family=". $family_id;
+ if ($this->sandbox_visits_comp_only == 0) {
+ $sql = "SELECT * FROM tc_visit WHERE date >= '$month_start' AND date <= '$month_end' AND companionship!=0 AND family=". $family_id;
+ } else {
+ $sql = "SELECT * FROM tc_visit WHERE date >= '$month_start' AND date <= '$month_end' AND companionship=$tc_companionship AND family=". $family_id;
+ }
$query_id = $this->db3->query($sql,__LINE__,__FILE__);
if($this->db3->next_record()) {
@@ -705,8 +726,10 @@ class tc
}
$sandbox_table_data .= " | ";
$sandbox_table_data .= " | ";
+ $switch_case_list .= "break;\n";
+ $this->t->set_var('switch_case_list',$switch_case_list);
+ $this->t->fp('sc_list','switch_case_list',True);
}
-
$sandbox_table_data .= " ";
$sandbox_table_data .= " | ";
}
@@ -1677,7 +1700,7 @@ 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');
@@ -1691,13 +1714,11 @@ class tc
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ppi_sched&action=save'));
$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');
@@ -1768,12 +1789,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="";
@@ -1795,10 +1814,8 @@ class tc
$appt_table_data = "";
// Display a scheduling table for this presidency member
- $district_number = '*';
- $district_name = $presidency_name;
- $not_completed_table_title = "District ".$district_number.": ".$district_name.": All indivs with " . $this->ppi_frequency_label . " PPI Not Completed";
- $appt_table_title = "District ".$district_number.": ".$district_name.": ".$this->ppi_frequency_label." PPI Appointment Slots";
+ $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);
@@ -1849,7 +1866,8 @@ 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);
}
@@ -1947,27 +1965,22 @@ class tc
}
} // End for individuals Loop
- $completed_table_title = "District ".$district_number.": ".$district_name.": All indivs with " . $this->ppi_frequency_label . " PPI Completed";
- $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('completed_table_title',$completed_table_title);
- $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','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 " . $this->ppi_frequency_label . " PPIs completed: | ";
$totals_data.= "$indivs_with_yearly_ppi / $total_indivs | ";
@@ -1981,7 +1994,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();
@@ -1995,7 +2008,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'));
@@ -2007,13 +2019,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');
@@ -2126,12 +2136,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;
@@ -2204,7 +2212,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
@@ -2317,28 +2324,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 | ";
@@ -2352,7 +2355,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();
@@ -2366,7 +2368,6 @@ class tc
$this->t->set_block('vis_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('vis_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.vis_view'));
@@ -2378,13 +2379,11 @@ class tc
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.vis_sched&action=save'));
$this->t->set_var('title','Presidency Yearly Visit Scheduler');
- $family_width=500; $phone_width=40; $pri_width=10; $notes_width=128; $visit_date_width=20;
- $table_width=$family_width + $phone_width + $pri_width + $notes_width + $visit_date_width;
- $header_row = "Family Name | ";
- $header_row.= "Phone | ";
- $header_row.= "Priority | ";
- $header_row.= "Last Visit | ";
- $header_row.= "Scheduling Notes | ";
+ $header_row = "Family Name | ";
+ $header_row.= "Phone | ";
+ $header_row.= "Priority | ";
+ $header_row.= "Last Visit | ";
+ $header_row.= "Scheduling Notes | ";
$table_data=""; $completed_data=""; $totals_data="";
$year = date('Y');
@@ -2454,12 +2453,10 @@ class tc
}
// APPOINTMENT TABLE
- $date_width=250; $time_width=100; $family_width=250; $location_width=100;
- $appt_table_width=$date_width + $time_width + $family_width + $location_width;
- $appt_header_row = "Date | ";
- $appt_header_row.= "Time | ";
- $appt_header_row.= "Family | ";
- $appt_header_row.= "Location | ";
+ $appt_header_row = "Date | ";
+ $appt_header_row.= "Time | ";
+ $appt_header_row.= "Family | ";
+ $appt_header_row.= "Location | ";
$appt_table_data = "";
// Find out what the President ID is
@@ -2524,7 +2521,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);
// VISIT SCHEDULING TABLE
@@ -2605,17 +2601,13 @@ class tc
}
}
- $name_width=190; $phone_width=100; $date_width=100; $notes_width=300;
- $completed_table_width=$name_width + $phone_width + $date_width + $notes_width;
- $completed_header_row = "Family Name | ";
- $completed_header_row.= "Phone | ";
- $completed_header_row.= "Date | ";
- $completed_header_row.= "Visit Notes | ";
+ $completed_header_row = "Family Name | ";
+ $completed_header_row.= "Phone | ";
+ $completed_header_row.= "Date | ";
+ $completed_header_row.= "Visit Notes | ";
- $family_width=300; $totals_width=100;
- $totals_table_width=$family_width + $totals_width;
- $totals_header_row = "Families | ";
- $totals_header_row.= "$year | ";
+ $totals_header_row = "Families | ";
+ $totals_header_row.= "$year | ";
$totals_data.= "
";
$totals_data.= "Total Families with yearly Visits completed: | ";
$totals_data.= "$families_with_yearly_visit / $total_families | ";
@@ -2627,16 +2619,15 @@ class tc
$totals_data.= "$percent% | ";
$totals_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);
$this->t->set_var('totals_header_row',$totals_header_row);
- $this->t->set_var('totals_table_width',$totals_table_width);
$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('totals',$totals_data);
$this->t->fp('familylist','family_list',True);
+ $this->t->set_var('lang_save_appt','Save Appts');
+ $this->t->set_var('lang_save_pri_notes','Save Pri / Notes');
$this->t->fp('apptlist','appt_list',True);
$this->t->pfp('out','vis_sched_t');