Fixed db maintenance code to delete monthly qoutas.
authorNik Okuntseff <support@anuko.com>
Sat, 17 Nov 2018 12:45:02 +0000 (12:45 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 17 Nov 2018 12:45:02 +0000 (12:45 +0000)
WEB-INF/lib/ttOrgHelper.class.php
WEB-INF/lib/ttTeamHelper.class.php
WEB-INF/templates/footer.tpl

index 4a322f0..81bfbcf 100644 (file)
@@ -84,11 +84,17 @@ class ttOrgHelper {
   }
 
   // deleteOrg deletes data for the entire organization from database permanently.
-  static function deleteOrg() {
-    return false; // Work in progress, currently not implemented.
-
+  // Work in progress, currently not fully implemented.
+  static function deleteOrg($org_id) {
     // We shall do it in a straightforward way by a delete operation from all tables by org_id.
     // However, at this time not all tables have org_id.
     // So, we need to add the field as we write code here.
+
+    // Delete monthly quotas.
+    $sql = "delete from tt_monthly_quotas where org_id = $org_id";
+    $affected = $mdb2->exec($sql);
+    if (is_a($affected, 'PEAR_Error')) return false;
+
+    return true; // Work in progress, currently not fully implemented.
   }
 }
index 40da272..2198c0a 100644 (file)
@@ -703,6 +703,11 @@ class ttTeamHelper {
     $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);
+    if (is_a($affected, 'PEAR_Error')) return false;
+
     // Delete group.
     $sql = "delete from tt_groups where id = $group_id";
     $affected = $mdb2->exec($sql);
index a89ed9b..4239f51 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.15.4436 | 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.15.4437 | 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>