Commit 19929a5a 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 9b667c9a
Loading
Loading
Loading
Loading
+2 −11
Changes for module/Structure/src/Structure/Service/Structure/StructureService.php: 2 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -375,11 +375,6 @@ EOS;
        return false;
    }

    /**
     * @param Structure $structure
     * @param Agent|null $agent
     * @return boolean
     */
    public function isResponsable(?Structure $structure, ?Agent $agent)  : bool
    {
        if ($structure === null) return false;
@@ -413,13 +408,9 @@ EOS;
        return false;
    }

    /**
     * @param Structure $structure
     * @param Agent|null $agent
     * @return bool
     */
    public function isAutorite(Structure $structure, ?Agent $agent) : bool
    public function isAutorite(?Structure $structure, ?Agent $agent) : bool
    {
        if ($structure === null) return false;
        if ($agent === null) return false;
        $date = (new DateTime());
        $structure = $structure->getNiv2();