Commit ba739d0e authored by François Agneray's avatar François Agneray
Browse files

possibilité de selectionner deux groupes de travail par demie journée

parent 4e3142ae
......@@ -52,7 +52,9 @@ final class DashboardParticipantParcoursAction
$agendas = $this->getAgendas($params['jour'],$params['debut'],$params['fin'],$participant->getId());
$a['agendas'] = $agendas;
$inscription = $this->getParcours($params['jour'],$params['debut'],$params['fin'],$participant->getId());
$a['inscription'] = $inscription;
if (count($inscription) > 0) {
$a['inscription'] = $inscription[0];
}
$a['jour'] = $params['jour'];
$a['debut'] = $params['debut'];
$a['fin'] = $params['fin'];
......
......@@ -49,16 +49,19 @@ final class DashboardParticipantParcoursFormationAction
}
// Inscription à la formation
if ($valid == 'true') {
$allParticipantAgenda = $this->getParcours($params['jour'], $params['debut'], $params['fin'], $id_participant);
$agenda=$this->getAgenda($id_agenda);
$inscription = new \App\Entity\ParticipantAgenda();
$inscription->setParticipant($participant);
$inscription->setAgenda($agenda[0]);
date_default_timezone_set('UTC');
$ladate=date_create_from_format('Y-m-d H:i:s', date("Y-m-d H:i:s"));
$inscription->setDateInscription($ladate);
if(count($allParticipantAgenda) < 1 || $agenda[0]->getFormation()->getType() == 'Groupe de Travail') {
$inscription = new \App\Entity\ParticipantAgenda();
$inscription->setParticipant($participant);
$inscription->setAgenda($agenda[0]);
date_default_timezone_set('UTC');
$ladate=date_create_from_format('Y-m-d H:i:s', date("Y-m-d H:i:s"));
$inscription->setDateInscription($ladate);
$this->em->persist($inscription);
$this->em->flush();
$this->em->persist($inscription);
$this->em->flush();
}
}
$a = [
......
......@@ -48,7 +48,9 @@ final class DashboardParticipantSondageAction
$a['preagendas'] = $preagendas;
$inscription = $this->getInscriptionPreAgenda($params['jour'],$params['debut'],$params['fin'],$participant->getId());
$a['inscription'] = $inscription;
if (count($inscription) > 0) {
$a['inscription'] = $inscription[0];
}
$a['jour'] = $params['jour'];
$a['debut'] = $params['debut'];
......
......@@ -43,8 +43,8 @@ final class DashboardParticipantSondageFormationAction
// Sélection de la formation
if ($valid == 'true') {
$allParticipantPreAgenda = $this->getAllParticipantPreAgenda($params['jour'], $params['debut'], $params['fin'], $id_participant);
if(count($allParticipantPreAgenda) < 1) {
$preagenda = $this->getPreAgenda($id_preagenda);
$preagenda = $this->getPreAgenda($id_preagenda);
if(count($allParticipantPreAgenda) < 1 || $preagenda[0]->getFormation()->getType() == 'Groupe de Travail') {
$inscription = new \App\Entity\ParticipantPreAgenda();
$inscription->setParticipant($participant);
$inscription->setPreAgenda($preagenda[0]);
......
......@@ -180,9 +180,13 @@
</td>
<td class="text-center">
{% if agenda.check == 0 %}
{% if inscription %}
{% if inscription and inscription.getAgenda().getFormation().getType() != 'Groupe de Travail' %}
{% elseif inscription
and (agenda['agenda'].getFormation().getType() != 'Groupe de Travail'
or (agenda['agenda'].getDateDebut() == inscription.getAgenda().getDateDebut() and agenda['agenda'].getDateFin() == inscription.getAgenda().getDateFin()))
%}
{% else %}
<a href="dashboard-participant-parcours-formation?token={{token}}&agenda={{id_agenda}}&valid=true"
<a href="dashboard-participant-parcours-formation?token={{token}}&agenda={{id_agenda}}&valid=true&jour={{jour}}&debut={{debut}}&fin={{fin}}"
class="btn btn-success btn-inscription-formation"
data-toggle="tooltip" title="S'inscrire à cette formation">S'inscrire
</a>
......
......@@ -65,7 +65,11 @@
<td class="text-center">
{% if preagenda.check == 0 %}
{% if inscription %}
{% if inscription and inscription.getPreAgenda().getFormation().getType() != 'Groupe de Travail' %}
{% elseif inscription
and (preagenda[0].getFormation().getType() != 'Groupe de Travail'
or (preagenda[0].getDateDebut() == inscription.getPreAgenda().getDateDebut() and preagenda[0].getDateFin() == inscription.getPreAgenda().getDateFin()))
%}
{% else %}
<a href="dashboard-participant-sondage-formation?token={{token}}&preagenda={{id_preagenda}}&valid=true&jour={{jour}}&debut={{debut}}&fin={{fin}}"
class="btn btn-success btn-sondage-formation"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment