fix(morelevel): ajout de niveau03 et niveau04
All checks were successful
Cadoles/nineskeletor/pipeline/head This commit looks good
All checks were successful
Cadoles/nineskeletor/pipeline/head This commit looks good
This commit is contained in:
@ -25,12 +25,22 @@
|
||||
{
|
||||
icon: 'fa fa-building',
|
||||
route: 'app_admin_niveau01',
|
||||
name: appNiveau01label~'s',
|
||||
name: appNiveau01labels,
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-sitemap',
|
||||
route: 'app_admin_niveau02',
|
||||
name: appNiveau02label~'s',
|
||||
name: appNiveau02labels,
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-store-alt',
|
||||
route: 'app_admin_niveau03',
|
||||
name: appNiveau03labels,
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-monument',
|
||||
route: 'app_admin_niveau04',
|
||||
name: appNiveau04labels,
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-users',
|
||||
@ -75,7 +85,6 @@
|
||||
]
|
||||
%}
|
||||
|
||||
|
||||
<div id="sidebar" class="d-flex flex-column">
|
||||
<ul class="nav nav-pills flex-column mb-auto">
|
||||
{% for section in sidebar %}
|
||||
@ -96,6 +105,10 @@
|
||||
{% set toshow=true %}
|
||||
{% if item.route=="app_admin_registration" and (appMasteridentity!="SQL" or appModeregistration is empty) %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_admin_whitelist" and (appMasteridentity!="SQL" or appModeregistration is empty) %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_admin_niveau02" and not appNiveau02use %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_admin_niveau03" and not appNiveau03use %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_admin_niveau04" and not appNiveau04use %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_admin_group" and not appGroupuse %} {% set toshow=false %} {% endif %}
|
||||
|
||||
{%if toshow %}
|
||||
<a class="nav-link nav-link-item {% if item.route in app.request.get('_route') %}active{%endif%}" href="{{path(item.route)}}" title="{{item.name}}">
|
||||
|
@ -7,8 +7,18 @@
|
||||
{
|
||||
icon: 'fa fa-sitemap',
|
||||
route: 'app_modo_niveau02',
|
||||
name: appNiveau02label~'s',
|
||||
name: appNiveau02labels,
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-store-alt',
|
||||
route: 'app_modo_niveau03',
|
||||
name: appNiveau03labels,
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-monument',
|
||||
route: 'app_modo_niveau04',
|
||||
name: appNiveau04labels,
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-users',
|
||||
route: 'app_modo_group',
|
||||
@ -49,6 +59,10 @@
|
||||
{% for item in section.items %}
|
||||
{% set toshow=true %}
|
||||
{% if item.route=="app_modo_registration" and (appMasteridentity!="SQL" or appModeregistration is empty) %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_modo_niveau02" and not appNiveau02use %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_modo_niveau03" and not appNiveau03use %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_modo_niveau04" and not appNiveau04use %} {% set toshow=false %} {% endif %}
|
||||
{% if item.route=="app_modo_group" and not appGroupuse %} {% set toshow=false %} {% endif %}
|
||||
|
||||
{%if toshow %}
|
||||
<a class="nav-link nav-link-item {% if item.route in app.request.get('_route') %}active{%endif%}" href="{{path(item.route)}}" title="{{item.name}}">
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">Gestion des {{ appNiveau01label }}s </h1>
|
||||
<h1 class="page-header">Gestion des {{ appNiveau01labels }} </h1>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-success" href={{ path('app_admin_niveau01_submit') }}>Ajouter</a>
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des {{ appNiveau01label }}s
|
||||
<i class="fa fa-table fa-fw"></i> Liste des {{ appNiveau01labels }}
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">Gestion des {{ appNiveau02label }}s </h1>
|
||||
<h1 class="page-header">Gestion des {{ appNiveau02labels }} </h1>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-success" href={{ path('app_'~access~'_niveau02_submit') }}>Ajouter</a>
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des {{ appNiveau02label }}s
|
||||
<i class="fa fa-table fa-fw"></i> Liste des {{ appNiveau02labels }}
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
92
templates/Niveau03/edit.html.twig
Executable file
92
templates/Niveau03/edit.html.twig
Executable file
@ -0,0 +1,92 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification {{ appNiveau03label }} = {{niveau03.label}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création {{ appNiveau02label }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_niveau03') }}>Annuler</a>
|
||||
{% if mode=="update" %}
|
||||
<a class="btn btn-danger float-end" href={{ path('app_'~access~'_niveau03_delete',{id:niveau03.id}) }} data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?">Supprimer</a>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.niveau01) }}
|
||||
{{ form_row(form.niveau02) }}
|
||||
|
||||
{{ form_row(form.label) }}
|
||||
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top:-2px; border-radius:0px 0px 0.25rem 0.25rem'>
|
||||
Caractères interdits = caractères spéciaux sauf ' @ . - _<br>
|
||||
</div>
|
||||
|
||||
{% if form.ldapfilter is defined %}
|
||||
{{ form_row(form.ldapfilter) }}
|
||||
{% endif %}
|
||||
|
||||
{% if form.attributes is defined %}
|
||||
{{ form_row(form.attributes) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if auditUse and mode=="update" and (access=="admin" or access=="modo" or access=="audit") %}
|
||||
<div class="float-end" style="width:700px;max-width:100%">
|
||||
{{ render(path("app_"~access~"_audit_renderid",{entityname:"Niveau02",entityid:niveau03.id})) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document.body).on("change","#niveau03_niveau01",function(){
|
||||
$("#niveau03_niveau02").empty();
|
||||
select2niveau02();
|
||||
});
|
||||
|
||||
function select2niveau02() {
|
||||
$('#niveau03_niveau02').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau01: $("#niveau03_niveau01").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
47
templates/Niveau03/list.html.twig
Normal file
47
templates/Niveau03/list.html.twig
Normal file
@ -0,0 +1,47 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">Gestion des {{ appNiveau03labels }} </h1>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-success" href={{ path('app_'~access~'_niveau03_submit') }}>Ajouter</a>
|
||||
{% if auditUse and (access=="admin" or access=="audit") %}
|
||||
<a class="btn btn-secondary float-end" href="{{ path("app_"~access~"_audit_render",{entityname:"Niveau03"}) }}"><i class="fas fa-eye fa-fw"></i> Audit</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des {{ appNiveau03labels }}
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%; font-size:11px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="70px" class="no-sort">Action</th>
|
||||
<th>{{appNiveau01label}}</th>
|
||||
<th>{{appNiveau02label}}</th>
|
||||
<th>{{appNiveau03label}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]],
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ path('app_'~access~'_niveau03_tablelist') }}",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
118
templates/Niveau04/edit.html.twig
Executable file
118
templates/Niveau04/edit.html.twig
Executable file
@ -0,0 +1,118 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification {{ appNiveau04label }} = {{niveau04.label}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création {{ appNiveau02label }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_niveau04') }}>Annuler</a>
|
||||
{% if mode=="update" %}
|
||||
<a class="btn btn-danger float-end" href={{ path('app_'~access~'_niveau04_delete',{id:niveau04.id}) }} data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?">Supprimer</a>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.niveau01) }}
|
||||
{{ form_row(form.niveau02) }}
|
||||
{{ form_row(form.niveau03) }}
|
||||
|
||||
{{ form_row(form.label) }}
|
||||
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top:-2px; border-radius:0px 0px 0.25rem 0.25rem'>
|
||||
Caractères interdits = caractères spéciaux sauf ' @ . - _<br>
|
||||
</div>
|
||||
|
||||
{% if form.ldapfilter is defined %}
|
||||
{{ form_row(form.ldapfilter) }}
|
||||
{% endif %}
|
||||
|
||||
{% if form.attributes is defined %}
|
||||
{{ form_row(form.attributes) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if auditUse and mode=="update" and (access=="admin" or access=="modo" or access=="audit") %}
|
||||
<div class="float-end" style="width:700px;max-width:100%">
|
||||
{{ render(path("app_"~access~"_audit_renderid",{entityname:"Niveau02",entityid:niveau03.id})) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document.body).on("change","#niveau04_niveau01",function(){
|
||||
$("#niveau04_niveau02").empty();
|
||||
$("#niveau04_niveau03").empty();
|
||||
|
||||
select2niveau02();
|
||||
select2niveau03();
|
||||
});
|
||||
|
||||
$(document.body).on("change","#niveau04_niveau02",function(){
|
||||
$("#niveau04_niveau03").empty();
|
||||
|
||||
select2niveau03();
|
||||
});
|
||||
|
||||
function select2niveau02() {
|
||||
$('#niveau04_niveau02').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau01: $("#niveau04_niveau01").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function select2niveau03() {
|
||||
$('#niveau04_niveau03').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau02: $("#niveau04_niveau02").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
48
templates/Niveau04/list.html.twig
Normal file
48
templates/Niveau04/list.html.twig
Normal file
@ -0,0 +1,48 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">Gestion des {{ appNiveau04labels }} </h1>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-success" href={{ path('app_'~access~'_niveau04_submit') }}>Ajouter</a>
|
||||
{% if auditUse and (access=="admin" or access=="audit") %}
|
||||
<a class="btn btn-secondary float-end" href="{{ path("app_"~access~"_audit_render",{entityname:"Niveau04"}) }}"><i class="fas fa-eye fa-fw"></i> Audit</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des {{ appNiveau04labels }}
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%; font-size:11px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="70px" class="no-sort">Action</th>
|
||||
<th>{{appNiveau01label}}</th>
|
||||
<th>{{appNiveau02label}}</th>
|
||||
<th>{{appNiveau03label}}</th>
|
||||
<th>{{appNiveau04label}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]],
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ path('app_'~access~'_niveau04_tablelist') }}",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
@ -121,7 +121,9 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ form_row(form.niveau01) }}
|
||||
{{ form_row(form.niveau02) }}
|
||||
{%if form.niveau02 is defined %}{{ form_row(form.niveau02) }}{%endif%}
|
||||
{%if form.niveau03 is defined %}{{ form_row(form.niveau03) }}{%endif%}
|
||||
{%if form.niveau04 is defined %}{{ form_row(form.niveau04) }}{%endif%}
|
||||
{{ form_row(form.firstname) }}
|
||||
{{ form_row(form.lastname) }}
|
||||
{{ form_row(form.email) }}
|
||||
@ -158,11 +160,81 @@
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if(!$("#paneloption").find(".card-body").find("label").length) $("#paneloption").hide();
|
||||
select2niveau02();
|
||||
select2niveau03();
|
||||
select2niveau04();
|
||||
requireniveau();
|
||||
});
|
||||
|
||||
function requireniveau() {
|
||||
roles=["ROLE_USER"];
|
||||
|
||||
{% if "ALL" in appNiveau02mandatory %}
|
||||
$("#registration_niveau02").attr("required","required");
|
||||
$("label[for='registration_niveau02']").text("{{appNiveau02label}} *");
|
||||
{% else %}
|
||||
$("#registration_niveau02").removeAttr("required");
|
||||
$("label[for='registration_niveau02']").text("{{appNiveau02label}}");
|
||||
{% for mandatory in appNiveau02mandatory %}
|
||||
if(roles.includes("{{ mandatory }}")) {
|
||||
$("#registration_niveau02").attr("required","required");
|
||||
$("label[for='registration_niveau02']").text("{{appNiveau02label}} *");
|
||||
}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if "ALL" in appNiveau03mandatory %}
|
||||
$("#registration_niveau03").attr("required","required");
|
||||
$("label[for='registration_niveau03']").text("{{appNiveau03label}} *");
|
||||
{% else %}
|
||||
$("#registration_niveau03").removeAttr("required");
|
||||
$("label[for='registration_niveau03']").text("{{appNiveau03label}}");
|
||||
{% for mandatory in appNiveau03mandatory %}
|
||||
if(roles.includes("{{ mandatory }}")) {
|
||||
$("#registration_niveau03").attr("required","required");
|
||||
$("label[for='registration_niveau03']").text("{{appNiveau03label}} *");
|
||||
}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if "ALL" in appNiveau04mandatory %}
|
||||
$("#registration_niveau04").attr("required","required");
|
||||
$("label[for='registration_niveau04']").text("{{appNiveau04label}} *");
|
||||
{% else %}
|
||||
$("#registration_niveau04").removeAttr("required");
|
||||
$("label[for='registration_niveau04']").text("{{appNiveau04label}}");
|
||||
{% for mandatory in appNiveau04mandatory %}
|
||||
if(roles.includes("{{ mandatory }}")) {
|
||||
$("#registration_niveau04").attr("required","required");
|
||||
$("label[for='registration_niveau04']").text("{{appNiveau04label}} *");
|
||||
}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
$(document.body).on("change","#registration_niveau01",function(){
|
||||
$("#registration_niveau02").empty();
|
||||
$("#registration_niveau03").empty();
|
||||
$("#registration_niveau04").empty();
|
||||
select2niveau02();
|
||||
select2niveau03();
|
||||
select2niveau04();
|
||||
});
|
||||
|
||||
$(document.body).on("change","#registration_niveau02",function(){
|
||||
$("#registration_niveau03").empty();
|
||||
$("#registration_niveau04").empty();
|
||||
select2niveau03();
|
||||
select2niveau04();
|
||||
});
|
||||
|
||||
$(document.body).on("change","#registration_niveau03",function(){
|
||||
$("#registration_niveau04").empty();
|
||||
select2niveau04();
|
||||
});
|
||||
|
||||
function select2niveau02() {
|
||||
$('#registration_niveau02').select2({
|
||||
theme: 'bootstrap4',
|
||||
@ -178,8 +250,37 @@
|
||||
});
|
||||
}
|
||||
|
||||
function select2niveau03() {
|
||||
$('#registration_niveau03').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau02: $("#registration_niveau02").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function select2niveau04() {
|
||||
$('#registration_niveau04').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau03: $("#registration_niveau03").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document.body).on("focusout","#registration_email",function(){
|
||||
console.log("pouet");
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_whitelist_is') }}",
|
||||
@ -201,26 +302,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
function hideshow() {
|
||||
|
||||
$('#registration_niveau02').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau01: $("#registration_niveau01").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
if(!$("#paneloption").find(".card-body").find("label").length) $("#paneloption").hide();
|
||||
hideshow();
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -24,6 +24,9 @@
|
||||
<th width="200px">Login</th>
|
||||
<th>Email</th>
|
||||
<th>{{ appNiveau01label }}</th>
|
||||
<th class="no-sort {% if not appNiveau02use%}no-visible{%endif%}">{{ appNiveau02label }}</th>
|
||||
<th class="no-sort {% if not appNiveau03use%}no-visible{%endif%}">{{ appNiveau03label }}</th>
|
||||
<th class="no-sort {% if not appNiveau04use%}no-visible{%endif%}">{{ appNiveau04label }}</th>
|
||||
<th>Statut</th>
|
||||
<th>Expire le</th>
|
||||
</tr>
|
||||
@ -38,7 +41,7 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
||||
columnDefs: [ { "targets": 'no-sort', "orderable": false },{ "targets": 'no-visible', "visible": false } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]],
|
||||
|
@ -180,7 +180,9 @@
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.niveau01) }}
|
||||
{{ form_row(form.niveau02) }}
|
||||
{%if form.niveau02 is defined %}{{ form_row(form.niveau02) }}{%endif%}
|
||||
{%if form.niveau03 is defined %}{{ form_row(form.niveau03) }}{%endif%}
|
||||
{%if form.niveau04 is defined %}{{ form_row(form.niveau04) }}{%endif%}
|
||||
{{ form_row(form.firstname) }}
|
||||
{{ form_row(form.lastname) }}
|
||||
{{ form_row(form.email) }}
|
||||
@ -188,6 +190,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if appGroupuse %}
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-users fa-fw"></i> Groupes
|
||||
@ -234,7 +237,8 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-sitemap fa-fw"></i> Organisation
|
||||
@ -351,17 +355,100 @@
|
||||
$(document).ready(function() {
|
||||
$("#user_password_first").val("");
|
||||
select2niveau02();
|
||||
select2niveau03();
|
||||
select2niveau04();
|
||||
|
||||
{% if access=="modo" %}
|
||||
$("label[for='user_roles_0']").hide();
|
||||
$("label[for='user_roles_1']").hide();
|
||||
{% endif %}
|
||||
|
||||
requireniveau();
|
||||
});
|
||||
|
||||
$(document.body).on("change","#user_roles",function(){
|
||||
|
||||
requireniveau();
|
||||
|
||||
});
|
||||
|
||||
function requireniveau() {
|
||||
roles=[];
|
||||
if($("#user_roles_0").is(":checked")) roles.push("ROLE_ADMIN");
|
||||
if($("#user_roles_1").is(":checked")) roles.push("ROLE_MODO");
|
||||
if($("#user_roles_2").is(":checked")) roles.push("ROLE_MASTER");
|
||||
if($("#user_roles_3").is(":checked")) roles.push("ROLE_MANAGER");
|
||||
if($("#user_roles_4").is(":checked")) roles.push("ROLE_USER");
|
||||
|
||||
{% if "ALL" in appNiveau02mandatory %}
|
||||
$("#user_niveau02").attr("required","required");
|
||||
$("label[for='user_niveau02']").text("{{appNiveau02label}} *");
|
||||
{% else %}
|
||||
$("#user_niveau02").removeAttr("required");
|
||||
$("label[for='user_niveau02']").text("{{appNiveau02label}}");
|
||||
{% for mandatory in appNiveau02mandatory %}
|
||||
if(roles.includes("{{ mandatory }}")) {
|
||||
$("#user_niveau02").attr("required","required");
|
||||
$("label[for='user_niveau02']").text("{{appNiveau02label}} *");
|
||||
}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if "ALL" in appNiveau03mandatory %}
|
||||
$("#user_niveau03").attr("required","required");
|
||||
$("label[for='user_niveau03']").text("{{appNiveau03label}} *");
|
||||
{% else %}
|
||||
$("#user_niveau03").removeAttr("required");
|
||||
$("label[for='user_niveau03']").text("{{appNiveau03label}}");
|
||||
{% for mandatory in appNiveau03mandatory %}
|
||||
if(roles.includes("{{ mandatory }}")) {
|
||||
$("#user_niveau03").attr("required","required");
|
||||
$("label[for='user_niveau03']").text("{{appNiveau03label}} *");
|
||||
}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if "ALL" in appNiveau04mandatory %}
|
||||
$("#user_niveau04").attr("required","required");
|
||||
$("label[for='user_niveau04']").text("{{appNiveau04label}} *");
|
||||
{% else %}
|
||||
$("#user_niveau04").removeAttr("required");
|
||||
$("label[for='user_niveau04']").text("{{appNiveau04label}}");
|
||||
{% for mandatory in appNiveau04mandatory %}
|
||||
if(roles.includes("{{ mandatory }}")) {
|
||||
$("#user_niveau04").attr("required","required");
|
||||
$("label[for='user_niveau04']").text("{{appNiveau04label}} *");
|
||||
}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
if(roles.includes("ROLE_MODO")) {
|
||||
$("#cardmodos").show();
|
||||
}
|
||||
else {
|
||||
$("#cardmodos").hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(document.body).on("change","#user_niveau01",function(){
|
||||
$("#user_niveau02").empty();
|
||||
$("#user_niveau03").empty();
|
||||
$("#user_niveau04").empty();
|
||||
select2niveau02();
|
||||
select2niveau03();
|
||||
select2niveau04();
|
||||
});
|
||||
|
||||
$(document.body).on("change","#user_niveau02",function(){
|
||||
$("#user_niveau03").empty();
|
||||
$("#user_niveau04").empty();
|
||||
select2niveau03();
|
||||
select2niveau04();
|
||||
});
|
||||
|
||||
$(document.body).on("change","#user_niveau03",function(){
|
||||
$("#user_niveau04").empty();
|
||||
select2niveau04();
|
||||
});
|
||||
|
||||
function select2niveau02() {
|
||||
@ -379,6 +466,36 @@
|
||||
});
|
||||
}
|
||||
|
||||
function select2niveau03() {
|
||||
$('#user_niveau03').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau02: $("#user_niveau02").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function select2niveau04() {
|
||||
$('#user_niveau04').select2({
|
||||
theme: 'bootstrap4',
|
||||
language: "fr",
|
||||
ajax: {
|
||||
data: function (params) {
|
||||
var query = {
|
||||
niveau03: $("#user_niveau03").val(),
|
||||
}
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Init Group
|
||||
var linkgroups="";
|
||||
|
@ -32,10 +32,12 @@
|
||||
<th>Email</th>
|
||||
<th>Téléphone</th>
|
||||
<th>{{ appNiveau01label }}</th>
|
||||
<th class="no-sort">{{ appNiveau02label }}</th>
|
||||
<th class="no-sort {% if not appNiveau02use%}no-visible{%endif%}">{{ appNiveau02label }}</th>
|
||||
<th class="no-sort {% if not appNiveau03use%}no-visible{%endif%}">{{ appNiveau03label }}</th>
|
||||
<th class="no-sort {% if not appNiveau04use%}no-visible{%endif%}">{{ appNiveau04label }}</th>
|
||||
<th>Visite</th>
|
||||
<th>Rôle</th>
|
||||
<th class="no-sort">Groupes</th>
|
||||
<th class="no-sort {% if not appGroupuse%}no-visible{%endif%}">Groupes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
@ -53,7 +53,9 @@
|
||||
<a class="nav-link" href="{{path("app_user_users")}}" title="Annuaire des Utilisateurs"><i class="fas fa-address-book fa-2x"></i></a>
|
||||
{% endif %}
|
||||
|
||||
<a class="nav-link" href="{{path("app_user_group")}}" title="Gestion des Groupes de Travail"><i class="fas fa-users fa-2x"></i></a>
|
||||
{% if appGroupuse %}
|
||||
<a class="nav-link" href="{{path("app_user_group")}}" title="Gestion des Groupes de Travail"><i class="fas fa-users fa-2x"></i></a>
|
||||
{% endif %}
|
||||
|
||||
<a id="switchHeader" class="nav-link" onclick="switchHeader()" title="Cacher / Afficher Bannière"><i class="fa fa-chevron-up fa-2x"></i></a>
|
||||
<a class="nav-link" href="{{path("app_logout")}}" title="Déconnexion"><i class="fa fa-sign-out-alt fa-2x"></i></a>
|
||||
|
Reference in New Issue
Block a user