fix few routes and basic errors
This commit is contained in:
parent
adb739775f
commit
bb8a114485
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
|
@ -26,7 +26,7 @@ function showMessage(message, type)
|
|||
function verifReceived()
|
||||
{
|
||||
jQuery('.popup-alert').fadeOut('slow');
|
||||
jQuery.getJSON(HTTP_PWD + "/receiveds/popup", function( data ) {
|
||||
jQuery.getJSON(HTTP_PWD + "/received/popup", function( data ) {
|
||||
$.each(data, function(key, val) {
|
||||
showMessage('SMS reçu du ' + val.send_by.replace(/</g, "<").replace(/>/g, ">") + ' : ' + val.content.replace(/</g, "<").replace(/>/g, ">"), 1);
|
||||
playReceptionSound();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"require": {
|
||||
"ingenerator/tokenista": "^1.1"
|
||||
"ingenerator/tokenista": "^1.1",
|
||||
"ajani/flash-message": "^2.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,44 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "a1268b58d2498b20008fffcaec529e24",
|
||||
"content-hash": "865bbe9b68621affffbd85b40e2cf26d",
|
||||
"content-hash": "37f7ef4e091e90d90b3c7d6056cbe454",
|
||||
"packages": [
|
||||
{
|
||||
"name": "ajani/flash-message",
|
||||
"version": "v2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/RaspbianFrance/flash-message.git",
|
||||
"reference": "7a01306c2850b0a37c9910f29935e0b0923b65a1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/RaspbianFrance/flash-message/zipball/7a01306c2850b0a37c9910f29935e0b0923b65a1",
|
||||
"reference": "7a01306c2850b0a37c9910f29935e0b0923b65a1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"FlashMessage": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-3.0-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "osaajani",
|
||||
"email": "plebwebsas@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A simple package to allow usage of flash messages using session.",
|
||||
"time": "2019-11-09T02:11:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ingenerator/tokenista",
|
||||
"version": "v1.1.0",
|
||||
|
@ -58,7 +93,7 @@
|
|||
"csrf",
|
||||
"token"
|
||||
],
|
||||
"time": "2018-02-26 14:16:22"
|
||||
"time": "2018-02-26T14:16:22+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
|
|
@ -46,14 +46,14 @@ namespace controllers\publics;
|
|||
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
||||
if (!$password)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez renseigner un mot de passe.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez renseigner un mot de passe.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -61,12 +61,12 @@ namespace controllers\publics;
|
|||
$update_password_result = $this->internal_user->update_password($_SESSION['user']['id'], $password);
|
||||
if (!$update_password_result)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de mettre à jour le mot de passe.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de mettre à jour le mot de passe.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Le mot de passe a bien été mis à jour.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Le mot de passe a bien été mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -83,14 +83,14 @@ namespace controllers\publics;
|
|||
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
||||
if (false === $transfer)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez choisir une option parmis celles de la liste déroulante.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez choisir une option parmis celles de la liste déroulante.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -98,14 +98,14 @@ namespace controllers\publics;
|
|||
$transfer_update_result = $this->internal_user->update_transfer($_SESSION['user']['id'], $transfer);
|
||||
if (!$transfer_update_result)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de mettre à jour.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de mettre à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
||||
$_SESSION['user']['transfer'] = $transfer;
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Le transfert a bien été '.($transfer ? 'activé' : 'désactivé').'.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Le transfert a bien été '.($transfer ? 'activé' : 'désactivé').'.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -130,14 +130,14 @@ namespace controllers\publics;
|
|||
|
||||
if (!$email)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez fournir une adresse e-mail !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez fournir une adresse e-mail !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'L\'adresse e-mail n\'est pas une adresse valide.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'L\'adresse e-mail n\'est pas une adresse valide.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -145,14 +145,14 @@ namespace controllers\publics;
|
|||
$update_email_result = $this->internal_user->update_email($_SESSION['user']['id'], $email);
|
||||
if (!$update_email_result)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de mettre à jour.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de mettre à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
||||
$_SESSION['user']['email'] = $email;
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'L\'email a bien été mis à jour.');
|
||||
\FlashMessage\FlashMessage::push('success', 'L\'email a bien été mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ namespace controllers\publics;
|
|||
|
||||
if (!$delete_account)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Pour supprimer le compte, vous devez cocher la case correspondante.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Pour supprimer le compte, vous devez cocher la case correspondante.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ namespace controllers\publics;
|
|||
$delete_account_result = $this->internal_user->delete($_SESSION['user']['id']);
|
||||
if (!$delete_account_result)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de supprimer le compte.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de supprimer le compte.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Account', 'show'));
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
$this->redirect(\descartes\Router::url('Command', 'list'));
|
||||
|
||||
return false;
|
||||
|
@ -107,7 +107,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Command', 'list'));
|
||||
}
|
||||
|
@ -118,19 +118,19 @@ namespace controllers\publics;
|
|||
|
||||
if (!$name || !$script)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Renseignez au moins un nom et un script.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Renseignez au moins un nom et un script.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Command', 'list'));
|
||||
}
|
||||
|
||||
if (!$this->internal_command->create($name, $script, $admin))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible créer cette commande.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible créer cette commande.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('commands', 'add'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'La commande a bien été crée.');
|
||||
\FlashMessage\FlashMessage::push('success', 'La commande a bien été crée.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Command', 'list'));
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Command', 'list'));
|
||||
}
|
||||
|
@ -161,12 +161,12 @@ namespace controllers\publics;
|
|||
|
||||
if ($nb_commands_update !== \count($_POST['commands']))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Certaines commandes n\'ont pas pu êtres mises à jour.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Certaines commandes n\'ont pas pu êtres mises à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Command', 'list'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Toutes les commandes ont été modifiées avec succès.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Toutes les commandes ont été modifiées avec succès.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Command', 'list'));
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace controllers\publics;
|
|||
$user = $this->internal_user->check_credentials($email, $password);
|
||||
if (!$user)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Email ou mot de passe invalide.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Email ou mot de passe invalide.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Connect', 'login'));
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Connect', 'forget_password'));
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ namespace controllers\publics;
|
|||
|
||||
if (!$email || !$user)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Aucun utilisateur n\'existe pour cette adresse mail.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Aucun utilisateur n\'existe pour cette adresse mail.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Connect', 'forget_password'));
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'list'));
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'add'));
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ namespace controllers\publics;
|
|||
|
||||
if (!$name || !$number)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Des champs sont manquants !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Des champs sont manquants !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'add'));
|
||||
}
|
||||
|
@ -128,19 +128,19 @@ namespace controllers\publics;
|
|||
$number = \controllers\internals\Tool::parse_phone($number);
|
||||
if (!$number)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Numéro de téléphone incorrect.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Numéro de téléphone incorrect.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'add'));
|
||||
}
|
||||
|
||||
if (!$this->internal_contact->create($number, $name))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de créer ce contact.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de créer ce contact.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'add'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Le contact a bien été créé.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Le contact a bien été créé.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'list'));
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'list'));
|
||||
}
|
||||
|
@ -171,12 +171,12 @@ namespace controllers\publics;
|
|||
|
||||
if ($nb_contacts_update !== \count($_POST['contacts']))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Certais contacts n\'ont pas pu êtres mis à jour.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Certais contacts n\'ont pas pu êtres mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'list'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Tous les contacts ont été modifiés avec succès.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Tous les contacts ont été modifiés avec succès.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Contact', 'list'));
|
||||
}
|
||||
|
|
|
@ -59,14 +59,14 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Event', 'list'));
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::is_admin())
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez être admin pour pouvoir supprimer des events.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez être admin pour pouvoir supprimer des events.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Event', 'list'));
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'list'));
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'add'));
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ namespace controllers\publics;
|
|||
|
||||
if (!$name || !$contacts_ids)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Des champs sont manquants !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Des champs sont manquants !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'add'));
|
||||
}
|
||||
|
@ -138,12 +138,12 @@ namespace controllers\publics;
|
|||
$id_group = $this->internal_group->create($name, $contacts_ids);
|
||||
if (!$id_group)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de créer ce groupe.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de créer ce groupe.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'add'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Le groupe a bien été créé.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Le groupe a bien été créé.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'list'));
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'list'));
|
||||
}
|
||||
|
@ -175,12 +175,12 @@ namespace controllers\publics;
|
|||
|
||||
if ($nb_groups_update !== \count($groups))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Certains groupes n\'ont pas pu êtres mis à jour.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Certains groupes n\'ont pas pu êtres mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'list'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Tous les groupes ont été modifiés avec succès.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Tous les groupes ont été modifiés avec succès.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Group', 'list'));
|
||||
}
|
||||
|
|
|
@ -107,14 +107,14 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Received', 'list'));
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::is_admin())
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez être administrateur pour effectuer cette action.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez être administrateur pour effectuer cette action.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Received', 'list'));
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
@ -154,14 +154,14 @@ namespace controllers\publics;
|
|||
|
||||
if (!$content)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous ne pouvez pas créer un Sms sans message.');
|
||||
\FlashMessage\FlashMessage::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.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez fournir une date valide.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ namespace controllers\publics;
|
|||
|
||||
if (!$numbers && !$contacts && !$groups)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez renseigner au moins un destinataire pour le Sms.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez renseigner au moins un destinataire pour le Sms.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'add'));
|
||||
}
|
||||
|
@ -196,12 +196,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.');
|
||||
\FlashMessage\FlashMessage::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.'.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Le Sms a bien été créé pour le '.$date.'.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
@ -281,12 +281,12 @@ namespace controllers\publics;
|
|||
|
||||
if (!$all_update_ok)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Certains SMS n\'ont pas pu êtres mis à jour.');
|
||||
\FlashMessage\FlashMessage::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.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Tous les SMS ont été mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Scheduled', 'list'));
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Sended', 'list'));
|
||||
}
|
||||
|
|
|
@ -48,14 +48,14 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Setting', 'show'));
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::is_admin())
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez être administrateur pour pouvoir modifier un réglage.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez être administrateur pour pouvoir modifier un réglage.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Setting', 'show'));
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ namespace controllers\publics;
|
|||
|
||||
if (false === $setting_value)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez renseigner une valeure pour le réglage.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez renseigner une valeure pour le réglage.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Setting', 'show'));
|
||||
}
|
||||
|
@ -72,12 +72,12 @@ namespace controllers\publics;
|
|||
$update_setting_result = $this->internal_setting->update($setting_name, $setting_value);
|
||||
if (false === $update_setting_result)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de mettre à jour ce réglage.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de mettre à jour ce réglage.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Setting', 'show'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'Le réglage a bien été mis à jour.');
|
||||
\FlashMessage\FlashMessage::push('success', 'Le réglage a bien été mis à jour.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('Setting', 'show'));
|
||||
}
|
||||
|
|
|
@ -58,14 +58,14 @@ namespace controllers\publics;
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::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" !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez être administrateur pour pouvoir supprimer un "STOP Sms" !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('SmsStop', 'list'));
|
||||
}
|
||||
|
|
|
@ -57,14 +57,14 @@ class User extends \descartes\Controller
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'list'));
|
||||
}
|
||||
|
||||
if (!\controllers\internals\Tool::is_admin())
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez être administrateur pour supprimer un utilisateur !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez être administrateur pour supprimer un utilisateur !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'list'));
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ class User extends \descartes\Controller
|
|||
{
|
||||
if (!$this->verify_csrf($csrf))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Jeton CSRF invalid !');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'add'));
|
||||
}
|
||||
|
@ -111,14 +111,14 @@ class User extends \descartes\Controller
|
|||
|
||||
if (!$email)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Vous devez au moins fournir une adresse e-mail pour l\'utilisateur.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Vous devez au moins fournir une adresse e-mail pour l\'utilisateur.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'add'));
|
||||
}
|
||||
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'L\'adresse e-mail n\'est pas valide.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'L\'adresse e-mail n\'est pas valide.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'add'));
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ class User extends \descartes\Controller
|
|||
$email_send = \controllers\internals\Tool::send_email($email, EMAIL_CREATE_USER, ['email' => $email, 'password' => $password]);
|
||||
if (!$email_send)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible d\'envoyer l\'e-mail à l\'utilisateur, le compte n\'a donc pas été créé.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible d\'envoyer l\'e-mail à l\'utilisateur, le compte n\'a donc pas été créé.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'add'));
|
||||
}
|
||||
|
@ -134,12 +134,12 @@ class User extends \descartes\Controller
|
|||
$user_id = $this->internal_user->create($email, $password, $admin);
|
||||
if (!$user_id)
|
||||
{
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('danger', 'Impossible de créer ce user.');
|
||||
\FlashMessage\FlashMessage::push('danger', 'Impossible de créer ce user.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'add'));
|
||||
}
|
||||
|
||||
\modules\DescartesSessionMessages\internals\DescartesSessionMessages::push('success', 'L\'utilisateur a bien été créé.');
|
||||
\FlashMessage\FlashMessage::push('success', 'L\'utilisateur a bien été créé.');
|
||||
|
||||
return $this->redirect(\descartes\Router::url('User', 'list'));
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<?php
|
||||
//Nom de la variable à utiliser en session pour stocker les messages
|
||||
define('DESCARTESSESSIONMESSAGES_VAR_NAME', 'descartes-session-messages-messages');
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
//Réglages du module DescartesLogger
|
||||
$environment = [
|
||||
'prod' => [
|
||||
'DESCARTESSESSIONMESSAGES_VAR_NAME' => 'descartes-session-messages-messages',
|
||||
],
|
||||
'dev' => [
|
||||
'DESCARTESSESSIONMESSAGES_VAR_NAME' => 'descartes-session-messages-messages',
|
||||
],
|
||||
'test' => [
|
||||
'DESCARTESSESSIONMESSAGES_VAR_NAME' => 'descartes-session-messages-messages',
|
||||
]
|
||||
];
|
|
@ -1,60 +0,0 @@
|
|||
<?php
|
||||
namespace modules\DescartesSessionMessages\internals;
|
||||
|
||||
/**
|
||||
* Cette classe permet de passer des messages d'une page à l'autre via la session
|
||||
*/
|
||||
|
||||
class DescartesSessionMessages
|
||||
{
|
||||
/**
|
||||
* Allow to add a message
|
||||
* @param string $type : Type of the message (usually success, info, warning or danger)
|
||||
* @param string $text : Text of the message
|
||||
*/
|
||||
public static function push ($type, $text)
|
||||
{
|
||||
if (empty($_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME]))
|
||||
{
|
||||
$_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME] = [];
|
||||
}
|
||||
|
||||
$_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME][] = [
|
||||
'type' => $type,
|
||||
'text' => $text,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow to get the next message
|
||||
* @return mixed array|bool : If there is a next message, return it, else return false
|
||||
*/
|
||||
public static function getNext ()
|
||||
{
|
||||
if (empty($_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$message = $_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME][0];
|
||||
unset($_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME][0]);
|
||||
$_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME] = array_values($_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME]);
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow to count message to display
|
||||
* @return int : Number of message to display
|
||||
*/
|
||||
public static function countMessages ()
|
||||
{
|
||||
if (empty($_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME]))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return count($_SESSION[DESCARTESSESSIONMESSAGES_VAR_NAME]);
|
||||
}
|
||||
|
||||
}
|
21
routes.php
21
routes.php
|
@ -65,17 +65,17 @@
|
|||
'delete' => '/event/delete/{csrf}/',
|
||||
],
|
||||
|
||||
'Groupe' => [
|
||||
'Group' => [
|
||||
'list' => [
|
||||
'/groupe/',
|
||||
'/groupe/p/{page}/',
|
||||
'/group/',
|
||||
'/group/p/{page}/',
|
||||
],
|
||||
'add' => '/groupe/add/',
|
||||
'create' => '/groupe/create/{csrf}/',
|
||||
'delete' => '/groupe/delete/{csrf}/',
|
||||
'edit' => '/groupe/edit/',
|
||||
'update' => '/groupe/update/{csrf}/',
|
||||
'json_list' => '/groupes.json/',
|
||||
'add' => '/group/add/',
|
||||
'create' => '/group/create/{csrf}/',
|
||||
'delete' => '/group/delete/{csrf}/',
|
||||
'edit' => '/group/edit/',
|
||||
'update' => '/group/update/{csrf}/',
|
||||
'json_list' => '/groups.json/',
|
||||
],
|
||||
|
||||
'Received' => [
|
||||
|
@ -84,6 +84,7 @@
|
|||
'/received/p/{page}/',
|
||||
],
|
||||
'delete' => '/received/delete/{csrf}/',
|
||||
'popup' => '/received/popup/',
|
||||
],
|
||||
|
||||
'Scheduled' => [
|
||||
|
@ -111,7 +112,7 @@
|
|||
'update' => '/setting/update/{setting_name}/{csrf}/',
|
||||
],
|
||||
|
||||
'SMSStop' => [
|
||||
'SmsStop' => [
|
||||
'list' => [
|
||||
'/smsstop/',
|
||||
'/smsstop/p/{page}/',
|
||||
|
|
|
@ -55,12 +55,12 @@
|
|||
<i class="fa fa-group fa-5x"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge"><?php echo $nb_groupes; ?></div>
|
||||
<div class="huge"><?php echo $nb_groups; ?></div>
|
||||
<div>Groupes</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="<?php echo \descartes\Router::url('Groupe', 'list') ?>">
|
||||
<a href="<?php echo \descartes\Router::url('Group', 'list') ?>">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left">Voir les groupes</span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<i class="fa fa-dashboard"></i> <a href="<?php echo \descartes\Router::url('Dashboard', 'show'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-group"></i> <a href="<?php echo \descartes\Router::url('Groupe', 'list'); ?>">Groupes</a>
|
||||
<i class="fa fa-group"></i> <a href="<?php echo \descartes\Router::url('Group', 'list'); ?>">Groupes</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-plus"></i> Nouveau
|
||||
|
@ -37,7 +37,7 @@
|
|||
<h3 class="panel-title"><i class="fa fa-group fa-fw"></i> Ajout d'un groupe</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="<?php echo \descartes\Router::url('Groupe', 'create', ['csrf' => $_SESSION['csrf']]);?>" method="POST">
|
||||
<form action="<?php echo \descartes\Router::url('Group', 'create', ['csrf' => $_SESSION['csrf']]);?>" method="POST">
|
||||
<div class="form-group">
|
||||
<label>Nom du groupe</label>
|
||||
<div class="form-group input-group">
|
||||
|
@ -49,7 +49,7 @@
|
|||
<label>Contacts au groupe</label>
|
||||
<input class="add-contacts form-control" name="contacts[]"/>
|
||||
</div>
|
||||
<a class="btn btn-danger" href="<?php echo \descartes\Router::url('Groupe', 'list'); ?>">Annuler</a>
|
||||
<a class="btn btn-danger" href="<?php echo \descartes\Router::url('Group', 'list'); ?>">Annuler</a>
|
||||
<input type="submit" class="btn btn-success" value="Enregistrer le groupe" />
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<i class="fa fa-dashboard"></i> <a href="<?php echo \descartes\Router::url('Dashboard', 'show'); ?>">Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-group"></i> <a href="<?php echo \descartes\Router::url('Groupe', 'list'); ?>">Groupes</a>
|
||||
<i class="fa fa-group"></i> <a href="<?php echo \descartes\Router::url('Group', 'list'); ?>">Groupes</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<i class="fa fa-edit"></i> Modifier
|
||||
|
@ -37,7 +37,7 @@
|
|||
<h3 class="panel-title"><i class="fa fa-edit fa-fw"></i> Modification de groupes</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="<?php echo \descartes\Router::url('Groupe', 'update', ['csrf' => $_SESSION['csrf']]);?>" method="POST">
|
||||
<form action="<?php echo \descartes\Router::url('Group', 'update', ['csrf' => $_SESSION['csrf']]);?>" method="POST">
|
||||
<?php
|
||||
foreach ($groupes as $groupe)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="btn btn-danger" href="<?php echo \descartes\Router::url('Groupe', 'list'); ?>">Annuler</a>
|
||||
<a class="btn btn-danger" href="<?php echo \descartes\Router::url('Group', 'list'); ?>">Annuler</a>
|
||||
<input type="submit" class="btn btn-success" value="Enregistrer le groupe" />
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -63,13 +63,13 @@
|
|||
<?php } ?>
|
||||
<div>
|
||||
<div class="col-xs-6 no-padding">
|
||||
<a class="btn btn-success" href="<?php echo \descartes\Router::url('Groupe', 'add'); ?>"><span class="fa fa-plus"></span> Ajouter un groupe</a>
|
||||
<a class="btn btn-success" href="<?php echo \descartes\Router::url('Group', 'add'); ?>"><span class="fa fa-plus"></span> Ajouter un groupe</a>
|
||||
</div>
|
||||
<?php if ($groupes) { ?>
|
||||
<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('Groupe', 'edit'); ?>"><span class="fa fa-edit"></span> Modifier</button>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \descartes\Router::url('Groupe', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \descartes\Router::url('Group', 'edit'); ?>"><span class="fa fa-edit"></span> Modifier</button>
|
||||
<button class="btn btn-default" type="submit" formaction="<?php echo \descartes\Router::url('Group', 'delete', ['csrf' => $_SESSION['csrf']]); ?>"><span class="fa fa-trash-o"></span> Supprimer</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
</audio>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (ENVIRONMENT == 'dev') { ?>
|
||||
<?php if (ENV == 'dev') { ?>
|
||||
<script>
|
||||
<?php while ($message = \modules\DescartesSessionMessages\internals\DescartesSessionMessages::getNext()) { ?>
|
||||
<?php while ($message = \FlashMessage\FlashMessage::next()) { ?>
|
||||
alert('<?php echo $message['type'] . ' : ' . $message['text']; ?>');
|
||||
<?php } ?>
|
||||
</script>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<a href="<?php echo \descartes\Router::url('Contact', 'list'); ?>"><i class="fa fa-fw fa-user"></i> Contacts</a>
|
||||
</li>
|
||||
<li <?php echo $page == 'groupes' ? 'class="active"' : ''; ?>>
|
||||
<a href="<?php echo \descartes\Router::url('Groupe', 'list'); ?>"><i class="fa fa-fw fa-group"></i> Groupes</a>
|
||||
<a href="<?php echo \descartes\Router::url('Group', 'list'); ?>"><i class="fa fa-fw fa-group"></i> Groupes</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
jQuery('.add-groupes').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo \descartes\Router::url('Groupe', 'json_list'); ?>',
|
||||
data: '<?php echo \descartes\Router::url('Group', 'json_list'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
});
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
jQuery('.add-groupes').each(function()
|
||||
{
|
||||
jQuery(this).magicSuggest({
|
||||
data: '<?php echo \descartes\Router::url('Groupe', 'json_list'); ?>',
|
||||
data: '<?php echo \descartes\Router::url('Group', 'json_list'); ?>',
|
||||
valueField: 'id',
|
||||
displayField: 'name',
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue