Commit 5accb8fe authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Cosmétique sur Autorisation d'inscription ; masquage des Autorisations de...

Cosmétique sur Autorisation d'inscription ; masquage des Autorisations de diplomation avant déplacement dans Soutenance
parent 9c88fdc1
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ class RapportCsiController extends RapportController
    protected $privilege_SUPPRIMER_SIEN = RapportPrivileges::RAPPORT_CSI_SUPPRIMER_SIEN;
    protected $privilege_TELECHARGER_TOUT = RapportPrivileges::RAPPORT_CSI_TELECHARGER_TOUT;
    protected $privilege_TELECHARGER_SIEN = RapportPrivileges::RAPPORT_CSI_TELECHARGER_SIEN;
//    protected $privilege_VALIDER_TOUT = RapportPrivileges::RAPPORT_CSI_VALIDER_TOUT;
//    protected $privilege_VALIDER_SIEN = RapportPrivileges::RAPPORT_CSI_VALIDER_SIEN;
//    protected $privilege_DEVALIDER_TOUT = RapportPrivileges::RAPPORT_CSI_DEVALIDER_TOUT;
//    protected $privilege_DEVALIDER_SIEN = RapportPrivileges::RAPPORT_CSI_DEVALIDER_SIEN;
@@ -58,8 +57,6 @@ class RapportCsiController extends RapportController
            'anneesUnivs' => $this->anneesUnivs,
            'isTeleversementPossible' => $this->isTeleversementPossible(),
            'membres' => $membres,
            'autorisationsInscriptionParAnneeUniv' => $this->fetchAutorisationsInscriptionParAnneeUniv(),
            'autorisationsDiplomationParAnneeUniv' => $this->fetchAutorisationsDiplomationParAnneeUniv(),

            'typeValidation' => $this->typeValidation,
            'routeName' => $this->routeName,
@@ -81,24 +78,6 @@ class RapportCsiController extends RapportController
        ]);
    }

    private function fetchAutorisationsInscriptionParAnneeUniv(): SplObjectStorage
    {
        // collecte des autorisations d'inscription existantes par année univ
        $autorisationsInscription = $this->autorisationInscriptionTheseService->getRepository()->findByThese($this->these);
        $autorisationsInscriptionParAnneeUniv = new SplObjectStorage();
        foreach ($this->rapportsTeleverses as $rapport) {
            // NB : une contrainte en bdd garantit qu'il n'existe qu'une seule autorisation par thèse et par année univ.
            foreach ($autorisationsInscription as $autorisation) {
                if ($rapport === $autorisation->getRapport()) {
                    $autorisationsInscriptionParAnneeUniv->attach($rapport->getAnneeUniv(), $autorisation);
                    break;
                }
            }
        }

        return $autorisationsInscriptionParAnneeUniv;
    }

    private function fetchAutorisationsDiplomationParAnneeUniv(): SplObjectStorage
    {
        // collecte des autorisations de diplomation existantes par année univ
+3 −12
Original line number Diff line number Diff line
@@ -3,9 +3,12 @@
namespace Application\Controller\Rapport;

use Application\Provider\Privilege\RapportPrivileges;
use AutorisationInscriptionThese\Service\Entity\AutorisationInscriptionTheseServiceAwareTrait;

class RapportCsiRechercheController extends RapportRechercheController
{
    use AutorisationInscriptionTheseServiceAwareTrait;

    protected $privilege_LISTER_TOUT = RapportPrivileges::RAPPORT_CSI_LISTER_TOUT;
    protected $privilege_LISTER_SIEN = RapportPrivileges::RAPPORT_CSI_LISTER_SIEN;
    protected $privilege_TELEVERSER_TOUT = RapportPrivileges::RAPPORT_CSI_TELEVERSER_TOUT;
@@ -25,16 +28,4 @@ class RapportCsiRechercheController extends RapportRechercheController
    protected $routeName = 'rapport-csi';

    protected $title = "Rapports CSI";

    public function indexAction()
    {
        $model = parent::indexAction();

        $model->setVariables([
            'autorisationsInscriptionParAnneeUniv' => null,
            'autorisationsDiplomationParAnneeUniv' => null,
        ]);

        return $model;
    }
}
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
    <one-to-many field="rapportValidations" target-entity="Application\Entity\Db\RapportValidation" mapped-by="rapport"/>
    <one-to-many field="rapportAvis" target-entity="Application\Entity\Db\RapportAvis" mapped-by="rapport"/>

    <one-to-one field="autorisationInscriptionThese" target-entity="AutorisationInscriptionThese\Entity\Db\AutorisationInscriptionThese" mapped-by="rapport"/>
    
    <field name="histoCreation" type="datetime" column="histo_creation"/>
    <field name="histoDestruction" type="datetime" column="histo_destruction" nullable="true"/>
    <field name="histoModification" type="datetime" column="histo_modification"/>
+13 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Application\Entity\Db;

use Application\Entity\AnneeUniv;
use AutorisationInscriptionThese\Entity\Db\AutorisationInscriptionThese;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
@@ -58,6 +59,8 @@ class Rapport implements ResourceInterface, HistoriqueAwareInterface
     */
    private $rapportAvis;

    private ?AutorisationInscriptionThese $autorisationInscriptionThese = null;

    /**
     * Rapport constructor.
     * @param TypeRapport|null $typeRapport
@@ -304,6 +307,16 @@ class Rapport implements ResourceInterface, HistoriqueAwareInterface
        return $this;
    }

    /**
     * Retourne l'eventuelle autorisation d'inscription liée.
     *
     * **NB: n'a de sens que pour un Rapport CSI.**
     */
    public function getAutorisationInscriptionThese(): ?AutorisationInscriptionThese
    {
        return $this->autorisationInscriptionThese;
    }

    /**
     * Returns the string identifier of the Resource
     *
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,10 @@ class RapportPrivileges extends Privileges
    public const RAPPORT_CSI_TELECHARGER_TOUT = 'rapport-csi-telecharger-tout';
    public const RAPPORT_CSI_TELECHARGER_SIEN = 'rapport-csi-telecharger-sien';
    public const RAPPORT_CSI_TELECHARGER_ZIP = 'rapport-csi-telecharger-zip';
    public const RAPPORT_CSI_VALIDER_TOUT = 'rapport-csi-valider-tout';
    public const RAPPORT_CSI_VALIDER_SIEN = 'rapport-csi-valider-sien';
    public const RAPPORT_CSI_DEVALIDER_TOUT = 'rapport-csi-devalider-tout';
    public const RAPPORT_CSI_DEVALIDER_SIEN = 'rapport-csi-devalider-sien';

    // catégorie = 'rapport-miparcours'
    public const RAPPORT_MIPARCOURS_LISTER_TOUT = 'rapport-miparcours-lister-tout';
Loading