From 3fa5ecf862a14a8137eb26d29337a095eaced87b Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Tue, 25 Sep 2018 15:53:42 +0200
Subject: [PATCH] FIX #8338 fix in_signature_book true and set status SEND_MASS

---
 sql/develop.sql                                         | 3 +++
 src/app/attachment/controllers/AttachmentController.php | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/sql/develop.sql b/sql/develop.sql
index 5dd19ad4cad..f624090f686 100644
--- a/sql/develop.sql
+++ b/sql/develop.sql
@@ -519,6 +519,9 @@ INSERT INTO status (id, label_status, is_system, img_filename, maarch_module, ca
 DELETE FROM status WHERE id = 'FRZ';
 INSERT INTO status (id, label_status, is_system, img_filename, maarch_module, can_be_searched, can_be_modified) VALUES ('FRZ', 'PJ gelée', 'Y', 'fa-pause', 'apps', 'Y', 'Y');
 
+DELETE FROM status WHERE id = 'SEND_MASS';
+INSERT INTO status (id, label_status, is_system, img_filename, maarch_module, can_be_searched, can_be_modified) VALUES ('SEND_MASS', 'Pour publipostage', 'Y', 'fa-mail-bulk', 'apps', 'Y', 'Y');
+
 DELETE FROM status WHERE id = 'SIGN';
 INSERT INTO status (id, label_status, is_system, img_filename, maarch_module, can_be_searched, can_be_modified) VALUES ('SIGN', 'PJ signée', 'Y', 'fa-check', 'apps', 'Y', 'Y');
 
diff --git a/src/app/attachment/controllers/AttachmentController.php b/src/app/attachment/controllers/AttachmentController.php
index 5a041096353..da0a5517dfc 100644
--- a/src/app/attachment/controllers/AttachmentController.php
+++ b/src/app/attachment/controllers/AttachmentController.php
@@ -361,6 +361,10 @@ class AttachmentController
                         'value' => $contactForMailing['address_id'],
                         'type' => 'integer'
                     ]);
+                    array_push($dataValue, [
+                        'column' => 'in_signature_book',
+                        'value' => 'true',
+                    ]);
 
                     $params = [
                         'res_id' => $aArgs['resIdMaster'],
-- 
GitLab