summaryrefslogtreecommitdiff
path: root/app/Model/TaskStatus.php
diff options
context:
space:
mode:
authorGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
committerGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
commite4de6b3898b64b26d29aff31f21df5fda8055686 (patch)
tree575f8a65440f291d70a070d168eafca8c82a6459 /app/Model/TaskStatus.php
parentd9ffbea174ea6524d0a22f8375ca8b3aa04a3c96 (diff)
parenta6540bc604c837d92c9368540c145606723e97f7 (diff)
Merge pull request #1 from fguillot/master
Update from upstream
Diffstat (limited to 'app/Model/TaskStatus.php')
-rw-r--r--app/Model/TaskStatus.php32
1 files changed, 28 insertions, 4 deletions
diff --git a/app/Model/TaskStatus.php b/app/Model/TaskStatus.php
index a5199ed9..2b902815 100644
--- a/app/Model/TaskStatus.php
+++ b/app/Model/TaskStatus.php
@@ -62,6 +62,32 @@ class TaskStatus extends Base
}
/**
+ * Close multiple tasks
+ *
+ * @access public
+ * @param array $task_ids
+ */
+ public function closeMultipleTasks(array $task_ids)
+ {
+ foreach ($task_ids as $task_id) {
+ $this->close($task_id);
+ }
+ }
+
+ /**
+ * Close all tasks within a column/swimlane
+ *
+ * @access public
+ * @param integer $swimlane_id
+ * @param integer $column_id
+ */
+ public function closeTasksBySwimlaneAndColumn($swimlane_id, $column_id)
+ {
+ $task_ids = $this->db->table(Task::TABLE)->eq('swimlane_id', $swimlane_id)->eq('column_id', $column_id)->findAllByColumn('id');
+ $this->closeMultipleTasks($task_ids);
+ }
+
+ /**
* Common method to change the status of task
*
* @access private
@@ -87,10 +113,8 @@ class TaskStatus extends Base
));
if ($result) {
- $this->container['dispatcher']->dispatch(
- $event,
- new TaskEvent(array('task_id' => $task_id) + $this->taskFinder->getById($task_id))
- );
+ $this->logger->debug('Event fired: '.$event);
+ $this->dispatcher->dispatch($event, new TaskEvent(array('task_id' => $task_id) + $this->taskFinder->getById($task_id)));
}
return $result;