From 601ed455f31498a64027a1ebb8b31b85d1f9b40c Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Mon, 6 Mar 2017 19:22:34 +0100
Subject: [PATCH] FIX #5274 fix create contact in multi

---
 apps/maarch_entreprise/actions/index_mlb.php | 5 +++--
 apps/maarch_entreprise/js/indexing.js        | 5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/apps/maarch_entreprise/actions/index_mlb.php b/apps/maarch_entreprise/actions/index_mlb.php
index 4b6bcada306..6746108030d 100644
--- a/apps/maarch_entreprise/actions/index_mlb.php
+++ b/apps/maarch_entreprise/actions/index_mlb.php
@@ -615,9 +615,10 @@ function get_form_txt($values, $pathManageAction,  $actionId, $table, $module, $
         $frmStr .= '<td><label for="contact" class="form_title" >'
             . '<span id="dest_multi_contact">' . _DEST . '</span>';
     if ($core->test_admin('my_contacts', 'apps', false)) {
+        $pathScriptTab = $_SESSION['config']['businessappurl']
+                . 'index.php?display=false&dir=my_contacts&page=create_contact_iframe';
         $frmStr .= ' <a href="#" id="create_multi_contact" title="' . _CREATE_CONTACT
-                . '" onclick="new Effect.toggle(\'create_contact_div\', '
-                . '\'blind\', {delay:0.2});return false;" '
+                . '" onclick="loadTab(\''.$res_id.'\',\''.$coll_id.'\',\'\',\''.$pathScriptTab.'\',\'create_contact\');return false;" '
                 . 'style="display:inline;" ><i class="fa fa-pencil" title="' 
                 . _CREATE_CONTACT . '"></i></a>';
     }
diff --git a/apps/maarch_entreprise/js/indexing.js b/apps/maarch_entreprise/js/indexing.js
index 707c7aa437e..e3ba7a6271b 100644
--- a/apps/maarch_entreprise/js/indexing.js
+++ b/apps/maarch_entreprise/js/indexing.js
@@ -1728,6 +1728,11 @@ function set_new_contact_address(path_manage_script, id_div, close,transmission)
             } else if (parent.parent.$('contact')) {
                 parent.parent.$('contact').value = response.contactName;
             }
+            if (parent.$('email')) {
+                parent.$('email').value = response.contactName;
+            } else if (parent.parent.$('email')) {
+                parent.parent.$('email').value = response.contactName;
+            }
             if (parent.$('contactidAttach')) {
                 parent.$('contactidAttach').value = response.contactId;
             } else if (parent.parent.$('contactidAttach')){
-- 
GitLab