A bit more refactoring ttProjectHelper class for subgroups.
authorNik Okuntseff <support@anuko.com>
Mon, 10 Dec 2018 12:12:36 +0000 (12:12 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 10 Dec 2018 12:12:36 +0000 (12:12 +0000)
WEB-INF/lib/ttProjectHelper.class.php
WEB-INF/lib/ttTeamHelper.class.php
WEB-INF/templates/footer.tpl

index 455076f..fe033b9 100644 (file)
@@ -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)";
index aa3893c..3fc06cc 100644 (file)
@@ -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()
index a5ede57..2ab232e 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.4625 | 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.4626 | 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>