diff --git a/bin/exportSeda/purge.php b/bin/exportSeda/purge.php index fa37203710c11d4810fba22d091e2b196d27d448..bfd4ddaa9d768fd50a5d592167458ebf82fea2c0 100755 --- a/bin/exportSeda/purge.php +++ b/bin/exportSeda/purge.php @@ -188,8 +188,10 @@ if (!empty($resIdMaster)) { $resIdToPurge[] = $resource['res_id']; } } - $tmpWhere[] = 'res_id in (?)'; - $tmpData[] = $resIdToPurge; + if (!empty($resIdToPurge)) { + $tmpWhere[] = 'res_id in (?)'; + $tmpData[] = $resIdToPurge; + } } $wherePurge[] = '((' . implode(") or (", $tmpWhere) . '))'; diff --git a/migration/20.10/migrateNotificationsConfig.php b/migration/20.10/migrateNotificationsConfig.php index 2ad4edf33210a42fa627699a14863650defdddaa..6ecc5d29a90d35bf60929a489c2d96abfebadcea 100755 --- a/migration/20.10/migrateNotificationsConfig.php +++ b/migration/20.10/migrateNotificationsConfig.php @@ -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")) { $notificationFilePath = "custom/{$custom}/modules/notifications/batch/config/config_{$custom}.xml"; } 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"); continue; } @@ -46,7 +53,7 @@ foreach ($customs as $custom) { $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)); fclose($fp); diff --git a/src/app/external/exportSeda/controllers/DOMTemplateProcessorController.php b/src/app/external/exportSeda/controllers/DOMTemplateProcessorController.php index 468e5d3754f6b3e9533ad323eefa222ab42a2c21..2224ecf6adbff2a1249d006b02faf17b5bec02e7 100755 --- a/src/app/external/exportSeda/controllers/DOMTemplateProcessorController.php +++ b/src/app/external/exportSeda/controllers/DOMTemplateProcessorController.php @@ -96,7 +96,7 @@ class DOMTemplateProcessorController extends \DOMXPath if ($pis = $this->query("descendant-or-self::processing-instruction('xinclude')", $node)) { foreach ($pis as $pi) { $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) { throw new \Exception("Error including Xml fragment: fragment '$pi->data' could not be parsed"); } diff --git a/src/app/external/exportSeda/controllers/ExportSEDATrait.php b/src/app/external/exportSeda/controllers/ExportSEDATrait.php index 444483f0b20fdd5472e5ed93a4822cd730839c01..2946830fcf141b786592854860412b7adfbf5a0a 100644 --- a/src/app/external/exportSeda/controllers/ExportSEDATrait.php +++ b/src/app/external/exportSeda/controllers/ExportSEDATrait.php @@ -14,6 +14,7 @@ namespace ExportSeda\controllers; use Attachment\models\AttachmentModel; use Contact\controllers\ContactController; +use Convert\controllers\ConvertPdfController; use Docserver\models\DocserverModel; use Docserver\models\DocserverTypeModel; use Doctype\models\DoctypeModel; @@ -250,6 +251,10 @@ trait ExportSEDATrait 'format' => 'xml', 'status' => 'TRA' ]); + ConvertPdfController::convert([ + 'resId' => $id, + 'collId' => 'attachments_coll' + ]); if (empty($id) || !empty($id['errors'])) { return ['errors' => ['[storeAttachment] ' . $id['errors']]]; }