Merge branch 'signature-app-master' into 'master'

Signature app master

Closes #307

See merge request Chill-Projet/chill-bundles!743
This commit is contained in:
2024-11-12 20:30:00 +00:00
426 changed files with 22236 additions and 2253 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Menu;
use Chill\MainBundle\Repository\Workflow\EntityWorkflowStepSignatureACLAwareRepository;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Repository\ResidentialAddressRepository;
@@ -43,6 +44,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
private readonly Security $security,
protected TranslatorInterface $translator,
private readonly ResidentialAddressRepository $residentialAddressRepo,
private readonly EntityWorkflowStepSignatureACLAwareRepository $entityWorkflowStepSignatureRepository,
) {
$this->showAccompanyingPeriod = $parameterBag->get('chill_person.accompanying_period');
}
@@ -125,6 +127,21 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
? $nbAccompanyingPeriod : null,
]);
}
$nbSignatures = count($this->entityWorkflowStepSignatureRepository->findByPersonAndPendingState($parameters['person']));
if ($nbSignatures > 0) {
$menu->addChild($this->translator->trans('workflow.signature_list.menu'), [
'route' => 'chill_person_signature_list',
'routeParameters' => [
'id' => $parameters['person']->getId(),
],
])
->setExtras([
'order' => 110,
'counter' => $nbSignatures,
]);
}
}
public static function getMenuIds(): array