diff --git a/src/app/document/controllers/DocumentController.php b/src/app/document/controllers/DocumentController.php index 90f71913fb2ba60661833068844fc1df04be52f6..dff5497ac74ff795b3249dd936a5068fe48a9089 100755 --- a/src/app/document/controllers/DocumentController.php +++ b/src/app/document/controllers/DocumentController.php @@ -300,9 +300,10 @@ class DocumentController $queryParams['physicalPurge'] = filter_var($queryParams['physicalPurge'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); if (!Validator::boolType()->validate($queryParams['physicalPurge'])) { - return $response->withStatus(400)->withJson(['errors' => 'physicalPurge is empty or not a boolean']); + return $response->withStatus(400)->withJson(['errors' => 'physicalPurge is not a boolean']); } + $historyInfo = ''; if($queryParams['physicalPurge']) { $docServers = DocserverModel::get(['select' => ['type', 'path']]); if (empty($docServers)) { @@ -364,12 +365,14 @@ class DocumentController 'where' => ['id = ?'], 'data' => [$args['id']] ]); + $historyInfo = "{documentDeleted} : {$document['title']}"; } else { DocumentModel::update([ 'set' => ['status' => 'SOFT_DEL'], 'where' => ['id = ?'], 'data' => [$args['id']] ]); + $historyInfo = "{softDeleted} : {$document['title']}"; } HistoryController::add([ @@ -377,7 +380,7 @@ class DocumentController 'objectType' => 'main_documents', 'objectId' => $args['id'], 'type' => 'SUPPRESSION', - 'message' => "{documentDeleted} : {$document['title']}" + 'message' => $historyInfo ]); return $response->withStatus(204);