Skip to content
Snippets Groups Projects
Verified Commit 5588b185 authored by Damien's avatar Damien
Browse files

FEAT #10525 TIME 0:20 Rest full text

parent 5ad258ee
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ use SrcCore\models\CoreConfigModel; ...@@ -36,6 +36,7 @@ use SrcCore\models\CoreConfigModel;
use SrcCore\models\DatabaseModel; use SrcCore\models\DatabaseModel;
use SrcCore\models\ValidatorModel; use SrcCore\models\ValidatorModel;
use Template\controllers\TemplateController; use Template\controllers\TemplateController;
use User\models\UserModel;
class AttachmentController class AttachmentController
{ {
...@@ -101,6 +102,18 @@ class AttachmentController ...@@ -101,6 +102,18 @@ class AttachmentController
return $response->withStatus(500)->withJson(['errors' => '[AttachmentController create] ' . $resId['errors']]); return $response->withStatus(500)->withJson(['errors' => '[AttachmentController create] ' . $resId['errors']]);
} }
$collId = empty($body['version']) ? 'attachments_coll' : 'attachments_version_coll';
ConvertPdfController::convert([
'resId' => $resId,
'collId' => $collId,
'isVersion' => !empty($body['version'])
]);
$customId = CoreConfigModel::getCustomId();
$customId = empty($customId) ? 'null' : $customId;
$user = UserModel::getByLogin(['select' => ['id'], 'login' => $GLOBALS['userId']]);
exec("php src/app/convert/scripts/FullTextScript.php {$customId} {$resId} {$collId} {$user['id']} > /dev/null &");
HistoryController::add([ HistoryController::add([
'tableName' => $body['table'], 'tableName' => $body['table'],
'recordId' => $resId, 'recordId' => $resId,
......
...@@ -78,6 +78,17 @@ class ResController ...@@ -78,6 +78,17 @@ class ResController
return $response->withStatus(500)->withJson(['errors' => '[ResController create] ' . $resId['errors']]); return $response->withStatus(500)->withJson(['errors' => '[ResController create] ' . $resId['errors']]);
} }
ConvertPdfController::convert([
'resId' => $resId,
'collId' => 'letterbox_coll',
'isVersion' => false
]);
$customId = CoreConfigModel::getCustomId();
$customId = empty($customId) ? 'null' : $customId;
$user = UserModel::getByLogin(['select' => ['id'], 'login' => $GLOBALS['userId']]);
exec("php src/app/convert/scripts/FullTextScript.php {$customId} {$resId} 'letterbox_coll' {$user['id']} > /dev/null &");
HistoryController::add([ HistoryController::add([
'tableName' => 'res_letterbox', 'tableName' => 'res_letterbox',
'recordId' => $resId, 'recordId' => $resId,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment