Merge branch 'master' into dist/envole/6/master
This commit is contained in:
commit
c813e78c69
|
@ -29,7 +29,7 @@ class ScriptCommand extends Command
|
||||||
$this
|
$this
|
||||||
->setName('Core:Script')
|
->setName('Core:Script')
|
||||||
->setDescription('Lauch Script')
|
->setDescription('Lauch Script')
|
||||||
->setHelp('Execeute some script : visibletrue / ')
|
->setHelp('Execeute some script : visibletrue / setusersniveau')
|
||||||
->addArgument('scriptname', InputArgument::OPTIONAL, 'scriptname')
|
->addArgument('scriptname', InputArgument::OPTIONAL, 'scriptname')
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ class ScriptCommand extends Command
|
||||||
|
|
||||||
switch($scriptname) {
|
switch($scriptname) {
|
||||||
case "visibletrue": $this->visibletrue(); break;
|
case "visibletrue": $this->visibletrue(); break;
|
||||||
|
case "setusersniveau": $this->setusersniveau(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->writeln('');
|
$this->writeln('');
|
||||||
|
@ -70,6 +71,19 @@ class ScriptCommand extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function setusersniveau() {
|
||||||
|
$users = $this->em->getRepository('CadolesCoreBundle:User')->findAll();
|
||||||
|
foreach($users as $user) {
|
||||||
|
$this->writeln($user->getUsername());
|
||||||
|
|
||||||
|
$user->setLabelniveau01($user->getNiveau01()->getLabel());
|
||||||
|
$user->setLabelniveau02(($user->getNiveau02()?$user->getNiveau02()->getLabel():null));
|
||||||
|
|
||||||
|
$this->em->persist($user);
|
||||||
|
$this->em->flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function writelnred($string) {
|
private function writelnred($string) {
|
||||||
$this->output->writeln('<fg=red>'.$string.'</>');
|
$this->output->writeln('<fg=red>'.$string.'</>');
|
||||||
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
||||||
|
|
|
@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
|
||||||
(-100, 'Interne', 'SIREN');
|
(-100, 'Interne', 'SIREN');
|
||||||
|
|
||||||
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
|
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
|
||||||
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}oBuVhAUjam9tCeMBwS0xBsAM2PdHZLW3
|
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}RpichoTKCN2p1e9VPz1JnGxjaZ7Xe1Eq
|
||||||
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');
|
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,9 @@ use Symfony\Component\Form\FormError;
|
||||||
use Ramsey\Uuid\Uuid;
|
use Ramsey\Uuid\Uuid;
|
||||||
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
|
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||||
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||||
|
|
||||||
use Cadoles\CoreBundle\Entity\Group;
|
use Cadoles\CoreBundle\Entity\Group;
|
||||||
use Cadoles\CoreBundle\Entity\Usergroup;
|
use Cadoles\CoreBundle\Entity\Usergroup;
|
||||||
|
@ -222,6 +225,7 @@ class GroupController extends Controller
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$group=$this->getData($id);
|
$group=$this->getData($id);
|
||||||
|
$this->canManager($group,$access);
|
||||||
|
|
||||||
$sub = $em->createQueryBuilder();
|
$sub = $em->createQueryBuilder();
|
||||||
$sub->select("usergroup");
|
$sub->select("usergroup");
|
||||||
|
@ -351,6 +355,7 @@ class GroupController extends Controller
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$group=$this->getData($id);
|
$group=$this->getData($id);
|
||||||
|
$this->canManager($group,$access);
|
||||||
|
|
||||||
$sub = $em->createQueryBuilder();
|
$sub = $em->createQueryBuilder();
|
||||||
$sub->select("usergroup");
|
$sub->select("usergroup");
|
||||||
|
@ -499,6 +504,7 @@ class GroupController extends Controller
|
||||||
$groupid=$request->request->get('groupid');
|
$groupid=$request->request->get('groupid');
|
||||||
|
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||||
|
$this->canManager($group,$access);
|
||||||
if($group->getFgAll()||$group->getFgtemplate())
|
if($group->getFgAll()||$group->getFgtemplate())
|
||||||
throw $this->createNotFoundException('Permission denied');
|
throw $this->createNotFoundException('Permission denied');
|
||||||
|
|
||||||
|
@ -563,6 +569,7 @@ class GroupController extends Controller
|
||||||
$groupid=$request->request->get('groupid');
|
$groupid=$request->request->get('groupid');
|
||||||
|
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||||
|
$this->canManager($group,$access);
|
||||||
if($group->getFgAll()||$group->getFgTemplate())
|
if($group->getFgAll()||$group->getFgTemplate())
|
||||||
throw $this->createNotFoundException('Permission denied');
|
throw $this->createNotFoundException('Permission denied');
|
||||||
|
|
||||||
|
@ -660,6 +667,9 @@ class GroupController extends Controller
|
||||||
$userid=$request->request->get('user');
|
$userid=$request->request->get('user');
|
||||||
$groupid=$request->request->get('group');
|
$groupid=$request->request->get('group');
|
||||||
|
|
||||||
|
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||||
|
$this->canManager($group,$access);
|
||||||
|
|
||||||
$data = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$userid,"group"=>$groupid));
|
$data = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$userid,"group"=>$groupid));
|
||||||
if($data) $data->setFgmanager(!$data->getFgmanager());
|
if($data) $data->setFgmanager(!$data->getFgmanager());
|
||||||
|
|
||||||
|
@ -760,6 +770,7 @@ class GroupController extends Controller
|
||||||
// Récupération de l'enregistrement courant
|
// Récupération de l'enregistrement courant
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$data=$this->getData($id);
|
$data=$this->getData($id);
|
||||||
|
$this->canOwner($data,$access);
|
||||||
|
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
$form = $this->createForm(GroupType::class,$data,array(
|
$form = $this->createForm(GroupType::class,$data,array(
|
||||||
|
@ -837,6 +848,7 @@ class GroupController extends Controller
|
||||||
|
|
||||||
// Récupération de l'enregistrement courant
|
// Récupération de l'enregistrement courant
|
||||||
$data=$this->getData($id);
|
$data=$this->getData($id);
|
||||||
|
$this->canOwner($data,$access);
|
||||||
|
|
||||||
// Vérifier que cet enregistrement est supprimable
|
// Vérifier que cet enregistrement est supprimable
|
||||||
if($data->getFgAll()||$data->getFgTemplate())
|
if($data->getFgAll()||$data->getFgTemplate())
|
||||||
|
@ -917,6 +929,7 @@ class GroupController extends Controller
|
||||||
{
|
{
|
||||||
// Récupération de l'enregistrement courant
|
// Récupération de l'enregistrement courant
|
||||||
$data=$this->getData($id);
|
$data=$this->getData($id);
|
||||||
|
$this->canManager($data,$access);
|
||||||
|
|
||||||
// Affichage du formulaire
|
// Affichage du formulaire
|
||||||
return $this->render($this->labelentity.':users.html.twig', [
|
return $this->render($this->labelentity.':users.html.twig', [
|
||||||
|
@ -928,6 +941,106 @@ class GroupController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function usergroupexportAction($id,Request $request, $access="config")
|
||||||
|
{
|
||||||
|
// Récupération de l'enregistrement courant
|
||||||
|
$data=$this->getData($id);
|
||||||
|
$this->canManager($data,$access);
|
||||||
|
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$dir = $this->get('kernel')->getRootDir() . '/../uploads/export/';
|
||||||
|
$file = "export-".$id.".csv";
|
||||||
|
|
||||||
|
$fs = new Filesystem();
|
||||||
|
$fs->mkdir($dir);
|
||||||
|
|
||||||
|
$csvh = fopen($dir.$file, 'w');
|
||||||
|
$d = ';'; // this is the default but i like to be explicit
|
||||||
|
$e = '"'; // this is the default but i like to be explicit
|
||||||
|
|
||||||
|
// Entête de colonne
|
||||||
|
$data=["id","Login","Nom","Prénom","Email","Téléphone",$this->getParameter("labelniveau01"),$this->getParameter("labelniveau02"),"Métier","Fonction","Nom Usage","Autres Prénom","Sexe","Adresse","Date Naissance","Pays Naissance","Ville Naissance"];
|
||||||
|
fputcsv($csvh, $data, $d, $e);
|
||||||
|
|
||||||
|
// Liste des utilisateurs en fonction du role de l'utilisateur en cours
|
||||||
|
$qb = $em->createQueryBuilder();
|
||||||
|
if($this->isGranted('ROLE_ADMIN')||$access=="user") {
|
||||||
|
$users = $qb->select('user')
|
||||||
|
->from('CadolesCoreBundle:User','user')
|
||||||
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
|
->where('usergroup.group=:group')
|
||||||
|
->andWhere('usergroup.user=user')
|
||||||
|
->setParameter("group", $id)
|
||||||
|
->getQuery()
|
||||||
|
->getResult();
|
||||||
|
}
|
||||||
|
elseif($this->isGranted('ROLE_MODO')) {
|
||||||
|
$users = $qb->select('user')
|
||||||
|
->from('CadolesCoreBundle:User','user')
|
||||||
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
|
->from('CadolesCoreBundle:Niveau01','niveau01')
|
||||||
|
->from('CadolesCoreBundle:UserModo', 'usermodo')
|
||||||
|
->where('usergroup.group=:group')
|
||||||
|
->andWhere('usergroup.user=user')
|
||||||
|
->andwhere('user.niveau01=niveau01.id')
|
||||||
|
->andwhere("usermodo.niveau01 = user.niveau01")
|
||||||
|
->andWhere("usermodo.user = :userid")
|
||||||
|
->setParameter("group", $id)
|
||||||
|
->setParameter("userid", $this->getUser()->getId())
|
||||||
|
->getQuery()
|
||||||
|
->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($users as $user) {
|
||||||
|
$data = [
|
||||||
|
"id"=>$user->getId(),
|
||||||
|
"username"=>$user->getUsername(),
|
||||||
|
"name"=>$user->getLastname(),
|
||||||
|
"firstname"=>$user->getFirstname(),
|
||||||
|
"email"=>$user->getEmail(),
|
||||||
|
"phone"=>$user->getTelephonenumber(),
|
||||||
|
"niveau01"=>$user->getNiveau01()->getLabel(),
|
||||||
|
"niveau02"=>($user->getNiveau02()?$user->getNiveau02()->getLabel():""),
|
||||||
|
"job"=>$user->getJob(),
|
||||||
|
"position"=>$user->getPosition(),
|
||||||
|
"usualname"=>$user->getUsualname(),
|
||||||
|
"givensname"=>$user->getGivensname(),
|
||||||
|
"gender"=>$user->getGender(),
|
||||||
|
"postaladress"=>$user->getPostaladress(),
|
||||||
|
"birthdate"=>($user->getBirthdate()?$user->getBirthdate()->format("d/m/Y"):""),
|
||||||
|
"birthcountry"=>($user->getBirthcountry()?$user->getBirthcountry()->getLabel():""),
|
||||||
|
"birthplace"=>($user->getBirthplace()?$user->getBirthplace()->getLabel():""),
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
fputcsv($csvh, $data, $d, $e);
|
||||||
|
}
|
||||||
|
fclose($csvh);
|
||||||
|
|
||||||
|
$response = new BinaryFileResponse($dir.$file);
|
||||||
|
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function canManager($group,$access) {
|
||||||
|
if($access!="config") {
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$ismanager=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser(),"fgmanager"=>true]);
|
||||||
|
if(!$ismanager)
|
||||||
|
throw $this->createNotFoundException('Permission denied');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function canOwner($group,$access) {
|
||||||
|
if($access!="config") {
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$isowner=($group->getOwner()==$this->getUser());
|
||||||
|
if(!$isowner)
|
||||||
|
throw $this->createNotFoundException('Permission denied');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected function ctrlOwner($group) {
|
protected function ctrlOwner($group) {
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
if($group->getOwner()) {
|
if($group->getOwner()) {
|
||||||
|
|
|
@ -804,10 +804,6 @@ class UserController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($users as $user) {
|
foreach($users as $user) {
|
||||||
$groups="";
|
|
||||||
foreach($user->getGroups() as $group) {
|
|
||||||
$groups.=$group->getGroup()->getLabel()." ";
|
|
||||||
}
|
|
||||||
$data = [
|
$data = [
|
||||||
"id"=>$user->getId(),
|
"id"=>$user->getId(),
|
||||||
"username"=>$user->getUsername(),
|
"username"=>$user->getUsername(),
|
||||||
|
|
|
@ -92,6 +92,17 @@ class User implements UserInterface, \Serializable
|
||||||
*/
|
*/
|
||||||
private $siret;
|
private $siret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=250, nullable=true)
|
||||||
|
*/
|
||||||
|
private $labelniveau01;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=250, nullable=true)
|
||||||
|
*/
|
||||||
|
private $labelniveau02;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", length=60, nullable=true)
|
* @ORM\Column(type="string", length=60, nullable=true)
|
||||||
*/
|
*/
|
||||||
|
@ -629,6 +640,54 @@ class User implements UserInterface, \Serializable
|
||||||
return $this->siret;
|
return $this->siret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set labelniveau01
|
||||||
|
*
|
||||||
|
* @param string $labelniveau01
|
||||||
|
*
|
||||||
|
* @return User
|
||||||
|
*/
|
||||||
|
public function setLabelniveau01($labelniveau01)
|
||||||
|
{
|
||||||
|
$this->labelniveau01 = $labelniveau01;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get labelniveau01
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getLabelniveau01()
|
||||||
|
{
|
||||||
|
return $this->labelniveau01;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set labelniveau02
|
||||||
|
*
|
||||||
|
* @param string $labelniveau02
|
||||||
|
*
|
||||||
|
* @return User
|
||||||
|
*/
|
||||||
|
public function setLabelniveau02($labelniveau02)
|
||||||
|
{
|
||||||
|
$this->labelniveau02 = $labelniveau02;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get labelniveau02
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getLabelniveau02()
|
||||||
|
{
|
||||||
|
return $this->labelniveau02;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set usualname
|
* Set usualname
|
||||||
*
|
*
|
||||||
|
|
|
@ -20,6 +20,7 @@ class syncNiveau01 implements EventSubscriber
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->shouldSync = true;
|
$this->shouldSync = true;
|
||||||
$this->changeSiren = true;
|
$this->changeSiren = true;
|
||||||
|
$this->changeLabel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSubscribedEvents()
|
public function getSubscribedEvents()
|
||||||
|
@ -41,6 +42,7 @@ class syncNiveau01 implements EventSubscriber
|
||||||
// Synchronisation uniquement si changement de valeur
|
// Synchronisation uniquement si changement de valeur
|
||||||
$this->shouldSync = $args->hasChangedField('label')||$args->hasChangedField('siren');
|
$this->shouldSync = $args->hasChangedField('label')||$args->hasChangedField('siren');
|
||||||
$this->changeSiren = $args->hasChangedField('siren');
|
$this->changeSiren = $args->hasChangedField('siren');
|
||||||
|
$this->changeLabel = $args->hasChangedField('label');
|
||||||
|
|
||||||
if($args->hasChangedField('label')) $this->oldid=$args->getOldValue('label');
|
if($args->hasChangedField('label')) $this->oldid=$args->getOldValue('label');
|
||||||
|
|
||||||
|
@ -57,7 +59,7 @@ class syncNiveau01 implements EventSubscriber
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($entity instanceof Niveau01 && $this->changeSiren) {
|
if ($entity instanceof Niveau01 && ($this->changeSiren||$this->changeLabel)) {
|
||||||
// On change le SIRET de l'ensemble des utlisateurs associés à cet établissement
|
// On change le SIRET de l'ensemble des utlisateurs associés à cet établissement
|
||||||
$qb = $this->em->createQueryBuilder();
|
$qb = $this->em->createQueryBuilder();
|
||||||
$datas= $qb ->select('table')->from('CadolesCoreBundle:User','table')
|
$datas= $qb ->select('table')->from('CadolesCoreBundle:User','table')
|
||||||
|
@ -67,10 +69,11 @@ class syncNiveau01 implements EventSubscriber
|
||||||
->getResult();
|
->getResult();
|
||||||
foreach($datas as $data) {
|
foreach($datas as $data) {
|
||||||
$data->setSiren($entity->getSiren());
|
$data->setSiren($entity->getSiren());
|
||||||
|
$data->setLabelniveau01($entity->getLabel());
|
||||||
$this->em->persist($data);
|
$this->em->persist($data);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postPersist(LifecycleEventArgs $args)
|
public function postPersist(LifecycleEventArgs $args)
|
||||||
|
|
|
@ -22,6 +22,7 @@ class syncNiveau02 implements EventSubscriber
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->shouldSync = true;
|
$this->shouldSync = true;
|
||||||
$this->changeSiret = true;
|
$this->changeSiret = true;
|
||||||
|
$this->changeLabel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSubscribedEvents()
|
public function getSubscribedEvents()
|
||||||
|
@ -43,6 +44,7 @@ class syncNiveau02 implements EventSubscriber
|
||||||
// Synchronisation uniquement si changement de valeur
|
// Synchronisation uniquement si changement de valeur
|
||||||
$this->shouldSync = $args->hasChangedField('label')||$args->hasChangedField('siret')||$args->hasChangedField('postaladress');
|
$this->shouldSync = $args->hasChangedField('label')||$args->hasChangedField('siret')||$args->hasChangedField('postaladress');
|
||||||
$this->changeSiret = $args->hasChangedField('siret');
|
$this->changeSiret = $args->hasChangedField('siret');
|
||||||
|
$this->changeLabel = $args->hasChangedField('label');
|
||||||
|
|
||||||
if($args->hasChangedField('label')) $this->oldid=$args->getOldValue('label');
|
if($args->hasChangedField('label')) $this->oldid=$args->getOldValue('label');
|
||||||
}
|
}
|
||||||
|
@ -56,7 +58,7 @@ class syncNiveau02 implements EventSubscriber
|
||||||
$this->upsertNiveau02($entity);
|
$this->upsertNiveau02($entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($entity instanceof Niveau02 && $this->changeSiret) {
|
if ($entity instanceof Niveau02 && ($this->changeSiret||$this->changeLabel)) {
|
||||||
// On change le SIRET de l'ensemble des utlisateurs associés à cet établissement
|
// On change le SIRET de l'ensemble des utlisateurs associés à cet établissement
|
||||||
$qb = $this->em->createQueryBuilder();
|
$qb = $this->em->createQueryBuilder();
|
||||||
$datas= $qb ->select('table')->from('CadolesCoreBundle:User','table')
|
$datas= $qb ->select('table')->from('CadolesCoreBundle:User','table')
|
||||||
|
@ -66,6 +68,7 @@ class syncNiveau02 implements EventSubscriber
|
||||||
->getResult();
|
->getResult();
|
||||||
foreach($datas as $data) {
|
foreach($datas as $data) {
|
||||||
$data->setSiret($entity->getSiret());
|
$data->setSiret($entity->getSiret());
|
||||||
|
$data->setLabelniveau02($entity->getLabel());
|
||||||
$this->em->persist($data);
|
$this->em->persist($data);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,8 @@ class syncUser implements EventSubscriber
|
||||||
$args->hasChangedField('niveau02') ||
|
$args->hasChangedField('niveau02') ||
|
||||||
$args->hasChangedField('siren') ||
|
$args->hasChangedField('siren') ||
|
||||||
$args->hasChangedField('siret') ||
|
$args->hasChangedField('siret') ||
|
||||||
|
$args->hasChangedField('labelniveau01') ||
|
||||||
|
$args->hasChangedField('labelniveau02') ||
|
||||||
$args->hasChangedField('authlevel') ||
|
$args->hasChangedField('authlevel') ||
|
||||||
$args->hasChangedField('usualname') ||
|
$args->hasChangedField('usualname') ||
|
||||||
$args->hasChangedField('telephonenumber') ||
|
$args->hasChangedField('telephonenumber') ||
|
||||||
|
@ -68,10 +70,15 @@ class syncUser implements EventSubscriber
|
||||||
;
|
;
|
||||||
|
|
||||||
$entity->setSiren($entity->getNiveau01()->getSiren());
|
$entity->setSiren($entity->getNiveau01()->getSiren());
|
||||||
if($entity->getNiveau02()!==null)
|
$entity->setLabelniveau01($entity->getNiveau01()->getLabel());
|
||||||
|
if($entity->getNiveau02()!==null) {
|
||||||
$entity->setSiret($entity->getNiveau02()->getSiret());
|
$entity->setSiret($entity->getNiveau02()->getSiret());
|
||||||
else
|
$entity->setLabelniveau02($entity->getNiveau02()->getLabel());
|
||||||
|
}
|
||||||
|
else {
|
||||||
$entity->setSiret(null);
|
$entity->setSiret(null);
|
||||||
|
$entity->setLabelniveau02(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postUpdate(LifecycleEventArgs $args)
|
public function postUpdate(LifecycleEventArgs $args)
|
||||||
|
|
|
@ -385,6 +385,10 @@ cadoles_core_config_group_ajax_switchmanager:
|
||||||
path: /config/group/ajax/switchmanager
|
path: /config/group/ajax/switchmanager
|
||||||
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: config }
|
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: config }
|
||||||
|
|
||||||
|
cadoles_core_config_group_usergroup_export:
|
||||||
|
path: /config/group/users/export/{id}
|
||||||
|
defaults: { _controller: CadolesCoreBundle:Group:usergroupexport, access: config }
|
||||||
|
|
||||||
#-- Access user
|
#-- Access user
|
||||||
cadoles_core_user_group:
|
cadoles_core_user_group:
|
||||||
path: /user/group
|
path: /user/group
|
||||||
|
@ -434,7 +438,9 @@ cadoles_core_user_group_ajax_switchmanager:
|
||||||
path: /user/group/ajax/switchmanager
|
path: /user/group/ajax/switchmanager
|
||||||
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: user }
|
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: user }
|
||||||
|
|
||||||
|
cadoles_core_user_group_usergroup_export:
|
||||||
|
path: /user/group/users/export/{id}
|
||||||
|
defaults: { _controller: CadolesCoreBundle:Group:usergroupexport, access: user }
|
||||||
|
|
||||||
|
|
||||||
#== Whitelist ============================================================================================================
|
#== Whitelist ============================================================================================================
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
<a class="btn btn-default" href={{ path('cadoles_core_'~access~'_group') }}>Fermer</a>
|
<a class="btn btn-default" href={{ path('cadoles_core_'~access~'_group') }}>Fermer</a>
|
||||||
{% if moderegistration!="none" and masteridentity=="SQL"%}
|
{% if moderegistration!="none" and masteridentity=="SQL"%}
|
||||||
<a class="btn btn-primary" style="cursor:pointer" onClick="showMail();">Inviter des personnes non listées ci-dessous</a>
|
<a class="btn btn-primary" style="cursor:pointer" onClick="showMail();">Inviter des personnes non listées ci-dessous</a>
|
||||||
{%endif%}
|
{%endif%}
|
||||||
|
<a class="btn btn-default pull-right" href={{ path('cadoles_core_'~access~'_group_usergroup_export',{'id':group.id}) }}>Exporter CSV</a>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
|
|
|
@ -270,7 +270,9 @@ class ldapService
|
||||||
$attrs['userPassword'] = $user->getPassword();
|
$attrs['userPassword'] = $user->getPassword();
|
||||||
$attrs['cn'] = $user->getFirstname() . ' ' . $user->getLastname();
|
$attrs['cn'] = $user->getFirstname() . ' ' . $user->getLastname();
|
||||||
$attrs['siren'] = $user->getNiveau01()->getSiren();
|
$attrs['siren'] = $user->getNiveau01()->getSiren();
|
||||||
|
$attrs['niveau01'] = $user->getNiveau01()->getLabel();
|
||||||
$attrs['siret'] = ($user->getNiveau02()!==null?$user->getNiveau02()->getSiret():"");
|
$attrs['siret'] = ($user->getNiveau02()!==null?$user->getNiveau02()->getSiret():"");
|
||||||
|
$attrs['niveau02'] = ($user->getNiveau02()!==null?$user->getNiveau02()->getLabel():"");
|
||||||
$attrs['authlevel'] = $user->getAuthlevel();
|
$attrs['authlevel'] = $user->getAuthlevel();
|
||||||
$attrs['usualname'] = $user->getUsualname();
|
$attrs['usualname'] = $user->getUsualname();
|
||||||
$attrs['telephoneNumber'] = $user->getTelephonenumber();
|
$attrs['telephoneNumber'] = $user->getTelephonenumber();
|
||||||
|
|
Loading…
Reference in New Issue