mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-07 07:06:26 +02:00
first refonte
This commit is contained in:
commit
9e9cd47b91
226 changed files with 34307 additions and 0 deletions
163
templates/scheduled/add.php
Executable file
163
templates/scheduled/add.php
Executable file
|
@ -0,0 +1,163 @@
|
|||
<?php
|
||||
//Template dashboard
|
||||
|
||||
$this->render('incs/head', ['title' => 'Scheduleds - Add'])
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
$this->render('incs/nav', ['page' => 'scheduleds'])
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
Nouveau SMS programmé
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-dashboard"></i> <a href="<?php echo \Router::url('Dashboard', 'list'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-calendar"></i> <a href="<?php echo \Router::url('Scheduled', 'list'); ?>">Scheduleds</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-plus"></i> Nouveau
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-calendar fa-fw"></i> Ajout d'un SMS programmé</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="<?php echo \Router::url('Scheduled', 'create', ['csrf' => $_SESSION['csrf']]);?>" method="POST">
|
||||
<div class="form-group">
|
||||
<label>Texte du SMS</label>
|
||||
<textarea name="content" class="form-control" required></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Date d'envoi du SMS</label>
|
||||
<input name="date" class="form-control form-datetime" type="text" value="<?php $this->s($now); ?>" readonly>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Numéros cibles</label>
|
||||
<div class="form-group scheduleds-number-groupe-container">
|
||||
<div class="form-group scheduleds-number-groupe">
|
||||
<input name="" class="form-control phone-international-input" type="tel" >
|
||||
<span class="remove-scheduleds-number fa fa-times"></span>
|
||||
<input name="numbers[]" type="hidden" class="phone-hidden-input">
|
||||
</div>
|
||||
<div class="add-number-button fa fa-plus-circle"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Contacts cibles</label>
|
||||
<input class="add-contacts form-control" name="contacts[]"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Groupes cibles</label>
|
||||
<input class="add-groupes form-control" name="groupes[]"/>
|
||||
</div>
|
||||
<?php if (RASPISMS_SETTINGS_SMS_FLASH) { ?>
|
||||
<div class="form-group">
|
||||
<label>Envoyer comme un SMS Flash : </label>
|
||||
<div class="form-group">
|
||||
<input name="admin" type="radio" value="1" required /> Oui
|
||||
<input name="admin" type="radio" value="0" required checked/> Non
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<a class="btn btn-danger" href="<?php echo \Router::url('Scheduled', 'list'); ?>">Annuler</a>
|
||||
<input type="submit" class="btn btn-success" value="Enregistrer le SMS" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
jQuery('.add-contacts').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo \Router::url('Contact', 'json_list'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('.add-groupes').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo \Router::url('Groupe', 'json_list'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('.phone-international-input').intlTelInput({
|
||||
defaultCountry: '<?php $this->s(RASPISMS_SETTINGS_DEFAULT_PHONE_COUNTRY); ?>',
|
||||
preferredCountries: <?php $this->s(json_encode(explode(',', RASPISMS_SETTINGS_PREFERRED_PHONE_COUNTRY)), false, false); ?>,
|
||||
nationalMode: true,
|
||||
utilsScript: '<?php echo HTTP_PWD; ?>/js/intlTelInput/lib/libphonenumber/utils.js'
|
||||
});
|
||||
|
||||
jQuery('body').on('click', '.remove-scheduleds-number', function(e)
|
||||
{
|
||||
jQuery(this).parents('.scheduleds-number-groupe').remove();
|
||||
});
|
||||
|
||||
jQuery('body').on('click', '.add-number-button', function(e)
|
||||
{
|
||||
var newScheduledsNumberGroupe = '' +
|
||||
'<div class="form-group scheduleds-number-groupe">' +
|
||||
'<input name="" class="form-control phone-international-input" type="tel" >' +
|
||||
'<span class="remove-scheduleds-number fa fa-times"></span>' +
|
||||
'<input name="numbers[]" type="hidden" class="phone-hidden-input">' +
|
||||
'</div>';
|
||||
|
||||
jQuery(this).before(newScheduledsNumberGroupe);
|
||||
|
||||
jQuery('.phone-international-input').intlTelInput({
|
||||
defaultCountry: '<?php $this->s(RASPISMS_SETTINGS_DEFAULT_PHONE_COUNTRY); ?>',
|
||||
preferredCountries: <?php $this->s(json_encode(explode(',', RASPISMS_SETTINGS_PREFERRED_PHONE_COUNTRY)), false, false); ?>,
|
||||
nationalMode: true,
|
||||
utilsScript: '<?php echo HTTP_PWD; ?>/js/intlTelInput/lib/libphonenumber/utils.js'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
jQuery('.form-datetime').datetimepicker(
|
||||
{
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
autoclose: true,
|
||||
minuteStep: 1,
|
||||
language: 'fr'
|
||||
});
|
||||
|
||||
|
||||
jQuery('form').on('submit', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
jQuery('.phone-international-input').each(function(key, value)
|
||||
{
|
||||
var container = jQuery(this).parents('.scheduleds-number-groupe');
|
||||
container.find('.phone-hidden-input').val(jQuery(this).intlTelInput("getNumber"));
|
||||
});
|
||||
|
||||
this.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$this->render('incs/footer');
|
179
templates/scheduled/edit.php
Executable file
179
templates/scheduled/edit.php
Executable file
|
@ -0,0 +1,179 @@
|
|||
<?php
|
||||
//Template dashboard
|
||||
|
||||
$this->render('incs/head', ['title' => 'Scheduleds - Edit'])
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
$this->render('incs/nav', ['page' => 'scheduleds'])
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
Modifier SMS programmés
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-dashboard"></i> <a href="<?php echo \Router::url('Dashboard', 'show'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-calendar"></i> <a href="<?php echo \Router::url('Scheduled', 'list'); ?>">Scheduleds</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-edit"></i> Modifier
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-edit fa-fw"></i> Modification des SMS programmés</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="<?php echo \Router::url('Scheduled', 'update', ['csrf' => $_SESSION['csrf']]);?>" method="POST">
|
||||
<?php foreach ($scheduleds as $scheduled) { ?>
|
||||
<div class="form-group">
|
||||
<label>Texte du SMS</label>
|
||||
<textarea name="scheduleds[<?php $this->s($scheduled['id']); ?>][content]" class="form-control" required><?php $this->s($scheduled['content'], true); ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Date d'envoi du SMS</label>
|
||||
<input name="scheduleds[<?php $this->s($scheduled['id']); ?>][date]" class="form-control form-datetime" type="text" value="<?php $this->s($scheduled['at']); ?>" readonly>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Numéros cibles</label>
|
||||
<div class="form-group scheduleds-number-groupe-container" scheduled-id="<?php $this->s($scheduled['id']); ?>" >
|
||||
<?php foreach ($scheduled['numbers'] as $number) { ?>
|
||||
<div class="form-group scheduleds-number-groupe">
|
||||
<input name="" class="form-control phone-international-input" type="tel" value="<?php $this->s($number); ?>">
|
||||
<span class="remove-scheduleds-number fa fa-times"></span>
|
||||
<input name="scheduleds[<?php $this->s($scheduled['id']); ?>][numbers][]" type="hidden" class="phone-hidden-input">
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="add-number-button fa fa-plus-circle"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Contacts cibles</label>
|
||||
<input class="add-contacts form-control" name="scheduleds[<?php $this->s($scheduled['id']); ?>][contacts][]" value="<?php $this->s(json_encode($scheduled['contacts'])); ?>" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Groupes cibles</label>
|
||||
<input class="add-groupes form-control" name="scheduleds[<?php $this->s($scheduled['id']); ?>][groupes][]" value="<?php $this->s(json_encode($scheduled['groupes'])); ?>" />
|
||||
</div>
|
||||
<?php if (RASPISMS_SETTINGS_SMS_FLASH) { ?>
|
||||
<div class="form-group">
|
||||
<label>Envoyer comme un SMS Flash : </label>
|
||||
<div class="form-group">
|
||||
<input name="admin" type="radio" value="1" required <?php echo ($scheduled['flash'] ? 'checked' : ''); ?> /> Oui
|
||||
<input name="admin" type="radio" value="0" required <?php echo ($scheduled['flash'] ? '' : 'checked'); ?> /> Non
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<hr/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="btn btn-danger" href="<?php echo \Router::url('Scheduled', 'list'); ?>">Annuler</a>
|
||||
<input type="submit" class="btn btn-success" value="Enregistrer le SMS" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
jQuery('.form-datetime').datetimepicker(
|
||||
{
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
autoclose: true,
|
||||
minuteStep: 1,
|
||||
language: 'fr'
|
||||
});
|
||||
|
||||
jQuery('.add-contacts').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo \Router::url('Contact', 'json_list'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('.add-groupes').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo \Router::url('Groupe', 'json_list'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('.phone-international-input').intlTelInput({
|
||||
defaultCountry: '<?php $this->s(RASPISMS_SETTINGS_DEFAULT_PHONE_COUNTRY); ?>',
|
||||
preferredCountries: <?php $this->s(json_encode(explode(',', RASPISMS_SETTINGS_PREFERRED_PHONE_COUNTRY)), false, false); ?>,
|
||||
nationalMode: true,
|
||||
utilsScript: '<?php echo HTTP_PWD; ?>/js/intlTelInput/lib/libphonenumber/utils.js'
|
||||
});
|
||||
|
||||
jQuery('body').on('click', '.remove-scheduleds-number', function(e)
|
||||
{
|
||||
jQuery(this).parents('.scheduleds-number-groupe').remove();
|
||||
});
|
||||
|
||||
jQuery('body').on('click', '.add-number-button', function(e)
|
||||
{
|
||||
var scheduledId = jQuery(this).parents('.scheduleds-number-groupe-container').attr('scheduled-id');
|
||||
var newScheduledsNumberGroupe = '' +
|
||||
'<div class="form-group scheduleds-number-groupe">' +
|
||||
'<input name="" class="form-control phone-international-input" type="tel" >' +
|
||||
'<span class="remove-scheduleds-number fa fa-times"></span>' +
|
||||
'<input name="scheduleds[' + scheduledId + '][numbers][]" type="hidden" class="phone-hidden-input">' +
|
||||
'</div>';
|
||||
|
||||
jQuery(this).before(newScheduledsNumberGroupe);
|
||||
|
||||
jQuery('.phone-international-input').intlTelInput({
|
||||
defaultCountry: '<?php $this->s(RASPISMS_SETTINGS_DEFAULT_PHONE_COUNTRY); ?>',
|
||||
preferredCountries: <?php $this->s(json_encode(explode(',', RASPISMS_SETTINGS_PREFERRED_PHONE_COUNTRY)), false, false); ?>,
|
||||
nationalMode: true,
|
||||
utilsScript: '<?php echo HTTP_PWD; ?>/js/intlTelInput/lib/libphonenumber/utils.js'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
jQuery('.form-datetime').datetimepicker(
|
||||
{
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
autoclose: true,
|
||||
minuteStep: 1,
|
||||
language: 'fr'
|
||||
});
|
||||
|
||||
|
||||
jQuery('form').on('submit', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
jQuery('.phone-international-input').each(function(key, value)
|
||||
{
|
||||
var container = jQuery(this).parents('.scheduleds-number-groupe');
|
||||
container.find('.phone-hidden-input').val(jQuery(this).intlTelInput("getNumber"));
|
||||
});
|
||||
|
||||
this.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$this->render('incs/footer');
|
106
templates/scheduled/list.php
Executable file
106
templates/scheduled/list.php
Executable file
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
//Template dashboard
|
||||
|
||||
$this->render('incs/head', ['title' => 'Scheduleds - Show All'])
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
$this->render('incs/nav', ['page' => 'scheduleds'])
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">
|
||||
Dashboard <small>Scheduleds</small>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-dashboard"></i> <a href="<?php echo \Router::url('Dashboard', 'list'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-calendar"></i> Scheduleds
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-calendar fa-fw"></i> Liste des SMS programmés</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form method="GET">
|
||||
<?php if (!$scheduleds) { ?>
|
||||
<p>Aucun SMS n'est actuellement programmé.</p>
|
||||
<?php } else { ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover table-striped" id="table-scheduleds">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Date</th>
|
||||
<th>Contenu</th>
|
||||
<th style="width:5%;">Sélectionner</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($scheduleds as $scheduled)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php $this->s($scheduled['id']); ?></td>
|
||||
<td><?php $this->s($scheduled['at']); ?></td>
|
||||
<td><?php $this->s($scheduled['content']); ?></td>
|
||||
<td><input type="checkbox" name="ids[]" value="<?php $this->s($scheduled['id']); ?>"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div>
|
||||
<div class="col-xs-6 no-padding">
|
||||
<a class="btn btn-success" href="<?php echo \Router::url('Scheduled', 'add'); ?>"><span class="fa fa-plus"></span> Ajouter un SMS programmé</a>
|
||||
</div>
|
||||
<?php if ($scheduleds) { ?>
|
||||
<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 \Router::url('Scheduled', 'edit'); ?>"><span class="fa fa-edit"></span> Modifier</button>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \Router::url('Scheduled', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function ()
|
||||
{
|
||||
jQuery('.action-dropdown a').on('click', function (e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var target = jQuery(this).parents('.action-dropdown').attr('target');
|
||||
var url = jQuery(this).attr('href');
|
||||
jQuery(target).find('input:checked').each(function ()
|
||||
{
|
||||
url += '/' + jQuery(this).val();
|
||||
});
|
||||
window.location = url;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$this->render('incs/footer');
|
Loading…
Add table
Add a link
Reference in a new issue