diff --git a/src/Octopus/Entity/Db/IndividuAffectation.php b/src/Octopus/Entity/Db/IndividuAffectation.php index d5cf92d649f0168bc3eed37e3cfc9f9b1ca6a2cf..e9b3a020547c367ba4d71ccb4844c3d35acaa823 100644 --- a/src/Octopus/Entity/Db/IndividuAffectation.php +++ b/src/Octopus/Entity/Db/IndividuAffectation.php @@ -12,7 +12,7 @@ class IndividuAffectation { private $individu; /** @var Structure */ private $structure; - /** @var StructureType */ + /** @var IndividuAffectationType */ private $type; /** @var Source */ private $source; @@ -50,7 +50,7 @@ class IndividuAffectation { } /** - * @return StructureType + * @return IndividuAffectationType */ public function getType() { diff --git a/src/Octopus/Entity/Db/IndividuAffectationType.php b/src/Octopus/Entity/Db/IndividuAffectationType.php new file mode 100644 index 0000000000000000000000000000000000000000..ed33e0d2764db47298bb482e662292106fec276f --- /dev/null +++ b/src/Octopus/Entity/Db/IndividuAffectationType.php @@ -0,0 +1,53 @@ +<?php + +namespace Octopus\Entity\Db; + +class IndividuAffectationType { + /** @var integer */ + private $id; + /** @var string */ + private $nom; + /** @var string */ + private $libelle; + /** @var string */ + private $description; + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getNom() + { + return $this->nom; + } + + /** + * @return string + */ + public function getLibelle() + { + return $this->libelle; + } + + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } + + public function __toString() + { + return $this->getLibelle(); + } + + +} diff --git a/src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.IndividuAffectation.dcm.xml b/src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.IndividuAffectation.dcm.xml index 0f82455a9b60272e35906c65ecba5cd9c8e89e88..f1938abd7074879509ee278b8c14bba69e29fae0 100644 --- a/src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.IndividuAffectation.dcm.xml +++ b/src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.IndividuAffectation.dcm.xml @@ -14,7 +14,7 @@ <join-column name="STRUCTURE_ID" referenced-column-name="ID" /> </many-to-one> - <many-to-one target-entity="Octopus\Entity\Db\StructureType" field="type"> + <many-to-one target-entity="Octopus\Entity\Db\IndividuAffectationType" field="type"> <join-column name="TYPE_ID" referenced-column-name="ID" /> </many-to-one> diff --git a/src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.IndividuAffectationType.dcm.xml b/src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.IndividuAffectationType.dcm.xml new file mode 100644 index 0000000000000000000000000000000000000000..1a4df3b1f821c28e19dbcb6d5ebfaac4edf718ae --- /dev/null +++ b/src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.IndividuAffectationType.dcm.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> + <entity name="Octopus\Entity\Db\IndividuAffectationType" table="INDIVIDU_AFFECTATION_TYPE"> + + <id name="id" type="integer" column="ID"> + <generator strategy="IDENTITY"/> + </id> + + <field name="nom" column="NOM" type="string" length="50" nullable="false"/> + <field name="libelle" column="LIBELLE" type="string" length="255" nullable="false"/> + <field name="description" column="DESCRIPTION" type="string" length="1024" nullable="false"/> + + </entity> +</doctrine-mapping> \ No newline at end of file diff --git a/view/octopus/octopus/index.phtml b/view/octopus/octopus/index.phtml index c7418bdc13663d855465f2c5aa62da7b68b6245c..c6c83f611f4a9f948217c8f56e40fddc6338330c 100644 --- a/view/octopus/octopus/index.phtml +++ b/view/octopus/octopus/index.phtml @@ -61,8 +61,9 @@ use UnicaenApp\Form\Element\SearchAndSelect; <?php echo $affectation->getSource(); ?> - <?php echo $affectation->getStructure()->getLibelleLong(); ?> <?php echo $affectation->getType(); ?> + <?php echo $affectation->getStructure()->getType(); ?> + <?php echo $affectation->getStructure()->getLibelleLong(); ?> (<?php echo $affectation->getDateDebut()->format('d/m/Y'); ?> → <?php echo ($affectation->getDateFin())?$affectation->getDateFin()->format('d/m/Y'):""; ?>)