From 47dd53abbe322413c3e47926d6719bb7a2d2e633 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sat, 11 Mar 2017 02:36:22 +0100
Subject: [PATCH] NEW The substitution keys available for emailing edition is
 now into a popup

---
 htdocs/comm/mailing/card.php          | 18 +++---------------
 htdocs/core/class/html.form.class.php |  4 ++--
 htdocs/theme/eldy/style.css.php       |  9 ++++-----
 htdocs/theme/md/style.css.php         |  3 +--
 4 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index ea4b21d78be..2ce6a638191 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -846,11 +846,6 @@ else
 			
 			print '<table class="border" width="100%">';
 
-/*			print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
-			print '<td colspan="3">';
-			print $form->showrefnav($object,'id', $linkback);
-			print '</td></tr>';
-*/
 			// Description
 			print '<tr><td class="titlefield">'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
 			print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
@@ -865,13 +860,6 @@ else
 			print '<tr><td>'.$form->editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
 			print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
 			print '</td></tr>';
-
-			// Status
-			/*
-			print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4);
-			if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')';
-			print'</td></tr>';
-			*/
 			
 			// Nb of distinct emails
 			print '<tr><td>';
@@ -1062,7 +1050,7 @@ else
 			$htmltext.='</i>';
 			
 			// Print mail content
-			print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
+			print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
 			
 			dol_fiche_head('');
 			
@@ -1085,7 +1073,7 @@ else
 			}
 			else
 			{
-				print $langs->trans("NoAttachedFiles").'<br>';
+				print '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
 			}
 			print '</td></tr>';
 
@@ -1191,7 +1179,7 @@ else
 			$htmltext.='</i>';
 			
 			// Print mail content
-			print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
+			print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
 
 			dol_fiche_head();
 			
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 3a99965e301..a427d67ac83 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -447,7 +447,7 @@ class Form
         else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
         if ($tooltipon == 1 || $tooltipon == 3) 
         {
-            $paramfortooltiptd=' class="'.$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" ';
+            $paramfortooltiptd=' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" ';
             if ($tooltiptrigger == '') $paramfortooltiptd.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
             else $paramfortooltiptd.=' dolid="'.$tooltiptrigger.'"';
         }
@@ -524,7 +524,7 @@ class Form
         elseif ($type == 'warning') $img = img_warning($alt);
 		else $img = img_picto($alt, $type);
 
-        return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger);
+        return $this->textwithtooltip($text, $htmltext, ($tooltiptrigger?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger);
     }
 
     /**
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 5ce9e9515c1..e424f65ca3f 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -304,7 +304,7 @@ input, select {
 	margin-top:1px;
 }
 select {
-	padding: 4px 4px 4px 1px;
+	/* padding: 4px 4px 2px 1px; */
 }
 textarea {
 	border-radius: 0;
@@ -387,7 +387,7 @@ fieldset { border: 1px solid #AAAAAA !important; }
 	border-color: #c5c5c5;
 	border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
 	display: inline-block;
-	padding: 4px 14px;
+	padding: 3px 14px;
 	margin-bottom: 0;
 	margin-top: 0;
 	text-align: center;
@@ -3942,6 +3942,7 @@ div.dataTables_length select {
 }
 .select2-drop.select2-drop-above.select2-drop-active {
 	border-top: 1px solid #ccc;
+	border-bottom: 1px solid #ccc;
 }
 .select2-container-active .select2-choice, .select2-container-active .select2-choices 
 {
@@ -3977,8 +3978,6 @@ div.dataTables_length select {
 }
 .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices {
 	background-image: none;
-	border-left: 1px solid #ccc !important;
-	border-right: 1px solid #ccc !important;
 	border-radius: 0 !important;
 }
 div.select2-drop-above
@@ -4025,7 +4024,7 @@ a span.select2-chosen
 .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices, .select2-container-multi .select2-choices,
 .select2-container-multi.select2-container-active .select2-choices
 {
-	border-bottom: 1px solid #ccc;
+	border-bottom: none;
 	border-right: none;
 	border-top: none;
 	border-left: 1px solid #ddd;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index b64ce9e3a89..76776e1c41e 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -3898,6 +3898,7 @@ div.dataTables_length select {
 }
 .select2-drop.select2-drop-above.select2-drop-active {
 	border-top: 1px solid #ccc;
+	border-bottom: 1px solid #ccc;
 }
 .select2-container-active .select2-choice, .select2-container-active .select2-choices 
 {
@@ -3933,8 +3934,6 @@ div.dataTables_length select {
 }
 .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices {
 	background-image: none;
-	border-left: 1px solid #ccc !important;
-	border-right: 1px solid #ccc !important;
 	border-radius: 0 !important;
 }
 div.select2-drop-above
-- 
GitLab