diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 3ad8972b97e..c31f23eeb4e 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -41,154 +41,154 @@
*/
class Form
{
- var $db;
- var $error;
-
- // Cache arrays
- var $cache_types_paiements=array();
- var $cache_conditions_paiements=array();
- var $cache_availability=array();
+ var $db;
+ var $error;
+
+ // Cache arrays
+ var $cache_types_paiements=array();
+ var $cache_conditions_paiements=array();
+ var $cache_availability=array();
var $cache_demand_reason=array();
var $cache_type_fees=array();
-
- var $tva_taux_value;
- var $tva_taux_libelle;
-
-
- /**
- * Constructor
+
+ var $tva_taux_value;
+ var $tva_taux_libelle;
+
+
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ */
+ public function __construct($db)
+ {
+ $this->db = $db;
+ }
+
+ /**
+ * Output key field for an editable field
+ *
+ * @param string $text Text of label or key to translate
+ * @param string $htmlname Name of select field
+ * @param string $preselected Name of Value to show/edit (not used in this function)
+ * @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', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
+ * @return string HTML edit field
+ */
+ function editfieldkey($text,$htmlname,$preselected,$object,$perm,$typeofdata='string')
+ {
+ global $conf,$langs;
+
+ $ret='';
+
+ if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
+ {
+ if ($perm)
+ {
+ $tmp=explode(':',$typeofdata);
+ $ret.= '
'."\n";
- }
- else
- {
- $out = $value;
- }
-
- return $out;
- }
-
- /**
- * Show a text and picto with tooltip on text or picto
- *
- * @param text Text to show
- * @param htmltext Content html of tooltip. Must be HTML/UTF8 encoded.
- * @param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
- * @param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
- * @param img Code img du picto (use img_xxx() function to get it)
- * @param extracss Add a CSS style to td tags
- * @param notabs Do not include table and tr tags
- * @param incbefore Include code before the text
- * @param noencodehtmltext Do not encode into html entity the htmltext
- * @return string Code html du tooltip (texte+picto)
- * @see Use function textwithpicto if you can.
- */
- function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='',$noencodehtmltext=0)
- {
- global $conf;
-
- if ($incbefore) $text = $incbefore.$text;
- if (! $htmltext) return $text;
-
- // Sanitize tooltip
- $htmltext=str_replace("\\","\\\\",$htmltext);
- $htmltext=str_replace("\r","",$htmltext);
- $htmltext=str_replace("\n","",$htmltext);
-
- $htmltext=str_replace('"',""",$htmltext);
- if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
- else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
- if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
- else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
-
- $s="";
- if (empty($notabs)) $s.='
';
- if ($direction > 0)
- {
- if ($text != '')
- {
- $s.='
'.$text;
+ /**
+ * Show a text and picto with tooltip on text or picto
+ *
+ * @param string $text Text to show
+ * @param string $htmltext Content html of tooltip. Must be HTML/UTF8 encoded.
+ * @param int $tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
+ * @param int $direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
+ * @param string $img Code img du picto (use img_xxx() function to get it)
+ * @param string $extracss Add a CSS style to td tags
+ * @param int $notabs Do not include table and tr tags
+ * @param string $incbefore Include code before the text
+ * @param int $noencodehtmltext Do not encode into html entity the htmltext
+ * @return string Code html du tooltip (texte+picto)
+ * @see Use function textwithpicto if you can.
+ */
+ function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='',$noencodehtmltext=0)
+ {
+ global $conf;
+
+ if ($incbefore) $text = $incbefore.$text;
+ if (! $htmltext) return $text;
+
+ // Sanitize tooltip
+ $htmltext=str_replace("\\","\\\\",$htmltext);
+ $htmltext=str_replace("\r","",$htmltext);
+ $htmltext=str_replace("\n","",$htmltext);
+
+ $htmltext=str_replace('"',""",$htmltext);
+ if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
+ else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
+ if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
+ else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
+
+ $s="";
+ if (empty($notabs)) $s.='
';
+ if ($direction > 0)
+ {
+ if ($text != '')
+ {
+ $s.='
'.$text;
if ($direction) $s.=' ';
$s.='
';
}
@@ -346,9 +346,9 @@ class Form
}
}
if (empty($notabs)) $s.='
';
-
- return $s;
- }
+
+ return $s;
+ }
/**
* Show a text with a picto and a tooltip on picto