Loading module/Carriere/config/merged/correspondance.config.php +7 −2 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Carriere\Service\Correspondance\CorrespondanceService; use Carriere\Service\Correspondance\CorrespondanceServiceFactory; use Carriere\Service\CorrespondanceType\CorrespondanceTypeService; use Carriere\Service\CorrespondanceType\CorrespondanceTypeServiceFactory; use Carriere\View\Helper\CorrespondanceViewHelper; use UnicaenPrivilege\Guard\PrivilegeController; use Laminas\Router\Http\Literal; use Laminas\Router\Http\Segment; Loading Loading @@ -146,6 +147,10 @@ return [ ], 'hydrators' => [ 'factories' => [], ] ], 'view_helpers' => [ 'invokables' => [ 'correspondance' => CorrespondanceViewHelper::class ], ], ]; No newline at end of file module/Carriere/src/Carriere/Entity/Db/Mapping/Carriere.Entity.Db.CorrespondanceType.dcm.xml +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ <field name="dateOuverture" column="d_ouverture" type="datetime" /> <field name="dateFermeture" column="d_fermeture" type="datetime" /> <!-- <one-to-many field="agentGrades" target-entity="Application\Entity\Db\AgentGrade" mapped-by="bap"/>--> <one-to-many field="correspondances" target-entity="Carriere\Entity\Db\Correspondance" mapped-by="type"/> <!-- DB IMPORT ############################# --> <field name="created_on" column="created_on" type="datetime"/> Loading module/Carriere/src/Carriere/Service/Correspondance/CorrespondanceService.php +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ class CorrespondanceService { */ public function createQueryBuilder() { $qb = $this->getEntityManager()->getRepository(Correspondance::class)->createQueryBuilder('correspondance') ->leftJoin('correspondance.type','ctype')->addSelect('ctype') ->andWhere('correspondance.deleted_on IS NULL') ; return $qb; Loading module/Carriere/src/Carriere/View/Helper/CorrespondanceViewHelper.php 0 → 100644 +24 −0 Original line number Diff line number Diff line <?php namespace Carriere\View\Helper; use Carriere\Entity\Db\Correspondance; use Laminas\View\Helper\AbstractHelper; use Laminas\View\Helper\Partial; use Laminas\View\Resolver\TemplatePathStack; class CorrespondanceViewHelper extends AbstractHelper { /** * @param Correspondance|null $correspondance * @param array $options * @return string|Partial */ public function __invoke(?Correspondance $correspondance, array $options = []) { $view = $this->getView(); $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); return $view->partial('correspondance', ['correspondance' => $correspondance, 'options' => $options]); } } No newline at end of file module/Carriere/src/Carriere/View/Helper/partial/correspondance.phtml 0 → 100644 +32 −0 Original line number Diff line number Diff line <?php /** * @see \Carriere\View\Helper\CorrespondanceViewHelper * @var Correspondance|null $correspondance * @var array $options */ use Carriere\Entity\Db\Correspondance; ?> <?php if ($correspondance === null) : ?> <span class="text-warning"> Aucune correspondance </span> <?php else: ?> <?php if ($correspondance->getType() === null) : ?> <span class="text-warning"> Aucun type </span> <?php else : ?> <span title="<?php echo $correspondance->getType()->getLibelleLong(); ?>"> <?php echo $correspondance->getType()->getLibelleCourt(); ?> </span> <?php endif; ?> - <span title="<?php echo $correspondance->getLibelleLong(); ?>"> <?php echo $correspondance->getCategorie(); ?> </span> <?php endif; ?> Loading
module/Carriere/config/merged/correspondance.config.php +7 −2 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Carriere\Service\Correspondance\CorrespondanceService; use Carriere\Service\Correspondance\CorrespondanceServiceFactory; use Carriere\Service\CorrespondanceType\CorrespondanceTypeService; use Carriere\Service\CorrespondanceType\CorrespondanceTypeServiceFactory; use Carriere\View\Helper\CorrespondanceViewHelper; use UnicaenPrivilege\Guard\PrivilegeController; use Laminas\Router\Http\Literal; use Laminas\Router\Http\Segment; Loading Loading @@ -146,6 +147,10 @@ return [ ], 'hydrators' => [ 'factories' => [], ] ], 'view_helpers' => [ 'invokables' => [ 'correspondance' => CorrespondanceViewHelper::class ], ], ]; No newline at end of file
module/Carriere/src/Carriere/Entity/Db/Mapping/Carriere.Entity.Db.CorrespondanceType.dcm.xml +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ <field name="dateOuverture" column="d_ouverture" type="datetime" /> <field name="dateFermeture" column="d_fermeture" type="datetime" /> <!-- <one-to-many field="agentGrades" target-entity="Application\Entity\Db\AgentGrade" mapped-by="bap"/>--> <one-to-many field="correspondances" target-entity="Carriere\Entity\Db\Correspondance" mapped-by="type"/> <!-- DB IMPORT ############################# --> <field name="created_on" column="created_on" type="datetime"/> Loading
module/Carriere/src/Carriere/Service/Correspondance/CorrespondanceService.php +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ class CorrespondanceService { */ public function createQueryBuilder() { $qb = $this->getEntityManager()->getRepository(Correspondance::class)->createQueryBuilder('correspondance') ->leftJoin('correspondance.type','ctype')->addSelect('ctype') ->andWhere('correspondance.deleted_on IS NULL') ; return $qb; Loading
module/Carriere/src/Carriere/View/Helper/CorrespondanceViewHelper.php 0 → 100644 +24 −0 Original line number Diff line number Diff line <?php namespace Carriere\View\Helper; use Carriere\Entity\Db\Correspondance; use Laminas\View\Helper\AbstractHelper; use Laminas\View\Helper\Partial; use Laminas\View\Resolver\TemplatePathStack; class CorrespondanceViewHelper extends AbstractHelper { /** * @param Correspondance|null $correspondance * @param array $options * @return string|Partial */ public function __invoke(?Correspondance $correspondance, array $options = []) { $view = $this->getView(); $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); return $view->partial('correspondance', ['correspondance' => $correspondance, 'options' => $options]); } } No newline at end of file
module/Carriere/src/Carriere/View/Helper/partial/correspondance.phtml 0 → 100644 +32 −0 Original line number Diff line number Diff line <?php /** * @see \Carriere\View\Helper\CorrespondanceViewHelper * @var Correspondance|null $correspondance * @var array $options */ use Carriere\Entity\Db\Correspondance; ?> <?php if ($correspondance === null) : ?> <span class="text-warning"> Aucune correspondance </span> <?php else: ?> <?php if ($correspondance->getType() === null) : ?> <span class="text-warning"> Aucun type </span> <?php else : ?> <span title="<?php echo $correspondance->getType()->getLibelleLong(); ?>"> <?php echo $correspondance->getType()->getLibelleCourt(); ?> </span> <?php endif; ?> - <span title="<?php echo $correspondance->getLibelleLong(); ?>"> <?php echo $correspondance->getCategorie(); ?> </span> <?php endif; ?>