Commit 2d11efb3 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Permettre une PEC ou REN sur l'année universitaire en cours mais aussi l'année...

Permettre une PEC ou REN sur l'année universitaire en cours mais aussi l'année universitaire N-1 dans le cas où est en transition vers l'année N
parent ebe27289
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ class ExportRhAssertion extends AbstractAssertion
    const PRIV_CAN_INTERVENANT_EXPORT_RH = 'intervenant-export-rh';



    /* ---- Routage général ---- */
    public function __invoke(array $page) // gestion des visibilités de menus
    {
@@ -34,7 +33,6 @@ class ExportRhAssertion extends AbstractAssertion
    }



    protected function assertEntity(ResourceInterface $entity, $privilege = null)
    {

@@ -65,7 +63,6 @@ class ExportRhAssertion extends AbstractAssertion
    }



    protected function assertIntervenantExportRh(Intervenant $intervenant)
    {
        if (!$this->getRole()->hasPrivilege(Privileges::INTERVENANT_EXPORTER)) {
@@ -77,11 +74,11 @@ class ExportRhAssertion extends AbstractAssertion
        $anneeContexte = $this->getServiceContext()->getAnnee();

        //Si nous ne sommes dans l'année universitaire en cours le module export reste inactif
        if ($anneeContexte->getId() != $anneeUniversitaireEnCours->getId()) {
            return false;
        if ($anneeContexte->getId() == $anneeUniversitaireEnCours->getId() || $anneeContexte->getId() == $anneeUniversitaireEnCours->getId() - 1) {
            return true;
        }

        return true;
        return false;
    }

}
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ class SihamConnecteur implements ConnecteurRhInterface
            /* Récupération du dossier de l'intervenant */
            $dossierIntervenant = $this->getServiceDossier()->getByIntervenant($intervenant);

            $anneeUniversitaire = $this->getServiceExportRh()->getAnneeUniversitaireEnCours();
            $anneeUniversitaire = $intervenant->getAnnee();//$this->getServiceExportRh()->getAnneeUniversitaireEnCours();
            $dateEffet = $anneeUniversitaire->getDateDebut()->format('Y-m-d');
            $dateFin = $anneeUniversitaire->getDateFin()->format('Y-m-d');

@@ -537,7 +537,7 @@ class SihamConnecteur implements ConnecteurRhInterface

            /* Récupération du dossier de l'intervenant */
            $dossierIntervenant = $this->getServiceDossier()->getByIntervenant($intervenant);
            $anneeUniversitaire = $this->getServiceExportRh()->getAnneeUniversitaireEnCours();
            $anneeUniversitaire = $intervenant->getAnnee();//$this->getServiceExportRh()->getAnneeUniversitaireEnCours();

            $dateEffet = $anneeUniversitaire->getDateDebut()->format('Y-m-d');
            $dateFin = $anneeUniversitaire->getDateFin()->format('Y-m-d');