From dbc457176c10ee668ddc4740d6973393d962b85c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2012 00:21:45 +0100 Subject: [PATCH] Fix: When option MAIN_DISABLE_NOTES_TAB is not enabled, we must show all notes with no need to click (saved 2 clicks) --- htdocs/core/class/html.form.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e64ba007246..7dc3dead3e7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -120,7 +120,7 @@ class Form * @param string $value Value to show/edit * @param object $object Object * @param boolean $perm Permission to allow button to edit parameter - * @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select:xxx'...) + * @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) * @param string $editvalue When in edit mode, use this value as $value instead of value * @param object $extObject External object * @param string $success Success message @@ -204,9 +204,13 @@ class Form else if (preg_match('/^ckeditor/',$typeofdata)) { $tmpcontent=dol_htmlentitiesbr($value); - $firstline=preg_replace('/
.*/','',$tmpcontent); - $firstline=preg_replace('/[\n\r].*/','',$firstline); - $ret.=$firstline.((strlen($firstline) != strlen($tmpcontent))?'...':''); + if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $firstline=preg_replace('/
.*/','',$tmpcontent); + $firstline=preg_replace('/[\n\r].*/','',$firstline); + $tmpcontent=$firstline.((strlen($firstline) != strlen($tmpcontent))?'...':''); + } + $ret.=$tmpcontent; } else $ret.=$value; }