Commit 9b667c9a authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Filtrage des structures null dans le calcul des superieurs et des autorites

parent 42ec83b5
Loading
Loading
Loading
Loading
+2 −0
Changes for module/Structure/src/Structure/Service/Structure/StructureService.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -405,6 +405,7 @@ EOS;
     */
    public function isResponsableS(array $structures, ?Agent $agent)  : bool
    {
        $structures = array_filter($structures, function ($s) { return $s !== null;});
        foreach ($structures as $structure) {
            $result = $this->isResponsable($structure, $agent);
            if ($result) return true;
@@ -443,6 +444,7 @@ EOS;
     */
    public function isAutoriteS(array $structures, ?Agent $agent)  : bool
    {
        $structures = array_filter($structures, function ($s) { return $s !== null;});
        foreach ($structures as $structure) {
            $result = $this->isAutorite($structure, $agent);
            if ($result) return true;