Some more refactoring for subgroups.
authorNik Okuntseff <support@anuko.com>
Sun, 9 Dec 2018 15:54:42 +0000 (15:54 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 9 Dec 2018 15:54:42 +0000 (15:54 +0000)
WEB-INF/lib/ttGroupHelper.class.php
WEB-INF/lib/ttTeamHelper.class.php
WEB-INF/templates/footer.tpl
mobile/tasks.php
tasks.php

index 801793f..0e45110 100644 (file)
@@ -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;
+  }
 }
index 6aa7b91..aa3893c 100644 (file)
@@ -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();
index 60f6f55..96e6058 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.29.4621 | 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.29.4622 | 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>
index 67adab0..2745df2 100644 (file)
@@ -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();
 
index 49d126f..ba91ed0 100644 (file)
--- 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();