fix few last
This commit is contained in:
parent
8f9bf0a729
commit
10ae91d23d
|
@ -29,7 +29,7 @@ class Console extends \descartes\InternalController
|
|||
|
||||
$this->model_command = new \models\Command($bdd);
|
||||
$this->model_database = new \models\DataBase($bdd);
|
||||
$this->model_sended = new \models\Sended($bdd);
|
||||
$this->model_sended = new \models\Sent($bdd);
|
||||
$this->model_smsstop = new \models\SmsStop($bdd);
|
||||
$this->model_received = new \models\Received($bdd);
|
||||
$this->model_user = new \models\User($bdd);
|
||||
|
@ -242,7 +242,7 @@ class Console extends \descartes\InternalController
|
|||
if ('Failed' === trim($text))
|
||||
{
|
||||
$this->model_sended->update($sended['id'], ['before_delivered' => 0, 'failed' => true]);
|
||||
echo 'Sended Sms id ' . $sended['id'] . " pass to failed status\n";
|
||||
echo 'Sent Sms id ' . $sended['id'] . " pass to failed status\n";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
@ -251,14 +251,14 @@ class Console extends \descartes\InternalController
|
|||
if ($sended['before_delivered'] > 1)
|
||||
{
|
||||
$this->model_database->update($sended['id'], ['before_delivered' => $sended['before_delivered'] - 1]);
|
||||
echo 'Sended Sms id ' . $sended['id'] . " before_delivered decrement\n";
|
||||
echo 'Sent Sms id ' . $sended['id'] . " before_delivered decrement\n";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
//Si tout est bon, que nous avons assez d'accusés, nous validons !
|
||||
$this->model_database->update($sended['id'], ['before_delivered' => 0, 'delivered' => true]);
|
||||
echo 'Sended Sms id ' . $sended['id'] . " to delivered status\n";
|
||||
echo 'Sent Sms id ' . $sended['id'] . " to delivered status\n";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -15,13 +15,13 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Classe des sendedes.
|
||||
*/
|
||||
class Sended extends \descartes\InternalController
|
||||
class Sent extends \descartes\InternalController
|
||||
{
|
||||
private $model_sended;
|
||||
|
||||
public function __construct(\PDO $bdd)
|
||||
{
|
||||
$this->model_sended = new \models\Sended($bdd);
|
||||
$this->model_sended = new \models\Sent($bdd);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Cette fonction retourne une liste des receivedes sous forme d'un tableau.
|
||||
*
|
||||
* @param string $target : Le numéro de à qui est envoyé le message
|
||||
* @param string $target : Le numéro auquel est envoyé le message
|
||||
*
|
||||
* @return array : La liste des sendeds
|
||||
*/
|
||||
|
@ -101,29 +101,6 @@ namespace controllers\internals;
|
|||
return $this->model_sended->create($sended);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cette fonction met à jour une série de sendedes.
|
||||
*
|
||||
* @param mixed $sendeds
|
||||
*
|
||||
* @return int : le nombre de ligne modifiées
|
||||
*/
|
||||
public function update($sendeds)
|
||||
{
|
||||
$nb_update = 0;
|
||||
foreach ($sendeds as $sended)
|
||||
{
|
||||
$result = $this->model_sended->update($sended['id'], $sended);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
++$nb_update;
|
||||
}
|
||||
}
|
||||
|
||||
return $nb_update;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cette fonction permet de compter le nombre de sendeds.
|
||||
*
|
|
@ -98,27 +98,4 @@ namespace controllers\internals;
|
|||
{
|
||||
return $this->model_sms_stop->insert($smsstop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cette fonction met à jour une série de smsstopes.
|
||||
*
|
||||
* @param mixed $smsstops
|
||||
*
|
||||
* @return int : le nombre de ligne modifiées
|
||||
*/
|
||||
public function update($smsstops)
|
||||
{
|
||||
$nb_update = 0;
|
||||
foreach ($smsstops as $smsstop)
|
||||
{
|
||||
$result = $this->model_sms_stop->update($smsstop['id'], $smsstop);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
++$nb_update;
|
||||
}
|
||||
}
|
||||
|
||||
return $nb_update;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace controllers\publics;
|
|||
{
|
||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
||||
|
||||
$this->internal_sended = new \controllers\internals\Sended($bdd);
|
||||
$this->internal_sended = new \controllers\internals\Sent($bdd);
|
||||
$this->internal_received = new \controllers\internals\Received($bdd);
|
||||
$this->internal_contact = new \controllers\internals\Contact($bdd);
|
||||
$this->internal_group = new \controllers\internals\Group($bdd);
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace controllers\publics;
|
|||
{
|
||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
||||
|
||||
$this->internal_sended = new \controllers\internals\Sended($bdd);
|
||||
$this->internal_sended = new \controllers\internals\Sent($bdd);
|
||||
$this->internal_scheduled = new \controllers\internals\Scheduled($bdd);
|
||||
$this->internal_received = new \controllers\internals\Received($bdd);
|
||||
$this->internal_contact = new \controllers\internals\Contact($bdd);
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace controllers\publics;
|
|||
/**
|
||||
* Page des sendeds.
|
||||
*/
|
||||
class Sended extends \descartes\Controller
|
||||
class Sent extends \descartes\Controller
|
||||
{
|
||||
private $internal_sended;
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace controllers\publics;
|
|||
public function __construct()
|
||||
{
|
||||
$bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD);
|
||||
$this->internal_sended = new \controllers\internals\Sended($bdd);
|
||||
$this->internal_sended = new \controllers\internals\Sent($bdd);
|
||||
|
||||
\controllers\internals\Tool::verifyconnect();
|
||||
}
|
||||
|
@ -59,8 +59,7 @@ namespace controllers\publics;
|
|||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Sended', 'list'));
|
||||
return $this->redirect(\descartes\Router::url('Sent', 'list'));
|
||||
}
|
||||
|
||||
$ids = $_GET['ids'] ?? [];
|
||||
|
@ -69,6 +68,6 @@ namespace controllers\publics;
|
|||
$this->internal_sended->delete($id);
|
||||
}
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Sended', 'list'));
|
||||
return $this->redirect(\descartes\Router::url('Sent', 'list'));
|
||||
}
|
||||
}
|
|
@ -59,14 +59,12 @@ namespace controllers\publics;
|
|||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::is_admin())
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez être administrateur pour pouvoir supprimer un "STOP Sms" !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<a href="<?php echo \Router::url('Sended', 'list'); ?>">Voir tous les SMS envoyés <i class="fa fa-arrow-circle-right"></i></a>
|
||||
<a href="<?php echo \Router::url('Sent', 'list'); ?>">Voir tous les SMS envoyés <i class="fa fa-arrow-circle-right"></i></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<a href="javascript:;" data-toggle="collapse" data-target="#logs"><i class="fa fa-fw fa-file-text"></i> Logs <i class="fa fa-fw fa-caret-down"></i></a>
|
||||
<ul id="logs" class="collapse <?php echo in_array($page, array('sendeds', 'receiveds', 'events', 'smsstop')) ? 'in' : ''; ?>">
|
||||
<li <?php echo $page == 'sendeds' ? 'class="active"' : ''; ?>>
|
||||
<a href="<?php echo \Router::url('Sended', 'list'); ?>"><i class="fa fa-fw fa-send"></i> SMS envoyés</a>
|
||||
<a href="<?php echo \Router::url('Sent', 'list'); ?>"><i class="fa fa-fw fa-send"></i> SMS envoyés</a>
|
||||
</li>
|
||||
<li <?php echo $page == 'receiveds' ? 'class="active"' : ''; ?>>
|
||||
<a href="<?php echo \Router::url('Received', 'list'); ?>"><i class="fa fa-fw fa-download"></i> SMS reçus</a>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
//Template dashboard
|
||||
|
||||
$this->render('incs/head', ['title' => 'Sendeds - Show All'])
|
||||
$this->render('incs/head', ['title' => 'Sents - Show All'])
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
|
@ -72,12 +72,12 @@
|
|||
<?php if ($_SESSION['user']['admin']) { ?>
|
||||
<div class="text-right col-xs-12 no-padding">
|
||||
<strong>Action pour la séléction :</strong>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \Router::url('Sended', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \Router::url('Sent', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<ul class="pager">
|
||||
<?php if ($page) { ?>
|
||||
<li><a href="<?php echo \Router::url('Sended', 'list', array('page' => $page - 1)); ?>"><span aria-hidden="true">←</span> Précèdents</a></li>
|
||||
<li><a href="<?php echo \Router::url('Sent', 'list', array('page' => $page - 1)); ?>"><span aria-hidden="true">←</span> Précèdents</a></li>
|
||||
<?php } ?>
|
||||
|
||||
Page : <?php $this->s($page + 1); ?>
|
||||
|
|
Loading…
Reference in New Issue