mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 09:26:27 +02:00
Use id_phone instead of number in scheduled, use ftok to generate queue id, improve adapter interface, add popup error
This commit is contained in:
parent
66fa2ef434
commit
6f8c7d62b9
25 changed files with 195 additions and 180 deletions
6
templates/incs/alert.php
Normal file
6
templates/incs/alert.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div class="popup-alert alert alert-<?php $this->s($type); ?> alert-dismissible show" role="alert">
|
||||
<?php $this->s($text); ?>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
|
@ -11,17 +11,15 @@
|
|||
</audio>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (ENV == 'dev') { ?>
|
||||
<script>
|
||||
<?php while ($message = \FlashMessage\FlashMessage::next()) { ?>
|
||||
alert('<?php $this->s($message['type'] . ' : ' . $message['text']); ?>');
|
||||
<?php } ?>
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (! ($_SESSION['user']['settings']['display_help'] ?? false)) { ?>
|
||||
<style>.help {display: none;}</style>
|
||||
<?php } ?>
|
||||
|
||||
<div class="popup-alerts-container">
|
||||
<?php while ($message = \FlashMessage\FlashMessage::next()) { ?>
|
||||
<?php $this->render('incs/alert', $message); ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -48,20 +48,5 @@
|
|||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ()
|
||||
{
|
||||
<?php if (!empty($_SESSION['errormessage'])) { ?>
|
||||
showMessage('<?php $this->s($_SESSION['errormessage'], false, true); ?>', 0);
|
||||
<?php unset($_SESSION['errormessage']); ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (!empty($_SESSION['successmessage'])) { ?>
|
||||
showMessage('<?php $this->s($_SESSION['successmessage'], false, true); ?>', 1);
|
||||
<?php unset($_SESSION['successmessage']); ?>
|
||||
<?php } ?>
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="popup-alerts-container"></div>
|
||||
<body>
|
||||
|
|
|
@ -44,12 +44,12 @@
|
|||
Le numéro de téléphone qui enverra et recevra les messages.
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<input name="" class="form-control" type="tel" id="phone-international-input" placeholder="Numéro de téléphone à utiliser.">
|
||||
<input required="required" name="" class="form-control" type="tel" id="phone-international-input" placeholder="Numéro de téléphone à utiliser.">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Adaptateur logiciel du téléphone : </label>
|
||||
<p class="italic small help" id="description-adapter">
|
||||
<p class="italic small help" id="description-adapter-general">
|
||||
L'adaptateur logiciel utilisé par RaspiSMS pour communiquer avec le téléphone. Pour plus d'information, consultez <a href="https://raspisms.raspberry-pi.fr/documentation" target="_blank">la documentation de RaspiSMS</a> concernant les adaptateurs logiciels.
|
||||
</p>
|
||||
<select name="adapter" class="form-control" id="adapter-select">
|
||||
|
@ -58,7 +58,6 @@
|
|||
value="<?= $adapter['meta_classname'] ?>"
|
||||
title="<?php $this->s($adapter['meta_description']); ?>"
|
||||
data-description="<?php $this->s($adapter['meta_description']); ?>"
|
||||
data-datas-help="<?php $this->s($adapter['meta_datas_help']); ?>"
|
||||
data-datas-fields="<?php $this->s(json_encode($adapter['meta_datas_fields'])); ?>"
|
||||
>
|
||||
<?php $this->s($adapter['meta_name']); ?>
|
||||
|
@ -66,7 +65,16 @@
|
|||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div id="adapter-datas-fields-container">
|
||||
<div id="adapter-datas-container" class="form-group">
|
||||
<div id="adapter-datas-description-container">
|
||||
<h4>Description de l'adaptateur</h4>
|
||||
<div id="adapter-datas-description"></div>
|
||||
</div>
|
||||
|
||||
<div id="adapter-data-fields-container">
|
||||
<h4>Réglages de l'adaptateur</h4>
|
||||
<div id="adapter-datas-fields"></div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="btn btn-danger" href="<?php echo \descartes\Router::url('Phone', 'list'); ?>">Annuler</a>
|
||||
<input type="submit" class="btn btn-success" value="Enregistrer le phone" />
|
||||
|
@ -83,7 +91,7 @@
|
|||
function change_adapter ()
|
||||
{
|
||||
var option = jQuery('#adapter-select').find('option:selected');
|
||||
jQuery('#description-adapter').text(option.attr('data-description'));
|
||||
jQuery('#adapter-datas-description').html(option.attr('data-description'));
|
||||
jQuery('#description-adapter-datas').text(option.attr('data-datas-help'));
|
||||
|
||||
var datas_fields = option.attr('data-datas-fields');
|
||||
|
@ -102,7 +110,12 @@
|
|||
'</div>';
|
||||
});
|
||||
|
||||
jQuery('#adapter-datas-fields-container').html(html);
|
||||
if (html == '')
|
||||
{
|
||||
html = 'Pas de réglages.';
|
||||
}
|
||||
|
||||
jQuery('#adapter-datas-fields').html(html);
|
||||
}
|
||||
|
||||
jQuery('document').ready(function($)
|
||||
|
|
|
@ -108,10 +108,10 @@
|
|||
<?php } ?>
|
||||
<div class="form-group">
|
||||
<label>Numéro à employer : </label>
|
||||
<select name="origin" class="form-control">
|
||||
<select name="id_phone" class="form-control">
|
||||
<option value="">N'importe lequel</option>
|
||||
<?php foreach ($phones as $phone) { ?>
|
||||
<option value="<?php $this->s($phone['number']); ?>"><?php $this->s($phone['number']); ?></option>
|
||||
<option value="<?php $this->s($phone['id']); ?>"><?php $this->s($phone['number']); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
@ -119,10 +119,10 @@
|
|||
<?php } ?>
|
||||
<div class="form-group">
|
||||
<label>Numéro à employer : </label>
|
||||
<select name="scheduleds[<?php $this->s($scheduled['id']); ?>][origin]" class="form-control">
|
||||
<option <?php echo ($scheduled['origin'] ? '' : 'selected="selected"'); ?> value="">N'importe lequel</option>
|
||||
<select name="scheduleds[<?php $this->s($scheduled['id']); ?>][id_phone]" class="form-control">
|
||||
<option <?php echo ($scheduled['id_phone'] ? '' : 'selected="selected"'); ?> value="">N'importe lequel</option>
|
||||
<?php foreach ($phones as $phone) { ?>
|
||||
<option <?php echo ($scheduled['origin'] == $phone['number'] ? 'selected="selected"' : '' ); ?> value="<?php $this->s($phone['number']); ?>"><?php $this->s($phone['number']); ?></option>
|
||||
<option <?php echo ($scheduled['id_phone'] == $phone['id'] ? 'selected="selected"' : '' ); ?> value="<?php $this->s($phone['id']); ?>"><?php $this->s($phone['number']); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue