ajout colonne metier et fonction (fixes #20)

This commit is contained in:
afornerot 2019-12-16 16:07:10 +01:00
parent fbea5bcccb
commit c702a4b0d2
5 changed files with 72 additions and 2 deletions

View File

@ -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";

View File

@ -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);

View File

@ -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

View File

@ -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') %}

View File

@ -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>