Loading module/Application/config/merged/structure.config.php +13 −0 Changes for module/Application/config/merged/structure.config.php: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ return [ 'action' => [ 'index', 'extraction-listing-fiche-poste', 'extraction-listing-mission-specifique', ], 'privileges' => StructurePrivileges::STRUCTURE_AFFICHER, ], Loading Loading @@ -317,6 +318,18 @@ return [ 'may_terminate' => true, 'child_routes' => [], ], 'listing-mission-specifique' => [ 'type' => Segment::class, 'options' => [ 'route' => '/listing-mission-specifique/:structure', 'defaults' => [ 'controller' => StructureController::class, 'action' => 'extraction-listing-mission-specifique', ], ], 'may_terminate' => true, 'child_routes' => [], ], ], ], ], Loading module/Application/src/Application/Controller/StructureController.php +34 −0 Changes for module/Application/src/Application/Controller/StructureController.php: 34 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -477,4 +477,38 @@ class StructureController extends AbstractActionController { } /** * Extraction du listing des agents et des fiches de poste associées */ public function extractionListingMissionSpecifiqueAction() { $structure = $this->getStructureService()->getRequestedStructure($this); $structures = $this->getStructureService()->getStructuresFilles($structure); $structures[] = $structure; $missionsSpecifiques = $this->getMissionSpecifiqueAffectationService()->getMissionsSpecifiquesByStructures($structures); $filename = "listing_mission_specifique-_" . str_replace(" ","_",$structure->getLibelleCourt()) . "_-_" . (new DateTime())->format('ymd-hms') . ".csv"; $header = ["Agent", "Structure", "Mission", "Début de mission", "Fin de mission", "Volume"]; $result = []; foreach ($missionsSpecifiques as $mission) { $agent = $mission->getAgent()->getDenomination(); $structure = $mission->getStructure()->getLibelleLong(); $libelle = $mission->getMission()->getLibelle(); $debut = ($mission->getDateDebut())?$mission->getDateDebut()->format('d/m/Y'):""; $fin = ($mission->getDateFin())?$mission->getDateFin()->format('d/m/Y'):""; $volume = $mission->getDecharge(); $result[] = [$agent, $structure, $libelle, $debut, $fin, $volume]; } $CSV = new CsvModel(); $CSV->setDelimiter(';'); $CSV->setEnclosure('"'); $CSV->setHeader($header); $CSV->setData($result); $CSV->setFilename($filename); return $CSV; } } No newline at end of file module/Application/view/application/structure/afficher.phtml +9 −3 Changes for module/Application/view/application/structure/afficher.phtml: 9 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ $canAfficherStructure = $this->isAllowed($structure, StructurePrivileges::STRU Fiches de <br/> poste </a> </li> <li role="missions"> <a href="#missions" aria-controls="missions" role="tab" data-toggle="tabz"> Missions <br/> spécifiques </a> </li> <?php if ($last !== null) : ?> <li role="campagne_<?php echo $last->getId(); ?>"> Loading Loading @@ -120,9 +125,6 @@ $canAfficherStructure = $this->isAllowed($structure, StructurePrivileges::STRU <!-- Informations -------------------------------------------------------------------------------------> <div id="informations" class="tab-pane " role="tabpanel"> <?php echo $this->partial('partial/missions-specifiques', ['structure' => $structure, 'missions' => $missions]); ?> <?php echo $this->partial('partial/fiches-postes', ['fichesCompletes' => $fichesCompletes, 'fichesIncompletes' => $fichesIncompletes]); ?> <?php echo $this->portenote('StructureController::indexAction()>Agents', '', []); ?> Loading Loading @@ -157,6 +159,10 @@ $canAfficherStructure = $this->isAllowed($structure, StructurePrivileges::STRU <?php echo $this->partial('partial/agents', ['structure' => $structure, 'agents' => $agentsForces, 'options' => ['force' => true]]); ?> </div> <!-- Missions spécifique -------------------------------------------------------------------------------------> <div id="missions" class="tab-pane " role="tabpanel"> <?php echo $this->partial('partial/missions-specifiques', ['structure' => $structure, 'missions' => $missions]); ?> </div> <!-- Campagne -------------------------------------------------------------------------------------> <?php $allAgents = array_merge($agents, $agentsForces); ?> Loading module/Application/view/application/structure/partial/extraction.phtml +10 −0 Changes for module/Application/view/application/structure/partial/extraction.phtml: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,3 +17,13 @@ use Application\Entity\Db\Structure; > <span class="icon csv"></span> Extraire au format CSV </a> <h2>Listing des missions spécifiques</h2> <a <?php /** @see \Application\Controller\StructureController::extractionListingMissionSpecifiqueAction() */ ?> href="<?php echo $this->url('structure/extraction/listing-mission-specifique', ['structure' => $structure->getId()], [], true); ?>" class="btn btn-primary action" > <span class="icon csv"></span> Extraire au format CSV </a> No newline at end of file Loading
module/Application/config/merged/structure.config.php +13 −0 Changes for module/Application/config/merged/structure.config.php: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ return [ 'action' => [ 'index', 'extraction-listing-fiche-poste', 'extraction-listing-mission-specifique', ], 'privileges' => StructurePrivileges::STRUCTURE_AFFICHER, ], Loading Loading @@ -317,6 +318,18 @@ return [ 'may_terminate' => true, 'child_routes' => [], ], 'listing-mission-specifique' => [ 'type' => Segment::class, 'options' => [ 'route' => '/listing-mission-specifique/:structure', 'defaults' => [ 'controller' => StructureController::class, 'action' => 'extraction-listing-mission-specifique', ], ], 'may_terminate' => true, 'child_routes' => [], ], ], ], ], Loading
module/Application/src/Application/Controller/StructureController.php +34 −0 Changes for module/Application/src/Application/Controller/StructureController.php: 34 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -477,4 +477,38 @@ class StructureController extends AbstractActionController { } /** * Extraction du listing des agents et des fiches de poste associées */ public function extractionListingMissionSpecifiqueAction() { $structure = $this->getStructureService()->getRequestedStructure($this); $structures = $this->getStructureService()->getStructuresFilles($structure); $structures[] = $structure; $missionsSpecifiques = $this->getMissionSpecifiqueAffectationService()->getMissionsSpecifiquesByStructures($structures); $filename = "listing_mission_specifique-_" . str_replace(" ","_",$structure->getLibelleCourt()) . "_-_" . (new DateTime())->format('ymd-hms') . ".csv"; $header = ["Agent", "Structure", "Mission", "Début de mission", "Fin de mission", "Volume"]; $result = []; foreach ($missionsSpecifiques as $mission) { $agent = $mission->getAgent()->getDenomination(); $structure = $mission->getStructure()->getLibelleLong(); $libelle = $mission->getMission()->getLibelle(); $debut = ($mission->getDateDebut())?$mission->getDateDebut()->format('d/m/Y'):""; $fin = ($mission->getDateFin())?$mission->getDateFin()->format('d/m/Y'):""; $volume = $mission->getDecharge(); $result[] = [$agent, $structure, $libelle, $debut, $fin, $volume]; } $CSV = new CsvModel(); $CSV->setDelimiter(';'); $CSV->setEnclosure('"'); $CSV->setHeader($header); $CSV->setData($result); $CSV->setFilename($filename); return $CSV; } } No newline at end of file
module/Application/view/application/structure/afficher.phtml +9 −3 Changes for module/Application/view/application/structure/afficher.phtml: 9 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ $canAfficherStructure = $this->isAllowed($structure, StructurePrivileges::STRU Fiches de <br/> poste </a> </li> <li role="missions"> <a href="#missions" aria-controls="missions" role="tab" data-toggle="tabz"> Missions <br/> spécifiques </a> </li> <?php if ($last !== null) : ?> <li role="campagne_<?php echo $last->getId(); ?>"> Loading Loading @@ -120,9 +125,6 @@ $canAfficherStructure = $this->isAllowed($structure, StructurePrivileges::STRU <!-- Informations -------------------------------------------------------------------------------------> <div id="informations" class="tab-pane " role="tabpanel"> <?php echo $this->partial('partial/missions-specifiques', ['structure' => $structure, 'missions' => $missions]); ?> <?php echo $this->partial('partial/fiches-postes', ['fichesCompletes' => $fichesCompletes, 'fichesIncompletes' => $fichesIncompletes]); ?> <?php echo $this->portenote('StructureController::indexAction()>Agents', '', []); ?> Loading Loading @@ -157,6 +159,10 @@ $canAfficherStructure = $this->isAllowed($structure, StructurePrivileges::STRU <?php echo $this->partial('partial/agents', ['structure' => $structure, 'agents' => $agentsForces, 'options' => ['force' => true]]); ?> </div> <!-- Missions spécifique -------------------------------------------------------------------------------------> <div id="missions" class="tab-pane " role="tabpanel"> <?php echo $this->partial('partial/missions-specifiques', ['structure' => $structure, 'missions' => $missions]); ?> </div> <!-- Campagne -------------------------------------------------------------------------------------> <?php $allAgents = array_merge($agents, $agentsForces); ?> Loading
module/Application/view/application/structure/partial/extraction.phtml +10 −0 Changes for module/Application/view/application/structure/partial/extraction.phtml: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,3 +17,13 @@ use Application\Entity\Db\Structure; > <span class="icon csv"></span> Extraire au format CSV </a> <h2>Listing des missions spécifiques</h2> <a <?php /** @see \Application\Controller\StructureController::extractionListingMissionSpecifiqueAction() */ ?> href="<?php echo $this->url('structure/extraction/listing-mission-specifique', ['structure' => $structure->getId()], [], true); ?>" class="btn btn-primary action" > <span class="icon csv"></span> Extraire au format CSV </a> No newline at end of file