Fixed db cleanup script by including predefined expenses.
authorNik Okuntseff <support@anuko.com>
Sat, 17 Nov 2018 16:52:44 +0000 (16:52 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 17 Nov 2018 16:52:44 +0000 (16:52 +0000)
WEB-INF/lib/ttOrgHelper.class.php
WEB-INF/lib/ttTeamHelper.class.php
WEB-INF/templates/footer.tpl
dbinstall.php

index 81bfbcf..3692123 100644 (file)
@@ -90,6 +90,11 @@ class ttOrgHelper {
     // However, at this time not all tables have org_id.
     // So, we need to add the field as we write code here.
 
+    // Delete predefined expenses.
+    $sql = "delete from tt_predefined_expenses where org_id = $org_id";
+    $affected = $mdb2->exec($sql);
+    if (is_a($affected, 'PEAR_Error')) return false;
+
     // Delete monthly quotas.
     $sql = "delete from tt_monthly_quotas where org_id = $org_id";
     $affected = $mdb2->exec($sql);
index 2198c0a..4203fdc 100644 (file)
@@ -703,6 +703,11 @@ class ttTeamHelper {
     $affected = $mdb2->exec($sql);
     if (is_a($affected, 'PEAR_Error')) return false;
 
+    // Delete predefined expenses.
+    $sql = "delete from tt_predefined_expenses where group_id = $group_id";
+    $affected = $mdb2->exec($sql);
+    if (is_a($affected, 'PEAR_Error')) return false;
+
     // Delete monthly quotas.
     $sql = "delete from tt_monthly_quotas where group_id = $group_id";
     $affected = $mdb2->exec($sql);
index f5c8057..232208f 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.16.4441 | 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.16.4442 | 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 8b7e8c5..069016a 100644 (file)
@@ -1031,6 +1031,7 @@ if ($_POST) {
     setChange("OPTIMIZE TABLE tt_invoices");
     setChange("OPTIMIZE TABLE tt_log");
     setChange("OPTIMIZE TABLE tt_monthly_quotas");
+    setChange("OPTIMIZE TABLE tt_predefined_expenses");
     setChange("OPTIMIZE TABLE tt_project_task_binds");
     setChange("OPTIMIZE TABLE tt_projects");
     setChange("OPTIMIZE TABLE tt_tasks");