global $user;
$mdb2 = getConnection();
+ $group_id = $user->getActiveGroup();
+ $org_id = $user->org_id;
+
// Start with project itself. Reason: if the passed in project_id is bogus,
// we'll fail right here and don't damage any other data.
// Mark project as deleted and remove associated tasks.
- $sql = "update tt_projects set status = NULL, tasks = NULL where id = $id and group_id = ".$user->getActiveGroup();
+ $sql = "update tt_projects set status = NULL, tasks = NULL where id = $id and group_id = $group_id and org_id = $org_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error') || 0 == $affected)
return false; // An error ocurred, or 0 rows updated.
// Delete user binds to this project.
- $sql = "delete from tt_user_project_binds where project_id = $id";
+ $sql = "delete from tt_user_project_binds where project_id = $id and group_id = $group_id and org_id = $org_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
// Delete task binds to this project.
- $sql = "delete from tt_project_task_binds where project_id = $id";
+ $sql = "delete from tt_project_task_binds where project_id = $id and group_id = $group_id and org_id = $org_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
global $i18n;
$mdb2 = getConnection();
+ $group_id = $user->getActiveGroup();
+ $org_id = $user->org_id;
+
if (isset($options['getAllFields']))
- $sql = "select u.*, r.name as role_name, r.rank from tt_users u left join tt_roles r on (u.role_id = r.id) where u.group_id = $user->group_id and u.status = 1 order by upper(u.name)";
+ $sql = "select u.*, r.name as role_name, r.rank from tt_users u left join tt_roles r on (u.role_id = r.id) where u.group_id = $group_id and u.org_id = $org_id and u.status = 1 order by upper(u.name)";
else
- $sql = "select id, name from tt_users where group_id = $user->group_id and status = 1 order by upper(name)";
+ $sql = "select id, name from tt_users where group_id = $group_id and org_id = $org_id and status = 1 order by upper(name)";
$res = $mdb2->query($sql);
$user_list = array();
if (is_a($res, 'PEAR_Error'))
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.28.4515 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.28.4516 | 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>
header('Location: feature_disabled.php');
exit();
}
+// End of access checks.
$users = ttTeamHelper::getActiveUsers();
foreach ($users as $user_item)
$all_users[$user_item['id']] = $user_item['name'];
-$tasks = ttTeamHelper::getActiveTasks($user->group_id);
+$tasks = ttTeamHelper::getActiveTasks($user->getActiveGroup());
foreach ($tasks as $task_item)
$all_tasks[$task_item['id']] = $task_item['name'];
foreach ($users as $user_item)
$all_users[$user_item['id']] = $user_item['name'];
-$tasks = ttTeamHelper::getActiveTasks($user->group_id);
+$tasks = ttTeamHelper::getActiveTasks($user->getActiveGroup());
foreach ($tasks as $task_item)
$all_tasks[$task_item['id']] = $task_item['name'];