forked from ZwiiCMS-Team/ZwiiCampus
add and remove all
This commit is contained in:
parent
e4647c0702
commit
a39985fe62
@ -658,10 +658,10 @@ class course extends common
|
||||
|
||||
// Construction du tableau
|
||||
self::$courseUsers[] = [
|
||||
template::checkbox($userId, true, '', ['class' => 'checkboxSelect']),
|
||||
$userId,
|
||||
$this->getData(['user', $userId, 'firstname']),
|
||||
$this->getData(['user', $userId, 'lastname']),
|
||||
template::checkbox($userId, true, '', ['class' => 'checkboxSelect'])
|
||||
];
|
||||
|
||||
}
|
||||
@ -802,10 +802,10 @@ class course extends common
|
||||
|
||||
// Construction du tableau
|
||||
self::$courseUsers[] = [
|
||||
template::checkbox($userId, true, '', ['class' => 'checkboxSelect']),
|
||||
$userId,
|
||||
$this->getData(['user', $userId, 'firstname']),
|
||||
$this->getData(['user', $userId, 'lastname']),
|
||||
template::checkbox($userId, true, '', ['class' => 'checkboxSelect'])
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,15 @@
|
||||
|
||||
$(document).ready((function () {
|
||||
|
||||
$('#courseUserAddSelectAll').on('click', function() {
|
||||
$('.checkboxSelect').prop('checked', true);
|
||||
saveCheckboxState();
|
||||
});
|
||||
$('#courseUserAddSelectNone').on('click', function() {
|
||||
$('.checkboxSelect').prop('checked', false);
|
||||
saveCheckboxState();
|
||||
});
|
||||
|
||||
$("#courseFilterGroup, #courseFilterFirstName, #courseFilterLastName").change(function () {
|
||||
saveCheckboxState();
|
||||
$("#courseUsersAddForm").submit();
|
||||
@ -24,7 +33,7 @@ $(document).ready((function () {
|
||||
},
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 3,
|
||||
target: 0,
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
}
|
||||
@ -45,7 +54,6 @@ $(document).ready((function () {
|
||||
|
||||
// Empty local storage after submit
|
||||
$("#courseUsersAddSubmit").on("click", function () {
|
||||
|
||||
localStorage.setItem('checkboxState', JSON.stringify({}));
|
||||
});
|
||||
|
||||
|
@ -7,12 +7,22 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset7">
|
||||
<?php echo template::button('courseUserAddSelectAll', [
|
||||
'value' => 'Tout'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset10">
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserAddSelectNone', [
|
||||
'value' => 'Aucun'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::submit('courseUsersAddSubmit', [
|
||||
'value' => 'Inscrire'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
@ -34,7 +44,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([4, 4, 4, 1], $module::$courseUsers, ['Id', 'Prénom', 'Nom', ''], ['id' => 'dataTables']); ?>
|
||||
<?php echo template::table([1, 4, 4, 3], $module::$courseUsers, ['', 'Id', 'Prénom', 'Nom'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
@ -13,6 +13,14 @@
|
||||
|
||||
$(document).ready((function () {
|
||||
|
||||
$('#courseUserDeleteSelectAll').on('click', function() {
|
||||
$('.checkboxSelect').prop('checked', true);
|
||||
saveCheckboxState();
|
||||
});
|
||||
$('#courseUserDeleteSelectNone').on('click', function() {
|
||||
$('.checkboxSelect').prop('checked', false);
|
||||
saveCheckboxState();
|
||||
});
|
||||
|
||||
$("#courseFilterGroup, #courseFilterFirstName, #courseFilterLastName").change(function () {
|
||||
saveCheckboxState();
|
||||
@ -25,7 +33,7 @@ $(document).ready((function () {
|
||||
},
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 3,
|
||||
target: 0,
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
}
|
||||
@ -46,9 +54,7 @@ $(document).ready((function () {
|
||||
|
||||
// Empty local storage after submit
|
||||
$("#courseUsersDeleteSubmit").on("click", function () {
|
||||
|
||||
localStorage.setItem('checkboxState', JSON.stringify({}));
|
||||
|
||||
});
|
||||
|
||||
// Restore checkbox state on page load
|
||||
|
@ -1,19 +1,29 @@
|
||||
<?php echo template::formOpen('courseUsersDeleteForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserAddBack', [
|
||||
<?php echo template::button('courseUserDeleteBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course/users/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset7">
|
||||
<?php echo template::button('courseUserDeleteSelectAll', [
|
||||
'value' => 'Tout'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset10">
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserDeleteSelectNone', [
|
||||
'value' => 'Aucun'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::submit('courseUsersDeleteSubmit', [
|
||||
'class' => 'buttonRed',
|
||||
'value' => 'Désinscrire'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
@ -35,7 +45,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([4, 4, 4, 1], $module::$courseUsers, ['Id', 'Prénom', 'Nom', ''], ['id' => 'dataTables']); ?>
|
||||
<?php echo template::table([1, 4, 4, 3], $module::$courseUsers, ['', 'Id', 'Prénom', 'Nom'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
2
core/vendor/datatables/french.json
vendored
2
core/vendor/datatables/french.json
vendored
@ -1,7 +1,7 @@
|
||||
{
|
||||
"processing": "Traitement en cours...",
|
||||
"search": "Rechercher :",
|
||||
"lengthMenu": "Afficher _MENU_ éléments",
|
||||
"lengthMenu": "Éléments par page _MENU_",
|
||||
"info": "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
|
||||
"infoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments",
|
||||
"infoFiltered": "(filtré de _MAX_ éléments au total)",
|
||||
|
Loading…
Reference in New Issue
Block a user