153 lines
5.4 KiB
Twig
153 lines
5.4 KiB
Twig
{% extends '@CadolesCore/base.html.twig' %}
|
|
|
|
{% block pagewrapper %}
|
|
<h1 class="page-header">Gestion des Utilisateurs</h1>
|
|
<h2>Groupe = {{ group.label }}</h2>
|
|
<a class="btn btn-default" href={{ path('cadoles_core_'~access~'_group') }}>Fermer</a>
|
|
<br><br>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-danger">
|
|
<div class="panel-heading">
|
|
<i class="fa fa-table fa-fw"></i> Liste des Utilisateurs non affectés au groupe
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
<div class="dataTable_wrapper">
|
|
<table class="table table-striped table-bordered table-hover" id="dataTablesnotin" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th width="70px" class="no-sort">Action</th>
|
|
<th width="70px" class="no-sort">Avatar</th>
|
|
<th width="200px">Login</th>
|
|
<th>Email</th>
|
|
{% if group.fgcanshare %}
|
|
<th class="no-sort">Manager</th>
|
|
{% endif %}
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<i class="fa fa-table fa-fw"></i> Liste des Utilisateurs affectés au groupe
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
<div class="dataTable_wrapper">
|
|
<table class="table table-striped table-bordered table-hover" id="dataTablesin" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th width="70px" class="no-sort">Action</th>
|
|
<th width="70px" class="no-sort">Avatar</th>
|
|
<th width="200px">Login</th>
|
|
<th>Email</th>
|
|
{% if group.fgcanshare %}
|
|
<th class="no-sort">Manager</th>
|
|
{% endif %}
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block localjavascript %}
|
|
$(document).ready(function() {
|
|
$('#dataTablesnotin').DataTable({
|
|
columnDefs: [ { "targets": 'no-sort', "orderable": false },{ "targets": 'no-visible', "visible": false } ],
|
|
responsive: true,
|
|
iDisplayLength: 100,
|
|
order: [[ 2, "asc" ]],
|
|
processing: true,
|
|
serverSide: true,
|
|
ajax: "{{ path('cadoles_core_'~access~'_group_ajax_usersnotin',{'id':group.id}) }}",
|
|
});
|
|
|
|
$('#dataTablesin').DataTable({
|
|
columnDefs: [ { "targets": 'no-sort', "orderable": false },{ "targets": 'no-visible', "visible": false } ],
|
|
responsive: true,
|
|
iDisplayLength: 100,
|
|
order: [[ 2, "asc" ]],
|
|
processing: true,
|
|
serverSide: true,
|
|
ajax: {
|
|
"url": "{{ path('cadoles_core_'~access~'_group_ajax_usersin',{'id':group.id}) }}",
|
|
"data": function ( d ) {
|
|
return $.extend( {}, d, {
|
|
"fgcanshare": "{{ group.fgcanshare }}"
|
|
});
|
|
}
|
|
},
|
|
"drawCallback": function(settings) {
|
|
$(".switch").bootstrapSwitch();
|
|
},
|
|
});
|
|
|
|
|
|
});
|
|
|
|
function addUsers(userid) {
|
|
$.ajax({
|
|
rowId: 2,
|
|
method: "POST",
|
|
url: "{{ path('cadoles_core_'~access~'_group_ajax_usergroup_add') }}",
|
|
data: "userid="+userid+"&groupid="+{{ group.id }},
|
|
success: function(data, dataType)
|
|
{
|
|
var row=$("#dataTablesnotin").DataTable().row("#user"+userid);
|
|
var rowNode = row.node();
|
|
row.remove().draw();
|
|
|
|
$("#dataTablesin").DataTable().row.add(rowNode).draw();
|
|
},
|
|
|
|
error: function(XMLHttpRequest, textStatus, errorThrown)
|
|
{
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function delUsers(userid) {
|
|
$.ajax({
|
|
rowId: 2,
|
|
method: "POST",
|
|
url: "{{ path('cadoles_core_'~access~'_group_ajax_usergroup_del') }}",
|
|
data: "userid="+userid+"&groupid="+{{ group.id }},
|
|
success: function(data, dataType)
|
|
{
|
|
var row=$("#dataTablesin").DataTable().row("#user"+userid);
|
|
var rowNode = row.node();
|
|
row.remove().draw();
|
|
|
|
$("#dataTablesnotin").DataTable().row.add(rowNode).draw();
|
|
},
|
|
|
|
error: function(XMLHttpRequest, textStatus, errorThrown)
|
|
{
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function switchManager(id) {
|
|
$.ajax({
|
|
method: "POST",
|
|
url: "{{ path('cadoles_core_'~access~'_group_ajax_switchmanager') }}",
|
|
data: {
|
|
"group": {{ group.id }},
|
|
"user": id,
|
|
}
|
|
});
|
|
}
|
|
{% endblock %}
|