Skip to content
Snippets Groups Projects
Commit 4b9e8f04 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #65 language notification, action, status

parent 49e1e508
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ class NotificationControllerTest extends TestCase
$fullRequest = \httpRequestCustom::addContentInBody($aArgs, $request);
$response = $NotificationController->create($fullRequest, new \Slim\Http\Response());
$responseBody = json_decode((string)$response->getBody());
$this->assertSame('Erreur sur la Notification: identifiant déjà existant', $responseBody->errors);
$this->assertSame('identifiant déjà existant', $responseBody->errors);
}
public function testRead()
......
......@@ -116,7 +116,7 @@ class ActionController
'recordId' => $obj['id'],
'eventType' => 'ADD',
'eventId' => 'actionadd',
'info' => _ACTION. ' "' . $obj['label_action'] .'" ' ._ADDED
'info' => _ACTION_ADDED . ' : ' . $obj['label_action']
]);
return $response->withJson(
......@@ -160,7 +160,7 @@ class ActionController
'recordId' => $obj['id'],
'eventType' => 'UP',
'eventId' => 'actionup',
'info' => _ACTION. ' "' . $obj['label_action'] .'" ' ._UPDATED
'info' => _ACTION_UPDATED. ' : ' . $obj['label_action']
]);
return $response->withJson(
......@@ -190,7 +190,7 @@ class ActionController
'recordId' => $aArgs['id'],
'eventType' => 'DEL',
'eventId' => 'actiondel',
'info' => _ACTION. ' "' . $action['label_action'] .'" ' ._DELETED
'info' => _ACTION_DELETED. ' : ' . $action['label_action']
]);
return $response->withJson(['action' => ActionModel::get()]);
......
......@@ -95,7 +95,7 @@ class NotificationController
$notificationInDb = NotificationModel::getByNotificationId(['notificationId' => $data['notification_id'], 'select' => ['notification_sid']]);
if (Validator::notEmpty()->validate($notificationInDb)) {
return $response->withStatus(400)->withJson(['errors' => _NOTIFICATIONS_ERROR.' '._NOTIF_ALREADY_EXIST]);
return $response->withStatus(400)->withJson(['errors' => _NOTIF_ALREADY_EXIST]);
}
if ($data['is_enabled'] == true) {
......
......@@ -87,6 +87,14 @@ class NotificationScheduleController
exec('crontab /tmp/crontab.txt');
HistoryController::add([
'tableName' => 'notifications',
'recordId' => $GLOBALS['userId'],
'eventType' => 'UP',
'eventId' => 'notificationadd',
'info' => _NOTIFICATION_SCHEDULE_UPDATED
]);
return $response->withJson(true);
}
......@@ -278,6 +286,14 @@ class NotificationScheduleController
fclose($file_open);
shell_exec("chmod +x " . escapeshellarg($pathToFolow . "modules/notifications/batch/scripts/" . $filename));
HistoryController::add([
'tableName' => 'notifications',
'recordId' => $notification_id,
'eventType' => 'ADD',
'eventId' => 'notificationadd',
'info' => _NOTIFICATION_SCRIPT_ADDED
]);
return $response->withJson(true);
}
}
......@@ -12,14 +12,24 @@
* @author dev@maarch.org
*/
define('_BASKETS_SORT_MODIFICATION', 'Baskets order modification');
define('_ACTION_ADDED', 'Action added');
define('_ACTION_DELETED', 'Action deleted');
define('_ACTION_UPDATED', 'Action updated');
define('_ADD_NOTIFICATIONS', 'Notification created');
define('_ALREADY_EXISTS', 'already exists');
define('_BASKET_CREATION', 'Basket creation');
define('_BASKET_MODIFICATION', 'Basket modification');
define('_BASKET_SUPPRESSION', 'Basket suppression');
define('_BASKETS_SORT_MODIFICATION', 'Baskets order modification');
define('_DELETE_NOTIFICATIONS', 'Notification deleted');
define('_ENTITY_CREATION', 'Entity creation');
define('_ENTITY_MODIFICATION', 'Entity modification');
define('_ENTITY_SUPPRESSION', 'Entity suppression');
define('_INVALID_CLAUSE', 'Clause is not valid');
define('_MODIFY_NOTIFICATIONS', 'Notification updated');
define('_MODIFY_STATUS', 'Statut updated');
define('_NOTIFICATION_SCHEDULE_UPDATED', 'Notification scheduled updated');
define('_NOTIFICATION_SCRIPT_ADDED', 'Script created');
define('_PARAMETER_CREATION', 'Parameter creation');
define('_PARAMETER_MODIFICATION', 'Parameter modification');
define('_PARAMETER_SUPPRESSION', 'Parameter suppression');
......@@ -27,3 +37,5 @@ define('_PRIORITY_CREATION', 'Priority creation');
define('_PRIORITY_MODIFICATION', 'Priority modification');
define('_PRIORITY_SUPPRESSION', 'Priority suppression');
define('_REPORT_MODIFICATION', 'Report modification');
define('_STATUS_ADDED', 'Statut added');
define('_STATUS_DELETED', 'Statut deleted');
\ No newline at end of file
......@@ -12,14 +12,24 @@
* @author dev@maarch.org
*/
define('_BASKETS_SORT_MODIFICATION', 'Modification ordre bannettes');
define('_ACTION_ADDED', 'Action ajoutée');
define('_ACTION_DELETED', 'Action supprimée');
define('_ACTION_UPDATED', 'Action modifiée');
define('_ADD_NOTIFICATIONS', 'Notification créée');
define('_ALREADY_EXISTS', 'existe déjà');
define('_BASKET_CREATION', 'Création bannette');
define('_BASKET_MODIFICATION', 'Modification bannette');
define('_BASKET_SUPPRESSION', 'Suppression bannette');
define('_BASKETS_SORT_MODIFICATION', 'Modification ordre bannettes');
define('_DELETE_NOTIFICATIONS', 'Notification supprimée');
define('_ENTITY_CREATION', 'Création entité');
define('_ENTITY_MODIFICATION', 'Modification entité');
define('_ENTITY_SUPPRESSION', 'Suppression entité');
define('_INVALID_CLAUSE', 'Clause non valide');
define('_MODIFY_NOTIFICATIONS', 'Notification modifiée');
define('_MODIFY_STATUS', 'Statut modifié');
define('_NOTIFICATION_SCHEDULE_UPDATED', 'La planification des notifications a été mise à jour');
define('_NOTIFICATION_SCRIPT_ADDED', 'Le script de la notification a été créé');
define('_PARAMETER_CREATION', 'Création paramètre');
define('_PARAMETER_MODIFICATION', 'Modification paramètre');
define('_PARAMETER_SUPPRESSION', 'Suppression paramètre');
......@@ -27,3 +37,5 @@ define('_PRIORITY_CREATION', 'Création priorité');
define('_PRIORITY_MODIFICATION', 'Modification priorité');
define('_PRIORITY_SUPPRESSION', 'Suppression priorité');
define('_REPORT_MODIFICATION', 'Modification états et édition');
define('_STATUS_ADDED', 'Statut ajouté');
define('_STATUS_DELETED', 'Statut supprimé');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment