Files
Kanboard-Prod/app/Subscriber/ProjectModificationDateSubscriber.php
Franky Van Liedekerke a0a7a1eb31 Add subtask events to ProjectModificationDateSubscriber
This allows also subtask updates to be reflected on the dashboard (the % info) when a subtask is completed.
2020-05-21 20:51:47 -07:00

34 lines
1.2 KiB
PHP

<?php
namespace Kanboard\Subscriber;
use Kanboard\Event\GenericEvent;
use Kanboard\Model\TaskModel;
use Kanboard\Model\SubtaskModel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ProjectModificationDateSubscriber extends BaseSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array(
TaskModel::EVENT_CREATE_UPDATE => 'execute',
TaskModel::EVENT_CLOSE => 'execute',
TaskModel::EVENT_OPEN => 'execute',
TaskModel::EVENT_MOVE_SWIMLANE => 'execute',
TaskModel::EVENT_MOVE_COLUMN => 'execute',
TaskModel::EVENT_MOVE_POSITION => 'execute',
TaskModel::EVENT_MOVE_PROJECT => 'execute',
TaskModel::EVENT_ASSIGNEE_CHANGE => 'execute',
SubtaskModel::EVENT_CREATE_UPDATE => 'execute',
SubtaskModel::EVENT_DELETE => 'execute',
);
}
public function execute(GenericEvent $event)
{
$this->logger->debug('Subscriber executed: '.__METHOD__);
$this->projectModel->updateModificationDate($event['task']['project_id']);
}
}