diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Model/TaskPosition.php | 10 | ||||
-rw-r--r-- | app/ServiceProvider/EventDispatcherProvider.php | 1 | ||||
-rw-r--r-- | app/Subscriber/TaskMovedDateSubscriber.php | 25 |
3 files changed, 9 insertions, 27 deletions
diff --git a/app/Model/TaskPosition.php b/app/Model/TaskPosition.php index 53193c9b..762f7fe3 100644 --- a/app/Model/TaskPosition.php +++ b/app/Model/TaskPosition.php @@ -120,10 +120,18 @@ class TaskPosition extends Base */ private function updateTaskPosition($task_id, $swimlane_id, $column_id, $position) { + $now = time(); + return $this->db->table(Task::TABLE) ->eq('id', $task_id) ->eq('is_active', 1) - ->update(array('position' => $position, 'column_id' => $column_id, 'swimlane_id' => $swimlane_id, 'date_modification' => time())); + ->update(array( + 'position' => $position, + 'column_id' => $column_id, + 'swimlane_id' => $swimlane_id, + 'date_modification' => $now, + 'date_moved' => $now, + )); } /** diff --git a/app/ServiceProvider/EventDispatcherProvider.php b/app/ServiceProvider/EventDispatcherProvider.php index 6cb302e6..8280a138 100644 --- a/app/ServiceProvider/EventDispatcherProvider.php +++ b/app/ServiceProvider/EventDispatcherProvider.php @@ -26,7 +26,6 @@ class EventDispatcherProvider implements ServiceProviderInterface $container['dispatcher']->addSubscriber(new ProjectModificationDateSubscriber($container)); $container['dispatcher']->addSubscriber(new NotificationSubscriber($container)); $container['dispatcher']->addSubscriber(new SubtaskTimeTrackingSubscriber($container)); - $container['dispatcher']->addSubscriber(new TaskMovedDateSubscriber($container)); $container['dispatcher']->addSubscriber(new TransitionSubscriber($container)); $container['dispatcher']->addSubscriber(new RecurringTaskSubscriber($container)); diff --git a/app/Subscriber/TaskMovedDateSubscriber.php b/app/Subscriber/TaskMovedDateSubscriber.php deleted file mode 100644 index 9857f4b3..00000000 --- a/app/Subscriber/TaskMovedDateSubscriber.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Kanboard\Subscriber; - -use Kanboard\Event\TaskEvent; -use Kanboard\Model\Task; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -class TaskMovedDateSubscriber extends \Kanboard\Core\Base implements EventSubscriberInterface -{ - public static function getSubscribedEvents() - { - return array( - Task::EVENT_MOVE_COLUMN => array('execute', 0), - Task::EVENT_MOVE_SWIMLANE => array('execute', 0), - ); - } - - public function execute(TaskEvent $event) - { - if (isset($event['task_id'])) { - $this->container['db']->table(Task::TABLE)->eq('id', $event['task_id'])->update(array('date_moved' => time())); - } - } -} |