}
return $result;
}
+
+ // getActiveProjects - returns an array of active projects for a group.
+ static function getActiveProjects()
+ {
+ global $user;
+ $mdb2 = getConnection();
+
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
+
+ $sql = "select id, name, description, tasks from tt_projects".
+ " where group_id = $group_id and org_id = $org_id and status = 1 order by upper(name)";
+ $res = $mdb2->query($sql);
+ $result = array();
+ if (!is_a($res, 'PEAR_Error')) {
+ while ($val = $res->fetchRow()) {
+ $result[] = $val;
+ }
+ }
+ return $result;
+ }
+
+ // getInactiveProjects - returns an array of inactive projects for a group.
+ static function getInactiveProjects()
+ {
+ global $user;
+ $mdb2 = getConnection();
+
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
+
+ $sql = "select id, name, description, tasks from tt_projects".
+ " 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;
+ }
}
return $result;
}
- // getInactiveProjects - returns an array of inactive projects for a group.
- static function getInactiveProjects($group_id)
- {
- $result = array();
- $mdb2 = getConnection();
-
- $sql = "select id, name, description, tasks from tt_projects
- 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 getAllProjects obtains all projects in a group.
static function getAllProjects($group_id, $all_fields = false) {
$mdb2 = getConnection();
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.29.4563 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.29.4564 | Copyright © <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>
require_once('../initialize.php');
import('form.Form');
import('ttTeamHelper');
+import('ttGroupHelper');
// Access checks.
if (!(ttAccessAllowed('view_own_projects') || ttAccessAllowed('manage_projects'))) {
// End of access checks.
if($user->can('manage_projects')) {
- $active_projects = ttTeamHelper::getActiveProjects($user->group_id);
- $inactive_projects = ttTeamHelper::getInactiveProjects($user->group_id);
+ $active_projects = ttGroupHelper::getActiveProjects();
+ $inactive_projects = ttGroupHelper::getInactiveProjects();
} else
$active_projects = $user->getAssignedProjects();
require_once('initialize.php');
import('form.Form');
import('ttTeamHelper');
+import('ttGroupHelper');
// Access checks.
if (!(ttAccessAllowed('view_own_projects') || ttAccessAllowed('manage_projects'))) {
}
if($user->can('manage_projects')) {
- $active_projects = ttTeamHelper::getActiveProjects($group_id);
- $inactive_projects = ttTeamHelper::getInactiveProjects($group_id);
+ $active_projects = ttGroupHelper::getActiveProjects();
+ $inactive_projects = ttGroupHelper::getInactiveProjects();
} else
$active_projects = $user->getAssignedProjects();