Loading module/Application/src/Application/Controller/CoEncadrantController.php +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ class CoEncadrantController extends AbstractActionController { $form = $this->getRechercherCoEncadrantForm(); $form->setAttribute('action', $this->url()->fromRoute('co-encadrant/ajouter-co-encadrant', [], [], true)); $form->setUrlCoEncadrant($this->url()->fromRoute('utilisateur/rechercher-individu', [], [], true)); $form->setUrlCoEncadrant($this->url()->fromRoute('utilisateur/rechercher-individu', [], ["query" => ['type' => Individu::TYPE_ACTEUR]], true)); $request = $this->getRequest(); if ($request->isPost()) { Loading module/Application/src/Application/Controller/UtilisateurController.php +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle */ public function rechercherIndividuAction($type = null) { $type = $this->params()->fromQuery('type'); if (($term = $this->params()->fromQuery('term'))) { $rows = $this->individuService->getRepository()->findByText($term, $type); $result = []; Loading module/Application/src/Application/Entity/Db/Individu.php +28 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface const CIVILITE_M = 'M.'; const CIVILITE_MME = 'Mme'; const TYPE_ACTEUR = 'acteur'; const TYPE_DOCTORANT = 'doctorant'; /** * Identifiant qui correspond en fait au : * - supannEmpId (pour les acteurs) ou au Loading Loading @@ -108,6 +111,11 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface */ private $utilisateurs; /** * @var string */ private $type; /** * Individu constructor. */ Loading Loading @@ -550,4 +558,24 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface { return $this->utilisateurs->toArray(); } /** * @return string */ public function getType(): string { return $this->type; } /** * @param string $type * @return Individu */ public function setType(string $type): Individu { $this->type = $type; return $this; } } No newline at end of file module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Individu.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ </id> <field name="supannId" column="SUPANN_ID" nullable="true"/> <field name="type" column="TYPE" nullable="false"/> <field name="civilite" column="CIVILITE" nullable="true"/> <field name="dateNaissance" type="datetime" column="DATE_NAISSANCE"/> <field name="nationalite" column="NATIONALITE" nullable="true"/> Loading module/Application/src/Application/Entity/Db/Repository/IndividuRepository.php +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ class IndividuRepository extends DefaultEntityRepository "WHERE i.HISTO_DESTRUCTION IS NULL AND rownum <= %d"; if ($type !== null) { $sqlTemplate .= " AND i.type = '%s'"; $sql = sprintf($sqlTemplate, $type, (int)$limit); $sql = sprintf($sqlTemplate, (int)$limit, $type); $tmp = null; } else { $sql = sprintf($sqlTemplate, (int)$limit); Loading Loading
module/Application/src/Application/Controller/CoEncadrantController.php +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ class CoEncadrantController extends AbstractActionController { $form = $this->getRechercherCoEncadrantForm(); $form->setAttribute('action', $this->url()->fromRoute('co-encadrant/ajouter-co-encadrant', [], [], true)); $form->setUrlCoEncadrant($this->url()->fromRoute('utilisateur/rechercher-individu', [], [], true)); $form->setUrlCoEncadrant($this->url()->fromRoute('utilisateur/rechercher-individu', [], ["query" => ['type' => Individu::TYPE_ACTEUR]], true)); $request = $this->getRequest(); if ($request->isPost()) { Loading
module/Application/src/Application/Controller/UtilisateurController.php +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle */ public function rechercherIndividuAction($type = null) { $type = $this->params()->fromQuery('type'); if (($term = $this->params()->fromQuery('term'))) { $rows = $this->individuService->getRepository()->findByText($term, $type); $result = []; Loading
module/Application/src/Application/Entity/Db/Individu.php +28 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface const CIVILITE_M = 'M.'; const CIVILITE_MME = 'Mme'; const TYPE_ACTEUR = 'acteur'; const TYPE_DOCTORANT = 'doctorant'; /** * Identifiant qui correspond en fait au : * - supannEmpId (pour les acteurs) ou au Loading Loading @@ -108,6 +111,11 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface */ private $utilisateurs; /** * @var string */ private $type; /** * Individu constructor. */ Loading Loading @@ -550,4 +558,24 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface { return $this->utilisateurs->toArray(); } /** * @return string */ public function getType(): string { return $this->type; } /** * @param string $type * @return Individu */ public function setType(string $type): Individu { $this->type = $type; return $this; } } No newline at end of file
module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Individu.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ </id> <field name="supannId" column="SUPANN_ID" nullable="true"/> <field name="type" column="TYPE" nullable="false"/> <field name="civilite" column="CIVILITE" nullable="true"/> <field name="dateNaissance" type="datetime" column="DATE_NAISSANCE"/> <field name="nationalite" column="NATIONALITE" nullable="true"/> Loading
module/Application/src/Application/Entity/Db/Repository/IndividuRepository.php +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ class IndividuRepository extends DefaultEntityRepository "WHERE i.HISTO_DESTRUCTION IS NULL AND rownum <= %d"; if ($type !== null) { $sqlTemplate .= " AND i.type = '%s'"; $sql = sprintf($sqlTemplate, $type, (int)$limit); $sql = sprintf($sqlTemplate, (int)$limit, $type); $tmp = null; } else { $sql = sprintf($sqlTemplate, (int)$limit); Loading