add link when task are near deadline in user menu

This commit is contained in:
2018-04-30 17:37:20 +02:00
parent 399f99ebfc
commit 63168818ec
6 changed files with 145 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Chill\TaskBundle\Workflow\TaskWorkflowManager;
use Symfony\Component\DependencyInjection\Reference;
use Chill\TaskBundle\Templating\UI\CountNotificationTask;
/**
*
@@ -37,6 +38,7 @@ class TaskWorkflowDefinitionCompilerPass implements CompilerPassInterface
}
$workflowManagerDefinition = $container->getDefinition(TaskWorkflowManager::class);
$counterDefinition = $container->getDefinition(CountNotificationTask::class);
foreach ($container->findTaggedServiceIds('chill_task.workflow_definition') as $id => $tags) {
// registering the definition to manager
@@ -50,6 +52,12 @@ class TaskWorkflowDefinitionCompilerPass implements CompilerPassInterface
'method' => 'onTaskStateEntered',
'priority' => -255
]);
$counterDefinition
->addTag('kernel.event_listener', [
'event' => sprintf('workflow.%s.entered', $definition->getClass()::getAssociatedWorkflowName()),
'method' => 'resetCacheOnNewStates',
'priority' => 0
]);
}
}
}