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 2932370c..f471eeb5 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql
@@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
(-100, 'Interne', 'SIREN');
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
-(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}aTs3IqgN93ehIEqy93uWTTyxg5wNa+80
+(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}XeJxoO2l4dkHFX78WQ1Ik30sjLt3kffh
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php
index c0ee499c..6326ccf9 100755
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php
@@ -185,7 +185,18 @@ class ConfigController extends Controller
$response->headers->set('Content-Type', 'application/json');
return $response;
}
+
+ public function datauserdefaultAction(Request $request)
+ {
+ $em = $this->getDoctrine()->getManager();
+ $config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser");
+ $config->setValue("");
+ $em->persist($config);
+ $em->flush();
+ return $this->redirectToRoute('cadoles_core_config_datauser');
+ }
+
public function datauserAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
@@ -282,6 +293,17 @@ class ConfigController extends Controller
]);
}
+ public function datausersdefaultAction(Request $request)
+ {
+ $em = $this->getDoctrine()->getManager();
+ $config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers");
+ $config->setValue("");
+ $em->persist($config);
+ $em->flush();
+
+ return $this->redirectToRoute('cadoles_core_config_datausers');
+ }
+
public function datausersAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
@@ -315,6 +337,12 @@ class ConfigController extends Controller
$fields["group"]["perm"]=1;
$fields["group"]["label"]="Groupes";
+ $fields["job"]["perm"]=1;
+ $fields["job"]["label"]="Métier";
+
+ $fields["position"]["perm"]=1;
+ $fields["position"]["label"]="Fonction";
+
$fields["role"]["perm"]=1;
$fields["role"]["label"]="Rôles";
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 c0a40dd6..7dbc9c04 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php
@@ -703,6 +703,7 @@ class GroupController extends Controller
$data->setFgtemplate(false);
if($data->getLdapfilter()!="") $data->setFgopen(false);
if($data->getAttributes()!="") $data->setFgopen(false);
+ if($access=="user") $data->setOwner($this->getUser());
// Icon
$idicon = $form->get('idicon')->getData();
@@ -713,20 +714,6 @@ class GroupController extends Controller
$em->persist($data);
$em->flush();
- // Si acces par user on ajoute forcement le owner comme membre du groupe en tant que manager
- /*
- if($access=="user") {
- $key = Uuid::uuid4();
- $usergroup=new Usergroup;
- $usergroup->setUser($this->getUser());
- $usergroup->setGroup($data);
- $usergroup->setFgmanager(true);
- $usergroup->setKeyvalue($key);
- $em->persist($usergroup);
- $em->flush();
- }
- */
-
// On s'assure que le propriétaire est bien membre du groupe
$this->ctrlOwner($data);
@@ -932,7 +919,7 @@ class GroupController extends Controller
protected function ctrlOwner($group) {
$em = $this->getDoctrine()->getManager();
if($group->getOwner()) {
- $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["user"=>$group->getOwner()]);
+ $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$group->getOwner()]);
if(!$usergroup) {
$key = Uuid::uuid4();
$usergroup=new Usergroup;
@@ -1037,6 +1024,13 @@ class GroupController extends Controller
$tmp=$this->getEntityBy("CadolesCoreBundle:Niveau02","label",$data->getLabel());
if($tmp) $form->addError(new FormError('Un niveau de rang 02 utilise déjà ce label'));
+ // On s'assure que le label ne contient pas des caractères speciaux
+ $string = preg_replace('~[^ @a-zA-Z0-9._-]~', '', $data->getLabel());
+ if($string!=$data->getLabel())
+ {
+ $form->addError(new FormError('Caractères interdit dans ce label'));
+ }
+
if($data->getFgcanshare()&&is_null($data->getPagetemplate()))
$form->addError(new FormError("Un groupe de travail doit avoir un modèle de page d'accueil"));
}
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php
index 4e08c28b..e5f5f40f 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau01Controller.php
@@ -273,7 +273,7 @@ class Niveau01Controller extends Controller
if($data->getNiveau02s()->count() > 0) {
$form->addError(new FormError('Un niveau de rang 02 utilise ce niveau de rang 01 : suppression impossible'));
- }
+ }
}
if ($form->get('submit')->isClicked() && ($mode=="submit" || $mode=="update")) {
@@ -282,6 +282,13 @@ class Niveau01Controller extends Controller
$tmp=$this->getEntityBy("CadolesCoreBundle:Niveau02","label",$data->getLabel());
if($tmp) $form->addError(new FormError('Un niveau de rang 02 utilise déjà ce label'));
+
+ // On s'assure que le label ne contient pas des caractères speciaux
+ $string = preg_replace('~[^@a-zA-Z0-9._-]~', '', $data->getLabel());
+ if($string!=$data->getLabel())
+ {
+ $form->addError(new FormError('Caractères interdit dans ce label'));
+ }
}
if ($form->get('submit')->isClicked() && !$form->isValid()) {
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php
index f05fd500..4a39c44a 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/Niveau02Controller.php
@@ -267,6 +267,13 @@ class Niveau02Controller extends Controller
$tmp=$this->getEntityBy("CadolesCoreBundle:Niveau01","label",$data->getLabel());
if($tmp) $form->addError(new FormError('Un niveau de rang 01 utilise déjà ce label'));
+
+ // On s'assure que le label ne contient pas des caractères speciaux
+ $string = preg_replace('~[^@a-zA-Z0-9._-]~', '', $data->getLabel());
+ if($string!=$data->getLabel())
+ {
+ $form->addError(new FormError('Caractères interdit dans ce label'));
+ }
}
if ($form->get('submit')->isClicked() && !$form->isValid()) {
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 0c50a841..cf58984c 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php
@@ -214,6 +214,14 @@ class UserController extends Controller
break;
case 10 :
+ $qb->orderBy('user.job',$order[0]["dir"]);
+ break;
+
+ case 11 :
+ $qb->orderBy('user.position',$order[0]["dir"]);
+ break;
+
+ case 12 :
$qb->orderBy('user.role',$order[0]["dir"]);
break;
}
@@ -245,6 +253,14 @@ class UserController extends Controller
break;
case 8 :
+ $qb->orderBy('user.job',$order[0]["dir"]);
+ break;
+
+ case 9 :
+ $qb->orderBy('user.position',$order[0]["dir"]);
+ break;
+
+ case 10 :
$qb->orderBy('user.role',$order[0]["dir"]);
break;
}
@@ -279,6 +295,8 @@ class UserController extends Controller
array_push($tmp,$data->getNiveau01()->getLabel());
if($viewniveau02) array_push($tmp,($data->getNiveau02()!==null?$data->getNiveau02()->getLabel():""));
array_push($tmp,$groups);
+ array_push($tmp,$data->getJob());
+ array_push($tmp,$data->getPosition());
array_push($tmp,$data->getRole());
array_push($output["data"],$tmp);
@@ -654,7 +672,7 @@ class UserController extends Controller
$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") {
+ if($this->isGranted('ROLE_MODO')) {
$niveau01=$data->getNiveau01();
$modos=$this->get('security.token_storage')->getToken()->getUser()->getmodos();
$fgperm=false;
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php
index d4dfeca3..d822d2c7 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php
@@ -91,6 +91,10 @@ class Niveau01
*/
protected $items;
+ /**
+ * @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Alert", mappedBy="niveau01s")
+ */
+ protected $alerts;
/**
* Constructor
@@ -427,4 +431,38 @@ class Niveau01
{
return $this->items;
}
+
+ /**
+ * Add alert
+ *
+ * @param \Cadoles\PortalBundle\Entity\Alert $alert
+ *
+ * @return Niveau01
+ */
+ public function addAlert(\Cadoles\PortalBundle\Entity\Alert $alert)
+ {
+ $this->alerts[] = $alert;
+
+ return $this;
+ }
+
+ /**
+ * Remove alert
+ *
+ * @param \Cadoles\PortalBundle\Entity\Alert $alert
+ */
+ public function removeAlert(\Cadoles\PortalBundle\Entity\Alert $alert)
+ {
+ $this->alerts->removeElement($alert);
+ }
+
+ /**
+ * Get alerts
+ *
+ * @return \Doctrine\Common\Collections\Collection
+ */
+ public function getAlerts()
+ {
+ return $this->alerts;
+ }
}
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 9333f7ee..904d8405 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
@@ -165,10 +165,18 @@ cadoles_core_config_datauser:
path: /config/commun/datauser
defaults: { _controller: CadolesCoreBundle:Config:datauser }
+cadoles_core_config_datauserdefault:
+ path: /config/commun/datauserdefault
+ defaults: { _controller: CadolesCoreBundle:Config:datauserdefault }
+
cadoles_core_config_datausers:
path: /config/commun/datausers
defaults: { _controller: CadolesCoreBundle:Config:datausers }
+cadoles_core_config_datausersdefault:
+ path: /config/commun/datausersdefault
+ defaults: { _controller: CadolesCoreBundle:Config:datausersdefault }
+
#== Registration =========================================================================================================
#-- Access config
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml
index 8e9b06e9..9cf7290a 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml
@@ -1,4 +1,28 @@
services:
+ Cadoles\CoreBundle\Command\InitDataCommand:
+ tags:
+ - { name: 'console.command', command: 'Core:InitData' }
+
+ Cadoles\CoreBundle\Command\OnlyCommand:
+ tags:
+ - { name: 'console.command', command: 'Core:Only' }
+
+ Cadoles\CoreBundle\Command\PurgeFileCommand:
+ tags:
+ - { name: 'console.command', command: 'Core:PurgeFile' }
+
+ Cadoles\CoreBundle\Command\PurgeRegistrationCommand:
+ tags:
+ - { name: 'console.command', command: 'Core:PurgeRegistration' }
+
+ Cadoles\CoreBundle\Command\SetPasswordCommand:
+ tags:
+ - { name: 'console.command', command: 'Core:SetPassword' }
+
+ Cadoles\CoreBundle\Command\SynchroCommand:
+ tags:
+ - { name: 'console.command', command: 'Core:Synchro' }
+
cadoles.core.session.listener:
public: true
class: Cadoles\CoreBundle\EventListener\sessionListener
@@ -135,4 +159,6 @@ services:
class: Cadoles\CoreBundle\Service\samlAttributeMapperService
+
+
\ No newline at end of file
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 f02d6c5f..025a599e 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
@@ -274,7 +274,7 @@ span.item-drag {
.grid-item .item-link img {
display: block;
max-width: 100%;
- max-height: 110px;
+ //max-height: 110px;
height: auto;
}
@@ -500,7 +500,7 @@ a.item-heart {
word-wrap: break-word;
width: 100%;
display: block;
- line-height: initial;
+ line-height: 14px;
padding: 0px;
}
@@ -513,9 +513,9 @@ a.item-heart {
.grid .grid-preview .grid-item-title small {
margin-bottom: 10px;
+ font-size:9px;
}
-
@media (max-width: 991px) {
.grid .grid-preview {
width:32.666666667%;
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css
index b3a9bf7e..47bfc2fb 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css
@@ -64,14 +64,7 @@ body.simple {
min-width: 138px;
}
-.grid .grid-preview .grid-item-title {
- font-size:14px;
- line-height: 8px;
-}
-.grid .grid-preview .grid-item-title small {
- font-size:9px;
-}
.widget-bordered .grid-preview img {
border-radius: 0px;
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Config/datauser.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Config/datauser.html.twig
index 91c1f8de..d2bee48f 100755
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Config/datauser.html.twig
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Config/datauser.html.twig
@@ -11,6 +11,16 @@
{{ form_widget(form.submit) }}
+ {% if mode=="datauser" %}
+ Valeurs par défaut
+ {% else %}
+ Valeurs par défaut
+ {% endif %}
+
{% if app.session.flashbag.has('error') %}
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 25f8f093..56c9d576 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
@@ -45,6 +45,9 @@
Login | Nom | Prénom | -Téléphone | {{ labelniveau01 }} | {% if viewniveau02 %}{{ labelniveau02 }} | {% endif %}Groupes | +Métier | +Fonction | Rôle |
---|