Permalink
Browse files

Made sure the task status is carried through t addedit

When a task is created or task_status is active, the task tree defaults
to only showing active tasks. If the task is inactive, it only displays
inactive. This should keep the parent relationship unless someone
changes status and parent at the same time.

Resolves: https://bugs.web2project.net/view.php?id=1750
  • Loading branch information...
caseysoftware committed Nov 24, 2017
1 parent a63f7ca commit 367f1ab60ea208f2530303e67f7c55a2324fed56
Showing with 6 additions and 3 deletions.
  1. +3 −0 modules/tasks/addedit.php
  2. +3 −3 modules/tasks/tasks.class.php
@@ -107,6 +107,9 @@
$root_tasks = $object->getRootTasks((int)$task_project);
foreach ($root_tasks as $root_task) {
if ($root_task['task_status'] != $object->task_status) {
continue;
}
build_date_list($projTasksWithEndDates, $root_task);
if ($root_task['task_id'] != $object_id) {
$task_parent_options .= buildTaskTree($root_task, 0, array(), $all_tasks, $parents, $task_parent, $object_id);
@@ -42,7 +42,7 @@ class CTask extends w2p_Core_BaseObject
public $task_hours_worked = null;
// @todo this should be task_end_datetime to take advantage of our templating
public $task_end_date = null;
public $task_status = null;
public $task_status = 0;
public $task_priority = null;
public $task_percent_complete = null;
public $task_description = null;
@@ -1943,7 +1943,7 @@ public function getRootTasks($project_id)
{
$q = $this->_getQuery();
$q->addTable('tasks');
$q->addQuery('task_id, task_name, task_end_date, task_start_date, task_milestone, task_parent, task_dynamic');
$q->addQuery('task_id, task_name, task_end_date, task_start_date, task_milestone, task_parent, task_dynamic, task_status');
$q->addWhere('task_project = ' . (int) $project_id);
$q->addWhere('task_id = task_parent');
$q->addOrder('task_start_date');
@@ -1954,7 +1954,7 @@ public function getRootTasks($project_id)
public function getNonRootTasks($project_id)
{
$q = $this->_getQuery();
$q->addQuery('task_id, task_name, task_end_date, task_start_date, task_milestone, task_parent, task_dynamic');
$q->addQuery('task_id, task_name, task_end_date, task_start_date, task_milestone, task_parent, task_dynamic, task_status');
$q->addTable('tasks');
$q->addWhere('task_project = ' . (int) $project_id);
$q->addWhere('task_id <> task_parent');

0 comments on commit 367f1ab

Please sign in to comment.