From 1401debace3ab0ea8291afac8c9722d993856061 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Fri, 11 Sep 2015 08:32:40 +0200
Subject: [PATCH] Fix print into form to attach file must be into return.

---
 htdocs/core/class/html.formfile.class.php | 9 ++++++---
 htdocs/langs/en_US/link.lang              | 1 +
 htdocs/theme/eldy/style.css.php           | 5 ++++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 47723a05cbc..59a418d73a2 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -75,6 +75,7 @@ class FormFile
         global $conf,$langs, $hookmanager;
         $hookmanager->initHooks(array('formfile'));
 
+        
         if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
 
 		if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
@@ -86,13 +87,13 @@ class FormFile
         	return $this->_formAjaxFileUpload($object);
         }
         else
-       {
+       	{
             $maxlength=$size;
 
             $out = "\n\n<!-- Start form attach new file -->\n";
 
             if (empty($title)) $title=$langs->trans("AttachANewFile");
-            if ($title != 'none') print_titre($title);
+            if ($title != 'none') $out.=load_fiche_titre($title, null, null);
 
             $out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">';
             $out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="">';
@@ -178,7 +179,7 @@ class FormFile
 	            $out .= '<table width="100%" class="nobordernopadding">';
 	            $out .= '<tr>';
 	            $out .= '<td valign="middle" class="nowrap">';
-	            $out .= $langs->trans("Link") . ': ';
+	            $out .= $langs->trans("URLToLink") . ': ';
 	            $out .= '<input type="text" name="link" size="'.$maxlength.'" id="link">';
 	            $out .= ' &nbsp; ' . $langs->trans("Label") . ': ';
 	            $out .= '<input type="text" name="label" id="label">';
@@ -200,7 +201,9 @@ class FormFile
 
             if (empty($res))
             {
+        		print '<div class="attacharea">';
             	print $out;
+            	print '</div>';
             }
 
             print $hookmanager->resPrint;
diff --git a/htdocs/langs/en_US/link.lang b/htdocs/langs/en_US/link.lang
index 8b1efb75ef3..6880d4d86a0 100644
--- a/htdocs/langs/en_US/link.lang
+++ b/htdocs/langs/en_US/link.lang
@@ -6,3 +6,4 @@ ErrorFileNotLinked=The file could not be linked
 LinkRemoved=The link %s has been removed
 ErrorFailedToDeleteLink= Failed to remove link '<b>%s</b>'
 ErrorFailedToUpdateLink= Failed to update link '<b>%s</b>'
+URLToLink=URL to link
\ No newline at end of file
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index ce4764373db..b88fcb187de 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -603,7 +603,10 @@ div.ficheaddleft {
 	padding-top: 1px;
 	padding-bottom: 1px;
 }
-
+div.attacharea {
+	padding-top: 10px;
+	padding-bottom: 10px;
+}
 
 /* ============================================================================== */
 /* Menu top et 1ere ligne tableau                                                 */
-- 
GitLab