From 158cb9fb88b6981edcb4e5df555f0e9ba03be3f3 Mon Sep 17 00:00:00 2001
From: "kevin.dezaphi" <kevin.dezaphi@maarch.org>
Date: Mon, 22 Oct 2018 14:58:32 +0200
Subject: [PATCH] set status to a defined status when rejected to the previous
 visor as the first one

---
 modules/visa/rejection_visa_previous.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/visa/rejection_visa_previous.php b/modules/visa/rejection_visa_previous.php
index 351dcaa899f..329bb12c96a 100755
--- a/modules/visa/rejection_visa_previous.php
+++ b/modules/visa/rejection_visa_previous.php
@@ -146,7 +146,11 @@ function manage_empty_error($arr_id, $history, $id_action, $label_action, $statu
     $stmt = $db->query($query,[$res_id, 'VISA_CIRCUIT']);
 
     if ($stmt->rowCount() < 1) {
-        $newStatus = 'AREV';
+        if ($status == '_NOSTATUS_') {
+            $newStatus = 'AREV';
+        } else {
+            $newStatus = $status;
+        }
     } else {
         $listInstance = $stmt->fetchObject();
         $db->query('UPDATE listinstance SET process_date = NULL WHERE res_id = ? AND difflist_type = ? AND listinstance_id = ?',
-- 
GitLab