Commit 8a5edba1 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Bloquage du dépôt initial après date de soutenance

parent df72da15
Loading
Loading
Loading
Loading
+7
Changes for module/Application/src/Application/Assertion/These/TheseEntityAssertion.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -220,6 +220,13 @@ class TheseEntityAssertion implements EntityAssertionInterface, ValidationServic
                $this->existeFichierTheseVersionCorrigee(),
            "Aucune version corrigée n'a été fournie.");
        }

        if (ThesePrivileges::THESE_DEPOT_VERSION_INITIALE) {
            $this->assertFalse(
                $this->these->estSoutenue(),
                "Dépot initial bloqué car soutenance effectuée"
            );
        }
    }

    private function assertAucuneValidationBU($message = null)
+11 −3
Changes for module/Application/src/Application/Entity/Db/These.php: 11 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -1195,10 +1195,18 @@ class These implements HistoriqueAwareInterface, ResourceInterface
     * Predicat testant si une thèse est soutenue en utilisant la date du système
     * @return boolean
     */
    public function estSoutenue() {
        $maintenant = new DateTime();
    public function estSoutenue()
    {
        $soutenance = $this->getDateSoutenance();
        if ($maintenant > $soutenance) return true;
        if ($soutenance === null)
        {
            return false;
        }
        $maintenant = new DateTime();
        if ($maintenant > $soutenance)
        {
            return true;
        }
        return false;
    }
}