diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-08 19:59:17 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-08 19:59:17 -0400 |
commit | f4fc02130ad7ee10f25baceb6bd00511d9de259d (patch) | |
tree | 40177d1b56af968117a53d1081b6e3a3a120b3af /app | |
parent | 61fb47bf3a595acf3c85707426890b2338b1d9b4 (diff) |
Fix bug: No creator when duplicating a task
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/Task.php | 1 | ||||
-rw-r--r-- | app/Model/TaskCreation.php | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/Controller/Task.php b/app/Controller/Task.php index 162b0ddd..0d85f411 100644 --- a/app/Controller/Task.php +++ b/app/Controller/Task.php @@ -152,7 +152,6 @@ class Task extends Base { $project = $this->getProject(); $values = $this->request->getValues(); - $values['creator_id'] = $this->userSession->getId(); list($valid, $errors) = $this->taskValidator->validateCreation($values); diff --git a/app/Model/TaskCreation.php b/app/Model/TaskCreation.php index b444a190..e530da13 100644 --- a/app/Model/TaskCreation.php +++ b/app/Model/TaskCreation.php @@ -46,7 +46,7 @@ class TaskCreation extends Base $this->dateParser->convert($values, array('date_due')); $this->dateParser->convert($values, array('date_started'), true); $this->removeFields($values, array('another_task')); - $this->resetFields($values, array('owner_id', 'swimlane_id', 'date_due', 'score', 'category_id', 'time_estimated')); + $this->resetFields($values, array('creator_id', 'owner_id', 'swimlane_id', 'date_due', 'score', 'category_id', 'time_estimated')); if (empty($values['column_id'])) { $values['column_id'] = $this->board->getFirstColumn($values['project_id']); @@ -60,6 +60,10 @@ class TaskCreation extends Base $values['title'] = t('Untitled'); } + if ($this->userSession->isLogged()) { + $values['creator_id'] = $this->userSession->getId(); + } + $values['swimlane_id'] = empty($values['swimlane_id']) ? 0 : $values['swimlane_id']; $values['date_creation'] = time(); $values['date_modification'] = $values['date_creation']; |