diff --git a/dicos/91_ninegate.xml b/dicos/91_ninegate.xml index 000fb384..8dc5c927 100644 --- a/dicos/91_ninegate.xml +++ b/dicos/91_ninegate.xml @@ -74,6 +74,8 @@ non scribe + oui + oui cadoles cadoles @@ -398,6 +400,8 @@ ninegate_syncldap ninegate_ldaptemplate + ninegate_scribegroup + ninegate_scribemaster ninegate_pwdadmin ninegate_organization @@ -517,6 +521,17 @@ + + + + scribe + + ninegate_scribegroup + ninegate_scribemaster + + + + non 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 7d131a8b..e3174898 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -101,6 +101,8 @@ class SynchroCommand extends Command $ldap_lastname = $this->container->getParameter('ldap_lastname'); $ldap_email = $this->container->getParameter('ldap_email'); $ldap_usersadmin = $this->container->getParameter('ldap_usersadmin'); + $scribe_group = $this->container->getParameter('scribe_group'); + $scribe_master = $this->container->getParameter('scribe_master'); $fieldstoread = array($ldap_username,$ldap_firstname,$ldap_lastname,$ldap_email); $ldapusers = array(); $ldapmails = array(); @@ -119,7 +121,7 @@ class SynchroCommand extends Command $ldapfilter="(|(&(uid=*)(ENTPersonProfils=enseignant))(&(uid=*)(typeadmin=0))(&(uid=*)(typeadmin=2)))"; $label="PROFIL - Enseignants"; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); // Responsables $ldapfilter="(&(uid=*)(ENTPersonProfils=responsable))"; @@ -131,7 +133,7 @@ class SynchroCommand extends Command $ldapfilter="(&(uid=*)(ENTPersonProfils=administratif))"; $label="PROFIL - Administratifs"; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); // Classes $this->writeln(''); @@ -143,7 +145,7 @@ class SynchroCommand extends Command $label="CLASSE - ".$result["cn"]; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } // Options @@ -156,7 +158,7 @@ class SynchroCommand extends Command $label="OPTION - ".$result["cn"]; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } // Groupes @@ -169,7 +171,7 @@ class SynchroCommand extends Command $label="GROUPE - ".$result["cn"]; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } } @@ -243,7 +245,8 @@ class SynchroCommand extends Command if($user->getLastname()!=$result[$ldap_lastname]||$user->getFirstname()!=$result[$ldap_firstname]||$user->getEmail()!=$result[$ldap_email]||$toadmin) { $usermail=$this->em->getRepository('CadolesCoreBundle:User')->findOneBy(array('email' => $result[$ldap_email])); - if($usermail!=$user) { + + if($usermail&&$usermail!=$user) { array_push($tberrors," - Modification dans Bundle impossible >> ".$result[$ldap_username]." un autre utilisateur a déjà ce mail = ".$result[$ldap_email]); } else { @@ -376,6 +379,62 @@ class SynchroCommand extends Command $this->em->clear(); if($nbusers%1000==0) $this->writelnred(" == Nombre d'utilisateurs traités = $nbusers=="); } + + $this->writeln(''); + $this->writeln('== GROUPS ============================================'); + // Pour chaque groupe annuaire on s'assure que le groupe existe bien dans l'annuaire + $groups=$this->em->getRepository('CadolesCoreBundle:Group')->findBy(["fgtemplate"=>true]); + foreach($groups as $group) { + if(stripos($group->getLabel(),"PROFIL - ")===false) { + $results = $this->ldap->search($group->getLdapfilter(), [], $this->ldap_basedn); + if(count($results)==0) { + $this->writeln(" - Suppression dans Bundle >> ".$group->getLabel()); + if(!$simulate) { + if($group->getFgcanshare()) { + // Sur l'ensemble des pages liés + $pages=$group->getPages(); + foreach($pages as $page) { + $getgroups=$page->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($page); + } + + // Sur l'ensemble des calendar liés + $calendars=$group->getCalendars(); + foreach($calendars as $calendar) { + $getgroups=$calendar->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($calendar); + } + + // Sur l'ensemble des blog liés + $blogs=$group->getBlogs(); + foreach($blogs as $blog) { + $getgroups=$blog->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($blog); + } + + // Sur l'ensemble des project liés + $projects=$group->getProjects(); + foreach($projects as $project) { + $getgroups=$project->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($project); + } + } + + $this->em->remove($group); + $this->em->flush(); + } + } + } + } + } } else { @@ -700,13 +759,13 @@ class SynchroCommand extends Command $group=$this->em->getRepository('CadolesCoreBundle:Group')->findOneBy(array('fgtemplate' => true, 'label' => $label)); if(!$group) { $group=new Group(); - $group->setFgcanshare($fgcanshare); $group->setFgcancreatepage(false); $group->setFgcancreateblog(false); $group->setFgcancreatecalendar(false); $group->setFgcancreateproject(false); } + $group->setFgcanshare($fgcanshare); $group->setLabel($label); $group->setFgopen(false); $group->setFgall(false); @@ -782,7 +841,8 @@ class SynchroCommand extends Command // Si modèle scribe $ldap_template = $this->container->getParameter('ldap_template'); - if($ldap_template=="scribe") { + $scribe_master = $this->container->getParameter('scribe_master'); + if($ldap_template=="scribe"&&$scribe_master) { $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); 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 a47e47a7..a20ed7e0 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -958,7 +958,7 @@ class GroupController extends Controller // Sur l'ensemble des project liés $projects=$data->getProjects(); foreach($projects as $project) { - $groups=$blog->getGroups(); + $groups=$project->getGroups(); // si la page est lié qu'à un seul group on peut la supprimer if($groups->count()==1) $em->remove($project); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js index 1e0a076d..0280f746 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js @@ -255,7 +255,7 @@ function MyTourGroupe() { element: $("#diviconsel"), title: "Icône du groupe", placement : "right", - content: "Choisissez l'icône pour votre groupe en cliquant sur 'Sélectionner un icône'.", + content: "Choisissez l'icône pour votre groupe en cliquant sur 'Sélectionner une icône'.", }, { element: $("#group_submit"), @@ -793,7 +793,7 @@ function AdminGroupSubmit() { element: $("#diviconsel"), title: "Icône du groupe", placement : "top", - content: "Choisissez l'icône pour le groupe en cliquant sur 'Sélectionner un icône'. ", + content: "Choisissez l'icône pour le groupe en cliquant sur 'Sélectionner une icône'. ", }, { element: $("#group_fgcancreatepage"), @@ -1876,7 +1876,7 @@ function AdminIcon() { steps: [ { element: $(".btn:first"), - title: "Ajouter une icone", + title: "Ajouter une icône", placement : "top", content: "Ajoutez une icône en cliquant sur ce bouton - les icônes sont utilisées pour l'identité des items, des widgets et des groupes. En cliquant sur une icône existante, vous pourrez la supprimer ou la modifier. Essayez de choisir des icônes en phase avec les tendances graphiques du portail... ", }, diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig index 35e3b377..41c5877f 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig @@ -41,7 +41,7 @@

{{ app.session.get('appname') }}

-

Vous avez perdu votre connection

+

Vous avez perdu votre connexion

ou

Vous n'avez plus accès à cette page



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 13f492b6..6666532f 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 @@ -121,7 +121,7 @@
{{ form_row(form.idicon) }} - Selectionner un Icône + Selectionner une Icône Détacher l'Icône

@@ -219,7 +219,7 @@ } function selectIcon() { - $("#mymodal").find(".modal-title").html("SELECTIONNER UN ICONE"); + $("#mymodal").find(".modal-title").html("SELECTIONNER UNE ICONE"); var url="{{ path('cadoles_portal_user_icon_select') }}"; $("#mymodal").find("#framemodal").attr("src",url); $("#mymodal").modal("show"); 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 1b7b1f8d..597d3bd7 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 @@ -32,7 +32,7 @@ Action - Icone + Icône Label Ouvert Filtre diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig index 5526446b..d131a30f 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig @@ -59,7 +59,7 @@
- Connection + Connexion
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig index 462dfe89..43885036 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig @@ -66,7 +66,7 @@
- Connection + Connexion
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 6051a8c4..4704ea71 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -21,6 +21,7 @@ use Cadoles\PortalBundle\Entity\Appexternal; use Cadoles\PortalBundle\Entity\Flux; use Cadoles\PortalBundle\Entity\Projecttasktag; use Cadoles\PortalBundle\Entity\Projecttaskstatus; +use Cadoles\PortalBundle\Entity\Alertcategory; use Cadoles\PortalBundle\Entity\Itemcategory; use Cadoles\PortalBundle\Entity\Item; @@ -95,6 +96,10 @@ class InitDataCommand extends ContainerAwareCommand $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); $metadata->setIdGenerator(new AssignedGenerator()); + $metadata = $em->getClassMetaData('CadolesPortalBundle:Alertcategory'); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); + $metadata->setIdGenerator(new AssignedGenerator()); + $metadata = $em->getClassMetaData('CadolesPortalBundle:Itemcategory'); $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); $metadata->setIdGenerator(new AssignedGenerator()); @@ -318,6 +323,21 @@ class InitDataCommand extends ContainerAwareCommand } +//== ALERTCATEGORY======================================================================================================================================== + $output->writeln(' > Creation Alert Category'); + + $entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_megaphone2.png"]); + $entityAlertcategoryapp = $em->getRepository('CadolesPortalBundle:Alertcategory')->find(-100); + if(!$entityAlertcategoryapp) { + $entityAlertcategoryapp = new Alertcategory(); + $entityAlertcategoryapp->setId(-100); + $entityAlertcategoryapp->setColor("00a996"); + $entityAlertcategoryapp->setLabel('Annonces'); + $entityAlertcategoryapp->setIcon($entityicon); + $em->persist($entityAlertcategoryapp); + } + + //== ITEMCATEGORY======================================================================================================================================== $output->writeln(' > Creation Item Category'); @@ -1221,7 +1241,7 @@ class InitDataCommand extends ContainerAwareCommand $entityWidget->setAutoajust(true); $entityWidget->setBorder(false); $entityWidget->setOpened(true); - $entityWidget->setAccess(["config","user","group"]); + $entityWidget->setAccess(["config","group"]); $parameter = json_decode('{"fields": []}'); $entityWidget->setParameter($parameter); $em->persist($entityWidget); @@ -1328,7 +1348,7 @@ class InitDataCommand extends ContainerAwareCommand $entityWidget->setOpened(true); $entityWidget->setAccess(["config","user","group"]); $entityWidget->setColorbodyback("ffffff"); - $parameter = json_decode('{"fields": [{"id": "seetitle", "loc": "col1", "type": "boolean", "label": "Afficher le titre", "value": "0", "mandatory": "true"},{"id": "seeicon", "loc": "col1", "type": "boolean", "label": "Afficher l\'icone", "value": "0", "mandatory": "true"}]}'); + $parameter = json_decode('{"fields": [{"id": "seetitle", "loc": "col1", "type": "boolean", "label": "Afficher le titre", "value": "0", "mandatory": "true"},{"id": "seeicon", "loc": "col1", "type": "boolean", "label": "Afficher l\'icône", "value": "0", "mandatory": "true"}]}'); $entityWidget->setParameter($parameter); $em->persist($entityWidget); 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 1d1953b9..27a0102f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogController.php @@ -112,8 +112,9 @@ class BlogController extends Controller foreach($datas as $data) { $route=str_replace("_config_","_".$access."_",$this->routeprimary); $action = ""; + $action.="$data->getId()))."'>"; + $action.="$data->getId()))."'>"; $action.="$data->getId()))."' data-method='delete'>"; - $action.="$data->getId()))."'>"; $user=""; if($data->getUser()) { 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 48f3fd6a..21b90872 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendarController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendarController.php @@ -109,8 +109,9 @@ class CalendarController extends Controller foreach($datas as $data) { $route=str_replace("_config_","_".$access."_",$this->routeprimary); $action = ""; + $action.="$data->getId()))."'>"; + $action.="$data->getId()))."'>"; $action.="$data->getId()))."' data-method='delete'>"; - $action.="$data->getId()))."'>"; $user=""; if($data->getUser()) { 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 7ebc3683..23421f0e 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php @@ -123,8 +123,9 @@ class PageController extends Controller $route=str_replace("_config_","_".$access."_",$this->routeprimary); $action = ""; //$action.="$data->getId()))."'>"; + $action.="$data->getId()))."'>"; + $action.="$data->getId()))."'>"; $action.="$data->getId()))."' data-method='delete'>"; - $action.="$data->getId()))."'>"; $user=""; if($data->getUser()) { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagetemplateController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagetemplateController.php index 4377507f..26f55706 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagetemplateController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagetemplateController.php @@ -102,9 +102,9 @@ class PagetemplateController extends Controller $route=str_replace("_config_","_".$access."_",$this->routeprimary); $action = ""; - //$action.="$data->getId()))."'>"; + $action.="$data->getId()))."'>"; + $action.="$data->getId()))."'>"; $action.="$data->getId()))."' data-method='delete'>"; - $action.="$data->getId()))."'>"; array_push($output["data"],[ $action, 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 e94e3132..5cb7ee85 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -1603,7 +1603,7 @@ class PagewidgetController extends Controller $entity = $em->getRepository($this->labelentity)->find($id); if (!$entity) throw $this->createNotFoundException('Unable to find entity.'); - $groupentity=$em->getRepository("CadolesCoreBundle:Group")->find($group); + if($group) $groupentity=$em->getRepository("CadolesCoreBundle:Group")->find($group); // Permissions if($access=="config") { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php index 896560e0..08c9c6d7 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php @@ -112,8 +112,10 @@ class ProjectController extends Controller foreach($datas as $data) { $route=str_replace("_config_","_".$access."_",$this->routeprimary); $action = ""; + $action.="$data->getId()))."'>"; + $action.="$data->getId()))."'>"; $action.="$data->getId()))."' data-method='delete'>"; - $action.="$data->getId()))."'>"; + $user=""; if($data->getUser()) { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alertcategory.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alertcategory.php index 3999c47c..3eb72d09 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alertcategory.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alertcategory.php @@ -50,6 +50,13 @@ class Alertcategory */ protected $alerts; + // A garder pour forcer l'id en init + public function setId($id) + { + $this->id = $id; + return $this; + } + /** * Constructor diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php index 64d8151e..a7a75e53 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php @@ -11,7 +11,7 @@ use Symfony\Component\Validator\Constraints as Assert; * @ORM\Entity * @ORM\Table(name="icon") * @ORM\HasLifecycleCallbacks - * @UniqueEntity(fields="label", message="Un Icone existe déjà avec ce label") + * @UniqueEntity(fields="label", message="Une Icône existe déjà avec ce label") */ class Icon { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig index f74b8bf1..2a2f0045 100755 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig @@ -57,7 +57,7 @@
@@ -68,7 +68,7 @@