From 5d133c16f1cc355bce1aba95ec1cd7de6cd7c9dc Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 7 May 2019 13:49:42 +0200 Subject: [PATCH] svg --- src/ninegate-1.0/app/config/security.yml | 4 + src/ninegate-1.0/app/config/twig.yml | 3 + .../CoreBundle/Command/InitDataCommand.php | 3 + .../CoreBundle/Command/SynchroCommand.php | 3 + .../CoreBundle/Command/data/core-init-01.sql | 1 + .../CoreBundle/Controller/AjaxController.php | 29 ++++++ .../CoreBundle/Controller/CoreController.php | 2 +- .../CoreBundle/Controller/GroupController.php | 70 ++++++++++++-- .../Controller/SecurityController.php | 67 +++++++++---- .../src/Cadoles/CoreBundle/Entity/Group.php | 95 ++++++++++++++++++- .../EventListener/sessionListener.php | 16 ++++ .../src/Cadoles/CoreBundle/Form/GroupType.php | 50 ++++++++-- .../CoreBundle/Resources/config/routing.yml | 4 + .../Resources/views/Group/edit.html.twig | 77 ++++++++++----- .../Resources/views/Group/list.html.twig | 7 +- .../views/Security/loginldap.html.twig | 2 +- .../Controller/BlogController.php | 7 +- .../Controller/CalendarController.php | 6 +- .../Controller/PageController.php | 3 + .../Cadoles/PortalBundle/Form/AlertType.php | 24 +++-- .../PortalBundle/Form/AlertcategoryType.php | 11 +-- .../Cadoles/PortalBundle/Form/BlogType.php | 24 +++-- .../PortalBundle/Form/BookmarkType.php | 8 +- .../PortalBundle/Form/CalendarType.php | 24 +++-- .../Cadoles/PortalBundle/Form/FluxType.php | 24 +++-- .../Cadoles/PortalBundle/Form/ItemType.php | 34 ++++--- .../Cadoles/PortalBundle/Form/NoticeType.php | 24 +++-- .../Form/PageUpdateEditorType.php | 23 +++-- .../PortalBundle/Form/PageUpdateToolType.php | 23 +++-- .../PortalBundle/Form/PageUpdateURLType.php | 23 +++-- .../Form/PageUpdateWidgetType.php | 23 +++-- .../Resources/views/Alert/list.html.twig | 4 +- .../Resources/views/Blog/edit.html.twig | 7 +- .../Resources/views/Calendar/edit.html.twig | 6 +- .../Resources/views/Calendar/view.html.twig | 9 +- .../Resources/views/Item/edit.html.twig | 2 +- .../Resources/views/Item/list.html.twig | 2 +- .../views/Pagewidget/viewbookmark.html.twig | 2 +- .../views/Pagewidget/viewitem.html.twig | 4 +- src/ninegate-1.0/todo.txt | 20 ++-- tmpl/ninegate-init-01.sql | 1 + 41 files changed, 595 insertions(+), 176 deletions(-) diff --git a/src/ninegate-1.0/app/config/security.yml b/src/ninegate-1.0/app/config/security.yml index f42fe80c..17dffd66 100644 --- a/src/ninegate-1.0/app/config/security.yml +++ b/src/ninegate-1.0/app/config/security.yml @@ -51,5 +51,9 @@ security: - { path: ^/config/item, roles: [ROLE_ADMIN, ROLE_MODO] } - { path: ^/config/alert, roles: [ROLE_ADMIN, ROLE_MODO] } - { path: ^/config/page, roles: [ROLE_ADMIN, ROLE_MODO] } + - { path: ^/config/calendar, roles: [ROLE_ADMIN, ROLE_MODO] } + - { path: ^/config/notice, roles: [ROLE_ADMIN, ROLE_MODO] } + - { path: ^/config/blog, roles: [ROLE_ADMIN, ROLE_MODO] } + - { path: ^/config/flux, roles: [ROLE_ADMIN, ROLE_MODO] } - { path: ^/config, roles: [ROLE_ADMIN] } diff --git a/src/ninegate-1.0/app/config/twig.yml b/src/ninegate-1.0/app/config/twig.yml index c0ec1a4f..defc52de 100644 --- a/src/ninegate-1.0/app/config/twig.yml +++ b/src/ninegate-1.0/app/config/twig.yml @@ -6,6 +6,9 @@ twig: masteridentity: %masteridentity% mode_auth: %mode_auth% + cron_activate: %cron_activate% + portal_activate: %portal_activate% + eportail_sync: %eportail_sync% moderegistration: %moderegistration% labelniveau01: %labelniveau01% diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php index 96018f7c..15454705 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php @@ -93,6 +93,9 @@ class InitDataCommand extends ContainerAwareCommand $group->setFgall(true); $group->setFgtemplate(false); $group->setFgcanshare(false); + $group->setFgcancreatepage(true); + $group->setFgcancreateblog(true); + $group->setFgcancreatecalendar(true); $em->persist($group); $em->flush(); } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php index 44db153c..3b8e680b 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -637,6 +637,9 @@ class SynchroCommand extends Command if(!$group) { $group=new Group(); $group->setFgcanshare($fgcanshare); + $group->setFgcancreatepage(true); + $group->setFgcancreateblog(true); + $group->setFgcancreatecalendar(true); } $group->setLabel($label); 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 850ded2f..5ef639d3 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 @@ -49,6 +49,7 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type ('004', 1, 1, 1, 'logo', 'logo', 'uploads/logo/logo.png', '', 'Le logo de votre site'), ('005', 0, 1, 0, 'theme', 'theme', '', '', 'Le theme de votre site'), +('010', 1, 1, 1, 'boolean', 'fgforceconnect', '0', '', 'Forcer la connection afin de rendre votre site privé'), ('040', 1, 1, 1, 'boolean', 'fgheader', '1', '', 'Utiliser une image en bannière du site'), ('041', 1, 1, 1, 'header', 'header', 'uploads/header/header.png', 'fgheader', 'Image en bannière du site'), diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/AjaxController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/AjaxController.php index 02f5b91b..a0c2c7e5 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/AjaxController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/AjaxController.php @@ -123,6 +123,35 @@ class AjaxController extends Controller } + public function grouplistAction(Request $request) + { + // S'assurer que c'est un appel ajax + if (!$request->isXmlHttpRequest()) { + return new JsonResponse(array('message' => 'Interdit'), 400); + } + + $output=array(); + $em = $this->getDoctrine()->getManager(); + $page_limit=$request->query->get('page_limit'); + $q=$request->query->get('q'); + + $qb = $em->createQueryBuilder(); + $qb->select('table')->from("CadolesCoreBundle:Group",'table') + ->where('table.label LIKE :value') + ->setParameter("value", "%".$q."%") + ->orderBy('table.label'); + + $datas=$qb->setFirstResult(0)->setMaxResults($page_limit)->getQuery()->getResult(); + foreach($datas as $data) { + array_push($output,array("id"=>$data->getId(),"text"=>$data->getLabel())); + } + + $response = new Response(json_encode($output)); + $response->headers->set('Content-Type', 'application/json'); + return $response; + + } + public function groupreadAction(Request $request) { // S'assurer que c'est un appel ajax diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php index 28067263..543ec9da 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php @@ -67,7 +67,7 @@ class CoreController extends Controller 'pagesadmin' => $pagesadmin, 'pagesuser' => $pagesuser, 'pagesshared' => $pagesshared, - 'canadd' => ($user), + 'canadd' => $this->get('session')->get('cancreatepage'), 'widgets' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->findAll() ]); } 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 34b216b3..7aebc9ba 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -37,6 +37,8 @@ class GroupController extends Controller return new JsonResponse(array('message' => 'Interdit'), 400); } + $portal_activate=$this->getParameter("portal_activate"); + $em = $this->getDoctrine()->getManager(); $start=$request->query->get('start'); @@ -83,17 +85,37 @@ class GroupController extends Controller case 2 : $qb->orderBy('table.fgopen',$order[0]["dir"]); break; - case 3 : + case 4 : $qb->orderBy('table.fgcanshare',$order[0]["dir"]); - break; + break; + case 5 : + $qb->orderBy('table.fgcancreatepage',$order[0]["dir"]); + break; + case 6 : + $qb->orderBy('table.fgcancreatecalendar',$order[0]["dir"]); + break; + case 7 : + $qb->orderBy('table.fgcancreateblog',$order[0]["dir"]); + break; } $datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult(); foreach($datas as $data) { $action = ""; - - $action .="$data->getId()))."'>"; + + // Modification possible si groupe non template et non tout le monde + if(!$data->getFgTemplate() && !$data->getFgall()) + $action .="$data->getId()))."'>"; + + // Modification possible si groupe template mais avec module portail activé + elseif($data->getFgTemplate()&&$portal_activate) + $action .="$data->getId()))."'>"; + + // Modification possible si groupe tout le monde mais avec module portail activé + elseif($data->getFgall()&&$portal_activate) + $action .="$data->getId()))."'>"; + if($data->getId()>0&&!$data->getFgall()&&!$data->getFgTemplate()&&$this->isGranted('ROLE_ADMIN')) $action.="$data->getId()))."'>"; if(!$data->getFgall()) $action .="$data->getId()))."'>"; @@ -101,7 +123,17 @@ class GroupController extends Controller if($this->GetParameter("masteridentity")=="LDAP") $filtre=$data->getLdapfilter(); if($this->GetParameter("masteridentity")=="SSO") $filtre=$data->getAttributes(); - array_push($output["data"],array($action,$data->getLabel(),($data->getFgopen()?"oui":"non"),($data->getFgcanshare()?"oui":"non"),$filtre)); + array_push($output["data"],array( + $action, + $data->getLabel(), + ($data->getFgopen()?"oui":"non"), + $filtre, + ($data->getFgcanshare()?"oui":"non"), + ($data->getFgcancreatepage()?"oui":"non"), + ($data->getFgcancreatecalendar()?"oui":"non"), + ($data->getFgcancreateblog()?"oui":"non"), + ) + ); } // Retour @@ -422,9 +454,19 @@ class GroupController extends Controller // Initialisation de l'enregistrement $data = new Group(); $data->setFgopen(false); + $data->setFgcanshare(true); + $data->setFgcancreatepage(true); + $data->setFgcancreatecalendar(true); + $data->setFgcancreateblog(true); // Création du formulaire - $form = $this->createForm(GroupType::class,$data,array("mode"=>"submit","updatelimite"=>false,"masteridentity"=> $this->GetParameter("masteridentity"))); + $form = $this->createForm(GroupType::class,$data,array( + "mode"=>"submit", + "updatelimite"=>false, + "masteridentity"=> $this->GetParameter("masteridentity"), + "portal_activate"=>$this->getParameter("portal_activate") + ) + ); // Récupération des data du formulaire $form->handleRequest($request); @@ -468,7 +510,13 @@ class GroupController extends Controller // Création du formulaire - $form = $this->createForm(GroupType::class,$data,array("mode"=>"update","updatelimite"=>($data->getFgAll()||$data->getFgTemplate()),"masteridentity"=> $this->GetParameter("masteridentity"))); + $form = $this->createForm(GroupType::class,$data,array( + "mode"=>"update", + "updatelimite"=>($data->getFgAll()||$data->getFgTemplate()), + "masteridentity"=> $this->GetParameter("masteridentity"), + "portal_activate"=>$this->getParameter("portal_activate") + ) + ); // Récupération des data du formulaire $form->handleRequest($request); @@ -521,7 +569,13 @@ class GroupController extends Controller throw $this->createNotFoundException('Permission denied'); // Création du formulaire - $form = $this->createForm(GroupType::class,$data,array("mode"=>"delete","masteridentity"=> $this->GetParameter("masteridentity"))); + $form = $this->createForm(GroupType::class,$data,array( + "mode"=>"delete", + "updatelimite"=>($data->getFgAll()||$data->getFgTemplate()), + "masteridentity"=> $this->GetParameter("masteridentity"), + "portal_activate"=>$this->getParameter("portal_activate") + ) + ); // Récupération des data du formulaire $form->handleRequest($request); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/SecurityController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/SecurityController.php index 1755a074..f9ff517c 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/SecurityController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/SecurityController.php @@ -72,14 +72,14 @@ class SecurityController extends Controller $fglogin = false; if($ldapConn){ // Connexion au serveur LDAP superuser - $ldapbind = ldap_bind($ldapConn, $ldap_user, $ldap_password); + @$ldapbind = ldap_bind($ldapConn, $ldap_user, $ldap_password); if($ldapbind) { $result = ldap_search($ldapConn, $ldap_basedn, "uid=".$data["_username"]); if($result) { $first = ldap_first_entry($ldapConn, $result); $dn = ldap_get_dn($ldapConn, $first); - $ldapbind = ldap_bind($ldapConn, $dn, $data["_password"]); + @$ldapbind = ldap_bind($ldapConn, $dn, $data["_password"]); if($ldapbind) { $fglogin = true; } @@ -140,29 +140,54 @@ class SecurityController extends Controller public function checkuserAction(Request $request) { - // Mode d'authentification + $userapp = $this->getUser(); + $fgforceconnect = $this->get('session')->get('fgforceconnect'); $modeauth=$this->getParameter('mode_auth'); - switch($modeauth) { - case "CAS": - // Init Client CAS - \phpCAS::setDebug(false); - \phpCAS::client(CAS_VERSION_2_0, $this->container->getParameter('cas_host'), $this->container->getParameter('cas_port'), is_null($this->container->getParameter('cas_path')) ? '' : $this->container->getParameter('cas_path'), false); - \phpCAS::setNoCasServerValidation(); + + if(is_null($userapp) && $fgforceconnect) { + switch($modeauth) { + case "SAML": + return new Response(""); + break; + + case "CAS": + return new Response(""); + break; - if(\phpCAS::checkAuthentication()) { - $usercas = \phpCAS::getUser(); - $userapp = $this->getUser(); + case "SQL": + return new Response(""); + break; + + case "LDAP": + return new Response(""); + break; + } + } + else + { + // Mode d'authentification + switch($modeauth) { + case "CAS": + // Init Client CAS + \phpCAS::setDebug(false); + \phpCAS::client(CAS_VERSION_2_0, $this->container->getParameter('cas_host'), $this->container->getParameter('cas_port'), is_null($this->container->getParameter('cas_path')) ? '' : $this->container->getParameter('cas_path'), false); + \phpCAS::setNoCasServerValidation(); + + if(\phpCAS::checkAuthentication()) { + $usercas = \phpCAS::getUser(); + - // si on a un usercas mais pas de userapp c'est qu'il faut s'autoconnect - if(!$userapp) { - $url=$this->generateUrl('cas_sp.login'); - return new Response( - '' - ); + // si on a un usercas mais pas de userapp c'est qu'il faut s'autoconnect + if(!$userapp) { + $url=$this->generateUrl('cas_sp.login'); + return new Response( + '' + ); - } - } - break; + } + } + break; + } } return new Response(); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php index 595290c3..9756d44a 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php @@ -30,22 +30,37 @@ class Group private $label; /** - * @ORM\Column(type="boolean") + * @ORM\Column(type="boolean", options={"default" : false}) */ private $fgopen; /** - * @ORM\Column(type="boolean") + * @ORM\Column(type="boolean", options={"default" : true}) */ private $fgcanshare; /** - * @ORM\Column(type="boolean") + * @ORM\Column(type="boolean", options={"default" : true}) + */ + private $fgcancreatepage; + + /** + * @ORM\Column(type="boolean", options={"default" : true}) + */ + private $fgcancreateblog; + + /** + * @ORM\Column(type="boolean", options={"default" : true}) + */ + private $fgcancreatecalendar; + + /** + * @ORM\Column(type="boolean", options={"default" : false}) */ private $fgall; /** - * @ORM\Column(type="boolean") + * @ORM\Column(type="boolean", options={"default" : false}) */ private $fgtemplate; @@ -202,6 +217,78 @@ class Group return $this->fgcanshare; } + /** + * Set fgcancreatepage + * + * @param boolean $fgcancreatepage + * + * @return Group + */ + public function setFgcancreatepage($fgcancreatepage) + { + $this->fgcancreatepage = $fgcancreatepage; + + return $this; + } + + /** + * Get fgcancreatepage + * + * @return boolean + */ + public function getFgcancreatepage() + { + return $this->fgcancreatepage; + } + + /** + * Set fgcancreateblog + * + * @param boolean $fgcancreateblog + * + * @return Group + */ + public function setFgcancreateblog($fgcancreateblog) + { + $this->fgcancreateblog = $fgcancreateblog; + + return $this; + } + + /** + * Get fgcancreateblog + * + * @return boolean + */ + public function getFgcancreateblog() + { + return $this->fgcancreateblog; + } + + /** + * Set fgcancreatecalendar + * + * @param boolean $fgcancreatecalendar + * + * @return Group + */ + public function setFgcancreatecalendar($fgcancreatecalendar) + { + $this->fgcancreatecalendar = $fgcancreatecalendar; + + return $this; + } + + /** + * Get fgcancreatecalendar + * + * @return boolean + */ + public function getFgcancreatecalendar() + { + return $this->fgcancreatecalendar; + } + /** * Set fgall * 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 fb926f14..c629d423 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php @@ -189,5 +189,21 @@ } } $session->set('sidebar', $sidebar); + + if($portal_activate) { + $session->set('cancreatepage',false); + $session->set('cancreatecalendar',false); + $session->set('cancreateblog',false); + + if($curentuser!="anon.") { + $groups=$curentuser->getGroups(); + foreach($groups as $usergroup) { + $group=$usergroup->getGroup(); + if($group->getFgcancreatepage()) $session->set('cancreatepage',true); + if($group->getFgcancreatecalendar()) $session->set('cancreatecalendar',true); + if($group->getFgcancreateblog()) $session->set('cancreateblog',true); + } + } + } } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php index 3b4297e4..83566b10 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php @@ -30,16 +30,45 @@ class GroupType extends AbstractType ) ); - $choices=array("oui" => "1","non" => "0"); - $builder->add("fgcanshare", - ChoiceType::class,array( - "label" =>"Partage dans le groupe activé", - 'disabled' => ($options["mode"]=="delete"?true:false), - "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), - "choices" => $choices - ) - ); - + if($options["portal_activate"]) { + $choices=array("oui" => "1","non" => "0"); + $builder->add("fgcanshare", + ChoiceType::class,array( + "label" =>"Partage dans le groupe activé", + 'disabled' => ($options["mode"]=="delete"?true:false), + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), + "choices" => $choices + ) + ); + + $builder->add("fgcancreatepage", + ChoiceType::class,array( + "label" =>"Permission de créer des Pages", + 'disabled' => ($options["mode"]=="delete"?true:false), + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), + "choices" => $choices + ) + ); + + $builder->add("fgcancreatecalendar", + ChoiceType::class,array( + "label" =>"Permission de créer des Calendriers", + 'disabled' => ($options["mode"]=="delete"?true:false), + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), + "choices" => $choices + ) + ); + + $builder->add("fgcancreateblog", + ChoiceType::class,array( + "label" =>"Permission de créer des Blogs", + 'disabled' => ($options["mode"]=="delete"?true:false), + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), + "choices" => $choices + ) + ); + } + if(!$options["updatelimite"]) { $builder->add('label', TextType::class, array( @@ -116,6 +145,7 @@ class GroupType extends AbstractType 'data_class' => 'Cadoles\CoreBundle\Entity\Group', 'mode' => "string", 'masteridentity' => "string", + 'portal_activate' => "boolean", 'updatelimite' => "boolean" )); } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml index 1b0cd93a..51f0b826 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml @@ -107,6 +107,10 @@ cadoles_core_ajax_niveau02_read: path: /ajax/niveau02/read defaults: { _controller: CadolesCoreBundle:Ajax:niveau02read } +cadoles_core_ajax_group_list: + path: /ajax/group/list + defaults: { _controller: CadolesCoreBundle:Ajax:grouplist } + cadoles_core_ajax_group_read: path: /ajax/group/read defaults: { _controller: CadolesCoreBundle:Ajax:groupread } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig index 6604db7b..0f77e133 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig @@ -33,37 +33,62 @@ {% endfor %} {% endif %} -
-
- Informations -
-
- {% if form.label is defined %} - {{ form_label(form.label) }} - {{ form_widget(form.label) }} - {% endif %} +
+ {% if form.label is defined %} +
+
+
+ Informations +
- {{ form_label(form.fgcanshare) }} - {{ form_widget(form.fgcanshare) }} +
+ {{ form_label(form.label) }} + {{ form_widget(form.label) }} - {% if form.label is defined %} - {{ form_label(form.fgopen) }} - {{ form_widget(form.fgopen) }} - {% endif %} + {{ form_label(form.fgopen) }} + {{ form_widget(form.fgopen) }} - {% if form.fgassoc is defined %} - {% if masteridentity=="LDAP" %} - {{ form_row(form.fgassoc) }} - {{ form_row(form.ldapfilter) }} - {% endif %} + {% if form.fgassoc is defined %} + {% if masteridentity=="LDAP" %} + {{ form_row(form.fgassoc) }} + {{ form_row(form.ldapfilter) }} + {% endif %} + + {% if masteridentity=="SSO" %} + {{ form_row(form.fgassoc) }} + {{ form_row(form.attributes) }} + {% endif %} + {% endif %} +
+
+
+ {% endif %} + + {% if form.fgcanshare is defined %} +
+
+
+ Permissions Portail +
+ +
+ {{ form_label(form.fgcanshare) }} + {{ form_widget(form.fgcanshare) }} + + {{ form_label(form.fgcancreatepage) }} + {{ form_widget(form.fgcancreatepage) }} + + {{ form_label(form.fgcancreatecalendar) }} + {{ form_widget(form.fgcancreatecalendar) }} + + {{ form_label(form.fgcancreateblog) }} + {{ form_widget(form.fgcancreateblog) }} +
+
+
+ {% endif %} - {% if masteridentity=="SSO" %} - {{ form_row(form.fgassoc) }} - {{ form_row(form.attributes) }} - {% endif %} - {% endif %} -
{{ form_end(form) }} {% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig index 6f15fec8..304358ec 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig @@ -18,8 +18,13 @@ Action Label Ouvert - Partage Filtre + {% if portal_activate %} + Partage + Création Pages + Création Calendriers + Création Blogs + {% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Security/loginldap.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Security/loginldap.html.twig index 53792058..54f9b268 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Security/loginldap.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Security/loginldap.html.twig @@ -31,7 +31,7 @@
{% if error %} -
{{ error.messageKey|trans(error.messageData, 'security') }}
+
{{ error }}
{% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogController.php index 889d6bc7..e21ffebe 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogController.php @@ -145,6 +145,9 @@ class BlogController extends Controller public function submitAction(Request $request,$access="config") { + if($access=="user"&&!$this->get('session')->get('cancreateblog')) + throw $this->createNotFoundException('Permission denied'); + $entity = new Blog(); $form = $this->entityForm($entity,$access); @@ -345,8 +348,7 @@ class BlogController extends Controller if(!$cansee) throw $this->createNotFoundException('Permission denied'); - $canupdate=false; - if($user) $canupdate=true; + $canupdate=$this->get('session')->get('cancreateblog'); } $pagination=15; @@ -355,6 +357,7 @@ class BlogController extends Controller else $em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,($page-1)*$pagination,$pagination,$count,$blogarticles); + return $this->render($this->labelentity.':view.html.twig', [ 'useheader' => ($access=="config"), 'usemenu' => false, diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendarController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendarController.php index 9d36fac5..b82601a2 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendarController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendarController.php @@ -142,6 +142,9 @@ class CalendarController extends Controller public function submitAction(Request $request,$access="config") { + if($access=="user"&&!$this->get('session')->get('cancreatecalendar')) + throw $this->createNotFoundException('Permission denied'); + $entity = new Calendar(); $form = $this->entityForm($entity,$access); @@ -326,8 +329,7 @@ class CalendarController extends Controller } $calendars=array_merge($calendarsuser,$calendarsadmin->toArray(),$calendarsshared); - $canupdate=false; - if($user) $canupdate=true; + $canupdate=$this->get('session')->get('cancreatecalendar'); } return $this->render($this->labelentity.':view.html.twig', [ 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 b465fde4..4c8c6760 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php @@ -182,6 +182,9 @@ class PageController extends Controller public function submitAction(Request $request,$access="config") { + if($access=="user"&&!$this->get('session')->get('cancreatepage')) + throw $this->createNotFoundException('Permission denied'); + $entity = new Page(); $entity->setMaxwidth(0); $entity->setRoworder(0); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertType.php index d1614eb7..c7098048 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertType.php @@ -12,6 +12,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Ivory\CKEditorBundle\Form\Type\CKEditorType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; class AlertType extends AbstractType { @@ -55,13 +56,22 @@ class AlertType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - "label" => 'Visible pour les Groupes', - "class" => 'CadolesCoreBundle:Group', - "choice_label" => 'label', - "multiple" => true, - "expanded" => true, - "disabled" => ($options["mode"]=="delete"?true:false), + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]) ->add('publishedat', DateType::class, [ diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertcategoryType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertcategoryType.php index e15fa8fa..4046127f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertcategoryType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/AlertcategoryType.php @@ -43,12 +43,11 @@ class AlertcategoryType extends AbstractType ) ); - $builder->add('color', - ColorType::class, array( - 'label' => 'Couleur', - 'attr' => ['placeholder' => '#FF0066'] - ) - ); + $builder->add('color', TextType::class, [ + 'label' => "Couleur", + 'required' => false, + 'attr' => array("class" => "pick-a-color") + ]); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BlogType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BlogType.php index c112c514..17177535 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BlogType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BlogType.php @@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -41,13 +42,22 @@ class BlogType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - "label" => 'Visible pour les Groupes', - "class" => 'CadolesCoreBundle:Group', - "choice_label" => 'label', - "multiple" => true, - "expanded" => true, - "disabled" => ($options["mode"]=="delete"?true:false), + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BookmarkType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BookmarkType.php index a8160279..4b81a68a 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BookmarkType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/BookmarkType.php @@ -39,10 +39,10 @@ class BookmarkType extends AbstractType ]) - ->add('color', ColorType::class, [ - "label" => 'Couleur de la tuile', - "required" => false, - "attr" => ['placeholder' => '#FF0066'], + ->add('color', TextType::class, [ + 'label' => "Couleur", + 'required' => false, + 'attr' => array("class" => "pick-a-color") ]) ->add('url') diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php index 18bdf864..dc9f9362 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/CalendarType.php @@ -10,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -79,13 +80,22 @@ class CalendarType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - "label" => 'Visible pour les Groupes', - "class" => 'CadolesCoreBundle:Group', - "choice_label" => 'label', - "multiple" => true, - "expanded" => true, - "disabled" => ($options["mode"]=="delete"?true:false), + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/FluxType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/FluxType.php index b991d90e..231e4cf2 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/FluxType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/FluxType.php @@ -13,6 +13,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Ivory\CKEditorBundle\Form\Type\CKEditorType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; class FluxType extends AbstractType { @@ -54,13 +55,22 @@ class FluxType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - "label" => 'Visible pour les Groupes', - "class" => 'CadolesCoreBundle:Group', - "choice_label" => 'label', - "multiple" => true, - "expanded" => true, - "disabled" => ($options["mode"]=="delete"?true:false), + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php index 3c09734a..2c988c31 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php @@ -14,6 +14,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\ColorType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; use Ivory\CKEditorBundle\Form\Type\CKEditorType; class ItemType extends AbstractType @@ -67,20 +68,29 @@ class ItemType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - "label" => 'Visible pour les Groupes', - "class" => 'CadolesCoreBundle:Group', - "choice_label" => 'label', - "multiple" => true, - "expanded" => true, - "disabled" => ($options["mode"]=="delete"?true:false), + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]) - ->add('color', ColorType::class, [ - "label" => 'Couleur de la tuile', - "required" => false, - "attr" => ['placeholder' => '#FF0066'], - ]) + ->add('color', TextType::class, [ + 'label' => "Couleur", + 'required' => false, + 'attr' => array("class" => "pick-a-color") + ]) ->add('url') diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/NoticeType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/NoticeType.php index 66b5f5f3..1908c978 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/NoticeType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/NoticeType.php @@ -13,6 +13,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Ivory\CKEditorBundle\Form\Type\CKEditorType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; class NoticeType extends AbstractType { @@ -62,13 +63,22 @@ class NoticeType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - "label" => 'Visible pour les Groupes', - "class" => 'CadolesCoreBundle:Group', - "choice_label" => 'label', - "multiple" => true, - "expanded" => true, - "disabled" => ($options["mode"]=="delete"?true:false), + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateEditorType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateEditorType.php index 6a50b1ce..ee313b62 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateEditorType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateEditorType.php @@ -10,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Ivory\CKEditorBundle\Form\Type\CKEditorType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; use Symfony\Component\OptionsResolver\OptionsResolver; class PageUpdateEditorType extends AbstractType @@ -57,12 +58,22 @@ class PageUpdateEditorType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - 'label' => 'Visible pour les Groupes', - 'class' => 'CadolesCoreBundle:Group', - 'choice_label' => 'label', - 'multiple' => true, - 'expanded' => true + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateToolType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateToolType.php index a9053e35..8e805c16 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateToolType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateToolType.php @@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; use Symfony\Component\OptionsResolver\OptionsResolver; class PageUpdateToolType extends AbstractType @@ -44,12 +45,22 @@ class PageUpdateToolType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - 'label' => 'Visible pour les Groupes', - 'class' => 'CadolesCoreBundle:Group', - 'choice_label' => 'label', - 'multiple' => true, - 'expanded' => true + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php index b5c6a3e9..05117a6e 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateURLType.php @@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; use Symfony\Component\OptionsResolver\OptionsResolver; class PageUpdateURLType extends AbstractType @@ -53,12 +54,22 @@ class PageUpdateURLType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - 'label' => 'Visible pour les Groupes', - 'class' => 'CadolesCoreBundle:Group', - 'choice_label' => 'label', - 'multiple' => true, - 'expanded' => true + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateWidgetType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateWidgetType.php index f4cc3ad9..7177fa7b 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateWidgetType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PageUpdateWidgetType.php @@ -10,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; use Symfony\Component\OptionsResolver\OptionsResolver; class PageUpdateWidgetType extends AbstractType @@ -54,12 +55,22 @@ class PageUpdateWidgetType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]) - ->add('groups', EntityType::class, [ - 'label' => 'Visible pour les Groupes', - 'class' => 'CadolesCoreBundle:Group', - 'choice_label' => 'label', - 'multiple' => true, - 'expanded' => true + ->add('groups', Select2EntityType::class, [ + 'label' => 'Visible pour les Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner un groupe', ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig index 6f0e116e..b073667b 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig @@ -27,7 +27,7 @@ " data-alert-category-id="{{ alert.alertcategory.id }}" data-alert-id="{{ alert.id }}" - style="background: {{ alert.alertcategory.color }};" + style="background: {{ "#"~alert.alertcategory.color }};" >