Permalink
Browse files

Adding a 'All user' option to the todolist module

  • Loading branch information...
caseysoftware committed Oct 5, 2014
1 parent 643765b commit bf36cc893589ecf1b1814d806927da5341a38f4d
Showing with 5 additions and 2 deletions.
  1. +2 −1 todos/index.php
  2. +3 −1 todos/todos.class.php
@@ -18,7 +18,8 @@
}
$owner = $AppUI->getState('TodoOwner') !== null ? $AppUI->getState('TodoOwner') : $AppUI->user_id;
$user_list = $users = $perms->getPermittedUsers('projects');
$user_list[0] = 'All Users';
$user_list += $users = $perms->getPermittedUsers('projects');
?>
<script src="./modules/todos/todos.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="./modules/todos/todos.css" />
@@ -95,7 +95,9 @@ public function getTodosForDateRange($dateRangeName, $user_id = 0, $project_id =
$q->addWhere("st.todo_due_date > '$nextSunday'");
}
$q->addWhere('st.todo_status = 1');
$q->addWhere("st.todo_owner = ".(($user_id > 0) ? $user_id : $this->_AppUI->user_id));
if ($user_id) {
$q->addWhere("st.todo_owner = " . $user_id);
}
$q->addQuery('pr.project_name, pr.project_color_identifier, pr.project_company');
$q->leftJoin('projects', 'pr', 'pr.project_id = st.todo_project');

0 comments on commit bf36cc8

Please sign in to comment.