mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Show pending signatures in the person's search results
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Workflow\Templating;
|
||||
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
||||
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
||||
use Twig\Environment;
|
||||
|
||||
final readonly class WorkflowEntityRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public function __construct(private EntityWorkflowManager $entityWorkflowManager, private Environment $twig) {}
|
||||
|
||||
public function renderBox($entity, array $options): string
|
||||
{
|
||||
/** @var EntityWorkflow $entity */
|
||||
$handler = $this->entityWorkflowManager->getHandler($entity);
|
||||
|
||||
return $this->twig->render(
|
||||
$handler->getTemplate($entity),
|
||||
$handler->getTemplateData($entity)
|
||||
);
|
||||
}
|
||||
|
||||
public function renderString($entity, array $options): string
|
||||
{
|
||||
/** @var EntityWorkflow $entity */
|
||||
$handler = $this->entityWorkflowManager->getHandler($entity);
|
||||
|
||||
return $handler->getEntityTitle($entity, $options);
|
||||
}
|
||||
|
||||
public function supports(object $entity, array $options): bool
|
||||
{
|
||||
return $entity instanceof EntityWorkflow;
|
||||
}
|
||||
}
|
@@ -67,6 +67,12 @@ workflow:
|
||||
one {Signature demandée}
|
||||
other {Signatures demandées}
|
||||
}
|
||||
pending_signatures: >-
|
||||
{nb_signatures, plural,
|
||||
=0 {Aucune signature demandée}
|
||||
one {Une signature demandée}
|
||||
other {# signatures demandées}
|
||||
}
|
||||
send_external_message:
|
||||
document_available_until: Le lien sera valable jusqu'au {expiration, date, long} à {expiration, time, short}.
|
||||
explanation: '{sender} vous fait parvenir des documents.'
|
||||
|
Reference in New Issue
Block a user