desactivation possible des notifications de groupe de travail

This commit is contained in:
2021-05-04 11:03:11 +02:00
parent 72c5e49cf6
commit 20c131db2e
5 changed files with 13 additions and 9 deletions

View File

@ -588,7 +588,7 @@ class GroupController extends Controller
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$userid,$groupid,$message);
// Notification mail auprès de la personne inscrite
if($group->getFgcanshare()) {
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
$idpage =$group->getPages()->first()->getId();
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
$texthtml="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = <a href='$url'>$url</a>";
@ -642,7 +642,7 @@ class GroupController extends Controller
$em->flush();
// Notification mail auprès des managers
if($group->getFgcanshare()) {
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
$text=$user->getUsername()." a été désinscrit du groupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
@ -688,7 +688,7 @@ class GroupController extends Controller
$em->flush();
// Notification mail auprès des managers
if($group->getFgcanshare()) {
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
$text=$user->getUsername()." a été désinscrit du groupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
@ -888,7 +888,7 @@ class GroupController extends Controller
$this->ctrlFgcanshare($data,$access);
// Si le propriétaire change de main on prévient le nouveau propriétaire
if($data->getOwner()&&$data->getOwner()!=$oldowner) {
if($data->getOwner()&&$data->getOwner()!=$oldowner&&$this->get('session')->get('fgnotifgroup')) {
// Email à destination de l'inscript pour le prévenir qu'un administrateur doit valider
$text="On vient de vous tranférer la propriété du groupe ".$data->getLabel();
$template="template";

View File

@ -429,7 +429,7 @@ class UserController extends Controller
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$iduser,$idgroup,$message);
// Notification mail auprès de la personne inscrite
if($group->getFgcanshare()) {
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
$idpage =$group->getPages()->first()->getId();
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
$texthtml="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = <a href='$url'>$url</a>";
@ -489,6 +489,7 @@ class UserController extends Controller
$oldpassword=$data->getPassword();
$fields=$this->getDefaultDatauser();
// Si un acces modo via console d'admin on s'assure qu'il a les droit dessus sinon retour à la liste
if($this->isGranted('ROLE_MODO')&&$access=="config") {
$niveau01=$data->getNiveau01();
@ -580,7 +581,7 @@ class UserController extends Controller
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$id,$idgroup,$message);
// Notification mail auprès de la personne inscrite
if($group->getFgcanshare()) {
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
$idpage =$group->getPages()->first()->getId();
$url = $this->generateUrl('cadoles_core_redirect', ["route"=>"cadoles_core_home","id"=>$idpage], UrlGeneratorInterface::ABSOLUTE_URL);
$texthtml="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel()."<br>Suivez le lien suivant pour y accéder = <a href='$url'>$url</a>";
@ -623,7 +624,7 @@ class UserController extends Controller
$em->flush();
// Notification mail auprès des managers
if($group->getFgcanshare()) {
if($group->getFgcanshare()&&$this->get('session')->get('fgnotifgroup')) {
$text=$data->getUsername()." a été désinscrit du groupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(

View File

@ -46,8 +46,6 @@
public function onDomainParse(Event $event) {
$session = new Session();
$configs = $this->em->getRepository("CadolesCoreBundle:Config")->findAll();
foreach($configs as $config) {
//dump($config->getId()." = ".strval($config->getValue()));

View File

@ -34,6 +34,10 @@ class CountMessageCommand extends Command
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
$this->noreply = $this->container->getParameter('noreply');
// S'assurer que la fonction de notification de mail est bien actif
$config = $this->em->getRepository("CadolesCoreBundle:Config")->find("fgnotifgroup");
if($config && !$config->getValue()) return 1;
$this->writelnred('');
$this->writelnred('== Websocket:Countmessage');