mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 01:55:01 +00:00
Add public workflow view functionality
Introduced the ability to render public views for workflows, including new templates, handlers, and metadata support. Updated entity interfaces and translations to enhance the public sharing of workflow documents.
This commit is contained in:
@@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflowSend;
|
||||
use Chill\MainBundle\Workflow\Exception\HandlerNotFoundException;
|
||||
use Chill\MainBundle\Workflow\Exception\HandlerWithPublicViewNotFoundException;
|
||||
use Chill\MainBundle\Workflow\Templating\EntityWorkflowViewMetadataDTO;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
|
||||
/**
|
||||
@@ -80,13 +81,13 @@ class EntityWorkflowManager
|
||||
*
|
||||
* @throws HandlerWithPublicViewNotFoundException if no handler with public view is found
|
||||
*/
|
||||
public function renderPublicView(EntityWorkflowSend $entityWorkflowSend): string
|
||||
public function renderPublicView(EntityWorkflowSend $entityWorkflowSend, EntityWorkflowViewMetadataDTO $metadata): string
|
||||
{
|
||||
$entityWorkflow = $entityWorkflowSend->getEntityWorkflowStep()->getEntityWorkflow();
|
||||
|
||||
foreach ($this->handlers as $handler) {
|
||||
if ($handler instanceof EntityWorkflowWithPublicViewInterface && $handler->supports($entityWorkflow)) {
|
||||
return $handler->renderPublicView($entityWorkflowSend);
|
||||
return $handler->renderPublicView($entityWorkflowSend, $metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user