* Finish task #5104.

This commit is contained in:
chenfei
2020-07-14 16:16:47 +08:00
parent b96bfde2ac
commit 41e862d5cb
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -363,7 +363,7 @@ class task extends control
$noclosedProjects = $this->project->getPairs('noclosed,nocode');
unset($noclosedProjects[$this->view->project->id]);
$this->view->projects = array($this->view->project->id => $this->view->project->name) + $noclosedProjects;
$tasks = $this->task->getParentTaskPairs($this->view->project->id);
$tasks = $this->task->getParentTaskPairs($this->view->project->id, $this->view->task->parent);
if(isset($tasks[$taskID])) unset($tasks[$taskID]);
if(!isset($this->view->members[$this->view->task->assignedTo])) $this->view->members[$this->view->task->assignedTo] = $this->view->task->assignedTo;
+3 -1
View File
@@ -1878,16 +1878,18 @@ class taskModel extends model
* Get project parent tasks pairs.
*
* @param int $projectID
* @param string $append
* @access public
* @return array
*/
public function getParentTaskPairs($projectID)
public function getParentTaskPairs($projectID, $append = '')
{
$tasks = $this->dao->select('id, name')->from(TABLE_TASK)
->where('deleted')->eq(0)
->andWhere('parent')->le(0)
->andWhere('status')->notin('cancel,closed')
->andWhere('project')->eq($projectID)
->beginIF($append)->orWhere('id')->in($append)->fi()
->fetchPairs();
foreach($tasks as $id => $name)