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

Merge branch 'develop' into 'master'

v20.0.0

See merge request !8
parents e4d55d11 1b3d624c
......@@ -6,11 +6,9 @@ build/*
log/*
cache/*
._*
.~lock.*
.buildpath
.DS_Store
.idea
.project
.settings
composer.lock
app/settings.php
stages:
- install_php
- install_frontend
- build
- deploy
variables:
VERSION: "4.1"
CONTAINER_IMAGE: portus.lam.fr/jdev/jdev-boarding
install_php:
image: jakzal/phpqa
stage: install_php
script:
- composer install --ignore-platform-reqs
cache:
paths:
- vendor
policy: push
only:
refs:
- develop
install_frontend:
image: node
stage: install_frontend
script:
- npm install -g bower
- bower install --allow-root
cache:
paths:
- vendor
- public/bower_components
policy: pull-push
only:
refs:
- develop
build:
image: docker:stable
stage: build
script:
- docker login -u fagneray -p $PORTUS_TOKEN portus.lam.fr
- docker pull $CONTAINER_IMAGE:latest || true
- docker build --cache-from $CONTAINER_IMAGE:latest -t $CONTAINER_IMAGE:latest .
- docker push $CONTAINER_IMAGE:latest
cache:
paths:
- vendor
- public/bower_components
policy: pull
only:
refs:
- develop
deploy:
image: alpine
stage: deploy
script:
- apk add --update curl
- curl -XPOST $DEV_WEBHOOK
only:
refs:
- develop
\ No newline at end of file
......@@ -2,8 +2,9 @@ FROM php:7.3-apache
# Install modules
RUN apt-get update \
&& apt-get install -y zlib1g zlib1g-dev libpq-dev libpq5 libzip-dev zip unzip \
&& docker-php-ext-install pgsql pdo_pgsql zip
&& apt-get install -y zlib1g zlib1g-dev libpq-dev libpq5 libzip-dev zip unzip libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd pgsql pdo_pgsql zip bcmath
RUN a2enmod rewrite
......
......@@ -68,14 +68,6 @@ Vous pouvez aussi afficher les logs des conteneurs lancés:
> make logs
## Installation de la base de données
Jdev-boarding à besoin d'une base de données pour fonctionner.
Pour pouvoir générer les tables automatiquement vous pouvez lancer la commane suivante:
> make gendb
## Accès
Vous poucez maintenant vous rendre sur votre navigateur pour afficher le boarding:
......
......@@ -30,19 +30,23 @@ $container[App\Action\ProgrammeAction::class] = function ($c) {
};
$container[App\Action\ContactAction::class] = function ($c) {
return new App\Action\ContactAction($c->get('view'), $c->get('logger'));
return new App\Action\ContactAction($c->get('view'), $c->get('logger'), $c->get('settings'));
};
$container[App\Action\CommunicationAction::class] = function ($c) {
return new App\Action\CommunicationAction($c->get('view'), $c->get('logger'), $c->get('settings'));
};
$container[App\Action\InfoAccesAction::class] = function ($c) {
return new App\Action\InfoAccesAction($c->get('view'), $c->get('logger'));
return new App\Action\InfoAccesAction($c->get('view'), $c->get('logger'), $c->get('settings'));
};
$container[App\Action\InfoHebergementAction::class] = function ($c) {
return new App\Action\InfoHebergementAction($c->get('view'), $c->get('logger'));
return new App\Action\InfoHebergementAction($c->get('view'), $c->get('logger'), $c->get('settings'));
};
$container[App\Action\InfoGeneralesAction::class] = function ($c) {
return new App\Action\InfoGeneralesAction($c->get('view'), $c->get('logger'));
return new App\Action\InfoGeneralesAction($c->get('view'), $c->get('logger'), $c->get('settings'));
};
$container[App\Action\NewPasswdAction::class] = function ($c) {
......
......@@ -19,7 +19,7 @@ $container['view'] = function ($c) {
$view = new Slim\Views\Twig(__DIR__ . '/templates', $settings['view']['twig']);
// Add extensions
$view->addExtension(new Slim\Views\TwigExtension($c->get('router'), $c->get('request')->getUri()));
$view->addExtension(new Twig_Extension_Debug());
$view->addExtension(new Twig\Extension\DebugExtension());
return $view;
};
......
......@@ -25,6 +25,9 @@ $app->get('/programme', App\Action\ProgrammeAction::class)
$app->get('/contact', App\Action\ContactAction::class)
->setName('contact');
$app->get('/communication', App\Action\CommunicationAction::class)
->setName('communication');
$app->get('/info-acces', App\Action\InfoAccesAction::class)
->setName('info_acces');
......
......@@ -37,7 +37,7 @@ return [
'host' => getenv('DB_HOST'), // cesamsidb (@LAM), db (@local)
'user' => getenv('DB_USER'),
'password' => getenv('DB_PASSWORD'),
'dbname' => getenv('DB_DBNAME') // jdevdb (dev), jdev2017 (prod)
'dbname' => getenv('DB_DBNAME') // jdevdb (dev)
]
],
'mailer' => [
......@@ -46,25 +46,35 @@ return [
],
// JDEV settings
'jdev' => [
'label' => 'JDEV2017',
'url' => 'jdev2017.fr',
'email' => 'chrystel.moreau@lam.fr', // jdev2017-inscription@univ-amu.fr (prod)
'email_clo' => 'jdev2017-co@univ-amu.fr',
'email_sponsor' => 'jdev2017-sponsor@univ-amu.fr',
'email_programme' => 'jdev2017-programme@univ-amu.fr',
'email_info' => 'jdev2017@univ-amu.fr',
'date_debut' => '2017-07-04', //'04/07/2017',
'date_fin' => '2017-07-07', //'07/07/2017',
'j1' => '2017-07-04',
'j2' => '2017-07-05',
'j3' => '2017-07-06',
'j4' => '2017-07-07',
// 1 version de base
'label' => 'JDEV2020',
'ville' => 'Rennes',
'DR' => 'DR14',
'url' => 'jdev2020.fr',
'email' => 'jdev2020-inscription@services.cnrs.fr',
'email_clo' => 'jdev2020-clo@services.cnrs.fr',
'email_web' => 'chrystel.moreau@lam.fr,francois.agneray@lam.fr,jdev2020-inscription@services.cnrs.fr',
'email_sponsor' => 'jdev2020-sponsor@services.cnrs.fr',
'email_programme' => 'jdev2020-cp@services.cnrs.fr',
'email_info' => 'jdev2020@services.cnrs.fr',
'mailing_list' => 'https://listes.services.cnrs.fr/sympa/subscribe/jdev2020',
'date_debut' => '2020-07-07',
'date_fin' => '2020-07-10',
'limite' => '2020-05-30',
'inscription_j1' => '2020-02-29',
'inscription_j2' => '2020-04-30',
'inscription_j3' => '2020-06-23',
'inscription_j4' => '2020-07-03',
'j1' => '2020-07-07',
'j2' => '2020-07-08',
'j3' => '2020-07-09',
'j4' => '2020-07-10',
// 0 version de base (sans inscription)
// 1 version avec les inscriptions actives
// 2 version avec le sondage actif
// 3 version avec le parcours actif
// 4 version durant les JDEVs
// 5 apres les JDEVs
'version' => 3
'version' => getenv('BOARDING_VERSION')
]
]
];
......@@ -40,7 +40,8 @@ final class ChangePasswdAction
if ($request->isGet()) {
$this->view->render($response, 'change_passwd.twig', [
'page' => 'change-passwd'
'page' => 'change-passwd',
'jdev' => $this->settings['jdev']
]);
}
......
<?php
/*
* This file is part of JDEV-BOARDING
*
* (c) François Agneray <francois.agneray@lam.fr>
* (c) Chrystel Moreau <chrystel.moreau@lam.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Action;
use Slim\Views\Twig;
use Psr\Log\LoggerInterface;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
final class CommunicationAction
{
private $view;
private $logger;
private $settings;
public function __construct(Twig $view, LoggerInterface $logger, $settings)
{
$this->view = $view;
$this->logger = $logger;
$this->settings = $settings;
}
public function __invoke(Request $request, Response $response, $args)
{
$this->logger->info("Info acces page action dispatched");
$this->view->render($response, 'communication.twig', [
'page' => 'communication',
'jdev' => $this->settings['jdev']
]);
return $response;
}
}
......@@ -39,7 +39,8 @@ final class ConnexionAction
if ($request->isGet()) {
$this->view->render($response, 'connexion.twig', [
'page' => 'connexion'
'page' => 'connexion',
'jdev' => $this->settings['jdev']
]);
}
......
......@@ -20,11 +20,13 @@ final class ContactAction
{
private $view;
private $logger;
private $settings;
public function __construct(Twig $view, LoggerInterface $logger)
public function __construct(Twig $view, LoggerInterface $logger, $settings)
{
$this->view = $view;
$this->logger = $logger;
$this->settings = $settings;
}
public function __invoke(Request $request, Response $response, $args)
......@@ -32,7 +34,8 @@ final class ContactAction
$this->logger->info("contact page action dispatched");
$this->view->render($response, 'contact.twig', [
'page' => 'contact'
'page' => 'contact',
'jdev' => $this->settings['jdev']
]);
return $response;
}
......
......@@ -152,13 +152,6 @@ final class DashboardAdminAgendaFormAction
}
// select distinct salle.id,salle.nom,salle.quota_physique,agenda.date_debut,agenda.date_fin from salle
// left join agenda on salle.id=agenda.id_salle
// where salle.quota_physique >= 30 and
// salle.id not in
// (select salle.id from salle left join agenda on salle.id=agenda.id_salle
// where (agenda.date_debut,agenda.date_fin) overlaps ('2017-07-04 14:00:00','2017-07-04 17:00:00'))
// order by salle.quota_physique
private function getSalles($debut, $fin, $quota)
{
$dql = "SELECT distinct s FROM App\Entity\Salle s LEFT JOIN s.agendas a ";
......
......@@ -133,13 +133,6 @@ final class DashboardAdminAgendaFormAction
}
// select distinct salle.id,salle.nom,salle.quota_physique,agenda.date_debut,agenda.date_fin from salle
// left join agenda on salle.id=agenda.id_salle
// where salle.quota_physique >= 30 and
// salle.id not in
// (select salle.id from salle left join agenda on salle.id=agenda.id_salle
// where (agenda.date_debut,agenda.date_fin) overlaps ('2017-07-04 14:00:00','2017-07-04 17:00:00'))
// order by salle.quota_physique
private function getSalles($debut, $fin, $quota)
{
$dql = "SELECT s FROM App\Entity\Salle s LEFT JOIN s.agendas a ";
......
......@@ -74,15 +74,26 @@ final class DashboardAdminParticipantParcoursFormationAction
'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());
// $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());
$a['pa_pm'][1] = $this->getParcours($this->settings['jdev']['j2'], '12:00:00', '19:00:00', $participant->getId());
$a['pa_am'][2] = $this->getParcours($this->settings['jdev']['j3'], '08:00:00', '13:00:00', $participant->getId());
$a['pa_pm'][2] = $this->getParcours($this->settings['jdev']['j3'], '12:00:00', '19:00:00', $participant->getId());
$a['pa_am'][3] = $this->getParcours($this->settings['jdev']['j4'], '08:00:00', '13:00:00', $participant->getId());
$a['pa_pm'][3] = $this->getParcours($this->settings['jdev']['j4'], '12:00:00', '19:00:00', $participant->getId());
$this->view->render($response, 'dashboard_participant_parcours.twig', $a);
return $response;
}
......
......@@ -115,12 +115,13 @@ final class DashboardParticipantParcoursAction
$dql = "SELECT a as agenda, ";
$dql .= "(select count(pa) from App\Entity\ParticipantAgenda pa where pa.agenda=a.id) as nb_inscrits, ";
$dql .= "(select count(p2) from App\Entity\ParticipantAgenda p2 where p2.agenda=a.id and p2.participant=$id) as check, ";
$dql .= "(select count(p3) from App\Entity\ParticipantAgenda p3 LEFT JOIN p3.agenda ag where p3.participant=$id and ag.dateDebut between '$date_debut' and '$date_fin' and ag.dateFin between '$date_debut' and '$date_fin' as inscrit ";
$dql .= "(select count(p3) from App\Entity\ParticipantAgenda p3 LEFT JOIN p3.agenda ag where p3.participant=$id and ag.dateDebut between '$date_debut' and '$date_fin' and ag.dateFin between '$date_debut' and '$date_fin') as inscrit ";
$dql .= "FROM App\Entity\Agenda a ";
$dql .= "WHERE a.dateDebut between '$date_debut' and '$date_fin' and a.dateFin between '$date_debut' and '$date_fin' ORDER BY a.display, a.dateDebut ASC";
$query = $this->em->createQuery($dql);
return $query->getResult();
}
public function getParcours($jour, $debut, $fin, $id)
{
......
......@@ -85,15 +85,23 @@ 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());
// $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());
$a['pa_pm'][1] = $this->getParcours($this->settings['jdev']['j2'], '12:00:00', '19:00:00', $participant->getId());
$a['pa_am'][2] = $this->getParcours($this->settings['jdev']['j3'], '08:00:00', '13:00:00', $participant->getId());
$a['pa_pm'][2] = $this->getParcours($this->settings['jdev']['j3'], '12:00:00', '19:00:00', $participant->getId());
$a['pa_am'][3] = $this->getParcours($this->settings['jdev']['j4'], '08:00:00', '13:00:00', $participant->getId());
$a['pa_pm'][3] = $this->getParcours($this->settings['jdev']['j4'], '12:00:00', '19:00:00', $participant->getId());
$this->view->render($response, 'dashboard_participant_parcours.twig', $a);
return $response;
}
......
......@@ -23,11 +23,12 @@ final class DashboardSondageAction
private $logger;
private $em;
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)
......@@ -42,17 +43,18 @@ final class DashboardSondageAction
$a = [
'page' => 'dashboard-sondage',
'token' => $token,
'participant' => $participant
'participant' => $participant,
'jdev' => $this->settings['jdev']
];
if (array_key_exists('jour', $params)) {
$j = explode("-", $params['jour']);
if ($params['debut'] == '08:00:00') {
$a['jour'] = $j[2] . ' Juillet 2017 - Matin';
$a['jour'] = $j[2] . ' Juillet 2020 - Matin';
}
if ($params['debut'] == '13:00:00') {
$a['jour'] = $j[2] . ' Juillet 2017 - Après-midi';
$a['jour'] = $j[2] . ' Juillet 2020 - Après-midi';
}
$agendas = $this->getAgendas($params['jour'], $params['debut'], $params['fin'], $participant->getId());
......
......@@ -20,11 +20,13 @@ final class InfoAccesAction
{
private $view;
private $logger;
private $settings;
public function __construct(Twig $view, LoggerInterface $logger)
public function __construct(Twig $view, LoggerInterface $logger, $settings)
{
$this->view = $view;
$this->logger = $logger;
$this->settings = $settings;
}
public function __invoke(Request $request, Response $response, $args)
......@@ -32,7 +34,8 @@ final class InfoAccesAction
$this->logger->info("Info acces page action dispatched");
$this->view->render($response, 'info_acces.twig', [
'page' => 'info_acces'
'page' => 'info_acces',
'jdev' => $this->settings['jdev']
]);
return $response;
}
......
......@@ -20,11 +20,13 @@ final class InfoGeneralesAction
{
private $view;
private $logger;
private $settings;
public function __construct(Twig $view, LoggerInterface $logger)
public function __construct(Twig $view, LoggerInterface $logger, $settings)
{
$this->view = $view;
$this->logger = $logger;
$this->settings = $settings;
}
public function __invoke(Request $request, Response $response, $args)
......@@ -32,7 +34,8 @@ final class InfoGeneralesAction
$this->logger->info("Info generales page action dispatched");
$this->view->render($response, 'info_generales.twig', [
'page' => 'info_generales'
'page' => 'info_generales',
'jdev' => $this->settings['jdev']
]);
return $response;
}
......
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