diff --git a/src/app/attachment/controllers/AttachmentController.php b/src/app/attachment/controllers/AttachmentController.php index dbfb654caa593aab873db44e1f0a9ab6430d6454..88c6ba0aa366fd48ac4d6bf861d371f301b2f289 100755 --- a/src/app/attachment/controllers/AttachmentController.php +++ b/src/app/attachment/controllers/AttachmentController.php @@ -73,7 +73,7 @@ class AttachmentController 'tableName' => 'res_letterbox', 'recordId' => $body['resIdMaster'], 'eventType' => 'ADD', - 'info' => _ATTACHMENT_ADDED, + 'info' => _ATTACHMENT_ADDED . " : {$id}", 'moduleId' => 'attachment', 'eventId' => 'attachmentAdd' ]); @@ -91,7 +91,7 @@ class AttachmentController 'fulltext_result as "fulltextResult"', 'in_signature_book as "inSignatureBook"', 'in_send_attach as "inSendAttach"' ] ]); - if (empty($attachment) || $attachment['status'] == 'DEL') { + if (empty($attachment) || !in_array($attachment['status'], ['A_TRA', 'TRA'])) { return $response->withStatus(400)->withJson(['errors' => 'Attachment does not exist']); } @@ -138,7 +138,7 @@ class AttachmentController public function update(Request $request, Response $response, array $args) { $attachment = AttachmentModel::getById(['id' => $args['id'], 'select' => ['res_id_master', 'status', 'typist']]); - if (empty($attachment) || $attachment['status'] == 'DEL') { + if (empty($attachment) || !in_array($attachment['status'], ['A_TRA', 'TRA'])) { return $response->withStatus(400)->withJson(['errors' => 'Attachment does not exist']); } if (!ResController::hasRightByResId(['resId' => [$attachment['res_id_master']], 'userId' => $GLOBALS['id']])) { @@ -201,7 +201,7 @@ class AttachmentController 'tableName' => 'res_letterbox', 'recordId' => $attachment['res_id_master'], 'eventType' => 'UP', - 'info' => _ATTACHMENT_UPDATED, + 'info' => _ATTACHMENT_UPDATED . " : {$args['id']}", 'moduleId' => 'attachment', 'eventId' => 'attachmentModification' ]); diff --git a/src/app/contentManagement/controllers/MergeController.php b/src/app/contentManagement/controllers/MergeController.php index 495cd701e003163dae79dabce5cdbb6f990aee4c..94d68f2c15658dfacaa31afec5f572e7c311b915 100644 --- a/src/app/contentManagement/controllers/MergeController.php +++ b/src/app/contentManagement/controllers/MergeController.php @@ -122,7 +122,7 @@ class MergeController foreach ($allDates as $date) { $resource[$date] = TextFormatModel::formatDate($resource[$date], 'd/m/Y'); } - $resource['category_id'] = ResModel::getCategoryLabel(['category_id' => $resource['category_id']]); + $resource['category_id'] = ResModel::getCategoryLabel(['categoryId' => $resource['category_id']]); if (!empty($resource['type_id'])) { $doctype = DoctypeModel::getById(['id' => $resource['type_id'], 'select' => ['process_delay', 'process_mode', 'description']]); @@ -174,7 +174,7 @@ class MergeController 'orderBy' => ['listinstance_id'] ]); foreach ($visaWorkflow as $value) { - $labelledUser = UserModel::getLabelledUserById(['id' => $value['item_id']]); + $labelledUser = UserModel::getLabelledUserById(['login' => $value['item_id']]); $primaryentity = UserModel::getPrimaryEntityByUserId(['userId' => $value['item_id']]); $visas .= "{$labelledUser} ({$primaryentity})\n"; } @@ -190,7 +190,7 @@ class MergeController 'orderBy' => ['listinstance_id'] ]); foreach ($opinionWorkflow as $value) { - $labelledUser = UserModel::getLabelledUserById(['id' => $value['item_id']]); + $labelledUser = UserModel::getLabelledUserById(['login' => $value['item_id']]); $primaryentity = UserModel::getPrimaryEntityByUserId(['userId' => $value['item_id']]); $opinions .= "{$labelledUser} ({$primaryentity})\n"; } diff --git a/src/app/resource/controllers/StoreController.php b/src/app/resource/controllers/StoreController.php index f786c88fedb105f9a41fbc62211986c0fa2abef2..96e76920bb196f34ef1d02a3bac98bd261beaa54 100755 --- a/src/app/resource/controllers/StoreController.php +++ b/src/app/resource/controllers/StoreController.php @@ -241,6 +241,7 @@ class StoreController 'title' => $args['title'] ?? null, 'attachment_type' => $args['type'], 'validation_date' => $args['validationDate'] ?? null, + 'effective_date' => $args['effectiveDate'] ?? null, 'modification_date' => 'CURRENT_TIMESTAMP' ];