Commit 995baefe authored by Thomas Hamel's avatar Thomas Hamel
Browse files

La création/modification d'une these_annee_univ pour une thèse saisie dans sygal améliorée

parent 6397c770
Loading
Loading
Loading
Loading
+1 −1
Changes for module/These/src/These/Entity/Db/Acteur.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface, IndividuRol
        if($estImportable){
            return $this->libelleQualite === null ? " " : $this->libelleQualite;
        }else{
            return $this->qualite;
            return $this->qualite ?: "";
        }
    }

+2 −2
Changes for module/These/src/These/Entity/Db/These.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1647,11 +1647,11 @@ class These implements HistoriqueAwareInterface, ResourceInterface
    /**
     * Remove anneesUnivInscription.
     *
     * @param VTheseAnneeUnivFirst $anneesUnivInscription
     * @param TheseAnneeUniv $anneesUnivInscription
     *
     * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
     */
    public function removeAnneesUnivInscription(VTheseAnneeUnivFirst $anneesUnivInscription)
    public function removeAnneesUnivInscription(TheseAnneeUniv $anneesUnivInscription)
    {
        return $this->anneesUnivInscription->removeElement($anneesUnivInscription);
    }
+1 −1
Changes for module/These/src/These/Fieldset/Generalites/GeneralitesFieldset.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class GeneralitesFieldset extends Fieldset implements InputFilterProviderInterfa
        $this->get('discipline')->setAttribute('disabled', !$estModifiable);
        $this->get('confidentialite')->setAttribute('disabled', !$estModifiable);
        $this->get('dateFinConfidentialite')->setAttribute('disabled', !$estModifiable);
        $this->get('datePremiereInscription')->setAttribute('disabled', !$estModifiable);
        $this->get('datePremiereInscription')->setAttribute('disabled', !$these->getSource()->getImportable() && !empty($this->get('datePremiereInscription')->getValue()));
        $this->get('dateAbandon')->setAttribute('readonly', !$estModifiable);
        $this->get('dateTransfert')->setAttribute('readonly', !$estModifiable);
        $this->get('resultat')->setAttribute('disabled', !$estModifiable);
+6 −14
Changes for module/These/src/These/Fieldset/Generalites/GeneralitesHydrator.php: 6 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use Application\Service\Source\SourceServiceAwareTrait;
use Doctrine\Laminas\Hydrator\DoctrineObject;
use These\Entity\Db\These;
use These\Entity\Db\TheseAnneeUniv;
use These\Entity\Db\VTheseAnneeUnivFirst;

class GeneralitesHydrator extends DoctrineObject
{
@@ -61,26 +62,17 @@ class GeneralitesHydrator extends DoctrineObject
        }

        $date = (isset($data['datePremiereInscription'])) ? \DateTime::createFromFormat('Y-m-d', $data['datePremiereInscription']) : null;
        $anneeUnivPremiereInscription = $date ? $this->anneeUnivService->fromDate($date) : null;

        //si une première année d'inscription est déjà renseignée, on lui ajoute les données
        if ($object->getAnneeUniv1ereInscription()) {
            $theseAnneeUnivPremiereInscription = $object->getAnneeUniv1ereInscription();
            if ($anneeUnivPremiereInscription) {
                $theseAnneeUnivPremiereInscription->setAnneeUniv($anneeUnivPremiereInscription->getPremiereAnnee());
            } else {
                $object->removeAnneesUniv1ereInscription($object->getAnneeUniv1ereInscription());
            }
        } else if ($date) {
        $anneeUnivDatePremiereInscription = $date ? $this->anneeUnivService->fromDate($date) : null;

        //si une date de première inscription est saisie
        if ($anneeUnivDatePremiereInscription) {
            $theseAnneeUnivPremiereInscription = new TheseAnneeUniv();
            if ($anneeUnivPremiereInscription) {
                $theseAnneeUnivPremiereInscription->setAnneeUniv($anneeUnivPremiereInscription->getPremiereAnnee());
            $theseAnneeUnivPremiereInscription->setAnneeUniv($anneeUnivDatePremiereInscription->getPremiereAnnee());
            $theseAnneeUnivPremiereInscription->setThese($object);
            $theseAnneeUnivPremiereInscription->setSource($this->sourceService->fetchApplicationSource());
            $theseAnneeUnivPremiereInscription->setSourceCode($this->sourceService->genereateSourceCode());
            $object->addAnneesUnivInscription($theseAnneeUnivPremiereInscription);
        }
        }

        if(!isset($data['cotutelle']) || !$data['cotutelle']) {
            $data['etablissementCoTutelle'] = null;
+0 −2
Changes for module/These/src/These/Service/These/TheseService.php: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -94,7 +94,6 @@ class TheseService extends BaseService
        }

        $theseAnneesUniv = $these->getAnneesUnivInscription();
        if($theseAnneesUniv){
        foreach ($theseAnneesUniv as $theseAnneeUniv) {
            try {
                $this->getEntityManager()->persist($theseAnneeUniv);
@@ -102,7 +101,6 @@ class TheseService extends BaseService
                throw new RuntimeException("Un problème est survenu lors de l'enregistrement en BD !", 0, $e);
            }
        }
        }

        $doctorant = $these->getDoctorant();
        if($doctorant){
Loading