From 6b3c52e45364387a8a72b16b5f960f4caea2550f Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 30 Sep 2019 16:30:52 +0200 Subject: [PATCH 1/5] svg modele scribe --- .../CoreBundle/Command/SynchroCommand.php | 174 ++++++++++++------ .../CoreBundle/Command/data/core-init-01.sql | 6 +- .../CoreBundle/Controller/UserController.php | 71 ++++++- .../Resources/views/Group/list.html.twig | 2 +- .../PortalBundle/Command/InitDataCommand.php | 69 ++++++- .../Controller/PagewidgetController.php | 44 ++--- .../Resources/views/Pagewidget/constants.twig | 3 - .../views/Pagewidget/viewchat.html.twig | 10 +- .../views/Pagewidget/viewfile.html.twig | 6 +- .../views/Pagewidget/viewflux.html.twig | 2 + .../views/Pagewidget/viewframe.html.twig | 4 +- .../views/Pagewidget/viewgalery.html.twig | 29 ++- .../Pagewidget/viewgroupmessage.html.twig | 20 +- .../Pagewidget/viewitemessential.html.twig | 3 + .../views/Pagewidget/viewurl.html.twig | 2 +- .../Controller/ChatController.php | 14 +- .../Resources/views/Chat/client.html.twig | 14 +- 17 files changed, 337 insertions(+), 136 deletions(-) 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 422b6f4d..1bcbdef4 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -16,6 +16,11 @@ use Cadoles\CoreBundle\Entity\Niveau02; use Cadoles\CoreBundle\Entity\User; use Cadoles\CoreBundle\Entity\Group; use Cadoles\CoreBundle\Entity\UserGroup; +use Cadoles\PortalBundle\Entity\Calendar; +use Cadoles\PortalBundle\Entity\Blog; + +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; global $bdd01; global $config; @@ -28,6 +33,8 @@ class SynchroCommand extends Command private $output; private $filesystem; private $rootlog; + private $ldap; + private $ldap_basedn; protected function configure() { @@ -76,8 +83,9 @@ class SynchroCommand extends Command $this->writeln('== SYNCHONISATION ANNUAIRE =========================='); $this->writeln('====================================================='); - $ldap = $this->container->get('cadoles.core.service.ldap'); - if(!$ldap->isEnabled()) { + $this->ldap = $this->container->get('cadoles.core.service.ldap'); + + if(!$this->ldap->isEnabled()) { if($masteridentity =="LDAP") { $this->writeln(''); $this->writeln('====================================================='); @@ -85,7 +93,7 @@ class SynchroCommand extends Command $this->writeln('====================================================='); - $ldap_basedn = $this->container->getParameter('ldap_basedn'); + $this->ldap_basedn = $this->container->getParameter('ldap_basedn'); $ldap_template = $this->container->getParameter('ldap_template'); $ldap_username = $this->container->getParameter('ldap_username'); $ldap_firstname = $this->container->getParameter('ldap_firstname'); @@ -126,7 +134,7 @@ class SynchroCommand extends Command $this->writeln(''); $this->writeln('== CLASSES =========================================='); - $results = $ldap->search("type=Classe", ['cn','description','gidNumber'], $ldap_basedn); + $results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn); foreach($results as $result) { $cn=$result["cn"]; $ldapfilter="(|(&(type=Classe)(cn=$cn))(&(type=Equipe)(cn=profs-$cn))(&(ENTPersonProfils=Administratif)(divcod=$cn)))"; @@ -155,7 +163,7 @@ class SynchroCommand extends Command // On execute le filtre d'appartenance à ce niveau $this->writeln("== Récupération des utilisateurs de l'annuaire"); $niveau01=$this->em->getRepository('CadolesCoreBundle:Niveau01')->find($data["id"]); - $results = $ldap->search($niveau01->getLdapfilter(), $fieldstoread, $ldap_basedn); + $results = $this->ldap->search($niveau01->getLdapfilter(), $fieldstoread, $this->ldap_basedn); $nbuserstotal=count($results); // Pour chaque utilisateur ldap @@ -247,7 +255,8 @@ class SynchroCommand extends Command $this->writeln('== '.$group->getLabel()); if(!is_null($ldapfilter)) { - $results = $ldap->search($ldapfilter,[$ldap_username,"memberuid"] , $ldap_basedn); + $results = $this->ldap->search($ldapfilter,[$ldap_username,"memberuid"] , $this->ldap_basedn); + foreach($results as $result) { if(isset($result["memberuid"])) { // Si memberid est un tableau il y a plusieur user dedans @@ -333,7 +342,7 @@ class SynchroCommand extends Command } else { //on peut unset les recherches suivantes seront plus rapide - unset($flipped[$user->getUsername()]); + unset($flipped[$data["username"]]); } $this->em->clear(); @@ -360,17 +369,17 @@ class SynchroCommand extends Command foreach($datas as $data) { $criteria = '(cn='.$data->getLabel().')'; $subbranch=$baseNiveau01; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); // Mise à jour si elle existe if(count($results) > 0) { $this->writeln(' - Modification dans annuaire >> '.$data->getLabel()); - if(!$simulate) $ldap->modifyNiveau01($data,$data->getLabel()); + if(!$simulate) $this->ldap->modifyNiveau01($data,$data->getLabel()); } // Sinon création de la fiche else { $this->writeln(' - Création dans annuaire >> '.$data->getLabel()); - if(!$simulate) $ldap->addNiveau01($data); + if(!$simulate) $this->ldap->addNiveau01($data); } } @@ -387,17 +396,17 @@ class SynchroCommand extends Command foreach($datas as $data) { $criteria = '(cn='.$data->getLabel().')'; $subbranch=$baseNiveau02; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); // Mise à jour si elle existe if(count($results) > 0) { $this->writeln(' - Modification dans annuaire >> '.$data->getLabel()); - if(!$simulate) $ldap->modifyNiveau02($data,$data->getLabel()); + if(!$simulate) $this->ldap->modifyNiveau02($data,$data->getLabel()); } // Sinon création de la fiche else { $this->writeln(' - Création dans annuaire >> '.$data->getLabel()); - if(!$simulate) $ldap->addNiveau02($data); + if(!$simulate) $this->ldap->addNiveau02($data); } } @@ -414,17 +423,17 @@ class SynchroCommand extends Command foreach($datas as $data) { $criteria = '(cn='.$data->getLabel().')'; $subbranch=$baseGroup; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); // Mise à jour si elle existe if(count($results) > 0) { $this->writeln(' - Modification dans annuaire >> '.$data->getLabel()); - if(!$simulate) $ldap->modifyGroup($data,$data->getLabel()); + if(!$simulate) $this->ldap->modifyGroup($data,$data->getLabel()); } // Sinon création de la fiche else { $this->writeln(' - Création dans annuaire >> '.$data->getLabel()); - if(!$simulate) $ldap->addGroup($data); + if(!$simulate) $this->ldap->addGroup($data); } } @@ -441,7 +450,7 @@ class SynchroCommand extends Command foreach($datas as $data) { $criteria = '(uid='.$data->getUsername().')'; $subbranch=$baseUser; - $results = $ldap->search($criteria, array('uid'), $subbranch); + $results = $this->ldap->search($criteria, array('uid'), $subbranch); // S'assurer que SIREN correspond au Niveau01 if($data->getNiveau01()->getSiren()!=$data->getSiren()) { @@ -458,16 +467,16 @@ class SynchroCommand extends Command // Mise à jour si elle existe if(count($results) > 0) { $this->writeln(' - Modification dans annuaire >> '.$data->getUsername()); - if(!$simulate) $ldap->modifyUser($data); + if(!$simulate) $this->ldap->modifyUser($data); } // Sinon création de la fiche else { $this->writeln(' - Création dans annuaire >> '.$data->getUsername()); - if(!$simulate) $ldap->addUser($data); + if(!$simulate) $this->ldap->addUser($data); } // Rattachement à Niveau01 et Niveau02 - if(!$simulate) $ldap->addGroupUser($data); + if(!$simulate) $this->ldap->addGroupUser($data); } $this->writeln(''); @@ -483,21 +492,21 @@ class SynchroCommand extends Command foreach($datas as $data) { $criteria = '(cn='.$data->getLabel().')'; $subbranch=$baseniveau01; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); // Mise à jour des membres du groupes if(count($results) > 0) { $this->writeln(' - '.$data->getLabel()); - $dn=$ldap->getNiveau01DN($data->getLabel()); + $dn=$this->ldap->getNiveau01DN($data->getLabel()); $attrs["memberuid"]=array(); $attrs["cadolesMember"]=array(); foreach($data->getUsers() as $userniveau01) { array_push($attrs["memberuid"],$userniveau01->getUsername()); - array_push($attrs["cadolesMember"],$ldap->getUserDN($userniveau01)); + array_push($attrs["cadolesMember"],$this->ldap->getUserDN($userniveau01)); $this->writeln(' > '.$userniveau01->getUsername()); } - if(!$simulate) $ldap->ldapModify($dn, $attrs); + if(!$simulate) $this->ldap->ldapModify($dn, $attrs); } } @@ -514,21 +523,21 @@ class SynchroCommand extends Command foreach($datas as $data) { $criteria = '(cn='.$data->getLabel().')'; $subbranch=$baseniveau02; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); // Mise à jour des membres du groupes if(count($results) > 0) { $this->writeln(' - '.$data->getLabel()); - $dn=$ldap->getNiveau02DN($data->getLabel()); + $dn=$this->ldap->getNiveau02DN($data->getLabel()); $attrs["memberuid"]=array(); $attrs["cadolesMember"]=array(); foreach($data->getUsers() as $userniveau01) { array_push($attrs["memberuid"],$userniveau01->getUsername()); - array_push($attrs["cadolesMember"],$ldap->getUserDN($userniveau01)); + array_push($attrs["cadolesMember"],$this->ldap->getUserDN($userniveau01)); $this->writeln(' > '.$userniveau01->getUsername()); } - if(!$simulate) $ldap->ldapModify($dn, $attrs); + if(!$simulate) $this->ldap->ldapModify($dn, $attrs); } } @@ -546,21 +555,21 @@ class SynchroCommand extends Command foreach($datas as $data) { $criteria = '(cn='.$data->getLabel().')'; $subbranch=$baseGroup; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); // Mise à jour des membres du groupes if(count($results) > 0) { $this->writeln(' - '.$data->getLabel()); - $dn=$ldap->getGroupDN($data->getLabel()); + $dn=$this->ldap->getGroupDN($data->getLabel()); $attrs["memberuid"]=array(); $attrs["cadolesMember"]=array(); foreach($data->getUsers() as $usergroupe) { array_push($attrs["memberuid"],$usergroupe->getUser()->getUsername()); - array_push($attrs["cadolesMember"],$ldap->getUserDN($usergroupe->getUser())); + array_push($attrs["cadolesMember"],$this->ldap->getUserDN($usergroupe->getUser())); $this->writeln(' > '.$usergroupe->getUser()->getUsername()); } - if(!$simulate) $ldap->ldapModify($dn, $attrs); + if(!$simulate) $this->ldap->ldapModify($dn, $attrs); } } @@ -576,14 +585,14 @@ class SynchroCommand extends Command $criteria = '(cn=*)'; $subbranch=$baseNiveau01; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); foreach($results as $result) { $data = $this->em->getRepository('CadolesCoreBundle:Niveau01')->findBy(array('label' => $result["cn"])); if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]); else { $this->writeln(' - A supprimer dans annuaire >> '.$result["cn"]); - $dn=$ldap->getNiveau01DN($result["cn"]); - if(!$simulate) $ldap->deleteByDN($dn); + $dn=$this->ldap->getNiveau01DN($result["cn"]); + if(!$simulate) $this->ldap->deleteByDN($dn); } } @@ -593,14 +602,14 @@ class SynchroCommand extends Command $criteria = '(cn=*)'; $subbranch=$baseNiveau02; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); foreach($results as $result) { $data = $this->em->getRepository('CadolesCoreBundle:Niveau02')->findBy(array('label' => $result["cn"])); if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]); else { $this->writeln(' - A supprimer dans annuaire >> '.$result["cn"]); - $dn=$ldap->getNiveau02DN($result["cn"]); - if(!$simulate) $ldap->deleteByDN($dn); + $dn=$this->ldap->getNiveau02DN($result["cn"]); + if(!$simulate) $this->ldap->deleteByDN($dn); } } @@ -611,14 +620,14 @@ class SynchroCommand extends Command $criteria = '(cn=*)'; $subbranch=$baseGroup; - $results = $ldap->search($criteria, array('cn'), $subbranch); + $results = $this->search($criteria, array('cn'), $subbranch); foreach($results as $result) { $data = $this->em->getRepository('CadolesCoreBundle:Group')->findBy(array('label' => $result["cn"])); if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]); else { $this->writeln(' - A supprimer dans annuaire >> '.$result["cn"]); - $dn=$ldap->getGroupDN($result["cn"]); - if(!$simulate) $ldap->deleteByDN($dn); + $dn=$this->ldap->getGroupDN($result["cn"]); + if(!$simulate) $this->ldap->deleteByDN($dn); } } @@ -628,14 +637,14 @@ class SynchroCommand extends Command $criteria = '(uid=*)'; $subbranch=$baseUser; - $results = $ldap->search($criteria, array('uid'), $subbranch); + $results = $this->ldap->search($criteria, array('uid'), $subbranch); foreach($results as $result) { $data = $this->em->getRepository('CadolesCoreBundle:User')->findBy(array('username' => $result["uid"])); if($data) $this->writeln(' - Existe dans bundle >> '.$result["uid"]); else { $this->writeln(' - A supprimer dans annuaire >> '.$result["uid"]); $dn='uid='.$result["uid"].','.$baseUser; - if(!$simulate) $ldap->deleteByDN($dn); + if(!$simulate) $this->ldap->deleteByDN($dn); } } } @@ -654,14 +663,14 @@ class SynchroCommand extends Command } protected function addmodGroup($label,$ldapfilter,$fgcanshare) { - + $portal_activate = $this->container->getParameter('portal_activate'); $group=$this->em->getRepository('CadolesCoreBundle:Group')->findOneBy(array('fgtemplate' => true, 'label' => $label)); if(!$group) { $group=new Group(); $group->setFgcanshare($fgcanshare); - $group->setFgcancreatepage(true); - $group->setFgcancreateblog(true); - $group->setFgcancreatecalendar(true); + $group->setFgcancreatepage(false); + $group->setFgcancreateblog(false); + $group->setFgcancreatecalendar(false); } $group->setLabel($label); @@ -669,9 +678,53 @@ class SynchroCommand extends Command $group->setFgall(false); $group->setLdapfilter($ldapfilter); $group->setFgtemplate(true); + + if($portal_activate) { + $pagetemplate=$this->em->getRepository("CadolesPortalBundle:Page")->find(-110); + if($pagetemplate) $group->setPagetemplate($pagetemplate); + } $this->em->persist($group); - $this->em->flush(); + $this->em->flush(); + + if($fgcanshare && $portal_activate) { + // On regarde s'il a au moins une page + if($group->getPages()->isEmpty()) { + $page=$this->em->getRepository("CadolesPortalBundle:Page")->clonePage(null,$group->getPagetemplate()); + $group->addPage($page); + $page->setName($group->getLabel()); + + $this->em->persist($page); + $this->em->persist($group); + $this->em->flush(); + } + + // On regarde s'il a au moins un calendrier + if($group->getCalendars()->isEmpty()) { + $calendar=new Calendar(); + $key = Uuid::uuid4(); + + $calendar->setName($group->getLabel()); + $calendar->setKeyvalue($key); + $calendar->addGroup($group); + $calendar->setColor($group->getColor()); + $calendar->setType(0); + + $this->em->persist($calendar); + $this->em->flush(); + } + + // On regarde s'il a au moins un blog + if($group->getBlogs()->isEmpty()) { + $blog=new Blog(); + + $blog->setName($group->getLabel()); + $blog->addGroup($group); + + $this->em->persist($blog); + $this->em->flush(); + } + } } protected function addtoGroup($user,$group) { @@ -680,10 +733,18 @@ class SynchroCommand extends Command $member= new UserGroup(); $member->setGroup($group); $member->setUser($user); + } + + // Si modèle scribe + $ldap_template = $this->container->getParameter('ldap_template'); + if($ldap_template=="scribe") { + $ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))"; + $results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn); + if($results) $member->setFgmanager(true); + } - $this->em->persist($member); - $this->em->flush(); - } + $this->em->persist($member); + $this->em->flush(); } protected function addUser($niveau01,$username,$firstname,$lastname,$email,$usersadmin) { @@ -702,9 +763,18 @@ class SynchroCommand extends Command if(in_array($username,$usersadmin)) $user->setRole("ROLE_ADMIN"); - else + else { $user->setRole("ROLE_USER"); + // Si modèle scribe + $ldap_template = $this->container->getParameter('ldap_template'); + if($ldap_template=="scribe") { + $ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))"; + $results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn); + if($results) $user->setRole("ROLE_ANIM"); + } + } + $this->em->persist($user); $this->em->flush(); } 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 df141a43..e8e84a60 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 @@ -5,11 +5,10 @@ SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES -(-100, 'DRAAF', '130007107'); +(-100, 'scribe26', '0000000A'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}eyoxoh9yJzJyNAacnf9gxyZbtRWITzXF -', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); +(-100, -100, 'admin', 'Administrateur', 'scribe26', 'PWD_CAS', 'admin@scribe26.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '0000000A', 'simple'); @@ -25,7 +24,6 @@ INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `f (1200, NULL, 1200, 'ORGANISATION', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), (1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN,ROLE_MODO', ''), (1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN,ROLE_MODO', ''), -(1230, 1200, 1230, 'Niveau 02', 'cadoles_core_config_niveau02', 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), (1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO', ''), (1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO', ''), (1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO', ''), diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php index 7b0ded5c..03b3265b 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php @@ -298,10 +298,7 @@ class UserController extends Controller $data->setVisible(true); $data->setBelongingpopulation("authlevel"); $data->setAuthlevel("simple"); - - $config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser"); - $fields=$config->getValue(); - $fields=json_decode($fields,true); + $fields=$this->getDefaultDatauser(); // Création du formulaire $form = $this->createForm(UserType::class,$data,array( @@ -410,9 +407,7 @@ class UserController extends Controller // Récupération de l'enregistrement courant $data=$this->getData($id); $oldpassword=$data->getPassword(); - $config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser"); - $fields=$config->getValue(); - $fields=json_decode($fields,true); + $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") { @@ -625,9 +620,7 @@ class UserController extends Controller // Récupération de l'enregistrement courant $data=$this->getData($id); - $config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser"); - $fields=$config->getValue(); - $fields=json_decode($fields,true); + $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") { @@ -987,6 +980,64 @@ class UserController extends Controller return $datas; } + protected function getDefaultDatauser() + { + $em = $this->getDoctrine()->getManager(); + $config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser"); + $fields=$config->getValue(); + $fields=json_decode($fields,true); + + if($fields=="") { + // Valeur par défaut 0=caché / 1=falcultatif / 2=obligatoire + $fields["firstname"]["perm"]=1; + $fields["firstname"]["label"]="Prénom"; + + $fields["visible"]["perm"]=2; + $fields["visible"]["label"]="Visible"; + + $fields["authlevel"]["perm"]=2; + $fields["authlevel"]["label"]="Niveau d'authentification"; + + $fields["belongingpopulation"]["perm"]=2; + $fields["belongingpopulation"]["label"]="Population d'appartenance"; + + $fields["job"]["perm"]=1; + $fields["job"]["label"]="Métier"; + + $fields["position"]["perm"]=1; + $fields["position"]["label"]="Fonction"; + + $fields["niveau02"]["perm"]=1; + $fields["niveau02"]["label"]="Niveau 02"; + + $fields["usualname"]["perm"]=1; + $fields["usualname"]["label"]="Nom d'Usage"; + + $fields["gender"]["perm"]=1; + $fields["gender"]["label"]="Sexe"; + + $fields["givensname"]["perm"]=1; + $fields["givensname"]["label"]="Autre Prénom"; + + $fields["telephonenumber"]["perm"]=1; + $fields["telephonenumber"]["label"]="Téléphone"; + + $fields["postaladress"]["perm"]=1; + $fields["postaladress"]["label"]="Adresse"; + + $fields["birthdate"]["perm"]=1; + $fields["birthdate"]["label"]="Date de Naissance"; + + $fields["birthcountry"]["perm"]=1; + $fields["birthcountry"]["label"]="Pays de Naissance"; + + $fields["birthplace"]["perm"]=1; + $fields["birthplace"]["label"]="Ville de Naissance"; + } + + return $fields; + } + protected function getErrorForm($id,$form,$request,$data,$mode) { if ($form->get('submit')->isClicked()&&$mode=="delete") { } 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 e36ece62..41cc1222 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 @@ -10,7 +10,7 @@ {% set permgroup = app.session.get('permgroup') %} - {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ADMIN" or permgroup=="ROLE_USER")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %} + {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ADMIN" or permgroup=="ROLE_ANIM")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %}

{% if access=="config" %} Ajouter diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php index 13f97aae..8a43ebfc 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -860,7 +860,74 @@ class InitDataCommand extends ContainerAwareCommand $em->flush(); } } - + + // Template Group + $entityPage = $em->getRepository('CadolesPortalBundle:Page')->find(-110); + if(!$entityPage) { + $entityPagecategory = $em->getRepository('CadolesPortalBundle:Pagecategory')->find(2); + $entityPage = new Page(); + $entityPage->setId(-110); + $entityPage->setRowOrder(0); + $entityPage->setName('Accueil Groupe'); + $entityPage->setParentfor('Groupe'); + $entityPage->setMaxwidth(1500); + $entityPage->setPagecategory($entityPagecategory); + $entityPage->setTemplate('{"rows":[{"id":0,"cols":[{"id":0,"size": 4,"rows":[]},{"id":1,"size": 8,"rows":[{"id":0,"cols":[{"id":0,"size": 12}]},{"id":1,"cols":[{"id":0,"size": 6},{"id":1,"size": 6}]}]}]}]}'); + + $em->persist($entityPage); + $em->flush(); + + // Widget Nos Liens + $fields=["fields"=>[["id"=>"modedesktop","value"=>2]]]; + $this->addWidget(-120,$entityPage,-1960,"R1C1",1,"Nos Liens",true,$fields); + + // Widget Nos Fichiers + $fields=["fields"=>[]]; + $this->addWidget(-130,$entityPage,-1920,"R1C1",2,"Nos Fichiers",true,$fields); + + // Widget Info Page + $fields=["fields"=>[]]; + $this->addWidget(-140,$entityPage,-1860,"R1C1",3,"Information Page",true,$fields); + + // Widget Notre Blog + $fields=["fields"=>[["id"=>"nbarticle","value"=>5]]]; + $this->addWidget(-150,$entityPage,-1890,"R1C2R1C1",1,"Notre Blog",false,$fields); + + // Widget Notre Calendrier + $fields=["fields"=>[["id"=>"nbday","value"=>30]]]; + $this->addWidget(-160,$entityPage,-1900,"R1C2R2C1",1,"Notre Calendrier",true,$fields); + + // Chat + $fields=["fields"=>[]]; + $this->addWidget(-170,$entityPage,-1840,"R1C2R2C2",1,"Chat",true,$fields); + } + $output->writeln(''); } + + private function addWidget($id,$entityPage,$widgetid,$loc,$order,$title,$border,$fields) { + $em = $this->getContainer()->get('doctrine')->getEntityManager(); + + $entityPagewidget = $em->getRepository('CadolesPortalBundle:Pagewidget')->find($id); + if(!$entityPagewidget) { + $entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find($widgetid); + + $entityPagewidget = new Pagewidget(); + $entityPagewidget->setId($id); + $entityPagewidget->setLoc($loc); + $entityPagewidget->setRoworder($order); + $entityPagewidget->setName($title); + $entityPagewidget->setHeight($entityWidget->getHeight()); + $entityPagewidget->setAutoajust($entityWidget->getAutoajust()); + $entityPagewidget->setBorder($border); + $entityPagewidget->setOpened($entityWidget->getOpened()); + $entityPagewidget->setIcon($entityWidget->getIcon()); + $entityPagewidget->setPage($entityPage); + $entityPagewidget->setWidget($entityWidget); + $entityPagewidget->setParameter($fields); + $em->persist($entityPagewidget); + $em->flush(); + } + + } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index 1c3a3e22..a8550d94 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -1933,11 +1933,10 @@ class PagewidgetController extends Controller if(!$cansee) throw $this->createNotFoundException('Permission denied'); } - if($usage!="group") { + if($usage!="group"||!$group) { $group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId(); - } - + dump($group); // Render return $this->render($this->labelentity.':viewchat.html.twig', [ @@ -2034,31 +2033,34 @@ class PagewidgetController extends Controller $mygroups=[]; $mymsg= []; $this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared); - foreach($groupsshared as $groupshared) { - // On récupère l'ensemble des messages du groupes - $messages=$this->getDoctrine()->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$groupshared]); - foreach($messages as $key => $message) { - // persistante collection à revoir - if($message->getSees()->count()>0) { - if($message->getSees()->contains($user) ) { + if(is_array($groupsshared)) { + foreach($groupsshared as $groupshared) { + // On récupère l'ensemble des messages du groupes + $messages=$this->getDoctrine()->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$groupshared]); + foreach($messages as $key => $message) { + // persistante collection à revoir + if($message->getSees()->count()>0) { + if($message->getSees()->contains($user) ) { - unset($messages[$key]); + unset($messages[$key]); + } } } - } - foreach($messages as $key => $message) { - $tmp=["id" => $message->getId(), "user" => $message->getUser(), "date"=>$message->getSubmitdate(), "topic"=>$message->getTopic()]; - array_push($mymsg,$tmp); + foreach($messages as $key => $message) { + $tmp=["id" => $message->getId(), "user" => $message->getUser(), "date"=>$message->getSubmitdate(), "topic"=>$message->getTopic()]; + array_push($mymsg,$tmp); + } } + + $ord = array(); + foreach ($mymsg as $key => $value){ + $ord[] = $value['date']; + } + array_multisort($ord, SORT_DESC, $mymsg); } + - $ord = array(); - foreach ($mymsg as $key => $value){ - $ord[] = $value['date']; - } - array_multisort($ord, SORT_DESC, $mymsg); - // Render return $this->render($this->labelentity.':viewgroupmessage.html.twig', [ 'entity' => $entity, diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/constants.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/constants.twig index ce26b3c1..855dd26a 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/constants.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/constants.twig @@ -242,9 +242,6 @@ {% set stylewidgetbodyframe = "" %} {% set stylewidgetbodyframe = stylewidgetbodyframe ~ "background-color: #" ~ colorbodyback ~ "; " %} {% set stylewidgetbodyframe = stylewidgetbodyframe ~ "color: #" ~ colorbodyfont ~ "; " %} - {% if entity.border %} - {% set stylewidgetbodyframe = stylewidgetbodyframe ~ "padding: 0px 0px 0px 10px; " %} - {% endif %} {% if not entity.autoajust %} {% set stylewidgetbodyframe = stylewidgetbodyframe ~ "height: " ~ (entity.height-50-2) ~ "px;" %} {% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig index c4773a76..7f305876 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewchat.html.twig @@ -23,6 +23,7 @@ {% set colorbodyfont = color['fontcolorhover'] %} {% endif %} +{% if app.user %}

{% if canupdate %}
@@ -46,8 +47,10 @@ {{ entity.name }}
-
+
+ {% if group is not null %} {{ render(url('cadoles_websocket_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont})) }} + {% endif %} @@ -56,7 +59,4 @@ {% endif %}
- - +{%endif%} \ No newline at end of file diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig index 59a378fe..32be8cb6 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig @@ -9,7 +9,7 @@ {% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} {% set stylewidgetheader = constants.mystylewidgetheader(entity) %} {% set stylewidgetbody = constants.mystylewidgetbody(entity) %} - +{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %} {% set color = app.session.get('color') %} @@ -95,7 +95,7 @@ {% endfor %} {% if canadd %} -
+
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig index 8c1c9504..c244127b 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig @@ -56,6 +56,7 @@ {% set firstflux="" %} + {% if fluxs is not empty %}
{% if fluxs is defined %} {% if fluxs|length > 1 %} @@ -116,6 +117,7 @@ {% endfor %}
+ {% endif %}
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewframe.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewframe.html.twig index 5ae28e20..bf29d63b 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewframe.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewframe.html.twig @@ -33,7 +33,7 @@ {% if onheader %}
- +
{% else %}
@@ -46,7 +46,7 @@
- +
{% endif %}
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgalery.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgalery.html.twig index 21cfc1d3..ca74f4e1 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgalery.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgalery.html.twig @@ -9,7 +9,7 @@ {% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} {% set stylewidgetheader = constants.mystylewidgetheader(entity) %} {% set stylewidgetbody = constants.mystylewidgetbody(entity) %} - +{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %} {% set color = app.session.get('color') %} @@ -48,11 +48,16 @@ {{ entity.name }}
- {% if files|length>0 %} + {% if files|length>0 or canupdate %}
+ {% if canupdate %} +
+
+ {% endif %} + {% for file in files|sort %} - {% if loop.index==1 %} + {% if loop.index==1 and not canupdate %}
{% endif %} @@ -74,6 +79,24 @@
{% endfor %} + + {% if canadd %} +
+ +
+ {% endif %} {% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig index 4ae6f4ae..c2a5c497 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig @@ -55,24 +55,9 @@ {{ entity.name }} - {% set firstflux="" %} - + + {% if messages is not empty %}
- {% if fluxs is defined %} - {% if fluxs|length > 1 %} -
Tout
- - {% for flux in fluxs %} - {% set stylefeed = "background-color: #" ~ color['main'] ~ ";" %} - {% if flux.color is not null %} - {% set stylefeed = "background-color: #" ~ flux.color ~ ";" %} - {% endif %} - -
{{ flux.title }}
- {% endfor %} - {% endif %} - {% endif %} -
@@ -107,6 +92,7 @@ {% endfor %}
+ {% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig index 7f6d1b4f..c5248c9e 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewitemessential.html.twig @@ -53,6 +53,7 @@ {{ entity.name }} + {% if canadd or bookmarks is not empty or items is not empty %}
@@ -162,6 +163,8 @@ {% endif %}
+ {% endif %} + diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewurl.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewurl.html.twig index 04aaa809..b6ee4624 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewurl.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewurl.html.twig @@ -46,7 +46,7 @@
- +
{% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Controller/ChatController.php b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Controller/ChatController.php index 78617f9f..c5611688 100644 --- a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Controller/ChatController.php +++ b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Controller/ChatController.php @@ -48,12 +48,11 @@ class ChatController extends Controller // Génération d'une clé temporaire d'accès au chat $key = Uuid::uuid4(); $usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["group"=>$group,"user"=>$user]); - if(!$usergroup) die("noingroup".$user->getUserName()); - $usergroup->setKeyvalue($key); - - // Sauvegarde - $em->persist($usergroup); - $em->flush(); + if($usergroup) { + $usergroup->setKeyvalue($key); + $em->persist($usergroup); + $em->flush(); + } // Récupération des message du groupe @@ -75,7 +74,8 @@ class ChatController extends Controller 'border' => $border, 'colorbodyback' => $colorbodyback, 'colorbodyfont' => $colorbodyfont, - 'fgmanager' => ($usergroup->getFgmanager()||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO"), + 'ingroup' => ($usergroup), + 'fgmanager' => ($usergroup&&($usergroup->getFgmanager()||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO")), 'form' => $form->createView() ]); } diff --git a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig index a973b62c..245b6b8f 100644 --- a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig +++ b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig @@ -51,13 +51,14 @@ {% endblock %} {% block pagewrapper %} + {% if app.user and ingroup %} {{ form_start(form) }} -
- {{ form_widget(form.message) }} - - - Envoyer -
+
+ {{ form_widget(form.message) }} + + + Envoyer +
@@ -109,6 +110,7 @@ {{ form_end(form) }} + {% endif %} {% endblock %} {% block localexternalscript %} From 8fcd736dfe112753fa3f5ea931937a3a02152759 Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 2 Oct 2019 17:11:19 +0200 Subject: [PATCH 2/5] svg modele scribe --- .../PortalBundle/Repository/PageRepository.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/PageRepository.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/PageRepository.php index d37f2016..820c1368 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/PageRepository.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/PageRepository.php @@ -260,6 +260,20 @@ class PageRepository extends EntityRepository $id=$pages->current()->getId(); $entity = $this->find($id); } + + // Si aucune page profilé on récupère la premiere page perso + if(!$entity) { + if($pagesuser) + $entity=$pagesuser[0]; + } + + // Si aucune page profilé on récupère la premiere page perso + if(!$entity) { + if($groupsshared) { + if($groupsshared[0]) + $entity=$groupsshared[0]->pagesshared[0]; + } + } } // ou On récupère la premiere page de l'utilisateur From c631ea36ef40c4d89e1d68db6ad23e62e56a0db8 Mon Sep 17 00:00:00 2001 From: afornerot Date: Thu, 3 Oct 2019 09:40:53 +0200 Subject: [PATCH 3/5] commit pour push --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 63b256d3..b0dc5f0b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ EOLE_VERSION=2.6 EOLE_RELEASE=2.6.2 PKGAPPS=web - ################################ # Début de zone à ne pas éditer ################################ From 86ad4a6e11d1343d45dc51aa38881bddef44dc9d Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 4 Oct 2019 10:22:14 +0200 Subject: [PATCH 4/5] =?UTF-8?q?r=C3=A9glage=20widget=20groupmessage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Cadoles/CoreBundle/Command/data/core-init-01.sql | 6 ++++-- .../Resources/views/Pagewidget/viewgroupmessage.html.twig | 2 +- 2 files changed, 5 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 e8e84a60..fe30d981 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 @@ -5,10 +5,11 @@ SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES -(-100, 'scribe26', '0000000A'); +(-100, 'DRAAF', '130007107'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'scribe26', 'PWD_CAS', 'admin@scribe26.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '0000000A', 'simple'); +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}kiCU5m1uSvZhdgI1Ga9gdq/8HUBjSIpX +', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); @@ -24,6 +25,7 @@ INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `f (1200, NULL, 1200, 'ORGANISATION', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), (1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN,ROLE_MODO', ''), (1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN,ROLE_MODO', ''), +(1230, 1200, 1230, 'Niveau 02', 'cadoles_core_config_niveau02', 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), (1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO', ''), (1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO', ''), (1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO', ''), diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig index c2a5c497..87be451a 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroupmessage.html.twig @@ -80,7 +80,7 @@
-
+
{{message.user.lastname}} {{message.user.firstname}}
{{message.date|date('d/m/Y H:i')}}

{{ message.topic | raw }} From 522d0c8b0f64d44136899820e692fd654e2d3e88 Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 4 Oct 2019 11:30:13 +0200 Subject: [PATCH 5/5] adaptation de style --- .../CoreBundle/Resources/public/css/style.css | 6 +++- .../views/Pagewidget/viewfile.html.twig | 29 +++++++++---------- .../views/Pagewidget/viewflux.html.twig | 2 +- .../views/Pagewidget/viewinfo.html.twig | 22 +++++++++----- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css index f611d414..e9814758 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css @@ -276,6 +276,10 @@ span.item-drag { height: auto; } +.grid-item-img { + filter: drop-shadow(1px 1px 1px #222); +} + .grid-item .grid-item-title { display: inline-block; vertical-align: top; @@ -436,7 +440,7 @@ a.item-heart { .grid .grid-image { width:19.2%; height:auto; - margin: 1% 0px 0px 0px; + /*margin: 1% 0px 0px 0px;*/ } .grid .grid-image .item-link { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig index 32be8cb6..a55abc79 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewfile.html.twig @@ -65,8 +65,8 @@
{% if canadd %} - - + + {% endif %} @@ -86,7 +86,7 @@
-

{{ file.name }}

+

{{ file.name }}

@@ -95,20 +95,17 @@ {% endfor %} {% if canadd %} -
-
- - {% endif %}
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig index c244127b..b8d4d61c 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewflux.html.twig @@ -56,7 +56,7 @@ {% set firstflux="" %} - {% if fluxs is not empty %} + {% if fluxs is defined and fluxs is not empty %}
{% if fluxs is defined %} {% if fluxs|length > 1 %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewinfo.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewinfo.html.twig index b6ec3979..c06bb14f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewinfo.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewinfo.html.twig @@ -19,6 +19,7 @@ {% set stylelink = "color:#" ~ color['fontcolorhover'] %} {% endif %} +
{% if canupdate %}
@@ -27,8 +28,8 @@
{% endif %} - -
+{% set canadd = false %} +
{% set style = "width: 90px;display: block;margin: auto; padding: 10px 0px 10px 0px; position: inherit;height: auto;" %} {% if icon %} @@ -37,9 +38,11 @@ {% endif %}
- {% set canadd = false %} +
-
+ + +
{%if usage=="group" %}Groupe
{% endif %} {{ title }}

{{ description | raw }} @@ -56,13 +59,16 @@
+

+ {{ member.user.lastname }} {{ member.user.firstname }} {%if member.fgmanager%} - +
+ {% if member.user==app.user %} {% set canadd=true %} {% endif %} - {%endif%}
- {{ member.user.lastname }} {{ member.user.firstname }} + {%endif%} +

@@ -78,7 +84,7 @@
- Ajouter un membre +

Ajouter un membre