Skip to content
Snippets Groups Projects
Commit 88abc535 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #15049 TIME 0:30 fix purge + send action + notification migration

parent c04ee111
No related branches found
No related tags found
No related merge requests found
...@@ -188,8 +188,10 @@ if (!empty($resIdMaster)) { ...@@ -188,8 +188,10 @@ if (!empty($resIdMaster)) {
$resIdToPurge[] = $resource['res_id']; $resIdToPurge[] = $resource['res_id'];
} }
} }
$tmpWhere[] = 'res_id in (?)'; if (!empty($resIdToPurge)) {
$tmpData[] = $resIdToPurge; $tmpWhere[] = 'res_id in (?)';
$tmpData[] = $resIdToPurge;
}
} }
$wherePurge[] = '((' . implode(") or (", $tmpWhere) . '))'; $wherePurge[] = '((' . implode(") or (", $tmpWhere) . '))';
......
...@@ -31,6 +31,13 @@ foreach ($customs as $custom) { ...@@ -31,6 +31,13 @@ foreach ($customs as $custom) {
} elseif (is_readable("custom/{$custom}/modules/notifications/batch/config/config_{$custom}.xml") && is_writable("custom/{$custom}/modules/notifications/batch/config/config_{$custom}.xml")) { } elseif (is_readable("custom/{$custom}/modules/notifications/batch/config/config_{$custom}.xml") && is_writable("custom/{$custom}/modules/notifications/batch/config/config_{$custom}.xml")) {
$notificationFilePath = "custom/{$custom}/modules/notifications/batch/config/config_{$custom}.xml"; $notificationFilePath = "custom/{$custom}/modules/notifications/batch/config/config_{$custom}.xml";
} else { } else {
$file = file_get_contents($configPath);
$file = json_decode($file, true);
$file['config']['maarchDirectory'] = realpath('.') . '/';
$file['config']['customID'] = $custom;
$fp = fopen($configPath, 'w+');
fwrite($fp, json_encode($file, JSON_PRETTY_PRINT));
fclose($fp);
printf("Aucun fichier de configuration de notification trouvé pour le custom {$custom}\n"); printf("Aucun fichier de configuration de notification trouvé pour le custom {$custom}\n");
continue; continue;
} }
...@@ -46,7 +53,7 @@ foreach ($customs as $custom) { ...@@ -46,7 +53,7 @@ foreach ($customs as $custom) {
$file['config']['maarchUrl'] = (string)$loadedNotificationXml->CONFIG->applicationUrl; $file['config']['maarchUrl'] = (string)$loadedNotificationXml->CONFIG->applicationUrl;
} }
$fp = fopen("apps/maarch_entreprise/xml/config.json", 'a+'); $fp = fopen($configPath, 'w+');
fwrite($fp, json_encode($file, JSON_PRETTY_PRINT)); fwrite($fp, json_encode($file, JSON_PRETTY_PRINT));
fclose($fp); fclose($fp);
......
...@@ -96,7 +96,7 @@ class DOMTemplateProcessorController extends \DOMXPath ...@@ -96,7 +96,7 @@ class DOMTemplateProcessorController extends \DOMXPath
if ($pis = $this->query("descendant-or-self::processing-instruction('xinclude')", $node)) { if ($pis = $this->query("descendant-or-self::processing-instruction('xinclude')", $node)) {
foreach ($pis as $pi) { foreach ($pis as $pi) {
$includeFragment = $this->document->createDocumentFragment(); $includeFragment = $this->document->createDocumentFragment();
$source = file_get_contents('modules/export_seda' . trim($pi->data)); $source = file_get_contents('src/app/external/exportSeda' . trim($pi->data));
if (!$source) { if (!$source) {
throw new \Exception("Error including Xml fragment: fragment '$pi->data' could not be parsed"); throw new \Exception("Error including Xml fragment: fragment '$pi->data' could not be parsed");
} }
......
...@@ -14,6 +14,7 @@ namespace ExportSeda\controllers; ...@@ -14,6 +14,7 @@ namespace ExportSeda\controllers;
use Attachment\models\AttachmentModel; use Attachment\models\AttachmentModel;
use Contact\controllers\ContactController; use Contact\controllers\ContactController;
use Convert\controllers\ConvertPdfController;
use Docserver\models\DocserverModel; use Docserver\models\DocserverModel;
use Docserver\models\DocserverTypeModel; use Docserver\models\DocserverTypeModel;
use Doctype\models\DoctypeModel; use Doctype\models\DoctypeModel;
...@@ -250,6 +251,10 @@ trait ExportSEDATrait ...@@ -250,6 +251,10 @@ trait ExportSEDATrait
'format' => 'xml', 'format' => 'xml',
'status' => 'TRA' 'status' => 'TRA'
]); ]);
ConvertPdfController::convert([
'resId' => $id,
'collId' => 'attachments_coll'
]);
if (empty($id) || !empty($id['errors'])) { if (empty($id) || !empty($id['errors'])) {
return ['errors' => ['[storeAttachment] ' . $id['errors']]]; return ['errors' => ['[storeAttachment] ' . $id['errors']]];
} }
......
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