if ($task_id) {
// Add a mapping.
$this->currentGroupTaskMap[$attrs['ID']] = $task_id;
- } else $this->errors->add($i18n->get('error.db'));
+ } else {
+ $this->errors->add($i18n->get('error.db'));
+ }
return;
}
if ($project_id) {
// Add a mapping.
$this->currentGroupProjectMap[$attrs['ID']] = $project_id;
- } else $this->errors->add($i18n->get('error.db'));
+ } else {
+ $this->errors->add($i18n->get('error.db'));
+ }
return;
}
global $user;
$mdb2 = getConnection();
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
$sql = "select id, name, description, status from tt_tasks
- where id = $id and group_id = $user->group_id and (status = 0 or status = 1)";
+ where id = $id and group_id = $group_id and org_id = $org_id and (status = 0 or status = 1)";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
// getAssignedProjects - returns an array of projects associatied with a task.
static function getAssignedProjects($task_id)
{
- global $user;
+ global $user;
$result = array();
$mdb2 = getConnection();
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
// Do a query with inner join to get assigned projects.
$sql = "select p.id, p.name from tt_projects p
inner join tt_project_task_binds ptb on (ptb.project_id = p.id and ptb.task_id = $task_id)
- where p.group_id = $user->group_id and p.status = 1 order by p.name";
+ where p.group_id = $group_id and p.org_id = $org_id and p.status = 1 order by p.name";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
while ($val = $res->fetchRow()) {
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.28.4522 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.28.4523 | 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>
<td align = "right">{$i18n.label.status}:</td>
<td>{$forms.taskForm.status.control}</td>
</tr>
+{if $show_projects}
<tr valign="top">
<td align="right">{$i18n.label.projects}:</td>
<td>{$forms.taskForm.projects.control}</td>
</tr>
+{/if}
<tr>
<td></td>
<td>{$i18n.label.required_fields}</td>
header('Location: access_denied.php');
exit();
}
-if (MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+if (MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) {
header('Location: feature_disabled.php');
exit();
}
// End of access checks.
-$projects = ttTeamHelper::getActiveProjects($user->group_id);
+$projects = ttTeamHelper::getActiveProjects($user->getGroup());
if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
header('Location: access_denied.php');
exit();
}
-if (MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+if (MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) {
header('Location: feature_disabled.php');
exit();
}
}
// End of access checks.
-$projects = ttTeamHelper::getActiveProjects($user->group_id);
+$projects = ttTeamHelper::getActiveProjects($user->getGroup());
if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('show_projects', count($projects) > 0);
$smarty->assign('title', $i18n->get('title.edit_task'));
$smarty->assign('content_page_name', 'task_edit.tpl');
$smarty->display('index.tpl');