Commit c3fb15c6 authored by Thomas Hamel's avatar Thomas Hamel
Browse files

ajout du champ idHal pour un doctorant

parent b26436b7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -306,3 +306,7 @@ select privilege__grant_privileges_to_profiles('portfolio',
                                               ARRAY['afficher'],
                                               ARRAY['ADMIN_TECH', 'DOCTORANT']
);


-- Ajout de l'id HAL pour un doctorant
alter table individu add id_hal varchar(200);
 No newline at end of file
+10 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ class DiffusionHydrator extends DoctrineObject implements EntityManagerAwareInte
        $data['confidentielle'] = $object->getThese()->getDateFinConfidentialite() !== null ? Diffusion::CONFIDENTIELLE_OUI : Diffusion::CONFIDENTIELLE_NON;
        $data['dateFinConfidentialite'] = $object->getThese()->getDateFinConfidentialite();
        $data['orcid'] = $object->getThese()->getDoctorant()->getIndividu()->getOrcid();
        $data['halId'] = $object->getThese()->getDoctorant()->getIndividu()->getIdHal();

        return $data;
    }
@@ -56,8 +57,16 @@ class DiffusionHydrator extends DoctrineObject implements EntityManagerAwareInte
            $data['orcid'] = null;
        }

        if (isset($data['halId'])) {
            $individu = $this->getIndividuThese($object);
            $individu?->setIdHal($data['halId']);

        if (!isset($data['halId'])) {
            try {
                $this->objectManager->flush($individu);
            } catch (ORMException $e) {
                throw new RuntimeException("Impossible d'enregistrer les modifications sur l'individu", null, $e);
            }
        }else{
            $data['halId'] = null;
        }

+3 −2
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ class RdvBuHydrator extends DoctrineObject
            // todo : à déplacer dans Doctorant/Individu :
            $individu = $this->getIndividuThese($diffusion);
            $data['idOrcid'] = $individu?->getOrcid();
            $data['halId'] = $diffusion->getHalId();
            $data['halId'] = $individu?->getIdHal();
            // todo : à déplacer dans These :
            $data['nnt'] = $diffusion->getNNT();
        }
@@ -69,13 +69,14 @@ class RdvBuHydrator extends DoctrineObject
            // todo : à déplacer dans Doctorant/Individu :
            $individu = $this->getIndividuThese($diffusion);
            $individu?->setOrcid($data['idOrcid']);
            $individu?->setIdHal($data['halId']);

            try {
                $this->objectManager->flush($individu);
            } catch (ORMException $e) {
                throw new RuntimeException("Impossible d'enregistrer les modifications sur l'individu", null, $e);
            }

            $diffusion->setHalId($data['halId']);
            // todo : à déplacer dans These :
            $diffusion->setNNT($data['nnt'] ?? null);
            try {
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ use These\Entity\Db\These;
        <li>Identifiant ORCID : <code class="text-muted"><?php echo $orcid ?></code></li>
    <?php endif ?>

    <?php if ($halId = $diffusion->getHalId()): ?>
    <?php if ($halId = $these->getDoctorant()->getIndividu()?->getIdHal()): ?>
        <li>IdHAL : <code class="text-muted"><?php echo $halId ?></code></li>
    <?php endif ?>
</ul>
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ class DoctorantForm extends Form implements InputFilterProviderInterface
            (new Text('orcid'))
                ->setLabel("ORCID :")
        );
        $this->add(
            (new Text('idHal'))
                ->setLabel("IdHAL :")
        );
        $this->add(
            (new Text('idRef'))
                ->setLabel("IdRef :")
@@ -105,6 +109,12 @@ class DoctorantForm extends Form implements InputFilterProviderInterface
                    ],
                ],
            ],
            'idHal' => [
                'required' => false,
                'filters' => [
                    ['name' => StringTrim::class],
                ],
            ],
        ];
    }
}
 No newline at end of file
Loading