From: Nik Okuntseff Date: Sat, 17 Nov 2018 16:52:44 +0000 (+0000) Subject: Fixed db cleanup script by including predefined expenses. X-Git-Tag: timetracker_1.19-1~630 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d906edf1ba6fe68dc39f811cbb6fd6b5e94d9d4c;p=timetracker.git Fixed db cleanup script by including predefined expenses. --- diff --git a/WEB-INF/lib/ttOrgHelper.class.php b/WEB-INF/lib/ttOrgHelper.class.php index 81bfbcf7..36921239 100644 --- a/WEB-INF/lib/ttOrgHelper.class.php +++ b/WEB-INF/lib/ttOrgHelper.class.php @@ -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); diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 2198c0a8..4203fdc6 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 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); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index f5c80574..232208f9 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.16.4441 | Copyright © Anuko | +  Anuko Time Tracker 1.18.16.4442 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 8b7e8c5e..069016ab 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -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");