From e41187e920ae58ffb29142e8770784a7b6e3aeeb Mon Sep 17 00:00:00 2001
From: pbarroca <pbarroca@afi-sa.fr>
Date: Thu, 26 Nov 2015 15:06:10 +0100
Subject: [PATCH] rel #23466 : add init mode to cosmogramme run

---
 VERSIONS_HOTLINE/23466                  |  1 +
 cosmogramme/php/integre_traite_main.php | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 VERSIONS_HOTLINE/23466

diff --git a/VERSIONS_HOTLINE/23466 b/VERSIONS_HOTLINE/23466
new file mode 100644
index 00000000000..1d63bfb86cb
--- /dev/null
+++ b/VERSIONS_HOTLINE/23466
@@ -0,0 +1 @@
+ - ticket #23466 : Cosmogramme : ajout de la possibilité de ne lancer que la mise en file d'attente des fichiers reçus
\ No newline at end of file
diff --git a/cosmogramme/php/integre_traite_main.php b/cosmogramme/php/integre_traite_main.php
index 6ab0c085d6c..e8448c9dcb9 100644
--- a/cosmogramme/php/integre_traite_main.php
+++ b/cosmogramme/php/integre_traite_main.php
@@ -105,12 +105,23 @@ if ($_REQUEST['reprise'] == 'oui') {
 	if ($cron_a_traiter > '') {
 		$txt = ['all' => 'tous types d\'imports',
 						'tot' => 'imports totaux uniquement',
-						'inc' => 'imports incrementiels uniquement'];
+						'inc' => 'imports incrementiels uniquement',
+            'init' => 'mise en file d\'attente uniquement'];
 		$log->ecrire('Type d\'import : ' . $txt[$cron_a_traiter] . BR);
 	}
 
 	try {
 		startIntegrationPhase('PrepareIntegrations');
+    if ('init' == $cron_a_traiter) {
+      $log->ecrire(BR . BR . '<h4>mise en file d\'attente uniquement : fin du traitement</h4>');
+      $log->ecrire('Déblocage de la base<br>');
+      setVariable('clef_traitements', '0');
+      setVariable('traitement_phase', 'Traitement terminé');
+      $chrono->timeStart = $timeStart;
+      $log->ecrire('Heure : ' . date('G:i:s') . BR);
+      $log->ecrire('Temps de traitement : ' . $chrono->end() . BR);
+      exit;
+    }
 	} catch (Class_Cosmogramme_Integration_PhasePrepareIntegrationsException $e) {
 		$log->ecrire(BR . BR
 								 . '<span class="rouge">' . $e->getMessage() . ' : Abandon du traitement !</span><br>');
-- 
GitLab