From c595ddbfdf0515e5fc91cc998bdf2bf92875c998 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 Dec 2018 12:12:36 +0000 Subject: [PATCH] A bit more refactoring ttProjectHelper class for subgroups. --- WEB-INF/lib/ttProjectHelper.class.php | 5 ++--- WEB-INF/lib/ttTeamHelper.class.php | 19 ------------------- WEB-INF/templates/footer.tpl | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index 455076fa..fe033b9d 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -26,7 +26,6 @@ // | https://www.anuko.com/time_tracker/credits.htm // +----------------------------------------------------------------------+ -import('ttTeamHelper'); import('ttUserHelper'); import('ttGroupHelper'); @@ -235,8 +234,8 @@ class ttProjectHelper { } // Bind the project to tasks in tt_project_task_binds table. - $all_tasks = ttTeamHelper::getAllTasks($group_id); - foreach ($all_tasks as $task) { + $active_tasks = ttGroupHelper::getActiveTasks(); + foreach ($active_tasks as $task) { if(in_array($task['id'], $tasks)) { $sql = "insert into tt_project_task_binds (project_id, task_id, group_id, org_id)". " values($last_id, ".$task['id'].", $group_id, $org_id)"; diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index aa3893c6..3fc06cc7 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -157,25 +157,6 @@ class ttTeamHelper { return false; } - // The getAllTasks obtains all tasks in a group. - static function getAllTasks($group_id, $all_fields = false) { - $mdb2 = getConnection(); - - if ($all_fields) - $sql = "select * from tt_tasks where group_id = $group_id order by status, upper(name)"; - else - $sql = "select id, name from tt_tasks where group_id = $group_id order by status, upper(name)"; - $res = $mdb2->query($sql); - $result = array(); - if (!is_a($res, 'PEAR_Error')) { - while ($val = $res->fetchRow()) { - $result[] = $val; - } - return $result; - } - return false; - } - // getActiveRolesForUser - returns an array of relevant active roles for user with rank less than self. // "Relevant" means that client roles are filtered out if Client plugin is disabled. static function getActiveRolesForUser() diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index a5ede572..2ab232e4 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.29.4625 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4626 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1