FEAT #12852 TIME 0:40 rm outgoing_mail from entreprise.xml

parent b843b4c4
......@@ -20,11 +20,6 @@
<label>_SIGNED_RESPONSE</label>
<process_mode/>
</type>
<type show="true" with_chrono="true" icon="DS" sign="true" select_in_reconciliation="true">
<id>outgoing_mail_signed</id>
<label>_OUTGOING_MAIL_SIGNED</label>
<process_mode/>
</type>
<type show="true" with_chrono="false" icon="PJ" sign="false" select_in_reconciliation="true">
<id>simple_attachment</id>
<label>_A_PJ</label>
......@@ -45,11 +40,6 @@
<label>_ROUTING</label>
<process_mode/>
</type>
<type show="true" with_chrono="true" icon="DS" sign="true">
<id>outgoing_mail</id>
<label>_OUTGOING_MAIL</label>
<process_mode/>
</type>
<type show="false" with_chrono="false" icon="" sign="false">
<id>converted_pdf</id>
<label>_CONVERTED_PDF</label>
......
......@@ -364,5 +364,39 @@ foreach ($customs as $custom) {
}
}
$path = "custom/{$custom}/apps/maarch_entreprise/xml/entreprise.xml";
if (file_exists($path)) {
if (!is_readable($path) || !is_writable($path)) {
printf("The file $path it is not readable or not writable.\n");
continue;
}
$loadedXml = simplexml_load_file($path);
if ($loadedXml) {
for ($i=count($loadedXml->attachment_types->type); $i >= 0; $i--) {
if (in_array($loadedXml->attachment_types->type[$i]->id, ['outgoing_mail', 'outgoing_mail_signed'])) {
unset($loadedXml->attachment_types->type[$i]);
}
}
$res = formatXml($loadedXml);
$fp = fopen($path, "w+");
if ($fp) {
fwrite($fp, $res);
}
$migrated++;
}
}
printf("Migration de Modèles de document départ spontannée (CUSTOM {$custom}) : " . $migrated . " Modèle(s) migré(s), $nonMigrated non migré(s).\n");
}
function formatXml($simpleXMLElement)
{
$xmlDocument = new DOMDocument('1.0');
$xmlDocument->preserveWhiteSpace = false;
$xmlDocument->formatOutput = true;
$xmlDocument->loadXML($simpleXMLElement->asXML());
return $xmlDocument->saveXML();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment