url sur notif message via redirect (ref #19)

This commit is contained in:
afornerot 2020-04-20 09:34:06 +02:00
parent 57df7bddbe
commit e662463969
4 changed files with 25 additions and 21 deletions

View File

@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Cadoles\PortalBundle\Entity\Blogarticle;
use Cadoles\PortalBundle\Form\BlogarticleType;
@ -57,8 +58,8 @@ class BlogarticleController extends Controller
foreach($entity->getBlog()->getGroups() as $group) {
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>";
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="Création article<br><a href='$url' target='_top'>".$entity->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
@ -105,8 +106,8 @@ class BlogarticleController extends Controller
foreach($entity->getBlog()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]);
$message="Modification article<br><a href='$url'>".$entity->getName()."</a>";
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="Modification article<br><a href='$url' target='_top'>".$entity->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();

View File

@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Cadoles\PortalBundle\Entity\Blogcomment;
use Cadoles\PortalBundle\Form\BlogcommentType;
@ -57,8 +58,8 @@ class BlogcommentController extends Controller
foreach($entity->getBlogarticle()->getBlog()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getBlogarticle()->getId()]);
$message="Création commentaire article<br><a href='$url'>".$entity->getName()."</a>";
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getBlogarticle()->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="Création commentaire article<br><a href='$url' target='_top'>".$entity->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
@ -105,8 +106,8 @@ class BlogcommentController extends Controller
foreach($entity->getBlogarticle()->getBlog()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getBlogarticle()->getId()]);
$message="Modification commentaire article<br><a href='$url'>".$entity->getBlogarticle()->getName()."</a>";
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getBlogarticle()->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="Modification commentaire article<br><a href='$url' target='_top'>".$entity->getBlogarticle()->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();

View File

@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Cadoles\PortalBundle\Entity\Projectcomment;
use Cadoles\PortalBundle\Form\ProjectcommentType;
@ -57,8 +58,9 @@ class ProjectcommentController extends Controller
foreach($entity->getProjecttask()->getProject()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_projecttask_view',["id"=>$entity->getProjecttask()->getId()]);
$message="Création commentaire tâche<br><a href='$url'>".$entity->getName()."</a>";
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_projecttask_view','id'=>$entity->getProjecttask()->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="Création commentaire tâche<br><a href='$url' target='_top'>".$entity->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
@ -105,8 +107,8 @@ class ProjectcommentController extends Controller
foreach($entity->getProjecttask()->getProject()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_projecttask_view',["id"=>$entity->getProjecttask()->getId()]);
$message="Modification commentaire tâche<br><a href='$url'>".$entity->getProjecttask()->getName()."</a>";
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_projecttask_view','id'=>$entity->getProjecttask()->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="Modification commentaire tâche<br><a href='$url' target='_top'>".$entity->getProjecttask()->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();

View File

@ -66,8 +66,8 @@ class ProjecttaskController extends Controller
foreach($entity->getProject()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_projecttask_view',["id"=>$entity->getId()]);
$message="Création tâche<br><a href='$url'>".$entity->getName()."</a>";
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_projecttask_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="Création tâche<br><a href='$url' target='_top'>".$entity->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
@ -124,13 +124,13 @@ class ProjecttaskController extends Controller
foreach($entity->getProject()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_projecttask_view',["id"=>$entity->getId()]);
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_projecttask_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
if($oldpercentage<100&$entity->getPercentage()==100)
$message="Tâche terminée<br><a href='$url'>".$entity->getName()."</a>";
$message="Tâche terminée<br><a href='$url' target='_top'>".$entity->getName()."</a>";
elseif($oldpercentage==100&$entity->getPercentage()<100)
$message="Tâche réouverte<br><a href='$url'>".$entity->getName()."</a>";
$message="Tâche réouverte<br><a href='$url' target='_top'>".$entity->getName()."</a>";
else
$message="Modification tâche<br><a href='$url'>".$entity->getName()."</a>";
$message="Modification tâche<br><a href='$url' target='_top'>".$entity->getName()."</a>";
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
@ -389,12 +389,12 @@ class ProjecttaskController extends Controller
foreach($entity->getProject()->getGroups() as $group) {
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_projecttask_view',["id"=>$entity->getId()]);
$url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_projecttask_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL);
$message="";
if($oldpercentage<100&$entity->getPercentage()==100)
$message="Tâche terminée<br><a href='$url'>".$entity->getName()."</a>";
$message="Tâche terminée<br><a href='$url' target='_top'>".$entity->getName()."</a>";
elseif($oldpercentage==100&$entity->getPercentage()<100)
$message="Tâche réouverte<br><a href='$url'>".$entity->getName()."</a>";
$message="Tâche réouverte<br><a href='$url' target='_top'>".$entity->getName()."</a>";
if($message!="") {
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);