summaryrefslogtreecommitdiff
path: root/app/Subscriber
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-03-26 22:40:46 -0400
committerFrederic Guillot <fred@kanboard.net>2015-03-26 22:40:46 -0400
commit87d2c6d99e6eb26b526f5da22b3496e3d02d11ed (patch)
treeedb8ef750b85fda13ebb2c4f7089eef94328d0f1 /app/Subscriber
parent93fa9b5cba4bf343d3c5dd97420cea81beaf6e88 (diff)
Add task transitions history
Diffstat (limited to 'app/Subscriber')
-rw-r--r--app/Subscriber/TransitionSubscriber.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/Subscriber/TransitionSubscriber.php b/app/Subscriber/TransitionSubscriber.php
new file mode 100644
index 00000000..347dd37d
--- /dev/null
+++ b/app/Subscriber/TransitionSubscriber.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Subscriber;
+
+use Event\TaskEvent;
+use Model\Task;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+class TransitionSubscriber extends Base implements EventSubscriberInterface
+{
+ public static function getSubscribedEvents()
+ {
+ return array(
+ Task::EVENT_MOVE_COLUMN => array('execute', 0),
+ );
+ }
+
+ public function execute(TaskEvent $event)
+ {
+ $user_id = $this->userSession->getId();
+
+ if (! empty($user_id)) {
+ $this->transition->save($user_id, $event->getAll());
+ }
+ }
+} \ No newline at end of file