mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Merge branch 'master' into homepage/rewrite
This commit is contained in:
commit
a2063ab13b
10
CHANGELOG.md
10
CHANGELOG.md
@ -11,6 +11,14 @@ and this project adheres to
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- write down unreleased development here -->
|
||||||
|
* renommer "dossier numéro" en "parcours numéro" dans les résultats de recherche
|
||||||
|
* renomme date de début en date d'ouverture dans le formulaire parcours
|
||||||
|
|
||||||
|
|
||||||
|
## Test releases
|
||||||
|
|
||||||
|
### test release 2021-01-31
|
||||||
|
|
||||||
[fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413
|
[fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413
|
||||||
[homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
|
[homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
|
||||||
* [person] accompanying course: optimisation: do not fetch some resources for the banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/409)
|
* [person] accompanying course: optimisation: do not fetch some resources for the banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/409)
|
||||||
@ -26,8 +34,6 @@ and this project adheres to
|
|||||||
* [workflow][notification] improve how notifications and workflows are 'attached' to entities: contextual list, counter, buttons and vue modal
|
* [workflow][notification] improve how notifications and workflows are 'attached' to entities: contextual list, counter, buttons and vue modal
|
||||||
|
|
||||||
|
|
||||||
## Test releases
|
|
||||||
|
|
||||||
### test release 2021-01-28
|
### test release 2021-01-28
|
||||||
|
|
||||||
* [person] improve filiations vis graph: disable physics, use chill colors for persons-households-course, increase label of relations, remove labels on household arrows and other improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/286, https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/362)
|
* [person] improve filiations vis graph: disable physics, use chill colors for persons-households-course, increase label of relations, remove labels on household arrows and other improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/286, https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/362)
|
||||||
|
@ -271,7 +271,7 @@ class ActivityType
|
|||||||
public function checkSocialActionsVisibility(ExecutionContextInterface $context, $payload)
|
public function checkSocialActionsVisibility(ExecutionContextInterface $context, $payload)
|
||||||
{
|
{
|
||||||
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
||||||
if (!($this->socialIssuesVisible === 2 && $this->socialActionsVisible === 1)) {
|
if (!(2 === $this->socialIssuesVisible && 1 === $this->socialActionsVisible)) {
|
||||||
$context
|
$context
|
||||||
->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value')
|
->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value')
|
||||||
->atPath('socialActionsVisible')
|
->atPath('socialActionsVisible')
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Aggregator;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Aggregator;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Aggregator;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Filter;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Filter;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\CustomFieldsBundle\Tests;
|
namespace Chill\CustomFieldsBundle\Tests\CustomFields;
|
||||||
|
|
||||||
use Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice;
|
use Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice;
|
||||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\CustomFieldsBundle\Tests;
|
namespace Chill\CustomFieldsBundle\Tests\CustomFields;
|
||||||
|
|
||||||
use Chill\CustomFieldsBundle\CustomFields\CustomFieldNumber;
|
use Chill\CustomFieldsBundle\CustomFields\CustomFieldNumber;
|
||||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||||
|
@ -9,10 +9,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\CustomFieldsBundle\Tests;
|
namespace Chill\CustomFieldsBundle\Tests\CustomFields;
|
||||||
|
|
||||||
use Chill\CustomFieldsBundle\CustomFields\CustomFieldText;
|
use Chill\CustomFieldsBundle\CustomFields\CustomFieldText;
|
||||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||||
|
use Chill\CustomFieldsBundle\Tests\CustomFieldTestHelper;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\CustomFieldsBundle\Tests;
|
namespace Chill\CustomFieldsBundle\Tests\Routing;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
@ -19,6 +19,7 @@ use Chill\MainBundle\Pagination\PaginatorFactory;
|
|||||||
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
||||||
use Chill\MainBundle\Security\Authorization\EntityWorkflowVoter;
|
use Chill\MainBundle\Security\Authorization\EntityWorkflowVoter;
|
||||||
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
||||||
|
use Chill\MainBundle\Workflow\Validator\StepDestValid;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -201,9 +202,18 @@ class WorkflowController extends AbstractController
|
|||||||
$entityWorkflow->getCurrentStep()->addDestUser($user);
|
$entityWorkflow->getCurrentStep()->addDestUser($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->entityManager->flush();
|
$errors = $this->validator->validate(
|
||||||
|
$entityWorkflow->getCurrentStep(),
|
||||||
|
new StepDestValid()
|
||||||
|
);
|
||||||
|
|
||||||
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflow->getId()]);
|
if (count($errors) === 0) {
|
||||||
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflow->getId()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response((string) $errors, Response::HTTP_UNPROCESSABLE_ENTITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($transitionForm->isSubmitted() && !$transitionForm->isValid()) {
|
if ($transitionForm->isSubmitted() && !$transitionForm->isValid()) {
|
||||||
@ -235,6 +245,7 @@ class WorkflowController extends AbstractController
|
|||||||
'handler_template_data' => $handler->getTemplateData($entityWorkflow),
|
'handler_template_data' => $handler->getTemplateData($entityWorkflow),
|
||||||
'transition_form' => isset($transitionForm) ? $transitionForm->createView() : null,
|
'transition_form' => isset($transitionForm) ? $transitionForm->createView() : null,
|
||||||
'entity_workflow' => $entityWorkflow,
|
'entity_workflow' => $entityWorkflow,
|
||||||
|
'transition_form_errors' => $errors ?? [],
|
||||||
//'comment_form' => $commentForm->createView(),
|
//'comment_form' => $commentForm->createView(),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -174,6 +174,20 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCurrentStepChained(): ?EntityWorkflowStep
|
||||||
|
{
|
||||||
|
$steps = $this->getStepsChained();
|
||||||
|
$currentStep = $this->getCurrentStep();
|
||||||
|
|
||||||
|
foreach ($steps as $step) {
|
||||||
|
if ($step === $currentStep) {
|
||||||
|
return $step;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function getCurrentStepCreatedAt(): ?DateTimeInterface
|
public function getCurrentStepCreatedAt(): ?DateTimeInterface
|
||||||
{
|
{
|
||||||
if (null !== $previous = $this->getPreviousStepIfAny()) {
|
if (null !== $previous = $this->getPreviousStepIfAny()) {
|
||||||
|
@ -48,6 +48,8 @@ class WorkflowStepType extends AbstractType
|
|||||||
$entityWorkflow = $options['entity_workflow'];
|
$entityWorkflow = $options['entity_workflow'];
|
||||||
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
||||||
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||||
|
$place = $workflow->getMarking($entityWorkflow);
|
||||||
|
$placeMetadata = $workflow->getMetadataStore()->getPlaceMetadata(array_keys($place->getPlaces())[0]);
|
||||||
|
|
||||||
if (true === $options['transition']) {
|
if (true === $options['transition']) {
|
||||||
if (null === $options['entity_workflow']) {
|
if (null === $options['entity_workflow']) {
|
||||||
@ -68,40 +70,77 @@ class WorkflowStepType extends AbstractType
|
|||||||
$transitions
|
$transitions
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (array_key_exists('validationFilterInputLabels', $placeMetadata)) {
|
||||||
|
$inputLabels = $placeMetadata['validationFilterInputLabels'];
|
||||||
|
|
||||||
|
$builder->add('transitionFilter', ChoiceType::class, [
|
||||||
|
'multiple' => false,
|
||||||
|
'label' => 'workflow.My decision',
|
||||||
|
'choices' => [
|
||||||
|
'forward' => 'forward',
|
||||||
|
'backward' => 'backward',
|
||||||
|
'neutral' => 'neutral',
|
||||||
|
],
|
||||||
|
'choice_label' => function (string $key) use ($inputLabels) {
|
||||||
|
return $this->translatableStringHelper->localize($inputLabels[$key]);
|
||||||
|
},
|
||||||
|
'choice_attr' => static function (string $key) {
|
||||||
|
return [
|
||||||
|
$key => $key,
|
||||||
|
];
|
||||||
|
},
|
||||||
|
'mapped' => false,
|
||||||
|
'expanded' => true,
|
||||||
|
'data' => 'forward',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$builder
|
$builder
|
||||||
->add('transition', ChoiceType::class, [
|
->add('transition', ChoiceType::class, [
|
||||||
'label' => 'workflow.Transition to apply',
|
'label' => 'workflow.Next step',
|
||||||
'mapped' => false,
|
'mapped' => false,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => $choices,
|
'choices' => $choices,
|
||||||
'choice_label' => function (Transition $transition) use ($workflow) {
|
'choice_label' => function (Transition $transition) use ($workflow) {
|
||||||
$meta = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
$meta = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
||||||
|
|
||||||
if (array_key_exists('label', $meta)) {
|
if (array_key_exists('label', $meta)) {
|
||||||
return $this->translatableStringHelper->localize($meta['label']);
|
return $this->translatableStringHelper->localize($meta['label']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $transition->getName();
|
return $transition->getName();
|
||||||
},
|
},
|
||||||
'choice_attr' => static function (Transition $transition) use ($workflow) {
|
'choice_attr' => static function (Transition $transition) use ($workflow) {
|
||||||
$toFinal = true;
|
$toFinal = true;
|
||||||
|
$isForward = 'neutral';
|
||||||
|
|
||||||
foreach ($transition->getTos() as $to) {
|
$metadata = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
||||||
$meta = $workflow->getMetadataStore()->getPlaceMetadata($to);
|
|
||||||
|
|
||||||
if (
|
if (array_key_exists('isForward', $metadata)) {
|
||||||
|
if ($metadata['isForward']) {
|
||||||
|
$isForward = 'forward';
|
||||||
|
} else {
|
||||||
|
$isForward = 'backward';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($transition->getTos() as $to) {
|
||||||
|
$meta = $workflow->getMetadataStore()->getPlaceMetadata($to);
|
||||||
|
|
||||||
|
if (
|
||||||
!array_key_exists('isFinal', $meta) || false === $meta['isFinal']
|
!array_key_exists('isFinal', $meta) || false === $meta['isFinal']
|
||||||
) {
|
) {
|
||||||
$toFinal = false;
|
$toFinal = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'data-is-transition' => 'data-is-transition',
|
'data-is-transition' => 'data-is-transition',
|
||||||
'data-to-final' => $toFinal ? '1' : '0',
|
'data-to-final' => $toFinal ? '1' : '0',
|
||||||
];
|
'data-is-forward' => $isForward,
|
||||||
},
|
];
|
||||||
|
},
|
||||||
])
|
])
|
||||||
->add('future_dest_users', PickUserDynamicType::class, [
|
->add('future_dest_users', PickUserDynamicType::class, [
|
||||||
'label' => 'workflow.dest for next steps',
|
'label' => 'workflow.dest for next steps',
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
/**
|
/**
|
||||||
* Create a control to show or hide values
|
* Create a control to show or hide values
|
||||||
*
|
*
|
||||||
* Possible options are:
|
* Possible options are:
|
||||||
*
|
*
|
||||||
* - froms: an Element, an Array of Element, or a NodeList. A
|
* - froms: an Element, an Array of Element, or a NodeList. A
|
||||||
* listener will be attached to **all** input of those elements
|
* listener will be attached to **all** input of those elements
|
||||||
* and will trigger the check on changes
|
* and will trigger the check on changes
|
||||||
* - test: a function which will test the element and will return true
|
* - test: a function which will test the element and will return true
|
||||||
* if the content must be shown, false if it must be hidden.
|
* if the content must be shown, false if it must be hidden.
|
||||||
* The function will receive the `froms` as first argument, and the
|
* The function will receive the `froms` as first argument, and the
|
||||||
* event as second argument.
|
* event as second argument.
|
||||||
* - container: an Element, an Array of Element, or a Node List. The
|
* - container: an Element, an Array of Element, or a Node List. The
|
||||||
* child nodes will be hidden / shown inside this container
|
* child nodes will be hidden / shown inside this container
|
||||||
* - event_name: the name of the event to listen to. `'change'` by default.
|
* - event_name: the name of the event to listen to. `'change'` by default.
|
||||||
*
|
*
|
||||||
* @param object options
|
* @param object options
|
||||||
*/
|
*/
|
||||||
var ShowHide = function(options) {
|
var ShowHide = function(options) {
|
||||||
@ -26,8 +26,10 @@ var ShowHide = function(options) {
|
|||||||
container_content = [],
|
container_content = [],
|
||||||
debug = 'debug' in options ? options.debug : false,
|
debug = 'debug' in options ? options.debug : false,
|
||||||
load_event = 'load_event' in options ? options.load_event : 'load',
|
load_event = 'load_event' in options ? options.load_event : 'load',
|
||||||
id = 'uid' in options ? options.id : Math.random();
|
id = 'uid' in options ? options.id : Math.random(),
|
||||||
|
toggle_callback = 'toggle_callback' in options ? options.toggle_callback : null
|
||||||
|
;
|
||||||
|
|
||||||
var bootstrap = function(event) {
|
var bootstrap = function(event) {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('debug is activated on this show-hide', this);
|
console.log('debug is activated on this show-hide', this);
|
||||||
@ -39,15 +41,14 @@ var ShowHide = function(options) {
|
|||||||
contents.push(el);
|
contents.push(el);
|
||||||
}
|
}
|
||||||
container_content.push(contents);
|
container_content.push(contents);
|
||||||
// console.log('container content', container_content);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// attach the listener on each input
|
// attach the listener on each input
|
||||||
for (let f of froms.values()) {
|
for (let f of froms.values()) {
|
||||||
let
|
let
|
||||||
inputs = f.querySelectorAll('input'),
|
inputs = f.querySelectorAll('input'),
|
||||||
selects = f.querySelectorAll('select');
|
selects = f.querySelectorAll('select');
|
||||||
|
|
||||||
for (let input of inputs.values()) {
|
for (let input of inputs.values()) {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('attaching event to input', input);
|
console.log('attaching event to input', input);
|
||||||
@ -67,10 +68,10 @@ var ShowHide = function(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// first launch of the show/hide
|
// first launch of the show/hide
|
||||||
onChange(event);
|
onChange(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var onChange = function (event) {
|
var onChange = function (event) {
|
||||||
var result = test(froms, event), me;
|
var result = test(froms, event), me;
|
||||||
|
|
||||||
@ -89,45 +90,53 @@ var ShowHide = function(options) {
|
|||||||
} else {
|
} else {
|
||||||
throw "the result of test is not a boolean";
|
throw "the result of test is not a boolean";
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var forceHide = function() {
|
var forceHide = function() {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('force hide');
|
console.log('force hide');
|
||||||
}
|
}
|
||||||
for (let contents of container_content.values()) {
|
if (toggle_callback !== null) {
|
||||||
for (let el of contents.values()) {
|
toggle_callback(container, 'hide');
|
||||||
el.remove();
|
} else {
|
||||||
|
for (let contents of container_content.values()) {
|
||||||
|
for (let el of contents.values()) {
|
||||||
|
el.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is_shown = false;
|
is_shown = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
var forceShow = function() {
|
var forceShow = function() {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('show');
|
console.log('show');
|
||||||
}
|
}
|
||||||
for (let i of container_content.keys()) {
|
if (toggle_callback !== null) {
|
||||||
var contents = container_content[i];
|
toggle_callback(container, 'show');
|
||||||
for (let el of contents.values()) {
|
} else {
|
||||||
container[i].appendChild(el);
|
for (let i of container_content.keys()) {
|
||||||
|
var contents = container_content[i];
|
||||||
|
for (let el of contents.values()) {
|
||||||
|
container[i].appendChild(el);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is_shown = true;
|
is_shown = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
var forceCompute = function(event) {
|
var forceCompute = function(event) {
|
||||||
onChange(event);
|
onChange(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (load_event !== null) {
|
if (load_event !== null) {
|
||||||
window.addEventListener('load', bootstrap);
|
window.addEventListener('load', bootstrap);
|
||||||
} else {
|
} else {
|
||||||
bootstrap(null);
|
bootstrap(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
forceHide: forceHide,
|
forceHide: forceHide,
|
||||||
forceShow: forceShow,
|
forceShow: forceShow,
|
||||||
|
@ -2,29 +2,89 @@ import {ShowHide} from 'ChillMainAssets/lib/show_hide/show_hide.js';
|
|||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', function() {
|
window.addEventListener('DOMContentLoaded', function() {
|
||||||
let
|
let
|
||||||
finalizeAfterContainer = document.querySelector('#finalizeAfter'),
|
divTransitions = document.querySelector('#transitions'),
|
||||||
futureDestUsersContainer = document.querySelector('#futureDestUsers')
|
futureDestUsersContainer = document.querySelector('#futureDestUsers')
|
||||||
;
|
;
|
||||||
|
|
||||||
if (null === finalizeAfterContainer) {
|
if (null !== divTransitions) {
|
||||||
return;
|
new ShowHide({
|
||||||
}
|
load_event: null,
|
||||||
|
froms: [divTransitions],
|
||||||
new ShowHide({
|
container: [futureDestUsersContainer],
|
||||||
load_event: null,
|
test: function(divs, arg2, arg3) {
|
||||||
froms: [finalizeAfterContainer],
|
for (let div of divs) {
|
||||||
container: [futureDestUsersContainer],
|
for (let input of div.querySelectorAll('input')) {
|
||||||
test: function(containers, arg2, arg3) {
|
if (input.checked) {
|
||||||
for (let container of containers) {
|
if (input.dataset.toFinal === "1") {
|
||||||
for (let input of container.querySelectorAll('input')) {
|
return false;
|
||||||
if (!input.checked) {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
},
|
return true;
|
||||||
})
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let
|
||||||
|
transitionFilterContainer = document.querySelector('#transitionFilter'),
|
||||||
|
transitions = document.querySelector('#transitions')
|
||||||
|
;
|
||||||
|
|
||||||
|
if (null !== transitionFilterContainer) {
|
||||||
|
transitions.querySelectorAll('.form-check').forEach(function(row) {
|
||||||
|
|
||||||
|
const isForward = row.querySelector('input').dataset.isForward;
|
||||||
|
|
||||||
|
new ShowHide({
|
||||||
|
load_event: null,
|
||||||
|
froms: [transitionFilterContainer],
|
||||||
|
container: row,
|
||||||
|
test: function (containers) {
|
||||||
|
for (let container of containers) {
|
||||||
|
for (let input of container.querySelectorAll('input')) {
|
||||||
|
if (input.checked) {
|
||||||
|
return isForward === input.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toggle_callback: function (c, dir) {
|
||||||
|
for (let div of c) {
|
||||||
|
let input = div.querySelector('input');
|
||||||
|
if ('hide' === dir) {
|
||||||
|
input.checked = false;
|
||||||
|
input.disabled = true;
|
||||||
|
} else {
|
||||||
|
input.disabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate form
|
||||||
|
let form = document.querySelector('form[name="workflow_step"]');
|
||||||
|
|
||||||
|
if (form === null) {
|
||||||
|
console.error('form to validate not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
const datas = new FormData(event.target);
|
||||||
|
|
||||||
|
if (datas.has('workflow_step[future_dest_users]')) {
|
||||||
|
const dests = JSON.parse(datas.get('workflow_step[future_dest_users]'));
|
||||||
|
if (dests === null || (dests instanceof Array && dests.length === 0)) {
|
||||||
|
event.preventDefault();
|
||||||
|
console.log('no users!');
|
||||||
|
window.alert('Indiquez un utilisateur pour traiter la prochaine étape.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<button v-if="hasWorkflow"
|
<button v-if="hasWorkflow"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
@click="openModal">
|
@click="openModal">
|
||||||
@ -7,36 +7,39 @@
|
|||||||
<template v-if="countWorkflows > 1">{{ $t('workflows') }}</template>
|
<template v-if="countWorkflows > 1">{{ $t('workflows') }}</template>
|
||||||
<template v-else>{{ $t('workflow') }}</template>
|
<template v-else>{{ $t('workflow') }}</template>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<pick-workflow v-else-if="allowCreate"
|
<pick-workflow v-else-if="allowCreate"
|
||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="this.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="this.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="workflowsAvailables"
|
||||||
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></pick-workflow>
|
></pick-workflow>
|
||||||
|
|
||||||
<teleport to="body">
|
<teleport to="body">
|
||||||
<modal v-if="modal.showModal"
|
<modal v-if="modal.showModal"
|
||||||
:modalDialogClass="modal.modalDialogClass"
|
:modalDialogClass="modal.modalDialogClass"
|
||||||
@close="modal.showModal = false">
|
@close="modal.showModal = false">
|
||||||
|
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<h2 class="modal-title">{{ $t('workflow_list') }}</h2>
|
<h2 class="modal-title">{{ $t('workflow_list') }}</h2>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<list-workflow-vue
|
<list-workflow-vue
|
||||||
:workflows="workflows"
|
:workflows="workflows"
|
||||||
></list-workflow-vue>
|
></list-workflow-vue>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<pick-workflow v-if="allowCreate"
|
<pick-workflow v-if="allowCreate"
|
||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="this.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="this.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="workflowsAvailables"
|
||||||
|
:preventDefaultMoveToGenerate="this.$props.preventDefaultMoveToGenerate"
|
||||||
|
@go-to-generate-workflow="this.goToGenerateWorkflow"
|
||||||
></pick-workflow>
|
></pick-workflow>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</modal>
|
</modal>
|
||||||
</teleport>
|
</teleport>
|
||||||
</template>
|
</template>
|
||||||
@ -53,6 +56,7 @@ export default {
|
|||||||
PickWorkflow,
|
PickWorkflow,
|
||||||
ListWorkflowVue
|
ListWorkflowVue
|
||||||
},
|
},
|
||||||
|
emits: ['goToGenerateWorkflow'],
|
||||||
props: {
|
props: {
|
||||||
workflows: {
|
workflows: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@ -73,9 +77,14 @@ export default {
|
|||||||
workflowsAvailables: {
|
workflowsAvailables: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
}
|
},
|
||||||
|
preventDefaultMoveToGenerate: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
modal: {
|
modal: {
|
||||||
showModal: false,
|
showModal: false,
|
||||||
@ -95,6 +104,10 @@ export default {
|
|||||||
openModal() {
|
openModal() {
|
||||||
this.modal.showModal = true;
|
this.modal.showModal = true;
|
||||||
},
|
},
|
||||||
|
goToGenerateWorkflow(data) {
|
||||||
|
console.log('go to generate workflow intercepted');
|
||||||
|
this.$emit('goToGenerateWorkflow', data);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
messages: {
|
messages: {
|
||||||
@ -108,4 +121,4 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" aria-labelledby="createWorkflowButton">
|
<ul class="dropdown-menu" aria-labelledby="createWorkflowButton">
|
||||||
<li v-for="w in workflowsAvailables" :key="w.name">
|
<li v-for="w in workflowsAvailables" :key="w.name">
|
||||||
<a class="dropdown-item" :href="makeLink(w.name)" @click="goToGenerateWorkflow($event, w.name)">{{ w.text }}</a>
|
<a class="dropdown-item" :href="makeLink(w.name)" @click.prevent="goToGenerateWorkflow($event, w.name)">{{ w.text }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -31,7 +31,12 @@ export default {
|
|||||||
workflowsAvailables: {
|
workflowsAvailables: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
}
|
},
|
||||||
|
preventDefaultMoveToGenerate: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['goToGenerateWorkflow'],
|
emits: ['goToGenerateWorkflow'],
|
||||||
methods: {
|
methods: {
|
||||||
@ -39,6 +44,12 @@ export default {
|
|||||||
return buildLinkCreate(workflowName, this.relatedEntityClass, this.relatedEntityId);
|
return buildLinkCreate(workflowName, this.relatedEntityClass, this.relatedEntityId);
|
||||||
},
|
},
|
||||||
goToGenerateWorkflow(event, workflowName) {
|
goToGenerateWorkflow(event, workflowName) {
|
||||||
|
console.log('goToGenerateWorkflow', event, workflowName);
|
||||||
|
|
||||||
|
if (!this.$props.preventDefaultMoveToGenerate) {
|
||||||
|
event.target.click();
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName)});
|
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,58 @@
|
|||||||
{% if transition_form is not null %}
|
{% if transition_form is not null %}
|
||||||
{{ form_start(transition_form) }}
|
{{ form_start(transition_form) }}
|
||||||
|
|
||||||
{{ form_row(transition_form.transition) }}
|
{% set step = entity_workflow.currentStepChained %}
|
||||||
|
{% set labels = workflow_metadata(entity_workflow, 'label', step.currentStep) %}
|
||||||
|
{% set label = labels is null ? step.currentStep : labels|localize_translatable_string %}
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
{{ 'workflow.Current step'|trans }} :
|
||||||
|
<span class="badge bg-primary">{{ label }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if step.previous is not null %}
|
||||||
|
{% if step.previous.comment is not empty %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<blockquote class="chill-user-quote">
|
||||||
|
{{ step.previous.comment|chill_markdown_to_html }}
|
||||||
|
</blockquote>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
{{ 'By'|trans }}
|
||||||
|
{{ step.previous.transitionBy|chill_entity_render_box }},
|
||||||
|
{{ step.previous.transitionAt|format_datetime('short', 'short') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-4">{{ 'workflow.Created by'|trans }}</div>
|
||||||
|
<div class="col-sm-8">{{ step.entityWorkflow.createdBy|chill_entity_render_box }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-4">{{ 'Le'|trans }}</div>
|
||||||
|
<div class="col-sm-8">{{ step.entityWorkflow.createdAt|format_datetime('short', 'short') }}</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="transitionFilter">
|
||||||
|
{% if transition_form.transitionFilter is defined %}
|
||||||
|
{{ form_row(transition_form.transitionFilter) }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="transitions">
|
||||||
|
{{ form_row(transition_form.transition) }}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if transition_form.freezeAfter is defined %}
|
{% if transition_form.freezeAfter is defined %}
|
||||||
{{ form_row(transition_form.freezeAfter) }}
|
{{ form_row(transition_form.freezeAfter) }}
|
||||||
|
@ -69,6 +69,18 @@
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if loop.last and step.destUser|length > 0 %}
|
||||||
|
<div class="item-row separator">
|
||||||
|
<div>
|
||||||
|
<p><b>{{ 'workflow.Users allowed to apply transition'|trans }} : </b></p>
|
||||||
|
<ul>
|
||||||
|
{% for u in step.destUser %}
|
||||||
|
<li>{{ u|chill_entity_render_box }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -44,7 +44,6 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte
|
|||||||
*/
|
*/
|
||||||
public function normalize($object, ?string $format = null, array $context = [])
|
public function normalize($object, ?string $format = null, array $context = [])
|
||||||
{
|
{
|
||||||
dump($object);
|
|
||||||
$entity = $this->entityManager
|
$entity = $this->entityManager
|
||||||
->getRepository($object->getRelatedEntityClass())
|
->getRepository($object->getRelatedEntityClass())
|
||||||
->find($object->getRelatedEntityId());
|
->find($object->getRelatedEntityId());
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\MainBundle\Tests\Security\Authorization;
|
namespace Chill\MainBundle\Tests\Authorization;
|
||||||
|
|
||||||
use Chill\MainBundle\Security\ParentRoleHelper;
|
use Chill\MainBundle\Security\ParentRoleHelper;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
|
@ -9,10 +9,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\MainBundle\Form\Type;
|
namespace Chill\MainBundle\Tests\Form\Type;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\GroupCenter;
|
use Chill\MainBundle\Entity\GroupCenter;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
|
use Chill\MainBundle\Form\CenterType;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
use Symfony\Component\Form\Test\TypeTestCase;
|
use Symfony\Component\Form\Test\TypeTestCase;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\MainBundle\Test\Search;
|
namespace Chill\MainBundle\Tests\Search;
|
||||||
|
|
||||||
use Chill\MainBundle\Search\ParsingException;
|
use Chill\MainBundle\Search\ParsingException;
|
||||||
use Chill\MainBundle\Search\SearchInterface;
|
use Chill\MainBundle\Search\SearchInterface;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\MainBundle\Tests\PasswordRecover;
|
namespace Chill\MainBundle\Tests\Security\PasswordRecover;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Security\PasswordRecover\TokenManager;
|
use Chill\MainBundle\Security\PasswordRecover\TokenManager;
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Chill\MainBundle\Workflow\Validator;
|
||||||
|
|
||||||
|
use Symfony\Component\Validator\Constraint;
|
||||||
|
|
||||||
|
class StepDestValid extends Constraint
|
||||||
|
{
|
||||||
|
public string $messageDestNotAllowed = 'workflow.As the step is final, no dest are allowed';
|
||||||
|
|
||||||
|
public string $messageRequireDest = 'workflow.As the step is not final, dest are required';
|
||||||
|
|
||||||
|
public function getTargets()
|
||||||
|
{
|
||||||
|
return [self::CLASS_CONSTRAINT];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Chill\MainBundle\Workflow\Validator;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep;
|
||||||
|
use Symfony\Component\Validator\Constraint;
|
||||||
|
use Symfony\Component\Validator\ConstraintValidator;
|
||||||
|
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||||
|
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||||
|
use function count;
|
||||||
|
|
||||||
|
class StepDestValidValidator extends ConstraintValidator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param EntityWorkflowStep $value
|
||||||
|
* @param Constraint|StepDestValid $constraint
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function validate($value, Constraint $constraint)
|
||||||
|
{
|
||||||
|
if (!$constraint instanceof StepDestValid) {
|
||||||
|
throw new UnexpectedTypeException($constraint, StepDestValid::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$value instanceof EntityWorkflowStep) {
|
||||||
|
throw new UnexpectedValueException($value, EntityWorkflowStep::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($value->isFinal() && 0 < count($value->getDestUser())) {
|
||||||
|
$this->context->buildViolation($constraint->messageDestNotAllowed)
|
||||||
|
->addViolation();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$value->isFinal() && 0 === count($value->getDestUser())) {
|
||||||
|
$this->context->buildViolation($constraint->messageRequireDest)
|
||||||
|
->addViolation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -370,7 +370,8 @@ Workflow history: Historique de la décision
|
|||||||
|
|
||||||
workflow:
|
workflow:
|
||||||
Created by: Créé par
|
Created by: Créé par
|
||||||
Transition to apply: Ma décision
|
My decision: Ma décision
|
||||||
|
Next step: Prochaine étape
|
||||||
dest for next steps: Utilisateurs qui valideront la prochaine étape
|
dest for next steps: Utilisateurs qui valideront la prochaine étape
|
||||||
Freeze: Geler
|
Freeze: Geler
|
||||||
Freezed: Gelé
|
Freezed: Gelé
|
||||||
@ -392,6 +393,9 @@ workflow:
|
|||||||
dest: Workflows en attente d'action
|
dest: Workflows en attente d'action
|
||||||
you subscribed to all steps: Vous recevrez une notification à chaque étape
|
you subscribed to all steps: Vous recevrez une notification à chaque étape
|
||||||
you subscribed to final step: Vous recevrez une notification à l'étape finale
|
you subscribed to final step: Vous recevrez une notification à l'étape finale
|
||||||
|
Current step: Étape actuelle
|
||||||
|
Comment on last change: Commentaire à la transition précédente
|
||||||
|
Users allowed to apply transition: Utilisateurs pouvant valider cette étape
|
||||||
|
|
||||||
Subscribe final: Recevoir une notification à l'étape finale
|
Subscribe final: Recevoir une notification à l'étape finale
|
||||||
Subscribe all steps: Recevoir une notification à chaque étape
|
Subscribe all steps: Recevoir une notification à chaque étape
|
||||||
|
@ -99,7 +99,7 @@ class AccompanyingPeriodWorkEvaluationApiController
|
|||||||
|
|
||||||
if ($request->query->getBoolean('countOnly', false)) {
|
if ($request->query->getBoolean('countOnly', false)) {
|
||||||
return new JsonResponse(
|
return new JsonResponse(
|
||||||
$this->serializer->serialize(new Counter($total), 'json', ['groups' => 'read']),
|
$this->serializer->serialize(new Counter($total), 'json', ['groups' => ['read']]),
|
||||||
JsonResponse::HTTP_OK,
|
JsonResponse::HTTP_OK,
|
||||||
[],
|
[],
|
||||||
true
|
true
|
||||||
@ -117,7 +117,7 @@ class AccompanyingPeriodWorkEvaluationApiController
|
|||||||
$collection = new Collection($works, $paginator);
|
$collection = new Collection($works, $paginator);
|
||||||
|
|
||||||
return new JsonResponse(
|
return new JsonResponse(
|
||||||
$this->serializer->serialize($collection, 'json', ['groups' => 'read']),
|
$this->serializer->serialize($collection, 'json', ['groups' => ['read', 'read:evaluation:include-work']]),
|
||||||
JsonResponse::HTTP_OK,
|
JsonResponse::HTTP_OK,
|
||||||
[],
|
[],
|
||||||
true
|
true
|
||||||
|
@ -213,7 +213,7 @@ class AccompanyingPeriod implements
|
|||||||
*
|
*
|
||||||
* @ORM\Column(type="date")
|
* @ORM\Column(type="date")
|
||||||
* @Groups({"read", "write", "docgen:read"})
|
* @Groups({"read", "write", "docgen:read"})
|
||||||
* @Assert\LessThan(value= "today", groups={AccompanyingPeriod::STEP_CONFIRMED})
|
* @Assert\LessThan(value="today", groups={AccompanyingPeriod::STEP_CONFIRMED})
|
||||||
* @Assert\LessThan(propertyPath="closingDate", groups={AccompanyingPeriod::STEP_CONFIRMED})
|
* @Assert\LessThan(propertyPath="closingDate", groups={AccompanyingPeriod::STEP_CONFIRMED})
|
||||||
*/
|
*/
|
||||||
private ?DateTime $openingDate = null;
|
private ?DateTime $openingDate = null;
|
||||||
|
@ -44,7 +44,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class)
|
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class)
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read","read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||||
|
|
||||||
@ -63,26 +63,26 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="datetime_immutable")
|
* @ORM\Column(type="datetime_immutable")
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private ?DateTimeImmutable $createdAt = null;
|
private ?DateTimeImmutable $createdAt = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="boolean")
|
* @ORM\Column(type="boolean")
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private bool $createdAutomatically = false;
|
private bool $createdAutomatically = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="text")
|
* @ORM\Column(type="text")
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private string $createdAutomaticallyReason = '';
|
private string $createdAutomaticallyReason = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=User::class)
|
* @ORM\ManyToOne(targetEntity=User::class)
|
||||||
* @ORM\JoinColumn(nullable=false)
|
* @ORM\JoinColumn(nullable=false)
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private ?User $createdBy = null;
|
private ?User $createdBy = null;
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"accompanying_period_work:create"})
|
* @Serializer\Groups({"accompanying_period_work:create"})
|
||||||
* @Serializer\Groups({"accompanying_period_work:edit"})
|
* @Serializer\Groups({"accompanying_period_work:edit"})
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
* @Assert\GreaterThan(propertyPath="startDate",
|
* @Assert\GreaterThan(propertyPath="startDate",
|
||||||
* message="accompanying_course_work.The endDate should be greater than the start date"
|
* message="accompanying_course_work.The endDate should be greater than the start date"
|
||||||
* )
|
* )
|
||||||
@ -122,7 +122,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue
|
* @ORM\GeneratedValue
|
||||||
* @ORM\Column(type="integer")
|
* @ORM\Column(type="integer")
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light", "read:evaluation:include-work"})
|
||||||
*/
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
/**
|
/**
|
||||||
* @ORM\ManyToMany(targetEntity=Person::class)
|
* @ORM\ManyToMany(targetEntity=Person::class)
|
||||||
* @ORM\JoinTable(name="chill_person_accompanying_period_work_person")
|
* @ORM\JoinTable(name="chill_person_accompanying_period_work_person")
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
* @Serializer\Groups({"accompanying_period_work:edit"})
|
* @Serializer\Groups({"accompanying_period_work:edit"})
|
||||||
* @Serializer\Groups({"accompanying_period_work:create"})
|
* @Serializer\Groups({"accompanying_period_work:create"})
|
||||||
*/
|
*/
|
||||||
@ -151,8 +151,9 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=SocialAction::class)
|
* @ORM\ManyToOne(targetEntity=SocialAction::class)
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
* @Serializer\Groups({"accompanying_period_work:create"})
|
* @Serializer\Groups({"accompanying_period_work:create"})
|
||||||
|
* @Serializer\Context(normalizationContext={"groups"={"read"}}, groups={"read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private ?SocialAction $socialAction = null;
|
private ?SocialAction $socialAction = null;
|
||||||
|
|
||||||
@ -160,7 +161,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
* @ORM\Column(type="date_immutable")
|
* @ORM\Column(type="date_immutable")
|
||||||
* @Serializer\Groups({"accompanying_period_work:create"})
|
* @Serializer\Groups({"accompanying_period_work:create"})
|
||||||
* @Serializer\Groups({"accompanying_period_work:edit"})
|
* @Serializer\Groups({"accompanying_period_work:edit"})
|
||||||
* @Serializer\Groups({"read", "docgen:read"})
|
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private ?DateTimeImmutable $startDate = null;
|
private ?DateTimeImmutable $startDate = null;
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
* targetEntity=AccompanyingPeriodWork::class,
|
* targetEntity=AccompanyingPeriodWork::class,
|
||||||
* inversedBy="accompanyingPeriodWorkEvaluations"
|
* inversedBy="accompanyingPeriodWorkEvaluations"
|
||||||
* )
|
* )
|
||||||
|
* @Serializer\Groups({"read:evaluation:include-work"})
|
||||||
|
* @Serializer\Context(normalizationContext={"groups"={"read:accompanyingPeriodWork:light"}}, groups={"read:evaluation:include-work"})
|
||||||
*/
|
*/
|
||||||
private ?AccompanyingPeriodWork $accompanyingPeriodWork = null;
|
private ?AccompanyingPeriodWork $accompanyingPeriodWork = null;
|
||||||
|
|
||||||
|
@ -28,6 +28,11 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
|||||||
$this->repository = $entityManager->getRepository(AccompanyingPeriod::class);
|
$this->repository = $entityManager->getRepository(AccompanyingPeriod::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function countBy(array $criteria): int
|
||||||
|
{
|
||||||
|
return $this->repository->count($criteria);
|
||||||
|
}
|
||||||
|
|
||||||
public function countByRecentUserHistory(User $user, DateTimeImmutable $since): int
|
public function countByRecentUserHistory(User $user, DateTimeImmutable $since): int
|
||||||
{
|
{
|
||||||
$qb = $this->buildQueryByRecentUserHistory($user, $since);
|
$qb = $this->buildQueryByRecentUserHistory($user, $since);
|
||||||
@ -35,11 +40,6 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
|||||||
return $qb->select('count(a)')->getQuery()->getSingleScalarResult();
|
return $qb->select('count(a)')->getQuery()->getSingleScalarResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countBy(array $criteria): int
|
|
||||||
{
|
|
||||||
return $this->repository->count($criteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
|
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
|
||||||
{
|
{
|
||||||
return $this->repository->createQueryBuilder($alias, $indexBy);
|
return $this->repository->createQueryBuilder($alias, $indexBy);
|
||||||
|
@ -152,8 +152,8 @@ const appMessages = {
|
|||||||
not_valid: "Sélectionnez un métier du référent"
|
not_valid: "Sélectionnez un métier du référent"
|
||||||
},
|
},
|
||||||
startdate: {
|
startdate: {
|
||||||
change: "Modifier la date de début",
|
change: "Date d'ouverture",
|
||||||
date: "Date de début",
|
date: "Date d'ouverture",
|
||||||
},
|
},
|
||||||
// catch errors
|
// catch errors
|
||||||
'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.",
|
'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.",
|
||||||
|
@ -251,6 +251,7 @@
|
|||||||
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
|
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
|
||||||
:relatedEntityId="this.work.id"
|
:relatedEntityId="this.work.id"
|
||||||
:workflowsAvailables="this.work.workflows_availables"
|
:workflowsAvailables="this.work.workflows_availables"
|
||||||
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></list-workflow-modal>
|
></list-workflow-modal>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -284,6 +285,7 @@ import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
|||||||
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
|
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
|
||||||
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
||||||
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||||
|
import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
|
||||||
|
|
||||||
const i18n = {
|
const i18n = {
|
||||||
messages: {
|
messages: {
|
||||||
@ -334,7 +336,6 @@ export default {
|
|||||||
ListWorkflowModal,
|
ListWorkflowModal,
|
||||||
OnTheFly,
|
OnTheFly,
|
||||||
PickWorkflow,
|
PickWorkflow,
|
||||||
OnTheFly,
|
|
||||||
PersonText,
|
PersonText,
|
||||||
},
|
},
|
||||||
i18n,
|
i18n,
|
||||||
@ -461,6 +462,15 @@ export default {
|
|||||||
removeThirdParty(t) {
|
removeThirdParty(t) {
|
||||||
this.$store.commit('removeThirdParty', t);
|
this.$store.commit('removeThirdParty', t);
|
||||||
},
|
},
|
||||||
|
goToGenerateWorkflow({link}) {
|
||||||
|
console.log('save before leave to generate workflow')
|
||||||
|
const callback = (data) => {
|
||||||
|
window.location.assign(link);
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.$store.dispatch('submit', callback)
|
||||||
|
.catch(e => { console.log(e); throw e; });
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$store.dispatch('submit');
|
this.$store.dispatch('submit');
|
||||||
},
|
},
|
||||||
|
@ -10,16 +10,16 @@
|
|||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li v-if="evaluation.workflows_availables.length > 0">
|
<li v-if="evaluation.workflows_availables.length > 0">
|
||||||
|
|
||||||
<list-workflow-modal
|
<list-workflow-modal
|
||||||
:workflows="evaluation.workflows"
|
:workflows="evaluation.workflows"
|
||||||
:allowCreate="true"
|
:allowCreate="true"
|
||||||
relatedEntityClass="faked"
|
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
|
||||||
:relatedEntityId="evaluation.id"
|
:relatedEntityId="evaluation.id"
|
||||||
:workflowsAvailables="evaluation.workflows_availables"
|
:workflowsAvailables="evaluation.workflows_availables"
|
||||||
@goToGenerateWorkflow="goToGenerateWorkflow"
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></list-workflow-modal>
|
></list-workflow-modal>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-delete" @click="modal.showModal = true" :title="$t('action.delete')"></a>
|
<a class="btn btn-delete" @click="modal.showModal = true" :title="$t('action.delete')"></a>
|
||||||
@ -106,8 +106,7 @@ export default {
|
|||||||
this.toggleEditEvaluation();
|
this.toggleEditEvaluation();
|
||||||
},
|
},
|
||||||
goToGenerateWorkflow({event, link, workflowName}) {
|
goToGenerateWorkflow({event, link, workflowName}) {
|
||||||
event.preventDefault();
|
console.log('goToGenerate in evaluation', event, link, workflowName);
|
||||||
console.log(event, link, workflowName);
|
|
||||||
|
|
||||||
const callback = (data) => {
|
const callback = (data) => {
|
||||||
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
||||||
|
@ -210,6 +210,7 @@ const store = createStore({
|
|||||||
editEvaluation: true,
|
editEvaluation: true,
|
||||||
workflows_availables: state.work.workflows_availables_evaluation,
|
workflows_availables: state.work.workflows_availables_evaluation,
|
||||||
documents: [],
|
documents: [],
|
||||||
|
workflows: [],
|
||||||
};
|
};
|
||||||
state.evaluationsPicked.push(e);
|
state.evaluationsPicked.push(e);
|
||||||
},
|
},
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
<div class="wl-col title">
|
<div class="wl-col title">
|
||||||
<h3 class="courseid mb-2">
|
<h3 class="courseid mb-2">
|
||||||
<i class="fa fa-random fa-fw"></i>
|
<i class="fa fa-random fa-fw"></i>
|
||||||
{{ 'File number'|trans }} {{ acp.id }}
|
{{ 'Course number'|trans }} {{ acp.id }}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="wl-col list">
|
<div class="wl-col list">
|
||||||
|
@ -44,6 +44,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz
|
|||||||
*/
|
*/
|
||||||
public function normalize($object, ?string $format = null, array $context = []): array
|
public function normalize($object, ?string $format = null, array $context = []): array
|
||||||
{
|
{
|
||||||
|
dump($context);
|
||||||
$initial = $this->normalizer->normalize($object, $format, array_merge(
|
$initial = $this->normalizer->normalize($object, $format, array_merge(
|
||||||
$context,
|
$context,
|
||||||
[self::IGNORE_EVALUATION => spl_object_hash($object)]
|
[self::IGNORE_EVALUATION => spl_object_hash($object)]
|
||||||
|
@ -109,7 +109,6 @@ final class AccompanyingPeriodConfidentialTest extends WebTestCase
|
|||||||
$user = new stdClass();
|
$user = new stdClass();
|
||||||
$user->id = 0;
|
$user->id = 0;
|
||||||
$user->type = 'user';
|
$user->type = 'user';
|
||||||
dump($user);
|
|
||||||
|
|
||||||
$this->client->request(
|
$this->client->request(
|
||||||
Request::METHOD_PATCH,
|
Request::METHOD_PATCH,
|
||||||
|
@ -81,7 +81,7 @@ Married: Marié(e)
|
|||||||
'Family information': Famille
|
'Family information': Famille
|
||||||
'Contact information': 'Informations de contact'
|
'Contact information': 'Informations de contact'
|
||||||
'Administrative information': Administratif
|
'Administrative information': Administratif
|
||||||
File number: Dossier n°
|
Course number: Parcours n°
|
||||||
Civility: Civilité
|
Civility: Civilité
|
||||||
choose civility: --
|
choose civility: --
|
||||||
All genders: tous les genres
|
All genders: tous les genres
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ReportBundle\Tests\Controller;
|
namespace Chill\ReportBundle\Tests\DependencyInjection;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ThirdPartyBundle\Test\Serializer\Normalizer;
|
namespace Chill\ThirdPartyBundle\Tests\Serializer\Normalizer;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\Civility;
|
use Chill\MainBundle\Entity\Civility;
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ThirdPartyBundle\Test\Serializer\Normalizer;
|
namespace Chill\ThirdPartyBundle\Tests\Serializer\Normalizer;
|
||||||
|
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user