From 1748f1d451821a34e58da4f2a1db6d7323e8de68 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Tue, 9 May 2017 16:52:03 +0200
Subject: [PATCH] Better tooltip for computed field

---
 htdocs/exports/export.php       | 22 ++++++++++++++--------
 htdocs/langs/en_US/exports.lang |  1 +
 htdocs/theme/eldy/style.css.php |  3 +++
 htdocs/theme/md/style.css.php   |  3 +++
 4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index e9f19f49ef4..43453041dfd 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -439,7 +439,7 @@ if ($step == 1 || ! $datatoexport)
     $h++;
     */
 
-    dol_fiche_head($head, $hselected, $langs->trans("NewExport"));
+    dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1);
 
 
     print '<table class="notopnoleftnoright" width="100%">';
@@ -609,7 +609,14 @@ if ($step == 2 && $datatoexport)
         $text=$langs->trans($label);
         $tablename=getablenamefromfield($code,$sqlmaxforexport);
         $htmltext ='<b>'.$langs->trans("Name").":</b> ".$text.'<br>';
-        $htmltext.='<b>'.$langs->trans("Table")." -> ".$langs->trans("Field").":</b> ".$tablename." -> ".preg_replace('/^.*\./','',$code)."<br>";
+        if (! empty($objexport->array_export_special[0][$code]))
+        {
+            $htmltext.='<b>'.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." :</b> ".$objexport->array_export_special[0][$code]."<br>";
+        }
+        else
+        {
+            $htmltext.='<b>'.$langs->trans("Table")." -> ".$langs->trans("Field").":</b> ".$tablename." -> ".preg_replace('/^.*\./','',$code)."<br>";
+        }
 		if (! empty($objexport->array_export_examplevalues[0][$code]))
 		{
 		    $htmltext.=$langs->trans("SourceExample").': <b>'.$objexport->array_export_examplevalues[0][$code].'</b><br>';
@@ -645,9 +652,8 @@ if ($step == 2 && $datatoexport)
     
     /*
      * Barre d'action
-     *
      */
-    print '<div class="tabsAction">';
+    print '<div class="tabsAction tabsActionNoBottom">';
 
     if (count($array_selected))
 	{
@@ -828,7 +834,7 @@ if ($step == 3 && $datatoexport)
 	/*
 	 * Barre d'action
 	 */
-	print '<div class="tabsAction">';
+	print '<div class="tabsAction tabsActionNoBottom">';
 	// il n'est pas obligatoire de filtrer les champs
 	print '<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans("NextStep").'</a>';
 	print '</div>';
@@ -883,14 +889,14 @@ if ($step == 4 && $datatoexport)
     print '<table width="100%" class="border">';
 
     // Module
-    print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
+    print '<tr><td class="titlefield">'.$langs->trans("Module").'</td>';
     print '<td>';
     //print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
     print $objexport->array_export_module[0]->getName();
     print '</td></tr>';
 
     // Lot de donnees a exporter
-    print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
+    print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
     print '<td>';
 	$icon=preg_replace('/:.*$/','',$objexport->array_export_icon[0]);
     print img_object($objexport->array_export_module[0]->getName(), $icon).' ';
@@ -898,7 +904,7 @@ if ($step == 4 && $datatoexport)
     print '</td></tr>';
 
     // List of exported fields
-    print '<tr><td width="25%">'.$langs->trans("ExportedFields").'</td>';
+    print '<tr><td>'.$langs->trans("ExportedFields").'</td>';
     $list='';
     foreach($array_selected as $code=>$value)
     {
diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang
index a2e208673bd..4a1152e6581 100644
--- a/htdocs/langs/en_US/exports.lang
+++ b/htdocs/langs/en_US/exports.lang
@@ -120,6 +120,7 @@ SelectPrimaryColumnsForUpdateAttempt=Select column(s) to use as primary key for
 UpdateNotYetSupportedForThisImport=Update is not supported for this type of import (only insert)
 NoUpdateAttempt=No update attempt was performed, only insert 
 ImportDataset_user_1=Users (employees or not) and properties
+ComputedField=Computed field
 ## filters
 SelectFilterFields=If you want to filter on some values, just input values here.
 FilteredFields=Filtered fields
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 4672d99b8ec..9de83c3bd97 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -2006,6 +2006,9 @@ div.tabsAction {
     padding: 0em 0em;
     text-align: right;
 }
+div.tabsActionNoBottom {
+    margin-bottom: 0px;
+}
 div.tabsAction > a {
 	margin-bottom: 16px !important;
 }
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 7818422d192..e6809a2c574 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -2011,6 +2011,9 @@ div.tabsAction {
     padding: 0em 0em;
     text-align: right;
 }
+div.tabsActionNoBottom {
+    margin-bottom: 0px;
+}
 div.tabsAction > a {
 	margin-bottom: 16px !important;
 }
-- 
GitLab