';
// Currency
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index b704fa954e7..8962f7add5d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -40,154 +40,154 @@
*/
class Form
{
- var $db;
- var $error;
+ 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();
+ // 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;
+ var $tva_taux_value;
+ var $tva_taux_libelle;
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- public function __construct($db)
- {
- $this->db = $db;
- }
+ /**
+ * 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;
+ /**
+ * 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='';
+ $ret='';
- if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
- {
- if ($perm)
- {
- $tmp=explode(':',$typeofdata);
- $ret.= '
'."\n";
+ }
+ else
+ {
+ $out = $value;
+ }
- return $out;
- }
+ return $out;
+ }
- /**
- * 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;
+ /**
+ * 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;
+ 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);
+ // 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
+ $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.='
';
- }
- if ($direction) $s.='
'.$img.'
';
- }
- else
- {
- if ($direction) $s.='
'.$img.'
';
- if ($text != '')
- {
- $s.='
';
- if ($direction) $s.=' ';
- $s.=$text.'
';
- }
- }
- if (empty($notabs)) $s.='
';
+ $s="";
+ if (empty($notabs)) $s.='
';
+ if ($direction > 0)
+ {
+ if ($text != '')
+ {
+ $s.='
'.$text;
+ if ($direction) $s.=' ';
+ $s.='
';
+ }
+ if ($direction) $s.='
'.$img.'
';
+ }
+ else
+ {
+ if ($direction) $s.='
'.$img.'
';
+ if ($text != '')
+ {
+ $s.='
';
+ if ($direction) $s.=' ';
+ $s.=$text.'
';
+ }
+ }
+ if (empty($notabs)) $s.='
';
- return $s;
- }
+ return $s;
+ }
/**
* Show a text with a picto and a tooltip on picto
@@ -371,7 +371,8 @@ class Form
if (empty($conf->use_javascript_ajax))
{
if ($type == 'info' || $type == 'help') return $text;
- else { $alt=$htmltext; $htmltext=''; }
+ else { $alt=$htmltext; $htmltext='';
+ }
}
// If info or help with smartphone, show only text
if (! empty($conf->browser->phone))
@@ -390,25 +391,25 @@ class Form
}
/**
- * Return combo list of activated countries, into language of user
+ * Return combo list of activated countries, into language of user
*
- * @param string $selected Id or Code or Label of preselected country
- * @param string $htmlname Name of html select object
- * @param string $htmloption Options html on select object
- * @return void
+ * @param string $selected Id or Code or Label of preselected country
+ * @param string $htmlname Name of html select object
+ * @param string $htmloption Options html on select object
+ * @return void
*/
function select_pays($selected='',$htmlname='pays_id',$htmloption='')
{
- print $this->select_country($selected,$htmlname,$htmloption);
+ print $this->select_country($selected,$htmlname,$htmloption);
}
/**
- * Return combo list of activated countries, into language of user
+ * Return combo list of activated countries, into language of user
*
- * @param string $selected Id or Code or Label of preselected country
- * @param string $htmlname Name of html select object
- * @param string $htmloption Options html on select object
- * @return string HTML string with select
+ * @param string $selected Id or Code or Label of preselected country
+ * @param string $htmlname Name of html select object
+ * @param string $htmloption Options html on select object
+ * @return string HTML string with select
*/
function select_country($selected='',$htmlname='pays_id',$htmloption='')
{
@@ -436,13 +437,13 @@ class Form
{
$foundselected=false;
- while ($i < $num)
- {
+ while ($i < $num)
+ {
$obj = $this->db->fetch_object($resql);
$countryArray[$i]['rowid'] = $obj->rowid;
$countryArray[$i]['code_iso'] = $obj->code_iso;
$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:''));
- $label[$i] = $countryArray[$i]['label'];
+ $label[$i] = $countryArray[$i]['label'];
$i++;
}
@@ -450,10 +451,10 @@ class Form
foreach ($countryArray as $row)
{
- //print 'rr'.$selected.'-'.$row['label'].'-'.$row['code_iso'].' ';
- if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['label']) )
- {
- $foundselected=true;
+ //print 'rr'.$selected.'-'.$row['label'].'-'.$row['code_iso'].' ';
+ if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['label']) )
+ {
+ $foundselected=true;
$out.= '
';
- print $value;
- print '
';
+ print '
';
+ print $value;
+ print '
';
}
print '';
@@ -654,7 +619,7 @@ class Form
*/
function select_societes($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0)
{
- print $this->select_company($selected,$htmlname,$filter,$showempty,$showtype,$forcecombo);
+ print $this->select_company($selected,$htmlname,$filter,$showempty,$showtype,$forcecombo);
}
/**
@@ -690,7 +655,7 @@ class Form
{
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
- $out.= ajax_combobox($htmlname);
+ $out.= ajax_combobox($htmlname);
}
$out.= '