mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 01:16:26 +02:00
start add support for phone status + improve edit of phone for hidden phones
This commit is contained in:
parent
f9e64aee65
commit
38d350dfc2
19 changed files with 357 additions and 6 deletions
|
@ -111,7 +111,7 @@ jQuery(document).ready(function ()
|
|||
{
|
||||
data: '_',
|
||||
render: function (data, type, row, meta) {
|
||||
return '<a class="btn btn-info preview-button" href="#" data-id-group="' + jQuery.fn.dataTable.render.text().display(row.id) + '"><span class="fa fa-eye"></span></a>';
|
||||
return '<a class="btn btn-info preview-button inline" href="#" data-id-group="' + jQuery.fn.dataTable.render.text().display(row.id) + '"><span class="fa fa-eye"></span></a>';
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -65,13 +65,15 @@
|
|||
</p>
|
||||
<select name="phones[<?php $this->s($phone['id']); ?>][adapter]" class="form-control adapter-select">
|
||||
<?php foreach ($adapters as $adapter) { ?>
|
||||
<?php if ($adapter['meta_hidden'] === false) { ?>
|
||||
<?php if ($adapter['meta_hidden'] === false || $phone['adapter'] == $adapter['meta_classname']) { ?>
|
||||
<option
|
||||
value="<?= $adapter['meta_classname'] ?>"
|
||||
data-description="<?php $this->s($adapter['meta_description']); ?>"
|
||||
data-data-fields="<?php $this->s(json_encode($adapter['meta_data_fields'])); ?>"
|
||||
<?php if ($phone['adapter'] == $adapter['meta_classname']) { ?>
|
||||
data-phone-adapter-data="<?php $this->s($phone['adapter_data']); ?>"
|
||||
<?php if (!$adapter['meta_hide_data']) { ?>
|
||||
data-phone-adapter-data="<?php $this->s($phone['adapter_data']); ?>"
|
||||
<?php } ?>
|
||||
selected
|
||||
<?php } ?>
|
||||
>
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
</div>
|
||||
<div class="text-right col-xs-6 no-padding">
|
||||
<strong>Action pour la séléction :</strong>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \descartes\Router::url('Phone', 'update_status', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-refresh"></span> Rafraichir le status</button>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \descartes\Router::url('Phone', 'edit'); ?>"><span class="fa fa-edit"></span> Modifier</button>
|
||||
<button class="btn btn-default btn-confirm" type="submit" formaction="<?php echo \descartes\Router::url('Phone', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
||||
</div>
|
||||
|
@ -90,7 +91,28 @@ jQuery(document).ready(function ()
|
|||
},
|
||||
"columns" : [
|
||||
{data: 'id', render: jQuery.fn.dataTable.render.text()},
|
||||
{data: 'name', render: jQuery.fn.dataTable.render.text()},
|
||||
{
|
||||
data: 'name',
|
||||
render: function (data, type, row, meta) {
|
||||
html = jQuery.fn.dataTable.render.text().display(data)
|
||||
switch (row.status)
|
||||
{
|
||||
case 'available':
|
||||
html += ' - <span class="text-success">Disponible</span>'
|
||||
break;
|
||||
|
||||
case 'unavailable':
|
||||
html += ' - <span class="text-danger">Indisponible</span>'
|
||||
break;
|
||||
|
||||
case 'no_credit':
|
||||
html += ' - <span class="text-warning">Plus de crédit</span>'
|
||||
break;
|
||||
}
|
||||
|
||||
return html
|
||||
},
|
||||
},
|
||||
{data: 'priority', render: jQuery.fn.dataTable.render.text()},
|
||||
{data: 'adapter', render: jQuery.fn.dataTable.render.text()},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue