summaryrefslogtreecommitdiff
path: root/app/Model/TaskCreation.php
diff options
context:
space:
mode:
authorLesstat <florianbarth@gmx.de>2015-07-11 11:44:26 +0200
committerLesstat <florianbarth@gmx.de>2015-07-11 11:44:26 +0200
commita85a1c613239c20fe72eb96c2921f4c220ec156b (patch)
treed032b4591e518cbbbfaa8886f8f5d98a6ea2efb7 /app/Model/TaskCreation.php
parent5101eaa8060ce3c75a81a26f6e47aae40e3d4ac3 (diff)
parent7e94d0ca233d15d6124c0adf3f956a119c82ccae (diff)
Merged branch 'master' of https://github.com/fguillot/kanboard
only imports conflicted
Diffstat (limited to 'app/Model/TaskCreation.php')
-rw-r--r--app/Model/TaskCreation.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Model/TaskCreation.php b/app/Model/TaskCreation.php
index 893cbc43..e530da13 100644
--- a/app/Model/TaskCreation.php
+++ b/app/Model/TaskCreation.php
@@ -43,9 +43,10 @@ class TaskCreation extends Base
*/
public function prepare(array &$values)
{
- $this->dateParser->convert($values, array('date_due', 'date_started'));
+ $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']);
@@ -59,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'];