Compare commits
No commits in common. "742383206ea556a09f33145df38ae5901ab829fe" and "f54efc703c724244680e9645dd8bb7990b8c77cf" have entirely different histories.
742383206e
...
f54efc703c
|
@ -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}XeJxoO2l4dkHFX78WQ1Ik30sjLt3kffh
|
||||
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}aTs3IqgN93ehIEqy93uWTTyxg5wNa+80
|
||||
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');
|
||||
|
||||
|
||||
|
|
|
@ -185,18 +185,7 @@ 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();
|
||||
|
@ -293,17 +282,6 @@ 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();
|
||||
|
@ -337,12 +315,6 @@ 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,7 +703,6 @@ 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();
|
||||
|
@ -714,6 +713,20 @@ 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);
|
||||
|
||||
|
@ -919,7 +932,7 @@ class GroupController extends Controller
|
|||
protected function ctrlOwner($group) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
if($group->getOwner()) {
|
||||
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$group->getOwner()]);
|
||||
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["user"=>$group->getOwner()]);
|
||||
if(!$usergroup) {
|
||||
$key = Uuid::uuid4();
|
||||
$usergroup=new Usergroup;
|
||||
|
@ -1024,13 +1037,6 @@ 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,13 +282,6 @@ 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,13 +267,6 @@ 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,14 +214,6 @@ 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;
|
||||
}
|
||||
|
@ -253,14 +245,6 @@ 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;
|
||||
}
|
||||
|
@ -295,8 +279,6 @@ 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);
|
||||
|
@ -672,7 +654,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')) {
|
||||
if($this->isGranted('ROLE_MODO')&&$access=="config") {
|
||||
$niveau01=$data->getNiveau01();
|
||||
$modos=$this->get('security.token_storage')->getToken()->getUser()->getmodos();
|
||||
$fgperm=false;
|
||||
|
|
|
@ -91,10 +91,6 @@ class Niveau01
|
|||
*/
|
||||
protected $items;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Alert", mappedBy="niveau01s")
|
||||
*/
|
||||
protected $alerts;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -431,38 +427,4 @@ 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,18 +165,10 @@ 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,28 +1,4 @@
|
|||
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
|
||||
|
@ -159,6 +135,4 @@ 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: 14px;
|
||||
line-height: initial;
|
||||
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,7 +64,14 @@ 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,16 +11,6 @@
|
|||
</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,9 +45,6 @@
|
|||
<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,10 +40,6 @@
|
|||
|
||||
<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,10 +41,6 @@
|
|||
<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,9 +1,5 @@
|
|||
{% 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>
|
||||
|
@ -25,7 +21,7 @@ td { font-size: 10px; }
|
|||
|
||||
<div class="panel-body">
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%: font-size:11px;">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
{% if access=="config" %}
|
||||
|
@ -35,15 +31,13 @@ td { font-size: 10px; }
|
|||
<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 %}" style="width:100px">Email</th>
|
||||
<th class="{% if fields["email"] is defined and fields["email"].perm==0 %}no-visible{% endif %}">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')->getManager();
|
||||
$entityManager = $this->getContainer()->get('doctrine')->getEntityManager();
|
||||
|
||||
$this->output = $output;
|
||||
$this->filesystem = new Filesystem();
|
||||
|
@ -105,7 +105,6 @@ class CronCommand extends ContainerAwareCommand
|
|||
$parameter = new ArrayInput($jsonparameter);
|
||||
|
||||
// Executer la commande
|
||||
$returnCode=false;
|
||||
try{
|
||||
$returnCode = $command->run($parameter, $output);
|
||||
|
||||
|
|
|
@ -83,29 +83,6 @@ 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,8 +141,6 @@ 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')."/admin";
|
||||
$widlimesurvey_url =$this->getContainer()->getParameter('widlimesurvey_url');
|
||||
$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","labelniveau01" => $this->GetParameter("labelsniveau01")));
|
||||
$form = $this->createForm(AlertType::class,$data,array("mode"=>"submit"));
|
||||
|
||||
// Récupération des data du formulaire
|
||||
$form->handleRequest($request);
|
||||
|
@ -111,8 +111,7 @@ class AlertController extends Controller
|
|||
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(AlertType::class,$data,array(
|
||||
"mode" => "update",
|
||||
"labelniveau01" => $this->GetParameter("labelsniveau01")
|
||||
"mode" => "update"
|
||||
));
|
||||
|
||||
// Récupération des data du formulaire
|
||||
|
|
|
@ -737,7 +737,6 @@ 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
|
||||
|
@ -766,28 +765,6 @@ 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();
|
||||
|
@ -1930,7 +1907,7 @@ class PagewidgetController extends Controller
|
|||
// Render
|
||||
return $this->render($this->labelentity.':viewinfo.html.twig', [
|
||||
'entity' => $entity,
|
||||
'canadd' => $canupdate,
|
||||
'canadd' => ($user),
|
||||
'canupdate' => $canupdate,
|
||||
'usage' => $usage,
|
||||
'icon' => $icon,
|
||||
|
|
|
@ -82,16 +82,6 @@ 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()
|
||||
{
|
||||
|
@ -356,38 +346,4 @@ 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,24 +57,6 @@ 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',
|
||||
|
@ -124,7 +106,6 @@ class AlertType extends AbstractType
|
|||
$resolver->setDefaults([
|
||||
'data_class' => 'Cadoles\PortalBundle\Entity\Alert',
|
||||
'mode' => "string",
|
||||
'labelniveau01' => "string",
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ form_row(form.roles) }}
|
||||
{{ form_row(form.niveau01s) }}
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set canadd = false %}
|
||||
<div class="widgetheader" style="{{ stylewidgetheader }}; padding-top:10px;">
|
||||
{% set style = "margin: auto; display: inherit;background-color:transparent;" %}
|
||||
{% if icon %}
|
||||
|
@ -49,46 +50,46 @@
|
|||
{%if usage=="group" %}
|
||||
<div class="grid clearfix">
|
||||
<div class="grid-sizer grid-small"></div>
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
|
||||
{% if canadd==true %}
|
||||
<div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }};">
|
||||
<div class="grid-item-content">
|
||||
<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 }};">Ajouter un membre</h2>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-gutter-sizer"></div>
|
||||
{% 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 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>
|
||||
|
||||
<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>
|
||||
</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,7 +300,6 @@ parameters:
|
|||
%end if
|
||||
%else
|
||||
activate_widonlyoffice: false
|
||||
widonlyoffice_sync: false
|
||||
%end if
|
||||
|
||||
%if %%getVar("ninegate_activate_widopensondage", 'non') == "oui"
|
||||
|
|
Loading…
Reference in New Issue