Merge branch 'master' into dist/envole/6/master
This commit is contained in:
commit
742383206e
|
@ -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');
|
||||
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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%;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -11,6 +11,16 @@
|
|||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
{% if mode=="datauser" %}
|
||||
<a class="btn btn-danger" href={{ path('cadoles_core_config_datauserdefault') }}
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir revenir aux valeurs par défaut ?">Valeurs par défaut</a>
|
||||
{% else %}
|
||||
<a class="btn btn-danger" href={{ path('cadoles_core_config_datausersdefault') }}
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir revenir aux valeurs par défaut ?">Valeurs par défaut</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
<div class="panel-body">
|
||||
{% if form.label is defined %}
|
||||
{{ form_row(form.label) }}
|
||||
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'>
|
||||
Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _<br>
|
||||
</div>
|
||||
|
||||
{% if form.fgassoc is defined %}
|
||||
{% if masteridentity=="LDAP" %}
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
|
||||
<div class="panel-body">
|
||||
{{ form_row(form.label) }}
|
||||
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'>
|
||||
Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _<br>
|
||||
</div>
|
||||
|
||||
{{ form_row(form.siren) }}
|
||||
{{ form_row(form.showsubappname) }}
|
||||
{% if masteridentity=="LDAP" %}
|
||||
|
|
|
@ -41,6 +41,10 @@
|
|||
<div class="panel-body">
|
||||
{{ form_row(form.niveau01) }}
|
||||
{{ form_row(form.label) }}
|
||||
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'>
|
||||
Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _<br>
|
||||
</div>
|
||||
|
||||
{{ form_row(form.siret) }}
|
||||
{{ form_row(form.postaladress) }}
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{% extends '@CadolesCore/base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
th { font-size: 10px; }
|
||||
td { font-size: 10px; }
|
||||
{% endblock %}
|
||||
{% block pagewrapper %}
|
||||
{% if access=="config" %}
|
||||
<h1 class="page-header">Gestion des Utilisateurs</h1>
|
||||
|
@ -21,7 +25,7 @@
|
|||
|
||||
<div class="panel-body">
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%: font-size:11px;">
|
||||
<thead>
|
||||
<tr>
|
||||
{% if access=="config" %}
|
||||
|
@ -31,13 +35,15 @@
|
|||
<th width="200px class=="{% if fields["login"] is defined and fields["login"].perm==0 %}no-visible{% endif %}">Login</th>
|
||||
<th class="{% if fields["lastname"] is defined and fields["lastname"].perm==0 %}no-visible{% endif %}">Nom</th>
|
||||
<th class="{% if fields["firstname"] is defined and fields["firstname"].perm==0 %}no-visible{% endif %}">Prénom</th>
|
||||
<th class="{% if fields["email"] is defined and fields["email"].perm==0 %}no-visible{% endif %}">Email</th>
|
||||
<th class="{% if fields["email"] is defined and fields["email"].perm==0 %}no-visible{% endif %}" style="width:100px">Email</th>
|
||||
<th class="{% if fields["telephonenumber"] is defined and fields["telephonenumber"].perm==0 %}no-visible{% endif %}">Téléphone</th>
|
||||
<th class="{% if fields["niveau01"] is defined and fields["niveau01"].perm==0 %}no-visible{% endif %}">{{ labelniveau01 }}</th>
|
||||
{% if viewniveau02 %}
|
||||
<th class="no-sort {% if fields["niveau02"] is defined and fields["niveau02"].perm==0 %}no-visible{% endif %}">{{ labelniveau02 }}</th>
|
||||
{% endif %}
|
||||
<th class="no-sort {% if fields["group"] is defined and fields["group"].perm==0 %}no-visible{% endif %}">Groupes</th>
|
||||
<th class="{% if fields["job"] is defined and fields["job"].perm==0 %}no-visible{% endif %}">Métier</th>
|
||||
<th class="{% if fields["position"] is defined and fields["position"].perm==0 %}no-visible{% endif %}">Fonction</th>
|
||||
<th class="{% if fields["role"] is defined and fields["role"].perm==0 %}no-visible{% endif %}">Rôle</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -30,7 +30,7 @@ class CronCommand extends ContainerAwareCommand
|
|||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$entityManager = $this->getContainer()->get('doctrine')->getEntityManager();
|
||||
$entityManager = $this->getContainer()->get('doctrine')->getManager();
|
||||
|
||||
$this->output = $output;
|
||||
$this->filesystem = new Filesystem();
|
||||
|
@ -105,6 +105,7 @@ class CronCommand extends ContainerAwareCommand
|
|||
$parameter = new ArrayInput($jsonparameter);
|
||||
|
||||
// Executer la commande
|
||||
$returnCode=false;
|
||||
try{
|
||||
$returnCode = $command->run($parameter, $output);
|
||||
|
||||
|
|
|
@ -83,6 +83,29 @@ class InitDataCommand extends ContainerAwareCommand
|
|||
$entity->setJsonargument('{"simulate":"false"}');
|
||||
$this->entityManager->persist($entity);
|
||||
}
|
||||
|
||||
// Job synchronisation onlyoffice
|
||||
// Toute les 1h // Désactivé par défaut
|
||||
$widonlyoffice_sync = $this->getContainer()->getParameter('widonlyoffice_sync');
|
||||
$entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(105);
|
||||
if(!$entity&&$widonlyoffice_sync) {
|
||||
$entity = new Cron;
|
||||
$nextdate=$entity->getSubmitdate();
|
||||
$nextdate->setTime(3,0);
|
||||
$entity->setCommand("Core:Only");
|
||||
$entity->setDescription("Synchronisation des Only Office");
|
||||
$entity->setId(105);
|
||||
$entity->setRepeatcall(0);
|
||||
$entity->setRepeatexec(0);
|
||||
$entity->setRepeatinterval(3600);
|
||||
$entity->setNextexecdate($entity->getSubmitdate());
|
||||
$entity->setJsonargument('{"simulate":"false"}');
|
||||
$this->entityManager->persist($entity);
|
||||
}
|
||||
elseif($entity&&!$widonlyoffice_sync) {
|
||||
$this->entityManager->remove($entity);
|
||||
}
|
||||
|
||||
// Job purge des registrations obsolètes
|
||||
// Toute les 5mn
|
||||
$entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(110);
|
||||
|
|
|
@ -141,6 +141,8 @@ class CronController extends Controller
|
|||
|
||||
public function execAction(Request $request, $id)
|
||||
{
|
||||
set_time_limit(0);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ class InitDataCommand extends ContainerAwareCommand
|
|||
|
||||
// Item Limesurvey
|
||||
if($activate_widlimesurvey) {
|
||||
$widlimesurvey_url =$this->getContainer()->getParameter('widlimesurvey_url');
|
||||
$widlimesurvey_url =$this->getContainer()->getParameter('widlimesurvey_url')."/admin";
|
||||
$entityItem = $em->getRepository('CadolesPortalBundle:Item')->find(-374);
|
||||
if(!$entityItem) {
|
||||
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_limesurvey.png"]);
|
||||
|
|
|
@ -69,7 +69,7 @@ class AlertController extends Controller
|
|||
$data = new Alert();
|
||||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(AlertType::class,$data,array("mode"=>"submit"));
|
||||
$form = $this->createForm(AlertType::class,$data,array("mode"=>"submit","labelniveau01" => $this->GetParameter("labelsniveau01")));
|
||||
|
||||
// Récupération des data du formulaire
|
||||
$form->handleRequest($request);
|
||||
|
@ -111,7 +111,8 @@ class AlertController extends Controller
|
|||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(AlertType::class,$data,array(
|
||||
"mode" => "update"
|
||||
"mode" => "update",
|
||||
"labelniveau01" => $this->GetParameter("labelsniveau01")
|
||||
));
|
||||
|
||||
// Récupération des data du formulaire
|
||||
|
|
|
@ -737,6 +737,7 @@ class PagewidgetController extends Controller
|
|||
// Profilage
|
||||
$user=$this->getUser();
|
||||
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
||||
$niveau01=($user?$user->getNiveau01():null);
|
||||
$groups=($user?$user->getGroups():[]);
|
||||
|
||||
// Initialisation du calcul des alerts
|
||||
|
@ -765,6 +766,28 @@ class PagewidgetController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
// Récupération par Niveau01
|
||||
$qb = $em->createQueryBuilder();
|
||||
$qb->select('alert')
|
||||
->from("CadolesPortalBundle:Alert", 'alert')
|
||||
->where(":niveau01 MEMBER OF alert.niveau01s")
|
||||
->andWhere('alert.publishedat <= :today')
|
||||
->andWhere($qb->expr()->orX(
|
||||
$qb->expr()->gt('alert.unpublishedat', ':today'),
|
||||
$qb->expr()->isNull('alert.unpublishedat')
|
||||
))
|
||||
->setParameter("niveau01",$niveau01)
|
||||
->setParameter('today', date('Y-m-d'));
|
||||
|
||||
if($idalertcategory && $alertcategoryfilter) {
|
||||
$qb->andWhere("alert.alertcategory=:alertcategory")
|
||||
->setParameter("alertcategory",$alertcategoryfilter);
|
||||
}
|
||||
$alertsniveau01s=$qb->getQuery()->getResult();
|
||||
foreach($alertsniveau01s as $alertsniveau01) {
|
||||
if(!$alerts->contains($alertsniveau01s)) $alerts->add($alertsniveau01);
|
||||
}
|
||||
|
||||
// Récupération des alerts par group
|
||||
foreach($groups as $group) {
|
||||
$qb = $em->createQueryBuilder();
|
||||
|
@ -1907,7 +1930,7 @@ class PagewidgetController extends Controller
|
|||
// Render
|
||||
return $this->render($this->labelentity.':viewinfo.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => ($user),
|
||||
'canadd' => $canupdate,
|
||||
'canupdate' => $canupdate,
|
||||
'usage' => $usage,
|
||||
'icon' => $icon,
|
||||
|
|
|
@ -82,6 +82,16 @@ class Alert
|
|||
*/
|
||||
protected $groups;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Cadoles\CoreBundle\Entity\Niveau01", inversedBy="alerts", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="alertniveau01",
|
||||
* joinColumns={@ORM\JoinColumn(name="alert", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="niveau01", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
protected $niveau01s;
|
||||
|
||||
|
||||
// Is Online
|
||||
public function isOnline()
|
||||
{
|
||||
|
@ -346,4 +356,38 @@ class Alert
|
|||
{
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add niveau01
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\Niveau01 $niveau01
|
||||
*
|
||||
* @return Alert
|
||||
*/
|
||||
public function addNiveau01(\Cadoles\CoreBundle\Entity\Niveau01 $niveau01)
|
||||
{
|
||||
$this->niveau01s[] = $niveau01;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove niveau01
|
||||
*
|
||||
* @param \Cadoles\CoreBundle\Entity\Niveau01 $niveau01
|
||||
*/
|
||||
public function removeNiveau01(\Cadoles\CoreBundle\Entity\Niveau01 $niveau01)
|
||||
{
|
||||
$this->niveau01s->removeElement($niveau01);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get niveau01s
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getNiveau01s()
|
||||
{
|
||||
return $this->niveau01s;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,24 @@ class AlertType extends AbstractType
|
|||
"disabled" => ($options["mode"]=="delete"?true:false),
|
||||
])
|
||||
|
||||
->add('niveau01s', Select2EntityType::class, [
|
||||
'label' => 'Visible pour les '.$options["labelniveau01"],
|
||||
'class' => 'CadolesCoreBundle:Niveau01',
|
||||
'text_property' => 'label',
|
||||
'multiple' => true,
|
||||
'remote_route' => 'cadoles_core_ajax_niveau01_list',
|
||||
'primary_key' => 'id',
|
||||
'text_property' => 'label',
|
||||
'minimum_input_length' => 0,
|
||||
'page_limit' => 100,
|
||||
'allow_clear' => true,
|
||||
'delay' => 250,
|
||||
'cache' => false,
|
||||
'cache_timeout' => 60000,
|
||||
'language' => 'fr',
|
||||
'placeholder' => 'Selectionner des '.$options["labelniveau01"],
|
||||
])
|
||||
|
||||
->add('groups', Select2EntityType::class, [
|
||||
'label' => 'Visible pour les Groupes',
|
||||
'class' => 'CadolesCoreBundle:Group',
|
||||
|
@ -106,6 +124,7 @@ class AlertType extends AbstractType
|
|||
$resolver->setDefaults([
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Alert',
|
||||
'mode' => "string",
|
||||
'labelniveau01' => "string",
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ form_row(form.roles) }}
|
||||
{{ form_row(form.niveau01s) }}
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set canadd = false %}
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}; padding-top:10px;">
|
||||
{% set style = "margin: auto; display: inherit;background-color:transparent;" %}
|
||||
{% if icon %}
|
||||
|
@ -50,46 +49,46 @@
|
|||
{%if usage=="group" %}
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer grid-small"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% for member in members %}
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
|
||||
{% if canadd==true %}
|
||||
<div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="grid-item-content">
|
||||
<div class="grid-item-logo">
|
||||
<img onclick="seeUser({{member.user.id}})" src="/{{ alias }}/uploads/avatar/{{ member.user.avatar}}" class="grid-item-img avatar" height="110" style="cursor:pointer;">
|
||||
</div>
|
||||
<a href="{{path('cadoles_core_user_group_users',{'id':id})}}" target="_top" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_add.png" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2 style="{{ stylewidgetbodyreverse }};">
|
||||
{{ member.user.lastname }} {{ member.user.firstname }}
|
||||
{%if member.fgmanager%}
|
||||
<br>
|
||||
<i style="{{ stylewidgetbodyreverse }};" class="fa fa-star" title="Manager"></i>
|
||||
{% if member.user==app.user %}
|
||||
{% set canadd=true %}
|
||||
{% endif %}
|
||||
{%endif%}
|
||||
</h2>
|
||||
<div class="grid-item-title">
|
||||
<h2 style="{{ stylewidgetbodyreverse }};">Ajouter un membre</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for member in members %}
|
||||
<div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="grid-item-content">
|
||||
<div class="item-link clearfix">
|
||||
<div class="grid-item-logo">
|
||||
<img onclick="seeUser({{member.user.id}})" src="/{{ alias }}/uploads/avatar/{{ member.user.avatar}}" class="grid-item-img avatar" height="110" style="cursor:pointer;">
|
||||
</div>
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2 style="{{ stylewidgetbodyreverse }};">
|
||||
{{ member.user.lastname }} {{ member.user.firstname }}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if canadd==true %}
|
||||
<div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }}; height:150px">
|
||||
<a href="{{path('cadoles_core_user_group_users',{'id':id})}}" target="_top" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="grid-item-content">
|
||||
<div class="grid-item-logo">
|
||||
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_add.png" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid-item-title">
|
||||
<h2 style="{{ stylewidgetbodyreverse }};">Ajouter un membre</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -300,6 +300,7 @@ parameters:
|
|||
%end if
|
||||
%else
|
||||
activate_widonlyoffice: false
|
||||
widonlyoffice_sync: false
|
||||
%end if
|
||||
|
||||
%if %%getVar("ninegate_activate_widopensondage", 'non') == "oui"
|
||||
|
|
Loading…
Reference in New Issue