Skip to content
Snippets Groups Projects
Commit 2fa8aa33 authored by lecluse's avatar lecluse
Browse files
parent 39ea6669
No related branches found
No related tags found
No related merge requests found
-- ********************************************************************* --
-- * à faire AVANT avoir mis à jour le code source * --
-- ********************************************************************* --
BEGIN DBMS_SCHEDULER.disable(name=>'"OSE"."OSE_SRC_SYNC"', force => TRUE); END;
/
UPDATE departement SET source_code = '0' || source_code WHERE length(source_code) = 2;
update intervenant set pays_naissance_id =
(select id from pays where source_code = pays_naissance_code_insee)
where pays_naissance_code_insee is not null;
update intervenant set pays_nationalite_id =
(select id from pays where source_code = pays_nationalite_code_insee)
where pays_nationalite_code_insee is not null;
update intervenant set dep_naissance_id =
(select id from departement where source_code = dep_naissance_code_insee)
where dep_naissance_code_insee is not null;
-- ********************************************************************* --
-- * à faire APRÈS avoir mis à jour le code source * --
-- ********************************************************************* --
BEGIN DBMS_SCHEDULER.enable(name=>'"OSE"."OSE_SRC_SYNC"'); END;
/
BEGIN OSE_FORMULE.CALCULER_TOUT; END;
/
\ No newline at end of file
This diff is collapsed.
......@@ -565,8 +565,8 @@ class Dossier implements HistoriqueAwareInterface
->setPrenom($intervenant->getPrenom())
->setCivilite($intervenant->getCivilite())
->setDateNaissance($intervenant->getDateNaissance())
// ->setPaysNaissance($intervenant->getPaysNaissance())
// ->setDepartementNaissance($intervenant->getDepNaissance())
->setPaysNaissance($intervenant->getPaysNaissance())
->setDepartementNaissance($intervenant->getDepNaissance())
->setVilleNaissance($intervenant->getVilleNaissanceLibelle())
->setNumeroInsee($intervenant->getNumeroInsee() . $intervenant->getNumeroInseeCle())
->setAdresse((string) $intervenant->getAdressePrincipale())
......
......@@ -13,7 +13,6 @@ use UnicaenApp\Entity\HistoriqueAwareTrait;
use UnicaenApp\Service\EntityManagerAwareTrait;
use UnicaenImport\Entity\Db\Interfaces\ImportAwareInterface;
use UnicaenImport\Entity\Db\Traits\ImportAwareTrait;
use Zend\Form\Annotation;
use Application\Constants;
use Zend\Permissions\Acl\Resource\ResourceInterface;
use Application\Entity\Db\Interfaces\AnneeAwareInterface;
......@@ -21,9 +20,6 @@ use Application\Entity\Db\Interfaces\AnneeAwareInterface;
/**
* Intervenant
*
* @Annotation\Name("intervenant")
* @Annotation\Type("Application\Form\Intervenant\AjouterModifier")
* @Annotation\Hydrator("Application\Entity\Db\Hydrator\Intervenant")
*/
class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, ResourceInterface, AnneeAwareInterface, ImportAwareInterface, ObjectManagerAware
{
......@@ -46,98 +42,66 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* @var \DateTime
* @Annotation\Type("UnicaenApp\Form\Element\DateInfSup")
* @Annotation\Options({"date_inf_label":"Date de naissance :"})
*/
protected $dateNaissance;
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Département de naissance (code INSEE) :"})
*/
protected $depNaissanceCodeInsee;
/**
* @var string
* @var Pays
*/
protected $depNaissanceLibelle;
private $paysNaissance;
/**
* @var string
* @Annotation\Type("Zend\Form\Element\Email")
* @Annotation\Validator({"name":"EmailAddress"})
* @Annotation\Options({"label":"Adresse mail :"})
* @var Pays
*/
protected $email;
private $paysNationalite;
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Nom patronymique :"})
* @var Departement
*/
protected $nomPatronymique;
private $depNaissance;
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Nom usuel :"})
*/
protected $nomUsuel;
protected $depNaissanceLibelle;
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Numéro INSEE :"})
*/
protected $numeroInsee;
protected $email;
/**
* @var string
*/
protected $numeroInseeCle;
/**
* @var boolean
*/
protected $numeroInseeProvisoire;
protected $nomPatronymique;
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Pays de naissance (code Insee) :"})
*/
protected $paysNaissanceCodeInsee;
protected $nomUsuel;
/**
* @var string
*/
protected $paysNaissanceLibelle;
protected $numeroInsee;
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Pays de nationalité (code Insee) :"})
*/
protected $paysNationaliteCodeInsee;
protected $numeroInseeCle;
/**
* @var string
* @var boolean
*/
protected $paysNationaliteLibelle;
protected $numeroInseeProvisoire;
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Validator({"name":"StringLength", "options":{"min":1, "max":25}})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Prénom :"})
*/
protected $prenom;
......@@ -153,9 +117,6 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* @var string
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"VIlle de naissance (code Insee) :"})
*/
protected $villeNaissanceCodeInsee;
......@@ -201,10 +162,6 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* @var \Application\Entity\Db\Civilite
* @Annotation\Type("Zend\Form\Element\Select")
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"Civilité :"})
*/
protected $civilite;
......@@ -423,43 +380,23 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Set depNaissanceLibelle
*
* @param string $depNaissanceLibelle
*
* @return Intervenant
*/
public function setDepNaissanceLibelle($depNaissanceLibelle)
{
$this->depNaissanceLibelle = $depNaissanceLibelle;
return $this;
}
/**
* Get depNaissanceLibelle
*
* @return string
* @return Pays
*/
public function getDepNaissanceLibelle()
public function getPaysNaissance()
{
return $this->depNaissanceLibelle;
return $this->paysNaissance;
}
/**
* Set email
*
* @param string $email
* @param Pays $paysNaissance
*
* @return Intervenant
*/
public function setEmail($email)
public function setPaysNaissance($paysNaissance)
{
$this->email = $email;
$this->paysNaissance = $paysNaissance;
return $this;
}
......@@ -467,27 +404,23 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get email
*
* @return string
* @return Pays
*/
public function getEmail()
public function getPaysNationalite()
{
return $this->email;
return $this->paysNationalite;
}
/**
* Set nomPatronymique
*
* @param string $nomPatronymique
* @param Pays $paysNationalite
*
* @return Intervenant
*/
public function setNomPatronymique($nomPatronymique)
public function setPaysNationalite($paysNationalite)
{
$this->nomPatronymique = $nomPatronymique;
$this->paysNationalite = $paysNationalite;
return $this;
}
......@@ -495,27 +428,23 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get nomPatronymique
*
* @return string
* @return Departement
*/
public function getNomPatronymique()
public function getDepNaissance()
{
return $this->nomPatronymique;
return $this->depNaissance;
}
/**
* Set nomUsuel
*
* @param string $nomUsuel
* @param Departement $depNaissance
*
* @return Intervenant
*/
public function setNomUsuel($nomUsuel)
public function setDepNaissance($depNaissance)
{
$this->nomUsuel = $nomUsuel;
$this->depNaissance = $depNaissance;
return $this;
}
......@@ -523,27 +452,15 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get nomUsuel
*
* @return string
*/
public function getNomUsuel()
{
return $this->nomUsuel;
}
/**
* Set numeroInsee
* Set depNaissanceLibelle
*
* @param string $numeroInsee
* @param string $depNaissanceLibelle
*
* @return Intervenant
*/
public function setNumeroInsee($numeroInsee)
public function setDepNaissanceLibelle($depNaissanceLibelle)
{
$this->numeroInsee = $numeroInsee;
$this->depNaissanceLibelle = $depNaissanceLibelle;
return $this;
}
......@@ -551,27 +468,27 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get numeroInsee
* Get depNaissanceLibelle
*
* @return string
*/
public function getNumeroInsee()
public function getDepNaissanceLibelle()
{
return $this->numeroInsee;
return $this->depNaissanceLibelle;
}
/**
* Set numeroInseeCle
* Set email
*
* @param string $numeroInseeCle
* @param string $email
*
* @return Intervenant
*/
public function setNumeroInseeCle($numeroInseeCle)
public function setEmail($email)
{
$this->numeroInseeCle = $numeroInseeCle;
$this->email = $email;
return $this;
}
......@@ -579,27 +496,27 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get numeroInseeCle
* Get email
*
* @return string
*/
public function getNumeroInseeCle()
public function getEmail()
{
return $this->numeroInseeCle ? sprintf('%02d', $this->numeroInseeCle) : $this->numeroInseeCle;
return $this->email;
}
/**
* Set numeroInseeProvisoire
* Set nomPatronymique
*
* @param boolean $numeroInseeProvisoire
* @param string $nomPatronymique
*
* @return Intervenant
*/
public function setNumeroInseeProvisoire($numeroInseeProvisoire)
public function setNomPatronymique($nomPatronymique)
{
$this->numeroInseeProvisoire = $numeroInseeProvisoire;
$this->nomPatronymique = $nomPatronymique;
return $this;
}
......@@ -607,27 +524,27 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get numeroInseeProvisoire
* Get nomPatronymique
*
* @return boolean
* @return string
*/
public function getNumeroInseeProvisoire()
public function getNomPatronymique()
{
return $this->numeroInseeProvisoire;
return $this->nomPatronymique;
}
/**
* Set paysNaissanceCodeInsee
* Set nomUsuel
*
* @param string $paysNaissanceCodeInsee
* @param string $nomUsuel
*
* @return Intervenant
*/
public function setPaysNaissanceCodeInsee($paysNaissanceCodeInsee)
public function setNomUsuel($nomUsuel)
{
$this->paysNaissanceCodeInsee = $paysNaissanceCodeInsee;
$this->nomUsuel = $nomUsuel;
return $this;
}
......@@ -635,27 +552,27 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get paysNaissanceCodeInsee
* Get nomUsuel
*
* @return string
*/
public function getPaysNaissanceCodeInsee()
public function getNomUsuel()
{
return $this->paysNaissanceCodeInsee;
return $this->nomUsuel;
}
/**
* Set paysNaissanceLibelle
* Set numeroInsee
*
* @param string $paysNaissanceLibelle
* @param string $numeroInsee
*
* @return Intervenant
*/
public function setPaysNaissanceLibelle($paysNaissanceLibelle)
public function setNumeroInsee($numeroInsee)
{
$this->paysNaissanceLibelle = $paysNaissanceLibelle;
$this->numeroInsee = $numeroInsee;
return $this;
}
......@@ -663,27 +580,27 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get paysNaissanceLibelle
* Get numeroInsee
*
* @return string
*/
public function getPaysNaissanceLibelle()
public function getNumeroInsee()
{
return $this->paysNaissanceLibelle;
return $this->numeroInsee;
}
/**
* Set paysNationaliteCodeInsee
* Set numeroInseeCle
*
* @param string $paysNationaliteCodeInsee
* @param string $numeroInseeCle
*
* @return Intervenant
*/
public function setPaysNationaliteCodeInsee($paysNationaliteCodeInsee)
public function setNumeroInseeCle($numeroInseeCle)
{
$this->paysNationaliteCodeInsee = $paysNationaliteCodeInsee;
$this->numeroInseeCle = $numeroInseeCle;
return $this;
}
......@@ -691,27 +608,27 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get paysNationaliteCodeInsee
* Get numeroInseeCle
*
* @return string
*/
public function getPaysNationaliteCodeInsee()
public function getNumeroInseeCle()
{
return $this->paysNationaliteCodeInsee;
return $this->numeroInseeCle ? sprintf('%02d', $this->numeroInseeCle) : $this->numeroInseeCle;
}
/**
* Set paysNationaliteLibelle
* Set numeroInseeProvisoire
*
* @param string $paysNationaliteLibelle
* @param boolean $numeroInseeProvisoire
*
* @return Intervenant
*/
public function setPaysNationaliteLibelle($paysNationaliteLibelle)
public function setNumeroInseeProvisoire($numeroInseeProvisoire)
{
$this->paysNationaliteLibelle = $paysNationaliteLibelle;
$this->numeroInseeProvisoire = $numeroInseeProvisoire;
return $this;
}
......@@ -719,13 +636,13 @@ class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, Res
/**
* Get paysNationaliteLibelle
* Get numeroInseeProvisoire
*
* @return string
* @return boolean
*/
public function getPaysNationaliteLibelle()
public function getNumeroInseeProvisoire()
{
return $this->paysNationaliteLibelle;
return $this->numeroInseeProvisoire;
}
......
......@@ -26,6 +26,7 @@
<field name="villeNaissance" type="string" column="VILLE_NAISSANCE" length="128" nullable="true"/>
<field name="premierRecrutement" type="boolean" column="PREMIER_RECRUTEMENT" nullable="false"/>
<!--<one-to-one field="intervenant" target-entity="Application\Entity\Db\Intervenant" mapped-by="dossier"/>-->
<many-to-one field="civilite" target-entity="Application\Entity\Db\Civilite">
<join-columns>
<join-column name="CIVILITE_ID" referenced-column-name="ID"/>
......
......@@ -23,8 +23,6 @@
<field name="code" type="string" column="CODE" length="60" nullable="false"/>
<field name="supannEmpId" type="string" column="SUPANN_EMP_ID" length="60" nullable="false"/>
<field name="dateNaissance" type="datetime" column="DATE_NAISSANCE" nullable="false"/>
<field name="depNaissanceCodeInsee" type="string" column="DEP_NAISSANCE_CODE_INSEE" length="3" nullable="true"/>
<field name="depNaissanceLibelle" type="string" column="DEP_NAISSANCE_LIBELLE" length="30" nullable="true"/>
<field name="email" type="string" column="EMAIL" length="255" nullable="true"/>
<field name="histoCreation" type="datetime" column="HISTO_CREATION" nullable="false"/>
<field name="histoDestruction" type="datetime" column="HISTO_DESTRUCTION" nullable="true"/>
......@@ -34,10 +32,6 @@
<field name="numeroInsee" type="string" column="NUMERO_INSEE" length="13" nullable="true"/>
<field name="numeroInseeCle" type="string" column="NUMERO_INSEE_CLE" length="2" nullable="true"/>
<field name="numeroInseeProvisoire" type="boolean" column="NUMERO_INSEE_PROVISOIRE" nullable="true"/>
<field name="paysNaissanceCodeInsee" type="string" column="PAYS_NAISSANCE_CODE_INSEE" length="3" nullable="false"/>
<field name="paysNaissanceLibelle" type="string" column="PAYS_NAISSANCE_LIBELLE" length="30" nullable="false"/>
<field name="paysNationaliteCodeInsee" type="string" column="PAYS_NATIONALITE_CODE_INSEE" length="3" nullable="false"/>
<field name="paysNationaliteLibelle" type="string" column="PAYS_NATIONALITE_LIBELLE" length="30" nullable="false"/>
<field name="prenom" type="string" column="PRENOM" length="60" nullable="false"/>
<field name="sourceCode" type="string" column="SOURCE_CODE" length="100" nullable="true"/>
<field name="telMobile" type="string" column="TEL_MOBILE" length="20" nullable="true"/>
......@@ -48,6 +42,23 @@
<field name="IBAN" type="string" column="IBAN" length="255" nullable="true"/>
<field name="premierRecrutement" type="boolean" column="PREMIER_RECRUTEMENT" nullable="true"/>
<field name="montantIndemniteFc" type="float" column="MONTANT_INDEMNITE_FC" nullable="true" />
<many-to-one field="paysNaissance" target-entity="Application\Entity\Db\Pays">
<join-columns>
<join-column name="PAYS_NAISSANCE_ID" referenced-column-name="ID"/>
</join-columns>
</many-to-one>
<many-to-one field="paysNationalite" target-entity="Application\Entity\Db\Pays">
<join-columns>
<join-column name="PAYS_NATIONALITE_ID" referenced-column-name="ID"/>
</join-columns>
</many-to-one>
<many-to-one field="depNaissance" target-entity="Application\Entity\Db\Departement">
<join-columns>
<join-column name="DEP_NAISSANCE_ID" referenced-column-name="ID"/>
</join-columns>
</many-to-one>
<many-to-one field="grade" target-entity="Application\Entity\Db\Grade">
<join-columns>
<join-column name="GRADE_ID" referenced-column-name="ID"/>
......
......@@ -14,6 +14,10 @@ use Application\Service\Traits\ValidationAwareTrait;
* Description of Dossier
*
* @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
*
* @method DossierEntity get($id)
* @method DossierEntity[] getList(\Doctrine\ORM\QueryBuilder $qb = null, $alias = null)
* @method DossierEntity newEntity()
*/
class Dossier extends AbstractEntityService
{
......
......@@ -61,7 +61,7 @@ class IntervenantViewHelper extends AbstractHtmlElement
"Civilité" => $entity->getCiviliteToString(),
"Date de naissance" => $entity->getDateNaissanceToString(),
"Ville de naissance" => $entity->getVilleNaissanceLibelle() ?: '<span class="inconnu">(Inconnue)</span>',
"Pays de naissance" => $entity->getPaysNaissanceLibelle(),
"Pays de naissance" => $entity->getPaysNaissance(),
"N° INSEE" => $entity->getNumeroInsee(),
],
'coordonnees' => [
......
......@@ -258,69 +258,6 @@ class Asset
return $e;
}
static public function newIntervenantPermanent(
Civilite $civilite,
StatutIntervenant $statut,
Structure $structure,
Corps $corps)
{
$e = new IntervenantPermanent();
$e
->setStructure($structure)
->setStatut($statut)
->setCorps($corps)
->setCivilite($civilite)
->setDateNaissance(new DateTime())
->setDepNaissanceCodeInsee('75')
->setDepNaissanceLibelle('IDF')
->setEmail(uniqid() . '@unicaen.fr')
->setNomPatronymique(uniqid('Nom patro '))
->setNomUsuel(uniqid('Nom '))
->setPaysNaissanceCodeInsee('12')
->setPaysNaissanceLibelle('France')
->setPaysNationaliteCodeInsee('12')
->setPaysNationaliteLibelle('Française')
->setPrenom(uniqid('Prénom '))
->setSource(static::getSource())
->setSourceCode(uniqid())
->setTelMobile(null)
->setVilleNaissanceCodeInsee('75019')
->setVilleNaissanceLibelle('CF');
return $e;
}
static public function newIntervenantExterieur(
Civilite $civilite,
StatutIntervenant $statut,
Structure $structure,
RegimeSecu $regimeSecu)
{
$e = new IntervenantExterieur();
$e
->setStructure($structure)
->setStatut($statut)
->setRegimeSecu($regimeSecu)
->setCivilite($civilite)
->setDateNaissance(new DateTime())
->setDepNaissanceCodeInsee('75')
->setDepNaissanceLibelle('IDF')
->setEmail(uniqid() . '@unicaen.fr')
->setNomPatronymique(uniqid('Nom patro '))
->setNomUsuel(uniqid('Nom '))
->setPaysNaissanceCodeInsee('12')
->setPaysNaissanceLibelle('France')
->setPaysNationaliteCodeInsee('12')
->setPaysNationaliteLibelle('Française')
->setPrenom(uniqid('Prénom '))
->setSource(static::getSource())
->setSourceCode(uniqid())
->setTelMobile(null)
->setVilleNaissanceCodeInsee('75019')
->setVilleNaissanceLibelle('CF');
return $e;
}
static public function newTypePieceJointe()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment