mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43:49 +00:00
add link when task are near deadline in user menu
This commit is contained in:
@@ -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
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user