diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php index 3a8626f26..6cf5e763e 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php @@ -23,6 +23,7 @@ use Chill\MainBundle\Security\Authorization\EntityWorkflowVoter; use Chill\MainBundle\Security\ChillSecurity; use Chill\MainBundle\Workflow\EntityWorkflowManager; use Chill\MainBundle\Workflow\WorkflowTransitionContextDTO; +use Chill\PersonBundle\Entity\Person; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\Extension\Core\Type\FormType; @@ -277,6 +278,22 @@ class WorkflowController extends AbstractController $handler = $this->entityWorkflowManager->getHandler($entityWorkflow); $workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName()); $errors = []; + $signaturesByPerson = false; + + $signatures = $entityWorkflow->getCurrentStep()->getSignatures(); + if (!$signatures->isEmpty()) { + $signaturesByPerson = $signatures[0]->getSigner() instanceof Person; + } +/* $personSignatures = []; + $userSignatures = [];*/ + +/* foreach ($signatures as $signature) { + if ($signature->getSigner() instanceof Person) { + $personSignatures[] = $signature->getSigner(); + } else { + $userSignatures[] = $signature->getSigner(); + } + }*/ if (\count($workflow->getEnabledTransitions($entityWorkflow)) > 0) { // possible transition @@ -347,6 +364,8 @@ class WorkflowController extends AbstractController 'transition_form' => isset($transitionForm) ? $transitionForm->createView() : null, 'entity_workflow' => $entityWorkflow, 'transition_form_errors' => $errors, + 'signatures' => $signatures, + 'signaturesByPerson' => $signaturesByPerson, // 'comment_form' => $commentForm->createView(), ] ); diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_signature.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_signature.html.twig index 77c11b9b7..644d540a1 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_signature.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_signature.html.twig @@ -1,21 +1,22 @@
name placeholder
-name placeholder
-{{ s.stateDate }}
+ {% endif %}