From be3cfa28142f9fc8a88860182efed887879a72d1 Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 23 Jun 2020 12:21:45 +0200 Subject: [PATCH] correction mineure --- .../EventListener/sessionListener.php | 11 +++---- .../Controller/PageController.php | 32 ++++++++++--------- .../views/Pagewidget/viewchat.html.twig | 6 ++-- .../Controller/ChatController.php | 7 ++++ .../Resources/views/Chat/client.html.twig | 23 +++++++++++-- 5 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php index eafe98ca..55288b62 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php @@ -54,11 +54,6 @@ $session->set($config->getId(), strval($config->getValue())); } - - // Calcul des couleurs - $color = $this->container->get('cadoles.core.service.color'); - $color->setColor(); - // Utilisateur en cours $curentuserid=0; $token = $this->token_storage->getToken(); @@ -303,9 +298,13 @@ } - } + // Calcul des couleurs + $color = $this->container->get('cadoles.core.service.color'); + $color->setColor(); + + // Visite if($curentuser!="anon.") { $now=new \DateTime(); if(!$curentuser->getVisitedate()) { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php index f59166b9..7ebc3683 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php @@ -517,21 +517,23 @@ class PageController extends Controller // Compteur de visite if($this->getUser()) { - $group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid); - if($group && $group->getFgcanshare()) { - $usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["group"=>$group,"user"=>$this->getUser()]); - if($usergroup) { - $visitedate=$usergroup->getVisitedate(); - if($visitedate) $visitedate->add(new \DateInterval("PT1H")); - $now=new \DateTime(); - if($visitedate<$now) { - $usergroup->setVisitedate($now); - $usergroup->setVisitecpt($usergroup->getVisitecpt()+1); - $em->persist($usergroup); - $em->flush(); - } - } - } + if($groupid) { + $group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid); + if($group && $group->getFgcanshare()) { + $usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["group"=>$group,"user"=>$this->getUser()]); + if($usergroup) { + $visitedate=$usergroup->getVisitedate(); + if($visitedate) $visitedate->add(new \DateInterval("PT1H")); + $now=new \DateTime(); + if($visitedate<$now) { + $usergroup->setVisitedate($now); + $usergroup->setVisitecpt($usergroup->getVisitecpt()+1); + $em->persist($usergroup); + $em->flush(); + } + } + } + } } // Type Calendrier diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig index 94e0b66f..bc298d56 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig @@ -22,6 +22,8 @@ {% if colorbodyfont is null %} {% set colorbodyfont = color['fontcolorhover'] %} {% endif %} +{% set colorbody = color['colorbody'] %} +{% set colormain = color['main'] %} {% if app.user %} @@ -37,7 +39,7 @@ {% if onheader %}
- +
{% else %}
@@ -51,7 +53,7 @@
{% if group is not null %} - {{ render(url('cadoles_websocket_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont})) }} + {{ render(url('cadoles_websocket_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont,'colorbody':colorbody,'colormain':colormain})) }} {% endif %}