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

FIX #13524 TIME 0:10 modal history + add history event after add/up/del note

parent 4d8a12fb
No related branches found
No related tags found
No related merge requests found
...@@ -125,6 +125,15 @@ class NoteController ...@@ -125,6 +125,15 @@ class NoteController
'eventId' => 'noteadd' 'eventId' => 'noteadd'
]); ]);
HistoryController::add([
'tableName' => 'res_letterbox',
'recordId' => $body['resId'],
'eventType' => 'ADD',
'info' => _NOTE_ADDED,
'moduleId' => 'resource',
'eventId' => 'resourceModification'
]);
return $response->withJson(['noteId' => $noteId]); return $response->withJson(['noteId' => $noteId]);
} }
...@@ -134,7 +143,7 @@ class NoteController ...@@ -134,7 +143,7 @@ class NoteController
return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); 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']) { if (empty($note) || $note['user_id'] != $GLOBALS['id']) {
return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']);
} }
...@@ -183,6 +192,15 @@ class NoteController ...@@ -183,6 +192,15 @@ class NoteController
'eventId' => 'noteModification' 'eventId' => 'noteModification'
]); ]);
HistoryController::add([
'tableName' => 'res_letterbox',
'recordId' => $note['identifier'],
'eventType' => 'UP',
'info' => _NOTE_UPDATED,
'moduleId' => 'resource',
'eventId' => 'resourceModification'
]);
return $response->withStatus(204); return $response->withStatus(204);
} }
...@@ -192,7 +210,7 @@ class NoteController ...@@ -192,7 +210,7 @@ class NoteController
return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); 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']) { if (empty($note) || $note['user_id'] != $GLOBALS['id']) {
return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']); return $response->withStatus(403)->withJson(['errors' => 'Note out of perimeter']);
} }
...@@ -215,6 +233,15 @@ class NoteController ...@@ -215,6 +233,15 @@ class NoteController
'eventId' => 'noteSuppression' 'eventId' => 'noteSuppression'
]); ]);
HistoryController::add([
'tableName' => 'res_letterbox',
'recordId' => $note['identifier'],
'eventType' => 'DEL',
'info' => _NOTE_DELETED,
'moduleId' => 'resource',
'eventId' => 'resourceModification'
]);
return $response->withStatus(204); return $response->withStatus(204);
} }
......
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
</button> </button>
</div> </div>
<div class="modal-module-content"> <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"> [resId]="currentResourceInformations.resId">
</app-history-list> </app-history-list>
<app-notes-list *ngIf="modal.id === 'notes' && !loading" #appNotesList [editMode]="true" <app-notes-list *ngIf="modal.id === 'notes' && !loading" #appNotesList [editMode]="true"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment