mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user