From: Nik Okuntseff Date: Sat, 17 Nov 2018 12:45:02 +0000 (+0000) Subject: Fixed db maintenance code to delete monthly qoutas. X-Git-Tag: timetracker_1.19-1~635 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=871d0e2a62747b03609afc04e0ed84cfb0b1d776;p=timetracker.git Fixed db maintenance code to delete monthly qoutas. --- diff --git a/WEB-INF/lib/ttOrgHelper.class.php b/WEB-INF/lib/ttOrgHelper.class.php index 4a322f07..81bfbcf7 100644 --- a/WEB-INF/lib/ttOrgHelper.class.php +++ b/WEB-INF/lib/ttOrgHelper.class.php @@ -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. } } diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 40da2720..2198c0a8 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -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); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index a89ed9b3..4239f513 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.15.4436 | Copyright © Anuko | +  Anuko Time Tracker 1.18.15.4437 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}