mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
action: confirm accompanying period + create workflow
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014-2016 Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*
|
||||
@@ -166,6 +165,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
$this->prependHomepageWidget($container);
|
||||
$this->prependDoctrineDQL($container);
|
||||
$this->prependCruds($container);
|
||||
$this->prependWorkflows($container);
|
||||
|
||||
//add person_fields parameter as global
|
||||
$chillPersonConfig = $container->getExtensionConfig($this->getAlias());
|
||||
@@ -195,6 +195,39 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
));
|
||||
}
|
||||
|
||||
protected function prependWorkflows(ContainerBuilder $container)
|
||||
{
|
||||
$container->prependExtensionConfig('framework', [
|
||||
'workflows' => [
|
||||
'accompanying_period_lifecycle' => [
|
||||
'type' => 'state_machine',
|
||||
'audit_trail' => [
|
||||
'enabled' => true
|
||||
],
|
||||
'marking_store' => [
|
||||
'type' => 'method',
|
||||
'property' => 'step',
|
||||
],
|
||||
'supports' => [
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod'
|
||||
],
|
||||
'initial_marking' => 'DRAFT',
|
||||
'places' => [
|
||||
'DRAFT',
|
||||
'CONFIRMED',
|
||||
],
|
||||
'transitions' => [
|
||||
'confirm' => [
|
||||
'from' => 'DRAFT',
|
||||
'to' => 'CONFIRMED'
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a widget "add a person" on the homepage, automatically
|
||||
*
|
||||
@@ -406,6 +439,16 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
]
|
||||
],
|
||||
|
||||
'confirm' => [
|
||||
'methods' => [
|
||||
Request::METHOD_POST => true,
|
||||
Request::METHOD_GET => false,
|
||||
Request::METHOD_HEAD => false,
|
||||
],
|
||||
'roles' => [
|
||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
|
Reference in New Issue
Block a user