diff --git a/apps/maarch_entreprise/indexing_searching/file_iframe.php b/apps/maarch_entreprise/indexing_searching/file_iframe.php
index 3c1484e3c1a829cb1e84d91be63e57920575abc6..73f83698f0329a4a78a5aa376e5756907929d6ed 100755
--- a/apps/maarch_entreprise/indexing_searching/file_iframe.php
+++ b/apps/maarch_entreprise/indexing_searching/file_iframe.php
@@ -95,6 +95,7 @@ if (isset($_GET['num'])) {
             readfile($loc);
             exit();
         } else {
+            echo '<script language="javascript">document.location.reload(true);</script>';
             echo '<br/><br/><div class="error" style="display:block">'._PROBLEM_LOADING_FILE_TMP_DIR. " : {$return['errors']}" .'.</div>';
             exit();
         }
diff --git a/apps/maarch_entreprise/lang/fr.php b/apps/maarch_entreprise/lang/fr.php
index 8f729845432984b5892a5bfe71294db6f48eac23..0736f8752fb58460000e36423161b4616ac72b39 100755
--- a/apps/maarch_entreprise/lang/fr.php
+++ b/apps/maarch_entreprise/lang/fr.php
@@ -40,13 +40,13 @@ if (!defined('_ADD_ATTACHMENT_TO_SEND_TO_CONTACT')) {
     define('_ADD_ATTACHMENT_TO_SEND_TO_CONTACT', "Veuillez ajouter une pièce jointe avant d'envoyer ce courrier au contact");
 }
 if (!defined('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT')) {
-    define('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT', 'Envoyer au contact avec une pièce jointe obligatoire');
+    define('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT', 'Envoyer au contact avec une pièce jointe obligatoire et accusé de réception');
 }
 if (!defined('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT_DESC')) {
     define('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT_DESC', "Ouvre une modal d'envoi de mail avec l'email du contact associé au document en tant que destinataire, présence OBLIGATOIRE de pièce(s) jointe(s) à l'envoi.");
 }
 if (!defined('_SEND_ATTACHMENTS_TO_CONTACT')) {
-    define('_SEND_ATTACHMENTS_TO_CONTACT', 'Envoyer au contact');
+    define('_SEND_ATTACHMENTS_TO_CONTACT', 'Envoyer au contact avec accusé de réception');
 }
 if (!defined('_SEND_ATTACHMENTS_TO_CONTACT_DESC')) {
     define('_SEND_ATTACHMENTS_TO_CONTACT_DESC', "Ouvre une modal d'envoi de mail avec l'email du contact associé au document en tant que destinataire.");
diff --git a/modules/notes/notes.php b/modules/notes/notes.php
index e0556d9f9fddb3d065f19150eee513a315f56275..ceb7ba7853edc46b34c6aa79a470ae68bd7fccbc 100755
--- a/modules/notes/notes.php
+++ b/modules/notes/notes.php
@@ -125,12 +125,17 @@ if (isset($_REQUEST['load'])) {
         
     //Where clause
         $where_tab = array();
-        //
+        
+        $rawUserEntities = \Entity\models\EntityModel::getByLogin(['login' => $_SESSION['user']['UserId'], 'select' => ['entity_id']]);
+        $userEntities = array_column($rawUserEntities, 'entity_id');
+        $userEntities = !empty($userEntities) ? $userEntities : [''];
+
         $where_tab[] = "identifier = ?";
         $where_tab[] = "type = ?";
-        $where_tab[] = "notes.id in (select notes.id from notes left join note_entities on notes.id = note_entities.note_id where item_id IS NULL OR item_id = '".$_SESSION['user']['primaryentity']['id']."' or notes.user_id = '".$_SESSION['user']['UserId']."')";
+        $where_tab[] = "notes.id in (select notes.id from notes left join note_entities on notes.id = note_entities.note_id where item_id IS NULL OR item_id in (?) or notes.user_id = '".$_SESSION['user']['UserId']."')";
         $arrayPDO = array($identifier);
         $arrayPDO[] = 'resource';
+        $arrayPDO[] = $userEntities;
 
         //Build where
         $where = implode(' and ', $where_tab);
diff --git a/modules/notes/notes_ajax_content.php b/modules/notes/notes_ajax_content.php
index faf3d0084bd818cbacd604be9b3e50a1a6a1049f..c05adb07809f37aa87d623a36e56bed0dec3c213 100755
--- a/modules/notes/notes_ajax_content.php
+++ b/modules/notes/notes_ajax_content.php
@@ -184,9 +184,9 @@ switch ($mode) {
                 if ($state_entity == false) {
                     $content .= '<option value="'
                         .$entitiesList[$i]->entity_id.'" alt="'
-                        .$entitiesList[$i]->short_label.'" title="'
-                        .$entitiesList[$i]->short_label.'">'
-                        .$entitiesList[$i]->short_label.'</option>';
+                        .functions::xssafe($entitiesList[$i]->short_label).'" title="'
+                        .functions::xssafe($entitiesList[$i]->short_label).'">'
+                        .functions::xssafe($entitiesList[$i]->short_label).'</option>';
                 }
             }
             $content .= '</select><br/> </td>';
@@ -203,10 +203,10 @@ switch ($mode) {
                if ($state_entity == true || ($entitiesForRestriction && in_array($entitiesList[$i]->entity_id, $entitiesForRestriction))) {
                     $content .= '<option value="'
                         .$entitiesList[$i]->entity_id.'" alt="'
-                        .$entitiesList[$i]->short_label.'" title="'
-                        .$entitiesList[$i]->short_label.'" selected="selected">'
-                        .$entitiesList[$i]->short_label.'</option>';
-               }
+                        .functions::xssafe($entitiesList[$i]->short_label).'" title="'
+                        .functions::xssafe($entitiesList[$i]->short_label).'" selected="selected">'
+                        .functions::xssafe($entitiesList[$i]->short_label).'</option>';
+                }
             }
             $content .= '</select></td>';
             $content .= '</tr></table>';
@@ -375,9 +375,9 @@ switch ($mode) {
                     if (!in_array($entitiesList[$i], $notesEntities)) {
                         $content .= '<option value="'
                             .$entitiesList[$i]->entity_id.'" alt="'
-                            .$entitiesList[$i]->short_label.'" title="'
-                            .$entitiesList[$i]->short_label.'">'
-                            .$entitiesList[$i]->short_label.'</option>';
+                            .functions::xssafe($entitiesList[$i]->short_label).'" title="'
+                            .functions::xssafe($entitiesList[$i]->short_label).'">'
+                            .functions::xssafe($entitiesList[$i]->short_label).'</option>';
                     }
                 }
                 $content .= '</select><br/> </td>';
@@ -392,9 +392,9 @@ switch ($mode) {
                 for ($i=0;$i<count($notesEntities);$i++) {
                     $content .= '<option value="'
                         .$notesEntities[$i]->entity_id.'" alt="'
-                        .$notesEntities[$i]->short_label.'" title="'
-                        .$notesEntities[$i]->short_label.'" selected="selected">'
-                        .$notesEntities[$i]->short_label.'</option>';
+                        .functions::xssafe($notesEntities[$i]->short_label).'" title="'
+                        .functions::xssafe($notesEntities[$i]->short_label).'" selected="selected">'
+                        .functions::xssafe($notesEntities[$i]->short_label).'</option>';
                 }
                 $content .= '</select></td>';
                 $content .= '</tr></table>';
@@ -540,4 +540,3 @@ switch ($mode) {
 echo "{status : " . $status . ", msg_result : '" . $msgResult . "', content : '" . addslashes(_parse($content)) . "', error : '" . addslashes($error) . "', exec_js : '".addslashes($js)."'}";
 exit ();
 ?>
-
diff --git a/modules/sendmail/js/functions.js b/modules/sendmail/js/functions.js
index 371aa7e2cc2af2d8535dad27c610d3e9f8e274cf..0614a7fb7829260481b794a27353dfe940677821 100755
--- a/modules/sendmail/js/functions.js
+++ b/modules/sendmail/js/functions.js
@@ -222,7 +222,7 @@ function validEmailForm(path, form_id) {
     });
 }
 
-function validEmailFormForSendToContact(path, form_id) {
+function validEmailFormForSendToContact(path, form_id, path2, status) {
     tinyMCE.triggerSave();
     new Ajax.Request(path,
     {
@@ -234,7 +234,7 @@ function validEmailFormForSendToContact(path, form_id) {
             eval("response = "+answer.responseText);
             if(response.status == 0){
                 eval(response.exec_js);
-                parent.document.getElementById('storage').click();
+                changeStatusForActionSendToContact(path2, status);
                 window.parent.destroyModal('form_email');
             } else {
                 alert(response.error);
@@ -244,6 +244,20 @@ function validEmailFormForSendToContact(path, form_id) {
     });
 }
 
+function changeStatusForActionSendToContact(path, status){
+    console.log(path);
+    new Ajax.Request(path,
+    {
+        asynchronous:false,
+        method:'post',
+        parameters: {status : status},   
+        encoding: 'UTF-8',                       
+        onSuccess : function(){
+          parent.document.getElementById('storage').click();
+        }
+    });
+}
+
 function extractEmailAdress(field, item) {
     var fullAdress = item.innerHTML;
     field.value = fullAdress.match(/\(([^)]+)\)/)[1];
diff --git a/modules/sendmail/mail_form_to_contact.php b/modules/sendmail/mail_form_to_contact.php
index c6c5af15cadcec9585d7f8ec7af09ddf661bc631..5019e3dcf33adecc0040962841e1d018b0078613 100755
--- a/modules/sendmail/mail_form_to_contact.php
+++ b/modules/sendmail/mail_form_to_contact.php
@@ -105,6 +105,10 @@ $path_to_script = $_SESSION['config']['businessappurl']
     .'index.php?display=true&module=sendmail&page=sendmail_ajax_content&identifier='
     .$identifier.'&origin='.$origin.$parameters;
 
+$path_to_script_ajax = $_SESSION['config']['businessappurl']
+    .'index.php?display=true&module=sendmail&page=sendmail_to_contact_ajax&identifier='
+    .$identifier.'&origin='.$origin.$parameters;
+
 $core_tools->load_lang();
 $core_tools->load_html();
 $core_tools->load_header('', true, false);
@@ -504,7 +508,7 @@ if ($mode == 'add') {
     //Send
     $id_action = 500;
     $content .= ' <input style="display:none;" type="button" name="valid" value="&nbsp;'._SEND_EMAIL
-                .'&nbsp;" id="valid" class="button" onclick="validEmailFormForSendToContact(\''.$path_to_script.'&mode=added&for=send&action='.$_GET['action'].'\', \'formEmail\');" />&nbsp;';
+                .'&nbsp;" id="valid" class="button" onclick="validEmailFormForSendToContact(\''.$path_to_script.'&mode=added&for=send&action='.$_GET['action'].'\', \'formEmail\',\''.$path_to_script_ajax.'&mode=added&for=send\', \''.$_SESSION['status'].'\');" />&nbsp;';
     $content .= '</div>';
     $content .= '</form>';
     $content .= '</div>';
diff --git a/modules/sendmail/sendmail_to_contact_ajax.php b/modules/sendmail/sendmail_to_contact_ajax.php
new file mode 100644
index 0000000000000000000000000000000000000000..8accc2c8c209812e79ee8f5b8f73ec0a505226e2
--- /dev/null
+++ b/modules/sendmail/sendmail_to_contact_ajax.php
@@ -0,0 +1,26 @@
+<?php
+
+require_once 'core/class/class_security.php';
+
+$security = new security();
+$right = $security->test_right_doc('letterbox_coll', $_REQUEST['identifier']);
+
+//REDIRECT IF NO RIGHT
+if (!$right) {
+    $_SESSION['error'] = _NO_RIGHT_TXT;
+    echo "<script language=\"javascript\" type=\"text/javascript\">window.top.location.href='index.php';</script>";
+    exit();
+}
+
+$user = \SrcCore\models\DatabaseModel::select([
+    'select'    => ['id'],
+    'table'     => ['users'],
+    'where'     => ['user_id = ?'],
+    'data'      => [$_SESSION['user']['UserId']],
+    ]);
+
+\SrcCore\models\DatabaseModel::insertMultiple([
+    'table'         => 'acknowledgement_receipts',
+    'columns'       => ['res_id', 'type', 'format', 'user_id', 'contact_address_id', 'creation_date', 'send_date', 'docserver_id', 'path', 'filename', 'fingerprint'],
+    'values'        => [[$_REQUEST['identifier'], 'simple', 'html', $user[0]['id'], 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 0, 0, 0]]
+]);
diff --git a/src/core/lang/lang-fr.php b/src/core/lang/lang-fr.php
index ee7f754493a1e11c30871547dbb5c79f6dde2f19..c5f505cd97fee69211a42a0637aaa2c60b3decc6 100755
--- a/src/core/lang/lang-fr.php
+++ b/src/core/lang/lang-fr.php
@@ -330,9 +330,9 @@ define('_PROCEED_WORKFLOW', 'Poursuivre le circuit de visa');
 define('_PROCEED_WORKFLOW_DESC', 'Met à jour la date du visa de l\'actuel viseur / signataire présent dans le circuit de visa du courrier (\'process_date\' de la table listinstance).');
 define('_VISA_MAIL', 'Viser le courrier');
 define('_VISA_MAIL_DESC', 'Ouvre la page du parapheur afin de pouvoir viser / signer le document.');
-define('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT', 'Envoyer au contact avec une pièce jointe obligatoire');
+define('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT', 'Envoyer au contact avec une pièce jointe obligatoire et accusé de réception');
 define('_SEND_TO_CONTACT_WITH_MANDATORY_ATTACHMENT_DESC', "Ouvre une modal d'envoi de mail avec l'email du contact associé au courrier en tant que destinataire, présence OBLIGATOIRE de pièce(s) jointe(s) à l'envoi.");
-define('_SEND_ATTACHMENTS_TO_CONTACT', 'Envoyer au contact');
+define('_SEND_ATTACHMENTS_TO_CONTACT', 'Envoyer au contact avec accusé de réception');
 define('_SEND_ATTACHMENTS_TO_CONTACT_DESC', "Ouvre une modal d'envoi de mail avec l'email du contact associé au courrier en tant que destinataire.");
 define("_VIEW_ATTACHMENTS", "Voir les pièces jointes");
 define("_VIEW_ATTACHMENTS_DESC", "Voir les pièces jointes");