diff options
author | 85pando <85pando@googlemail.com> | 2016-02-05 10:28:40 +0100 |
---|---|---|
committer | 85pando <85pando@googlemail.com> | 2016-02-05 10:28:40 +0100 |
commit | 791d13c87bf510d913973b77a5f6d152311a1d87 (patch) | |
tree | 81412e8dbd3ac4fa0047030a6068afafd975687e /app/Model/Task.php | |
parent | 2074aaaa9a75455097e4e77ca09f4fba3e567052 (diff) | |
parent | 12aaec03b19a07635f59b00f532c92c37ac1df5f (diff) |
Merge remote-tracking branch 'refs/remotes/upstream/master'
Conflicts:
app/Locale/de_DE/translations.php
Diffstat (limited to 'app/Model/Task.php')
-rw-r--r-- | app/Model/Task.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/Model/Task.php b/app/Model/Task.php index 7aa9e312..38fdd0d5 100644 --- a/app/Model/Task.php +++ b/app/Model/Task.php @@ -42,6 +42,7 @@ class Task extends Base const EVENT_ASSIGNEE_CHANGE = 'task.assignee_change'; const EVENT_OVERDUE = 'task.overdue'; const EVENT_USER_MENTION = 'task.user.mention'; + const EVENT_DAILY_CRONJOB = 'task.cronjob.daily'; /** * Recurrence: status @@ -198,4 +199,25 @@ class Task extends Base return round(($position * 100) / count($columns), 1); } + + /** + * Helper method to duplicate all tasks to another project + * + * @access public + * @param integer $src_project_id + * @param integer $dst_project_id + * @return boolean + */ + public function duplicate($src_project_id, $dst_project_id) + { + $task_ids = $this->taskFinder->getAllIds($src_project_id, array(Task::STATUS_OPEN, Task::STATUS_CLOSED)); + + foreach ($task_ids as $task_id) { + if (! $this->taskDuplication->duplicateToProject($task_id, $dst_project_id)) { + return false; + } + } + + return true; + } } |