correction

This commit is contained in:
afornerot 2019-12-06 10:55:14 +01:00
parent a095f6504b
commit 92ce9cbaaa
4 changed files with 35 additions and 14 deletions

View File

@ -138,12 +138,15 @@ class uploadListener
if($fgexit) $message="Modification fichier<br>".$filename;
else $message="Création fichier<br>".$filename;
$key=$this->em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->token->getToken()->getUser()])->getKeyvalue();
$usergroup=$this->em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->token->getToken()->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->token->getToken()->getUser()->getId(),$group->getId(),$message);
}
}
}
}
}
$response = $event->getResponse();
$response['file'] = $filename;

View File

@ -59,10 +59,13 @@ class BlogarticleController extends Controller
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]);
$message="Création article<br><a href='$url'>".$entity->getName()."</a>";
$key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
}
}
}
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]));
}
@ -104,10 +107,13 @@ class BlogarticleController extends Controller
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]);
$message="Modification article<br><a href='$url'>".$entity->getName()."</a>";
$key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
}
}
}
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]));
}

View File

@ -67,11 +67,14 @@ class BookmarkController extends Controller
foreach($pagewidget->getPage()->getGroups() as $groupchat) {
if($groupchat->getFgcanshare()) {
$message="Création favoris<br><a href='".$data->getUrl()."' target='_blank'>".$data->getTitle()."</a>";
$key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()])->getKeyvalue();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groupchat->getId(),$message);
}
}
}
}
// Retour à la page
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage,"usage"=>$usage,"group"=>$group]));
@ -155,11 +158,14 @@ class BookmarkController extends Controller
foreach($pagewidget->getPage()->getGroups() as $groupchat) {
if($groupchat->getFgcanshare()) {
$message="Modification favoris<br><a href='".$data->getUrl()."' target='_blank'>".$data->getTitle()."</a>";
$key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()])->getKeyvalue();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groupchat->getId(),$message);
}
}
}
}
// Retour à la page
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage,"usage"=>$usage,"group"=>$group]));

View File

@ -128,10 +128,13 @@ class CalendareventController extends Controller
foreach($calendarevent->getCalendar()->getGroups() as $group) {
if($group->getFgcanshare()) {
$message="Création évènement<br>".$calendarevent->getName()."<br>du ".$start->format("d/m/Y H:i")." au ".$end->sub(new \DateInterval('PT1M'))->format("d/m/Y H:i");
$key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
}
}
}
$output["id"]=$calendarevent->getId();
$output["color"]="#".(is_null($calendar->getColor())?$this->get('session')->get('color')["main"]:$calendar->getColor());
@ -181,10 +184,13 @@ class CalendareventController extends Controller
foreach($calendarevent->getCalendar()->getGroups() as $group) {
if($group->getFgcanshare()) {
$message="Modification évènement<br>".$calendarevent->getName()."<br>du ".$start->format("d/m/Y H:i")." au ".$end->sub(new \DateInterval('PT1M'))->format("d/m/Y H:i");
$key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
}
}
}
$output["id"]=$calendarevent->getId();
$output["color"]="#".(is_null($calendar->getColor())?$this->get('session')->get('color')["main"]:$calendar->getColor());