Added 2 additional group by fields in database as part of ongoing work on multiple...
authorNik Okuntseff <support@anuko.com>
Sun, 28 Oct 2018 17:56:59 +0000 (17:56 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 28 Oct 2018 17:56:59 +0000 (17:56 +0000)
WEB-INF/lib/ttFavReportHelper.class.php
WEB-INF/templates/footer.tpl
dbinstall.php
mysql.sql

index 069ecbb..adc6e2e 100644 (file)
@@ -84,7 +84,7 @@ class ttFavReportHelper {
       show_client, show_invoice, show_paid, show_ip,
       show_project, show_start, show_duration, show_cost,
       show_task, show_end, show_note, show_custom_field_1, show_work_units,
-      group_by, show_totals_only)
+      group_by1, show_totals_only)
       values(".
       $mdb2->quote($fields['name']).", ".$fields['user_id'].", ".
       $mdb2->quote($fields['client']).", ".$mdb2->quote($fields['option']).", ".
@@ -139,7 +139,7 @@ class ttFavReportHelper {
       "show_note = ".$fields['chnote'].", ".
       "show_custom_field_1 = ".$fields['chcf_1'].", ".
       "show_work_units = ".$fields['chunits'].", ".
-      "group_by = ".$mdb2->quote($fields['group_by']).", ".
+      "group_by1 = ".$mdb2->quote($fields['group_by']).", ".
       "show_totals_only = ".$fields['chtotalsonly'].
       " where id = ".$fields['id'];
     $affected = $mdb2->exec($sql);
@@ -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_by']);
+      $bean->setAttribute('group_by', $val['group_by1']);
       $bean->setAttribute('chtotalsonly', $val['show_totals_only']);
       $bean->setAttribute('new_fav_report', $val['name']);
     } else {
index 7167ac7..52a5e80 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.17.100.4324 | 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.00.4325 | 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 5144d19..097d2ab 100644 (file)
@@ -956,6 +956,13 @@ if ($_POST) {
     print "Updated $tt_expense_items_updated tt_expense_items records...<br>\n";
   }
 
+  if ($_POST["convert11797to11800"]) {
+    setChange("ALTER TABLE `tt_fav_reports` CHANGE `group_by` `group_by1` varchar(20) default NULL");
+    setChange("ALTER TABLE `tt_fav_reports` ADD `group_by2` varchar(20) default NULL AFTER `group_by1`");
+    setChange("ALTER TABLE `tt_fav_reports` ADD `group_by3` varchar(20) default NULL AFTER `group_by2`");
+    setChange("UPDATE `tt_site_config` SET param_value = '1.18.00', modified = now() where param_name = 'version_db' and param_value = '1.17.97'");
+  }
+
   if ($_POST["cleanup"]) {
 
     $mdb2 = getConnection();
@@ -999,7 +1006,7 @@ if ($_POST) {
 <h2>DB Install</h2>
 <table width="80%" border="1" cellpadding="10" cellspacing="0">
   <tr>
-    <td width="80%"><b>Create database structure (v1.17.97)</b>
+    <td width="80%"><b>Create database structure (v1.18.00)</b>
     <br>(applies only to new installations, do not execute when updating)</br></td><td><input type="submit" name="crstructure" value="Create"></td>
   </tr>
 </table>
@@ -1040,7 +1047,12 @@ if ($_POST) {
   </tr>
     <tr valign="top">
     <td>Update database structure (v1.17.44 to v1.17.97)</td>
-    <td><input type="submit" name="convert11744to11797" value="Update"><br><input type="submit" name="update_group_id" value="Update group_id"></td>
+    <td><input type="submit" name="convert11744to117797" value="Update"><br><input type="submit" name="update_group_id" value="Update group_id"></td>
+  </tr>
+  </tr>
+  <tr valign="top">
+    <td>Update database structure (v1.17.97 to v1.18.00)</td>
+    <td><input type="submit" name="convert11797to11800" value="Update"></td>
   </tr>
 </table>
 
index 62c1d7c..07a2323 100644 (file)
--- a/mysql.sql
+++ b/mysql.sql
@@ -269,7 +269,9 @@ CREATE TABLE `tt_fav_reports` (
   `show_custom_field_1` tinyint(4) NOT NULL default 0,   # whether to show custom field 1
   `show_work_units` tinyint(4) NOT NULL default 0,       # whether to show work units
   `show_totals_only` tinyint(4) NOT NULL default 0,      # whether to show totals only
-  `group_by` varchar(20) default NULL,                   # group by field
+  `group_by1` varchar(20) default NULL,                  # group by field 1
+  `group_by2` varchar(20) default NULL,                  # group by field 2
+  `group_by3` varchar(20) default NULL,                  # group by field 3
   `status` tinyint(4) default 1,                         # favorite report status
   PRIMARY KEY (`id`)
 );
@@ -454,4 +456,4 @@ CREATE TABLE `tt_site_config` (
   PRIMARY KEY  (`param_name`)
 );
 
-INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.17.97', now()); # TODO: change when structure changes.
+INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.18.00', now()); # TODO: change when structure changes.