";
}
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 0339dedb3b1..1e89c73ef71 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -68,6 +68,9 @@ class DolEditor
dol_syslog("DolEditor::DolEditor htmlname=".$htmlname." tool=".$tool);
+ if (! $rows) $rows=round($height/25);
+ if (! $cols) $rows=round($height/6);
+
// Name of extended editor to use (FCKEDITOR_EDITORNAME can be 'ckeditor' or 'fckeditor')
$defaulteditor='ckeditor';
$this->tool=empty($conf->global->FCKEDITOR_EDITORNAME)?$defaulteditor:$conf->global->FCKEDITOR_EDITORNAME;
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index b54817341dc..4658c615b7d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -74,7 +74,7 @@ class Form
* @param string $paramkey Key of parameter for Url (unique if there is several parameter to show). In most cases "id".
* @param string $paramvalue Value of parameter for Url
* @param boolean $perm Permission to allow button to edit parameter
- * @param string $typeofdata Type of data ('string' by default, 'email', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz', 'select:xxx'...)
+ * @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
* @return string HTML edit field
*/
function editfieldkey($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string')
@@ -110,7 +110,7 @@ class Form
* @param string $value Value to show/edit
* @param string $paramkey Key of parameter (unique if there is several parameter to show). In most cases "id".
* @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', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:rows:cols', 'select:xxx'...)
+ * @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
* @param string $editvalue When in edit mode, use this value as $value instead of value
* @return string HTML edit field
*/
@@ -140,7 +140,7 @@ class Form
$tmp=explode(':',$typeofdata);
$ret.='';
}
- else if ($typeofdata == 'text' || $typeofdata == 'textarea')
+ else if ($typeofdata == 'text' || $typeofdata == 'textarea' || $typeofdata == 'note')
{
$ret.='';
}
@@ -152,7 +152,7 @@ class Form
{
$tmp=explode(':',$typeofdata);
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
- $doleditor=new DolEditor($htmlname,($editvalue?$editvalue:$value),($tmp[2]?$tmp[2]:''),($tmp[3]?$tmp[3]:'100'),($tmp[1]?$tmp[1]:'dolibarr_notes'),'In',false,true,true,($tmp[4]?$tmp[4]:ROWS_4),($tmp[5]?$tmp[5]:'100'));
+ $doleditor=new DolEditor($htmlname,($editvalue?$editvalue:$value),($tmp[2]?$tmp[2]:''),($tmp[3]?$tmp[3]:'100'),($tmp[1]?$tmp[1]:'dolibarr_notes'),'In',false,true,true);
$ret.=$doleditor->Create(1);
//$ret.='';
}
@@ -165,7 +165,14 @@ class Form
{
if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1);
elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day');
- elseif ($typeofdata == 'text' || $typeofdata == 'textarea') $ret.=dol_htmlentitiesbr($value);
+ elseif ($typeofdata == 'text' || $typeofdata == 'textarea') $ret.=dol_htmlentitiesbr($value);
+ 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))?'...':'');
+ }
else $ret.=$value;
}
}
@@ -181,7 +188,7 @@ class Form
* @param string $inputType Type of input ('numeric', 'datepicker', 'textarea', 'ckeditor:dolibarr_zzz', 'select:xxx')
* @return string HTML edit in place
*/
- function editInPlace($value, $htmlname, $condition, $inputType='textarea')
+ private function editInPlace($value, $htmlname, $condition, $inputType='textarea')
{
global $conf;
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index 027d8fba2ce..c0a97637996 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -816,9 +816,9 @@ else if ($id > 0 || ! empty($ref))
// Description (must be a textarea and not html must be allowed (used in list view)
print '