From cc81f9d4f5a9857e024829613ad670bc51056be5 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 16 Oct 2018 01:39:42 +0100 Subject: Write log entry on file removal --- app/EventBuilder/TaskFileEventBuilder.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/EventBuilder/TaskFileEventBuilder.php') diff --git a/app/EventBuilder/TaskFileEventBuilder.php b/app/EventBuilder/TaskFileEventBuilder.php index 8c985cc0..de514b59 100644 --- a/app/EventBuilder/TaskFileEventBuilder.php +++ b/app/EventBuilder/TaskFileEventBuilder.php @@ -64,6 +64,10 @@ class TaskFileEventBuilder extends BaseEventBuilder return e('%s attached a file to the task #%d', $author, $eventData['task']['id']); } + if ($eventName === TaskFileModel::EVENT_DESTROY) { + return e('%s removed a file from the task #%d', $author, $eventData['task']['id']); + } + return ''; } @@ -81,6 +85,10 @@ class TaskFileEventBuilder extends BaseEventBuilder return e('New attachment on task #%d: %s', $eventData['file']['task_id'], $eventData['file']['name']); } + if ($eventName === TaskFileModel::EVENT_DESTROY) { + return e('Attachment removed from task #%d: %s', $eventData['file']['task_id'], $eventData['file']['name']); + } + return ''; } } -- cgit v1.2.3