diff --git a/app/actions.php b/app/actions.php index 69af1579ca9ecb2e57833cf4b5e10d7d711a9862..95ce10ec7f2e2e8650035fb14583e4ff416de995 100644 --- a/app/actions.php +++ b/app/actions.php @@ -103,7 +103,7 @@ $container[App\Action\DashboardParticipantSessionsRefreshAction::class] = functi }; $container[App\Action\DashboardParticipantParcoursFormationAction::class] = function ($c) { - return new App\Action\DashboardParticipantParcoursFormationAction($c->get('view'), $c->get('logger'), $c->get('em')); + return new App\Action\DashboardParticipantParcoursFormationAction($c->get('view'), $c->get('logger'), $c->get('em'), $c->get('settings')); }; $container[App\Action\DashboardParticipantAgendaAction::class] = function ($c) { diff --git a/app/src/Action/DashboardAdminAgendaFormAction.php b/app/src/Action/DashboardAdminAgendaFormAction.php index a3fd901d87b9ca42f70c5058d6bd9350bec999b9..752aafb986b63761c8e933d3f6d1190b23ba1976 100644 --- a/app/src/Action/DashboardAdminAgendaFormAction.php +++ b/app/src/Action/DashboardAdminAgendaFormAction.php @@ -46,6 +46,7 @@ final class DashboardAdminAgendaFormAction if ($request->isGet()) { $formations = $this->getFormations(); + $agenda=null; $a = [ 'page' => 'dashboard', @@ -75,6 +76,7 @@ final class DashboardAdminAgendaFormAction } else { $salles = $this->getSalles($debut->format('Y-m-d H:i:s'), $fin->format('Y-m-d H:i:s'), $quota); } + //$salle = $this->getSalleById($id_salle); //$salles = array_merge(array($salle), $this->getSalles($debut->format('Y-m-d H:i:s'), $fin->format('Y-m-d H:i:s'),$quota)); $response = $response->write(json_encode($salles))->withHeader('Content-type', 'application/json'); @@ -170,5 +172,6 @@ final class DashboardAdminAgendaFormAction $dql = "SELECT s FROM App\Entity\Salle s WHERE s.id = $id"; $query = $this->em->createQuery($dql); return $query->getArrayResult()[0]; + //return $query->getArrayResult(); } } diff --git a/app/src/Action/DashboardParticipantParcoursFormationAction.php b/app/src/Action/DashboardParticipantParcoursFormationAction.php index f7485c3300c9857c87aee1bebe86c58b7b93bfca..f622eab92eb2796b0d99d8c61b3b2f7d4c94950f 100644 --- a/app/src/Action/DashboardParticipantParcoursFormationAction.php +++ b/app/src/Action/DashboardParticipantParcoursFormationAction.php @@ -22,12 +22,14 @@ final class DashboardParticipantParcoursFormationAction private $view; private $logger; private $em; + private $settings; - public function __construct(Twig $view, LoggerInterface $logger, EntityManagerInterface $em) + public function __construct(Twig $view, LoggerInterface $logger, EntityManagerInterface $em, $settings) { $this->view = $view; $this->logger = $logger; $this->em = $em; + $this->settings = $settings; } public function __invoke(Request $request, Response $response, $args) @@ -85,15 +87,7 @@ final class DashboardParticipantParcoursFormationAction 'participant' => $participant, ]; -// $a['pa_4_am'] = $this->getParcours('2017-07-04', '08:00:00', '13:00:00', $participant->getId()); -// $a['pa_4_pm'] = $this->getParcours('2017-07-04', '12:00:00', '19:00:00', $participant->getId()); -// $a['pa_5_am'] = $this->getParcours('2017-07-05', '08:00:00', '13:00:00', $participant->getId()); -// $a['pa_5_pm'] = $this->getParcours('2017-07-05', '12:00:00', '19:00:00', $participant->getId()); -// $a['pa_6_am'] = $this->getParcours('2017-07-06', '08:00:00', '13:00:00', $participant->getId()); -// $a['pa_6_pm'] = $this->getParcours('2017-07-06', '12:00:00', '19:00:00', $participant->getId()); -// $a['pa_7_am'] = $this->getParcours('2017-07-07', '08:00:00', '13:00:00', $participant->getId()); -// $a['pa_7_pm'] = $this->getParcours('2017-07-07', '12:00:00', '19:00:00', $participant->getId()); - // Attention chgt 2020 !!!! + $a['pa_am'][0] = $this->getParcours($this->settings['jdev']['j1'], '08:00:00', '13:00:00', $participant->getId()); $a['pa_pm'][0] = $this->getParcours($this->settings['jdev']['j1'], '12:00:00', '19:00:00', $participant->getId()); $a['pa_am'][1] = $this->getParcours($this->settings['jdev']['j2'], '08:00:00', '13:00:00', $participant->getId()); @@ -108,6 +102,7 @@ final class DashboardParticipantParcoursFormationAction return $response; } + private function getParticipant($email) { $participant = $this->em->getRepository('App\Entity\Participant')->findOneBy(array('email' => $email)); @@ -136,7 +131,8 @@ final class DashboardParticipantParcoursFormationAction { $date_debut = $jour . " " . $debut; $date_fin = $jour . " " . $fin; - + //$date_debut = "2020-07-06 " . $debut; + //$date_fin = "2020-07-06 " . $fin; $dql = "SELECT pa FROM App\Entity\ParticipantAgenda pa LEFT JOIN pa.agenda a "; $dql .= "WHERE pa.participant=$id "; $dql .= "AND a.dateDebut between '$date_debut' and '$date_fin' and a.dateFin between '$date_debut' and '$date_fin'"; @@ -150,6 +146,9 @@ final class DashboardParticipantParcoursFormationAction $date_fin = $jour . " " . $fin; $date_gtsoir = $jour . " 17:00:00"; + //$date_debut = "2020-07-06 " . $debut; + //$date_fin = "2020-07-06 " . $fin; + //$date_gtsoir = "2020-07-06 17:00:00"; $dql = "SELECT pa FROM App\Entity\ParticipantAgenda pa LEFT JOIN pa.agenda a "; $dql .= "WHERE pa.participant=$id "; $dql .= "AND a.dateDebut between '$date_debut' and '$date_fin' and a.dateFin between '$date_debut' and '$date_fin'"; diff --git a/app/templates/dashboard_participant_parcours_agenda.twig b/app/templates/dashboard_participant_parcours_agenda.twig index b469b42430b4ce1a115b744a8f02381299c03b55..a746d17bb7c01037250430edafe94b29011f263e 100644 --- a/app/templates/dashboard_participant_parcours_agenda.twig +++ b/app/templates/dashboard_participant_parcours_agenda.twig @@ -93,11 +93,12 @@ {% set prct = ((agenda.nb_inscrits / quota) * 100) | round %} {{ prct }}% - + + {% if agenda.check == 0 %} {% set gt_h_debut = agenda['agenda'].getDateDebut() | date("H") %} {% if agenda['agenda'].getFormation().getType() == 'Groupe de Travail' and gt_h_debut >= 17 %} - {% if nbgt17 < 1 %} + {% if nbgt17 < 1 %} {% if prct < 100 %}