From: Nik Okuntseff Date: Sun, 9 Dec 2018 15:54:42 +0000 (+0000) Subject: Some more refactoring for subgroups. X-Git-Tag: timetracker_1.19-1~443 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ef3d1adc569966ab70efa4c780e2165cccaaa205;p=timetracker.git Some more refactoring for subgroups. --- diff --git a/WEB-INF/lib/ttGroupHelper.class.php b/WEB-INF/lib/ttGroupHelper.class.php index 801793ff..0e45110c 100644 --- a/WEB-INF/lib/ttGroupHelper.class.php +++ b/WEB-INF/lib/ttGroupHelper.class.php @@ -505,4 +505,25 @@ class ttGroupHelper { } return $result; } + + // getInactiveTasks - returns an array of inactive tasks for a group. + static function getInactiveTasks() + { + global $user; + $mdb2 = getConnection(); + + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $sql = "select id, name, description from tt_tasks". + " where group_id = $group_id and org_id = $org_id and status = 0 order by upper(name)"; + $res = $mdb2->query($sql); + $result = array(); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $result[] = $val; + } + } + return $result; + } } diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 6aa7b917..aa3893c6 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -157,24 +157,6 @@ class ttTeamHelper { return false; } - // getInactiveTasks - returns an array of inactive tasks for a group. - static function getInactiveTasks($group_id) - { - $result = array(); - $mdb2 = getConnection(); - - $sql = "select id, name, description from tt_tasks - where group_id = $group_id and status = 0 order by upper(name)"; - $res = $mdb2->query($sql); - $result = array(); - if (!is_a($res, 'PEAR_Error')) { - while ($val = $res->fetchRow()) { - $result[] = $val; - } - } - return $result; - } - // The getAllTasks obtains all tasks in a group. static function getAllTasks($group_id, $all_fields = false) { $mdb2 = getConnection(); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 60f6f55c..96e60584 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.29.4621 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4622 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/mobile/tasks.php b/mobile/tasks.php index 67adab04..2745df23 100644 --- a/mobile/tasks.php +++ b/mobile/tasks.php @@ -28,7 +28,6 @@ require_once('../initialize.php'); import('form.Form'); -import('ttTeamHelper'); import('ttGroupHelper'); // Access checks. @@ -44,7 +43,7 @@ if (MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) { if($user->can('manage_tasks')) { $active_tasks = ttGroupHelper::getActiveTasks(); - $inactive_tasks = ttTeamHelper::getInactiveTasks($user->getGroup()); + $inactive_tasks = ttGroupHelper::getInactiveTasks(); } else $active_tasks = $user->getAssignedTasks(); diff --git a/tasks.php b/tasks.php index 49d126f0..ba91ed01 100644 --- a/tasks.php +++ b/tasks.php @@ -28,7 +28,6 @@ require_once('initialize.php'); import('form.Form'); -import('ttTeamHelper'); import('ttGroupHelper'); // Access checks. @@ -75,7 +74,7 @@ if ($user->can('manage_subgroups')) { if($user->can('manage_tasks')) { $active_tasks = ttGroupHelper::getActiveTasks(); - $inactive_tasks = ttTeamHelper::getInactiveTasks($group_id); + $inactive_tasks = ttGroupHelper::getInactiveTasks(); } else $active_tasks = $user->getAssignedTasks();