Skip to content
Snippets Groups Projects
Verified Commit 0fd6279f authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #13679 TIME 1:45 update retrieveMailFromExternalSignatoryBook.sh + breaking change

parent e073e0b5
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ $migrated = 0; ...@@ -9,7 +9,7 @@ $migrated = 0;
$customs = scandir('custom'); $customs = scandir('custom');
foreach ($customs as $custom) { foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') { if (in_array($custom, ['custom.json', 'custom.xml', '.', '..'])) {
continue; continue;
} }
......
...@@ -9,7 +9,7 @@ $migrated = 0; ...@@ -9,7 +9,7 @@ $migrated = 0;
$customs = scandir('custom'); $customs = scandir('custom');
foreach ($customs as $custom) { foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') { if (in_array($custom, ['custom.json', 'custom.xml', '.', '..'])) {
continue; continue;
} }
...@@ -61,6 +61,7 @@ foreach ($customs as $custom) { ...@@ -61,6 +61,7 @@ foreach ($customs as $custom) {
foreach ($notifications as $notification) { foreach ($notifications as $notification) {
\Notification\models\NotificationScheduleModel::createScriptNotification(['notification_sid' => $notification['notification_sid'], 'notification_id' => $notification['notification_id']]); \Notification\models\NotificationScheduleModel::createScriptNotification(['notification_sid' => $notification['notification_sid'], 'notification_id' => $notification['notification_id']]);
} }
printf("Si les scripts de notifications sont lancés dans la crontab, il faut modifier les chemins. Tous les scripts sont dans le dossier : bin/notification/scripts/ \n");
$migrated++; $migrated++;
} }
......
...@@ -7,7 +7,7 @@ chdir('../..'); ...@@ -7,7 +7,7 @@ chdir('../..');
$customs = scandir('custom'); $customs = scandir('custom');
$migrated = 0; $migrated = 0;
foreach ($customs as $custom) { foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') { if (in_array($custom, ['custom.json', 'custom.xml', '.', '..'])) {
continue; continue;
} }
......
...@@ -9,7 +9,7 @@ $migrated = 0; ...@@ -9,7 +9,7 @@ $migrated = 0;
$customs = scandir('custom'); $customs = scandir('custom');
foreach ($customs as $custom) { foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') { if (in_array($custom, ['custom.json', 'custom.xml', '.', '..'])) {
continue; continue;
} }
...@@ -53,6 +53,8 @@ foreach ($customs as $custom) { ...@@ -53,6 +53,8 @@ foreach ($customs as $custom) {
fwrite($fp, $res); fwrite($fp, $res);
} }
createScript();
$migrated++; $migrated++;
} }
} }
...@@ -73,3 +75,33 @@ function formatXml($simpleXMLElement) ...@@ -73,3 +75,33 @@ function formatXml($simpleXMLElement)
return $xmlDocument->saveXML(); return $xmlDocument->saveXML();
} }
function createScript()
{
$corePath = str_replace('migration/20.10', '', __DIR__);
$config = $corePath . \SrcCore\models\CoreConfigModel::getConfigPath();
if (!empty($GLOBALS['customId'])) {
$folderScript = $corePath.'custom/'.$GLOBALS['customId'].'/bin/signatureBook/scripts/';
if (!file_exists($folderScript)) {
mkdir($folderScript, 0777, true);
}
$scriptPath = $folderScript . 'retrieveMailFromExternalSignatoryBook.sh';
} else {
$scriptPath = $corePath.'bin/signatureBook/scripts/retrieveMailFromExternalSignatoryBook.sh';
}
$fileToOpen = fopen($scriptPath, 'w+');
fwrite($fileToOpen, '#!/bin/sh');
fwrite($fileToOpen, "\n");
fwrite($fileToOpen, 'cd ' . $corePath . 'bin/signatureBook/');
fwrite($fileToOpen, "\n");
fwrite($fileToOpen, 'filePath=\''.$corePath.'bin/signatureBook/process_mailsFromSignatoryBook.php\'');
fwrite($fileToOpen, "\n");
fwrite($fileToOpen, 'php $filePath -c ' . $config);
fwrite($fileToOpen, "\n");
fclose($fileToOpen);
shell_exec('chmod +x '. $scriptPath);
printf("Si le script process_mailsFromSignatoryBook.php est lancé dans la crontab, il faut modifier le chemin comme ceci : " . $scriptPath . "\n");
}
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