Some fixes associated with renaming the group_by field.
authorNik Okuntseff <support@anuko.com>
Sun, 28 Oct 2018 18:43:40 +0000 (18:43 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 28 Oct 2018 18:43:40 +0000 (18:43 +0000)
WEB-INF/lib/ttFavReportHelper.class.php
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/reports.tpl
report.php
reports.php

index adc6e2e..96188f2 100644 (file)
@@ -96,7 +96,7 @@ class ttFavReportHelper {
       $fields['chclient'].", ".$fields['chinvoice'].", ".$fields['chpaid'].", ".$fields['chip'].", ".
       $fields['chproject'].", ".$fields['chstart'].", ".$fields['chduration'].", ".$fields['chcost'].", ".
       $fields['chtask'].", ".$fields['chfinish'].", ".$fields['chnote'].", ".$fields['chcf_1'].", ".$fields['chunits'].", ".
-      $mdb2->quote($fields['group_by']).", ".$fields['chtotalsonly'].")";
+      $mdb2->quote($fields['group_by1']).", ".$fields['chtotalsonly'].")";
     $affected = $mdb2->exec($sql);
     if (is_a($affected, 'PEAR_Error'))
       return false;
@@ -139,7 +139,7 @@ class ttFavReportHelper {
       "show_note = ".$fields['chnote'].", ".
       "show_custom_field_1 = ".$fields['chcf_1'].", ".
       "show_work_units = ".$fields['chunits'].", ".
-      "group_by1 = ".$mdb2->quote($fields['group_by']).", ".
+      "group_by1 = ".$mdb2->quote($fields['group_by1']).", ".
       "show_totals_only = ".$fields['chtotalsonly'].
       " where id = ".$fields['id'];
     $affected = $mdb2->exec($sql);
@@ -209,7 +209,7 @@ class ttFavReportHelper {
       'chnote'=>$bean->getAttribute('chnote'),
       'chcf_1'=>$bean->getAttribute('chcf_1'),
       'chunits'=>$bean->getAttribute('chunits'),
-      'group_by'=>$bean->getAttribute('group_by'),
+      'group_by1'=>$bean->getAttribute('group_by1'),
       'chtotalsonly'=>$bean->getAttribute('chtotalsonly'));
 
     $id = false;
@@ -270,7 +270,7 @@ class ttFavReportHelper {
       $bean->setAttribute('chnote', $val['show_note']);
       $bean->setAttribute('chcf_1', $val['show_custom_field_1']);
       $bean->setAttribute('chunits', $val['show_work_units']);
-      $bean->setAttribute('group_by', $val['group_by1']);
+      $bean->setAttribute('group_by1', $val['group_by1']);
       $bean->setAttribute('chtotalsonly', $val['show_totals_only']);
       $bean->setAttribute('new_fav_report', $val['name']);
     } else {
@@ -295,7 +295,7 @@ class ttFavReportHelper {
         'chnote'=>'1',
         'chcf_1'=>'',
         'chunits'=>'',
-        'group_by'=>'',
+        'group_by1'=>'',
         'chtotalsonly'=>'',
         'new_fav_report'=>''));
       $bean->setAttributes($attrs);
index e2bb8dd..538830c 100644 (file)
@@ -127,7 +127,7 @@ class ttReportHelper {
     $canViewReports = $user->can('view_reports') || $user->can('view_all_reports');
     $isClient = $user->isClient();
 
-    $group_by_option = $options['group_by'];
+    $group_by_option = $options['group_by1'];
     $convertTo12Hour = ('%I:%M %p' == $user->time_format) && ($options['show_start'] || $options['show_end']);
 
     // Prepare a query for time items in tt_log table.
@@ -394,7 +394,7 @@ class ttReportHelper {
   static function getSubtotals($options) {
     global $user;
 
-    $group_by_option = $options['group_by'];
+    $group_by_option = $options['group_by1'];
     if ('no_grouping' == $group_by_option) return null;
 
     $mdb2 = getConnection();
@@ -667,7 +667,7 @@ class ttReportHelper {
     $isClient = $user->isClient();
 
     $items = ttReportHelper::getItems($options);
-    $group_by = $options['group_by'];
+    $group_by = $options['group_by1'];
     if ($group_by && 'no_grouping' != $group_by)
       $subtotals = ttReportHelper::getSubtotals($options);
     $totals = ttReportHelper::getTotals($options);
@@ -1062,7 +1062,7 @@ class ttReportHelper {
     $options['show_custom_field_1'] = $bean->getAttribute('chcf_1');
     $options['show_work_units'] = $bean->getAttribute('chunits');
     $options['show_totals_only'] = $bean->getAttribute('chtotalsonly');
-    $options['group_by'] = $bean->getAttribute('group_by');
+    $options['group_by1'] = $bean->getAttribute('group_by1');
     return $options;
   }
 
index 52a5e80..a54d6aa 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.00.4325 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.01.4326 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 9c8221a..feb5800 100644 (file)
@@ -138,7 +138,7 @@ function selectAssignedUsers(project_id) {
 function handleCheckboxes() {
   var totalsOnlyCheckbox = document.getElementById("chtotalsonly");
   var totalsOnlyLabel = document.getElementById("totals_only_label");
-  if ("no_grouping" == document.getElementById("group_by").value) {
+  if ("no_grouping" == document.getElementById("group_by1").value) {
     // Unmark and disable the "Totals only" checkbox.
     totalsOnlyCheckbox.checked = false;
     totalsOnlyCheckbox.style.visibility = "hidden";
@@ -302,7 +302,7 @@ function handleCheckboxes() {
             <td><b>{$i18n.form.reports.group_by}</b></td>
         </tr>
         <tr valign="top">
-          <td>{$forms.reportForm.group_by.control}</td>
+          <td>{$forms.reportForm.group_by1.control}</td>
           <td>{$forms.reportForm.group_by2.control}</td>
           <td>{$forms.reportForm.group_by3.control}</td>
         </tr>
index cd093e4..efbacce 100644 (file)
@@ -69,7 +69,7 @@ $client_id = $bean->getAttribute('client');
 
 // Do we need to show checkboxes?
 if ($bean->getAttribute('chpaid') ||
-   ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by')) && !$user->isClient())) {
+   ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by1')) && !$user->isClient())) {
   if ($user->can('manage_invoices'))
     $smarty->assign('use_checkboxes', true);
 }
@@ -92,7 +92,7 @@ if ($user->can('manage_invoices') && $bean->getAttribute('chpaid')) {
 
 // Controls for "Assign to invoice" block.
 if ($user->can('manage_invoices') &&
-  ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by')) && !$user->isClient())) {
+  ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by1')) && !$user->isClient())) {
   // Client is selected and we are displaying the invoice column.
   $recent_invoices = ttTeamHelper::getRecentInvoices($user->group_id, $client_id);
   if ($recent_invoices) {
@@ -170,7 +170,7 @@ if ($request->isPost()) {
   }
 } // isPost
 
-$group_by = $bean->getAttribute('group_by');
+$group_by = $bean->getAttribute('group_by1');
 
 $options = ttReportHelper::getReportOptions($bean);
 $report_items = ttReportHelper::getItems($options);
@@ -183,10 +183,10 @@ if ('no_grouping' != $group_by)
 $totals = ttReportHelper::getTotals($options);
 
 // Assign variables that are used to print subtotals.
-if ($report_items && 'no_grouping' != $group_by) {
+if ($report_items && 'no_grouping' != $group_by1) {
   $smarty->assign('print_subtotals', true);
   $smarty->assign('first_pass', true);
-  $smarty->assign('group_by', $group_by);
+  $smarty->assign('group_by1', $group_by1);
   $smarty->assign('prev_grouped_by', '');
   $smarty->assign('cur_grouped_by', '');
 }
index dae0c18..39f09c0 100644 (file)
@@ -233,7 +233,7 @@ if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['ty
   $group_by_options['cf_1'] = $custom_fields->fields[0]['label'];
 }
 $group_by_options_size = sizeof($group_by_options);
-$form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by','data'=>$group_by_options));
+$form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by1','data'=>$group_by_options));
 if (defined('MULTIPLE_GROUP_BY_DEBUG') && isTrue(MULTIPLE_GROUP_BY_DEBUG)) {
   if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','name'=>'group_by2','data'=>$group_by_options));
   if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','name'=>'group_by3','data'=>$group_by_options));