diff --git a/src/app/convert/controllers/ConvertPdfController.php b/src/app/convert/controllers/ConvertPdfController.php index 3ebf29da937f948ae907c06f10cc1143827a707a..e192965d872b196772f2062abb9d4dd08efa7560 100755 --- a/src/app/convert/controllers/ConvertPdfController.php +++ b/src/app/convert/controllers/ConvertPdfController.php @@ -25,6 +25,7 @@ use Resource\models\ResModel; use Respect\Validation\Validator; use Slim\Http\Request; use Slim\Http\Response; +use SrcCore\controllers\LogsController; use SrcCore\controllers\UrlController; use SrcCore\models\CoreConfigModel; use SrcCore\models\ValidatorModel; @@ -45,7 +46,26 @@ class ConvertPdfController if (OnlyOfficeController::canConvert(['url' => $url])) { $converted = OnlyOfficeController::convert(['fullFilename' => $aArgs['fullFilename'], 'url' => $url, 'userId' => $GLOBALS['id']]); if (empty($converted['errors'])) { + LogsController::add([ + 'isTech' => true, + 'moduleId' => 'convert', + 'level' => 'DEBUG', + 'tableName' => '', + 'recordId' => '', + 'eventType' => "Convert Pdf with Only Office success", + 'eventId' => "document : {$aArgs['fullFilename']}" + ]); return ['output' => [], 'return' => 0]; + } else { + LogsController::add([ + 'isTech' => true, + 'moduleId' => 'convert', + 'level' => 'ERROR', + 'tableName' => '', + 'recordId' => '', + 'eventType' => "Convert Pdf with Only Office failed", + 'eventId' => "{$converted['errors']}, document : {$aArgs['fullFilename']}" + ]); } } diff --git a/src/app/convert/scripts/ConvertPdfScript.php b/src/app/convert/scripts/ConvertPdfScript.php index 8c62ca30d94368be16939a5ac844b2c11bd2c375..994e15c431c88e77402c879910b8b74d3a2eeff9 100644 --- a/src/app/convert/scripts/ConvertPdfScript.php +++ b/src/app/convert/scripts/ConvertPdfScript.php @@ -109,6 +109,28 @@ class ConvertPdfScript $output = []; if (OnlyOfficeController::canConvert(['url' => $args['coreUrl']])) { $converted = OnlyOfficeController::convert(['fullFilename' => $fullFilename, 'url' => $args['coreUrl'], 'userId' => $args['userId']]); + + if (empty($converted['errors'])) { + LogsController::add([ + 'isTech' => true, + 'moduleId' => 'convert', + 'level' => 'DEBUG', + 'tableName' => '', + 'recordId' => '', + 'eventType' => "Convert Pdf with Only Office success", + 'eventId' => "document : {$fullFilename}" + ]); + } else { + LogsController::add([ + 'isTech' => true, + 'moduleId' => 'convert', + 'level' => 'ERROR', + 'tableName' => '', + 'recordId' => '', + 'eventType' => "Convert Pdf with Only Office failed", + 'eventId' => "{$converted['errors']}, document : {$fullFilename}" + ]); + } $converted = empty($converted['errors']); } if (!$converted) {