From 1ae4bef04b7092a975a6815a518c21c8f9f53e4d Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sat, 2 Jan 2016 00:27:14 +0100
Subject: [PATCH] Fix conflict with the div #dialog used for popup cut and
 paste of address.

---
 htdocs/core/boxes/box_actions.php |  13 +++++++------
 htdocs/core/js/lib_head.js.php    |   9 +++++----
 htdocs/core/lib/company.lib.php   |   3 ---
 htdocs/main.inc.php               |   5 ++++-
 htdocs/theme/common/gmap.png      | Bin 358 -> 374 bytes
 htdocs/theme/md/style.css.php     |   4 ++--
 6 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index fdd69a26a5b..1f5e8493d7b 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -173,7 +173,8 @@ class box_actions extends ModeleBoxes
 	{
 		global $langs, $conf;
 		parent::showBox($this->info_box_head, $this->info_box_contents);
-        if ($conf->global->SHOW_DIALOG_HOMEPAGE) {
+        if (! empty($conf->global->SHOW_DIALOG_HOMEPAGE)) 
+        {
 			$actioncejour=false;
 			$contents=$this->info_box_contents;
 			$nblines=count($contents);
@@ -182,7 +183,7 @@ class box_actions extends ModeleBoxes
 			$bcx[1] = 'class="box_impair"';
 			if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo"))
 			{
-				print '<div id="dialog" title="'.$nblines." ".$langs->trans("ActionsToDo").'">';
+				print '<div id="dialogboxaction" title="'.$nblines." ".$langs->trans("ActionsToDo").'">';
 				print '<table width=100%>';
 				for ($line=0, $n=$nblines; $line < $n; $line++)
 				{
@@ -219,11 +220,11 @@ class box_actions extends ModeleBoxes
 			if ($actioncejour)
 			{
 				print '<script>';
-				print '$( "#dialog" ).dialog({ autoOpen: true });';
-				if ($conf->global->SHOW_DIALOG_HOMEPAGE > 1)
+				print '$("#dialogboxaction").dialog({ autoOpen: true });';
+				if ($conf->global->SHOW_DIALOG_HOMEPAGE > 1)    // autoclose after this delay
 				{
 					print 'setTimeout(function(){';
-					print '$("#dialog").dialog("close");';
+					print '$("#dialogboxaction").dialog("close");';
 					print '}, '.($conf->global->SHOW_DIALOG_HOMEPAGE*1000).');';
 				}
 				print '</script>';
@@ -231,7 +232,7 @@ class box_actions extends ModeleBoxes
 			else
 			{
 				print '<script>';
-				print '$( "#dialog" ).dialog({ autoOpen: false });';
+				print '$("#dialogboxaction").dialog({ autoOpen: false });';
 				print '</script>';
 			}
 		}
diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php
index aad079d2b0e..234a2348590 100644
--- a/htdocs/core/js/lib_head.js.php
+++ b/htdocs/core/js/lib_head.js.php
@@ -940,10 +940,11 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
 function copyToClipboard(text,text2) 
 {
 	text = text.replace(/<br>/g,"\n");
-	var newElem = '<textarea id="coords" style="border: none; width: 90%; height: 120px;">'+text+'</textarea><br><br>'+text2;
-	$("#dialog").html(newElem);
-	$("#dialog").dialog();
-	$("#coords").select();
+	var newElem = '<textarea id="coordsforpopup" style="border: none; width: 90%; height: 120px;">'+text+'</textarea><br><br>'+text2;
+	/* alert(newElem); */
+	$("#dialogforpopup").html(newElem);
+	$("#dialogforpopup").dialog();
+	$("#coordsforpopup").select();
 	return false;
 }
 
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index c7b370b287f..fc544a51d93 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -767,9 +767,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
 
     print '</form>'."\n";
 
-    // A div for the address popup
-    print '<div id="dialog" title="'.dol_escape_htmltag($langs->trans('Address')).'" style="display: none;"></div>';
-
     return $i;
 }
 
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 1c35968790c..1da5fa8f864 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1952,7 +1952,10 @@ if (! function_exists("llxFooter"))
         		jQuery(".classfortooltip").tipTip({maxWidth: "'.dol_size(600,'width').'px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});
         	});
         </script>' . "\n";
-
+        
+		// A div for the address popup
+		print "\n<!-- A div to allow dialog popup -->\n";
+		print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
         
         print "</body>\n";
         print "</html>\n";
diff --git a/htdocs/theme/common/gmap.png b/htdocs/theme/common/gmap.png
index 201577281f048ad530a5ffc90ae5ddcde1ea09cb..2d91b4634190a80ef1002cfef6b03cac54633ed1 100644
GIT binary patch
delta 348
zcmV-i0i*ur0`>xsBYyw}VoOIv0RI600RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_
z000McNliru-~j;_2oilou|fa<0Ru@yK~y-)m6E+}!!QtqKLuHVb&?6V00Dc1Y@loq
zc>+@t*dwTPX%7%U0a&Co+cdUo7O^I<n=`;LCmA{5z{9&AzJGhT3dKT9ufRJn7pMnX
zXH8$$R!VaR)aceaYkUqoC_mT004#tP@m5NfA*OlW^H}`Q$m^Xo>kRiHrZcbte74$e
z2Ea_-PNBaoYSaP$wsJr$R>|#6-p?rw_J9?!et@0eHL#TUIK^O_#cSXo?ni3WJ2(PQ
zBP*YrHP81%>{TW->+XqoqdqA3Ai2M%9Adf@_(G0m5_8s6x4k!t7JZ26BHk<cO}@fT
uq1*`VVdO48@&Vsv)>*Tc#zx}Oz5uRguU8FH`GtW10000<MNUMnLSTZRD3g2u

delta 332
zcmV-S0ki)00_FmcBYy!cNkl<ZI8UvTflb3O5Jl@`0AK>L0Z}plWdk}vvjJrS(g|RM
zG6Aqb7$A{1XxV@ckc4-Yja>Hv5+YJ0`@Zk)|9@v@%2$@<E#W)<xr3X&@7LDaCVp<>
z0LdF-ORexYj_a=L>JU3B;5xtXV9(=v7=~AQoFqwQjCqhVOn+`dCPxK|qG)({P4YdR
zp2ALGE3ikfcQ7w)7Bd)KmkYXlh6VCG&(bvAN~~?$@4Wvl08I<cE6pshT739TLO6jH
zhP^oxmn3`lpOH{`c~eu+rs!h}3LK^*-^m_8bw{_$i9PsW0@>sq2;jB;X^|v}ah)@+
z9mlh%$R1C!ctyM?5*&-e(u4)H<x)NHNq#Hk9*^!v4?KvJ94U?5p+1MY)qGJU1S~2!
e<NQWTme?2YKb{c}V=j3B0000<MNUMnLSTaFFO${)

diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 5983243341e..c349a2e2944 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -80,7 +80,7 @@ $dol_use_jmobile=$conf->dol_use_jmobile;
 //var_dump($user->conf->THEME_ELDY_RGB);
 
 // Colors
-$colorbackhmenu1='0,0,0';      // topmenu
+$colorbackhmenu1='0,0,80';      // topmenu
 $colorbackvmenu1='255,255,255';      // vmenu
 $colorbacktitle1='230,230,230';      // title of array
 $colorbacktabcard1='255,255,255';  // card
@@ -102,7 +102,7 @@ $useboldtitle=1;
 
 // Case of option always editable
 if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody;
-if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1='0,0,0';
+if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1='50,50,60';
 if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1;
 if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=='238,246,252';
 if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab;
-- 
GitLab