extend suppression of smsstops to all users

This commit is contained in:
osaajani 2021-12-27 20:25:23 +01:00
parent b5d1483048
commit fadffdab10
3 changed files with 6 additions and 19 deletions

View File

@ -1 +1 @@
v3.2.4
v3.2.5

View File

@ -74,13 +74,6 @@ namespace controllers\publics;
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
}
if (!\controllers\internals\Tool::is_admin())
{
\FlashMessage\FlashMessage::push('danger', 'Vous devez être administrateur pour pouvoir supprimer un "STOP Sms" !');
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
}
$ids = $_GET['ids'] ?? [];
foreach ($ids as $id)
{

View File

@ -40,9 +40,7 @@
<thead>
<tr>
<th>Numéro</th>
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
<?php } ?>
</tr>
</thead>
<tbody>
@ -50,12 +48,10 @@
</table>
</div>
<div>
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
<div class="text-right col-xs-12 no-padding">
<strong>Action pour la séléction :</strong>
<button class="btn btn-default btn-confirm" type="submit" formaction="<?php echo \descartes\Router::url('SmsStop', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
</div>
<?php } ?>
</div>
</form>
</div>
@ -87,14 +83,12 @@ jQuery(document).ready(function ()
{
data: 'number_formatted',
}
<?php if ($_SESSION['user']['admin'] ?? false) { ?>
,{
data: 'id',
render: function (data, type, row, meta) {
return '<input name="ids[]" type="checkbox" value="' + data + '">';
},
},
<?php } ?>
],
"deferRender": true
});