From 57df7bddbedff2172b9e0cf40269377f55ace7ab Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 20 Apr 2020 09:09:21 +0200 Subject: [PATCH 1/2] =?UTF-8?q?retour=20sur=20page=20apr=C3=A8s=20creation?= =?UTF-8?q?=20de=20groupe=20(ref=20#126)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Cadoles/CoreBundle/Command/data/core-init-01.sql | 2 +- .../src/Cadoles/CoreBundle/Controller/GroupController.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 7b065970..11341265 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES (-100, 'DRAAF', '130007107'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}lfWLOzsWTTGkrbaPndkzPSiFKH078TmD +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}9tH17tlC86xamslwYLnhF4qiMaQqvbuL ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php index b9a15619..2176e20e 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -31,6 +31,7 @@ class GroupController extends Controller private $labelentity = 'CadolesCoreBundle:Group'; private $labeldata = 'group'; private $labeldatas = 'groups'; + private $idpage; public function listAction($access) { @@ -756,7 +757,7 @@ class GroupController extends Controller $this->ctrlFgcanshare($data,$access); // Retour à la liste - return $this->redirectToRoute("cadoles_core_".$access."_group_users",["id"=>$data->getId()]); + return $this->redirectToRoute("cadoles_core_".$access."_group_users",["id"=>$data->getId(),"idreturn"=>$this->idpage]); } // Affichage du formulaire @@ -1097,8 +1098,11 @@ class GroupController extends Controller $em->persist($page); $em->persist($group); - $em->flush(); + $em->flush(); + } + $pages=$group->getPages(); + $this->idpage=$pages[0]->getId(); // On regarde s'il a au moins un calendrier if($group->getCalendars()->isEmpty()) { From e662463969f1851f98a86ab71ec2c7b9d83d0250 Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 20 Apr 2020 09:34:06 +0200 Subject: [PATCH 2/2] url sur notif message via redirect (ref #19) --- .../Controller/BlogarticleController.php | 9 +++++---- .../Controller/BlogcommentController.php | 9 +++++---- .../Controller/ProjectcommentController.php | 10 ++++++---- .../Controller/ProjecttaskController.php | 18 +++++++++--------- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php index abc36c7d..af464a4a 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php @@ -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
".$entity->getName().""; + $url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL); + $message="Création article
".$entity->getName().""; $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
".$entity->getName().""; + $url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL); + $message="Modification article
".$entity->getName().""; $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]); if($usergroup) { $key=$usergroup->getKeyvalue(); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogcommentController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogcommentController.php index 6e57146f..f0e044a3 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogcommentController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogcommentController.php @@ -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
".$entity->getName().""; + $url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getBlogarticle()->getId()], UrlGeneratorInterface::ABSOLUTE_URL); + $message="Création commentaire article
".$entity->getName().""; $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
".$entity->getBlogarticle()->getName().""; + $url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_blogarticle_view','id'=>$entity->getBlogarticle()->getId()], UrlGeneratorInterface::ABSOLUTE_URL); + $message="Modification commentaire article
".$entity->getBlogarticle()->getName().""; $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]); if($usergroup) { $key=$usergroup->getKeyvalue(); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectcommentController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectcommentController.php index ee636b5d..529f335d 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectcommentController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectcommentController.php @@ -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
".$entity->getName().""; + $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
".$entity->getName().""; $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
".$entity->getProjecttask()->getName().""; + $url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_projecttask_view','id'=>$entity->getProjecttask()->getId()], UrlGeneratorInterface::ABSOLUTE_URL); + $message="Modification commentaire tâche
".$entity->getProjecttask()->getName().""; $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]); if($usergroup) { $key=$usergroup->getKeyvalue(); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php index 7a3c25a3..d966ae55 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php @@ -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
".$entity->getName().""; + $url=$this->generateUrl('cadoles_core_redirect', ['route'=>'cadoles_portal_user_projecttask_view','id'=>$entity->getId()], UrlGeneratorInterface::ABSOLUTE_URL); + $message="Création tâche
".$entity->getName().""; $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
".$entity->getName().""; + $message="Tâche terminée
".$entity->getName().""; elseif($oldpercentage==100&$entity->getPercentage()<100) - $message="Tâche réouverte
".$entity->getName().""; + $message="Tâche réouverte
".$entity->getName().""; else - $message="Modification tâche
".$entity->getName().""; + $message="Modification tâche
".$entity->getName().""; $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
".$entity->getName().""; + $message="Tâche terminée
".$entity->getName().""; elseif($oldpercentage==100&$entity->getPercentage()<100) - $message="Tâche réouverte
".$entity->getName().""; + $message="Tâche réouverte
".$entity->getName().""; if($message!="") { $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);