diff --git a/module/task/control.php b/module/task/control.php index bef793c7d4..88419e0d62 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -577,9 +577,14 @@ class task extends control unset($_POST['taskIDList']); if(!is_array($taskIDList)) die(js::locate($this->createLink('project', 'task', "projectID=$project"), 'parent')); $taskIDList = array_unique($taskIDList); - foreach($taskIDList as $taskID) + + $muletipleTasks = $this->dao->select('root')->from(TABLE_TEAM)->where('type')->eq('task')->andWhere('root')->in($taskIDList)->fetchPairs(); + $tasks = $this->task->getByList($taskIDList); + foreach($tasks as $taskID => $task) { $this->loadModel('action'); + if(in_array($taskID, $muletipleTasks) and $task->assignedTo != $this->app->user->account) continue; + $changes = $this->task->assign($taskID); if(dao::isError()) die(js::error(dao::getError())); $actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo); diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 8f4aac9f9e..a905387ae7 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -87,6 +87,7 @@ } ?> + assignedTo != $this->app->user->account) ? "disabled='disabled'" : '';?> @@ -102,7 +103,7 @@ ' style='overflow:visible'>module, "class='form-control chosen'")?> - ' style='overflow:visible'>assignedTo, "class='form-control chosen'");?> + ' style='overflow:visible'>assignedTo, "class='form-control chosen' {$disableAssignedTo}");?> type, "class='form-control'");?> >status, "class='form-control'");?> >pri, "class='form-control'");?> diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 8ad4cfffa7..b01134b9fc 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -121,7 +121,8 @@ task->assignedTo;?> - assignedTo, "class='form-control chosen'");?> + team) and $task->assignedTo != $this->app->user->account) ? "disabled='disabled'" :'';?> + assignedTo, "class='form-control chosen' {$disableAssignedTo}");?> ' id='teamTr'> task->team;?>