mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Rename a few classes, fix bugs, fix syntax
This commit is contained in:
parent
7cb963b8cf
commit
bda1c7ddfd
18 changed files with 106 additions and 37 deletions
|
@ -58,6 +58,7 @@ namespace controllers\publics;
|
|||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
||||
|
@ -141,6 +142,7 @@ namespace controllers\publics;
|
|||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
||||
|
@ -153,12 +155,14 @@ namespace controllers\publics;
|
|||
if (!$content)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous ne pouvez pas créer un Sms sans message.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::validate_date($date, 'Y-m-d H:i:s') && !\controllers\internals\Tool::validate_date($date, 'Y-m-d H:i'))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez fournir une date valide.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
||||
|
@ -179,6 +183,7 @@ namespace controllers\publics;
|
|||
if (!$numbers && !$contacts && !$groups)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez renseigner au moins un destinataire pour le Sms.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
||||
|
@ -192,10 +197,12 @@ namespace controllers\publics;
|
|||
if (!$scheduled_id = $this->internal_scheduled->create($scheduled, $numbers, $contacts, $groups))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de créer le Sms.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Le Sms a bien été créé pour le '.$date.'.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
||||
|
@ -212,6 +219,7 @@ namespace controllers\publics;
|
|||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
||||
|
@ -230,12 +238,14 @@ namespace controllers\publics;
|
|||
if (!$content)
|
||||
{
|
||||
$all_update_ok = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::validate_date($date, 'Y-m-d H:i:s') && !\controllers\internals\Tool::validate_date($date, 'Y-m-d H:i'))
|
||||
{
|
||||
$all_update_ok = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -246,6 +256,7 @@ namespace controllers\publics;
|
|||
if (!$number)
|
||||
{
|
||||
unset($numbers[$key]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -255,13 +266,15 @@ namespace controllers\publics;
|
|||
if (!$numbers && !$contacts && !$groups)
|
||||
{
|
||||
$all_update_ok = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$success = $this->internal_scheduled->update($id_scheduled, $content, $at, $numbers, $contacts, $groups);
|
||||
$success = $this->internal_scheduled->update($id_scheduled, $content, $date, $numbers, $contacts, $groups);
|
||||
if (!$success)
|
||||
{
|
||||
$all_update_ok = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -269,10 +282,12 @@ namespace controllers\publics;
|
|||
if (!$all_update_ok)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Certains SMS n\'ont pas pu êtres mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Tous les SMS ont été mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue