From: Alan Pippin Date: Mon, 11 Oct 2010 18:33:32 +0000 (-0600) Subject: Merge branch 'master' of git@github.com:apippin/tc X-Git-Tag: release_1_1_0~6^2~3 X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=commitdiff_plain;h=9e3770fc8b3456d646e43fe13f238324f8d85740;hp=e5086ad471f964105838ad01cc3d0214f5521e35;p=eq%2F.git Merge branch 'master' of git@github.com:apippin/tc --- diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php index f07b9b9..7f2700e 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()) { @@ -1344,13 +1357,13 @@ class tc $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; @@ -1362,6 +1375,10 @@ class tc $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 @@ -1454,9 +1471,9 @@ class tc // 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 = "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"; + $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 @@ -1529,7 +1546,7 @@ class tc } $max = count($individual); - + for($i=0; $i < $max; $i++) { $id = $individual[$i]; $name = $indiv_name[$i]; @@ -1537,9 +1554,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,6 +1623,7 @@ 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"; @@ -1612,6 +1631,7 @@ class tc $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); @@ -1626,7 +1646,7 @@ class tc $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); @@ -2318,12 +2338,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 +3538,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; diff --git a/mls/MLSFileTrimmerInstaller.msi b/mls/MLSFileTrimmerInstaller.msi index 5d63238..848eabf 100644 Binary files a/mls/MLSFileTrimmerInstaller.msi and b/mls/MLSFileTrimmerInstaller.msi differ diff --git a/mls/windowsGUI/MLSFileTrimmer/CSVTrimmer.cs b/mls/windowsGUI/MLSFileTrimmer/CSVTrimmer.cs index 9b39874..97b25c5 100644 --- a/mls/windowsGUI/MLSFileTrimmer/CSVTrimmer.cs +++ b/mls/windowsGUI/MLSFileTrimmer/CSVTrimmer.cs @@ -1,9 +1,7 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.IO; +using System.Text; namespace MLSFileTrimmer { diff --git a/mls/windowsGUI/MLSFileTrimmer/Window1.xaml b/mls/windowsGUI/MLSFileTrimmer/Window1.xaml index 074a27e..13b01b0 100644 --- a/mls/windowsGUI/MLSFileTrimmer/Window1.xaml +++ b/mls/windowsGUI/MLSFileTrimmer/Window1.xaml @@ -1,13 +1,25 @@  + Title="MLS File Trimmer" Height="200" Width="600" MaxHeight="Infinity" MaxWidth="Infinity" MinHeight="0" MinWidth="0" ResizeMode="CanResize"> - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/mls/windowsGUI/MLSFileTrimmer/Window1.xaml.cs b/mls/windowsGUI/MLSFileTrimmer/Window1.xaml.cs index 098aa47..9ababe2 100644 --- a/mls/windowsGUI/MLSFileTrimmer/Window1.xaml.cs +++ b/mls/windowsGUI/MLSFileTrimmer/Window1.xaml.cs @@ -1,24 +1,13 @@ using System; -using System.Collections.Generic; -using System.Linq; +using System.ComponentModel; +using System.IO; using System.Text; +using System.Threading; using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using Microsoft.Win32; -using System.IO; -using FolderBrowserDialog = System.Windows.Forms.FolderBrowserDialog; -using System.Xml.Serialization; using System.Xml; +using System.Xml.Serialization; using Ionic.Zip; -using System.ComponentModel; -using System.Threading; +using FolderBrowserDialog = System.Windows.Forms.FolderBrowserDialog; namespace MLSFileTrimmer { @@ -62,7 +51,7 @@ namespace MLSFileTrimmer openFolderDialog.RootFolder = Environment.SpecialFolder.MyDocuments; if (openFolderDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { - outputDirtextBox.Text = openFolderDialog.SelectedPath; + outputDirTextBox.Text = openFolderDialog.SelectedPath; currentDirectory = openFolderDialog.SelectedPath; } } @@ -70,14 +59,14 @@ namespace MLSFileTrimmer private void parseButton_Click(object sender, RoutedEventArgs e) { // make sure the directory exists - if (outputDirtextBox.Text.Equals(String.Empty)) + if (outputDirTextBox.Text.Equals(String.Empty)) { MessageBox.Show("Please select the correct output directory."); return; } - else if (!Directory.Exists(outputDirtextBox.Text)) + else if (!Directory.Exists(outputDirTextBox.Text)) { - MessageBox.Show(outputDirtextBox.Text + " does not exist. Please select the correct output directory."); + MessageBox.Show(outputDirTextBox.Text + " does not exist. Please select the correct output directory."); } // make sure the original files exist @@ -147,5 +136,10 @@ namespace MLSFileTrimmer this.trimmingLabel.Visibility = Visibility.Hidden; this.finishedLabel.Visibility = Visibility.Visible; } + + private void exitButton_Click(object sender, RoutedEventArgs e) + { + this.Close(); + } } } diff --git a/setup/tc_config b/setup/tc_config index 19849a2..7b959ae 100644 --- a/setup/tc_config +++ b/setup/tc_config @@ -33,6 +33,11 @@ $this->time_drop_down_lists = 1; // Examples: Monthly=1 Quarterly=3 Yearly=12 $this->monthly_hometeaching_interview_stats = 3; +// Frequency of PPIs in months +// This number must evenly divide 12. +// Examples: Monthly=1 Quarterly=3 Yearly=12 +$this->ppi_frequency = 12; + // Specify who can hold yearly PPIs // 1 = EQ President // 2 = EQ President + Counselors diff --git a/templates/default/ppi_sched.tpl b/templates/default/ppi_sched.tpl index 191a9a2..f694d4f 100644 --- a/templates/default/ppi_sched.tpl +++ b/templates/default/ppi_sched.tpl @@ -50,7 +50,7 @@ - {table_title} + {not_completed_table_title} {header_row} @@ -71,7 +71,7 @@ {completed_header_row}
- All Individuals with Yearly PPI Completed + {completed_table_title}