Commit 7e34bf6d authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Meilleure information pour la mise à jour de la feuille de route des intervenants

parent df676386
Loading
Loading
Loading
Loading
(170 KiB)

File changed.

No diff preview for this file type.

+7 −1
Changes for module/Application/src/Application/Controller/WorkflowController.php: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -155,10 +155,16 @@ class WorkflowController extends AbstractController
        $intervenant = $this->getEvent()->getParam('intervenant');

        if ($intervenant){
            $this->getServiceWorkflow()->calculerTableauxBord([], $intervenant);
            $errors = $this->getServiceWorkflow()->calculerTableauxBord([], $intervenant);
        }

        if (empty($errors)){
            $this->flashMessenger()->addSuccessMessage('Feuille de route actualisée.');
        }else{
            foreach( $errors as $error){
                $this->flashMessenger()->addErrorMessage($error->getMessage());
            }
        }

        return new MessengerViewModel();
    }
+8 −2
Changes for module/Application/src/Application/Service/WorkflowService.php: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -317,8 +317,10 @@ class WorkflowService extends AbstractService
     * @param array                                        $tableauxBords
     * @param Intervenant|Intervenant[]|string $intervenant
     */
    public function calculerTableauxBord($tableauxBords = [], $intervenant)
    public function calculerTableauxBord($tableauxBords = [], $intervenant): array
    {
        $errors = [];

        $deps = [
            'formule'                 => ['agrement', 'paiement'],
            'piece_jointe_demande'    => ['piece_jointe'],
@@ -364,14 +366,18 @@ class WorkflowService extends AbstractService
                    $params = 'INTERVENANT_ID IN (' . $intervenant . ')';
                }

                try {
                    $this->getServiceTableauBord()->calculer(
                        $dep,
                        $params
                    );
                }catch(\Exception $e ){
                    $errors[$dep] = $e;
                }
            }
        }

        return $this;
        return $errors;
    }


Loading