Commit 0e7a5a50 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Blocage au niveau des validations si dépassement de plafond

Meilleure prise en charge des dérogations : on n'affiche plus de dépassement dans ce cas
parent 862386fc
Loading
Loading
Loading
Loading
+5 −0
Changes for module/Application/src/Controller/ServiceController.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -625,6 +625,11 @@ class ServiceController extends AbstractController
        /* @var $structure Structure */


        $plafondOk = $this->getProcessusPlafond()->controle($intervenant, $typeVolumeHoraire, true);
        if (!$plafondOk) {
            return new MessengerViewModel();
        }

        $validation = $this->getProcessusValidationEnseignement()->creer($intervenant, $structure);

        if ($this->isAllowed($validation, $typeVolumeHoraire->getPrivilegeEnseignementValidation())) {
+2 −2
Changes for module/Plafond/src/View/Helper/PlafondsViewHelper.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -119,13 +119,13 @@ class PlafondsViewHelper extends AbstractHtmlElement
        $text = '';

        $max = $plafond->getPlafond() + $plafond->getDerogation();
        if ($plafond->getHeures() >= $max) {
        if ($plafond->getHeures() > $max) {
            $max = $plafond->getHeures();
            if ($plafond->getHeures() > 0) {
                if ($plafond->getPlafond() == 0) {
                    $text = floatToString($plafond->getHeures()) . 'h pour aucune autorisée';
                } else {
                    $text = floatToString($plafond->getHeures()) . 'h pour ' . floatToString($plafond->getPlafond()) . ' max.';
                    $text = floatToString($plafond->getHeures()) . 'h pour ' . floatToString($plafond->getPlafond() + $plafond->getDerogation()) . ' max.';
                }
            }