diff --git a/src/app/note/controllers/NoteController.php b/src/app/note/controllers/NoteController.php index b81d40f85bea2d2af34673651d731313d922c77b..00f8a306f802ce52e71715985afcfb68d26175c3 100755 --- a/src/app/note/controllers/NoteController.php +++ b/src/app/note/controllers/NoteController.php @@ -125,6 +125,15 @@ class NoteController 'eventId' => 'noteadd' ]); + HistoryController::add([ + 'tableName' => 'res_letterbox', + 'recordId' => $body['resId'], + 'eventType' => 'ADD', + 'info' => _NOTE_ADDED, + 'moduleId' => 'resource', + 'eventId' => 'resourceModification' + ]); + return $response->withJson(['noteId' => $noteId]); } @@ -134,7 +143,7 @@ class NoteController return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); } - $note = NoteModel::getById(['select' => ['user_id'], 'id' => $args['id']]); + $note = NoteModel::getById(['select' => ['user_id', 'identifier'], 'id' => $args['id']]); if (empty($note) || $note['user_id'] != $GLOBALS['id']) { return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); } @@ -183,6 +192,15 @@ class NoteController 'eventId' => 'noteModification' ]); + HistoryController::add([ + 'tableName' => 'res_letterbox', + 'recordId' => $note['identifier'], + 'eventType' => 'UP', + 'info' => _NOTE_UPDATED, + 'moduleId' => 'resource', + 'eventId' => 'resourceModification' + ]); + return $response->withStatus(204); } @@ -192,7 +210,7 @@ class NoteController return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); } - $note = NoteModel::getById(['select' => ['user_id'], 'id' => $args['id']]); + $note = NoteModel::getById(['select' => ['user_id', 'identifier'], 'id' => $args['id']]); if (empty($note) || $note['user_id'] != $GLOBALS['id']) { return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); } @@ -215,6 +233,15 @@ class NoteController 'eventId' => 'noteSuppression' ]); + HistoryController::add([ + 'tableName' => 'res_letterbox', + 'recordId' => $note['identifier'], + 'eventType' => 'DEL', + 'info' => _NOTE_DELETED, + 'moduleId' => 'resource', + 'eventId' => 'resourceModification' + ]); + return $response->withStatus(204); } diff --git a/src/frontend/app/process/process.component.html b/src/frontend/app/process/process.component.html index d7362fd7f5a7ab1213c7cc04a2e44885ec7554c2..403f6ddd41bc640c42c4efe0e1b1212f538a0518 100644 --- a/src/frontend/app/process/process.component.html +++ b/src/frontend/app/process/process.component.html @@ -267,7 +267,7 @@ </button> </div> <div class="modal-module-content"> - <app-history-list *ngIf="currentTool === 'history' && !loading" #appHistoryList + <app-history-list *ngIf="modal.id === 'history' && !loading" #appHistoryList [resId]="currentResourceInformations.resId"> </app-history-list> <app-notes-list *ngIf="modal.id === 'notes' && !loading" #appNotesList [editMode]="true"