2
0
forked from Wavyzz/dolibarr

Fix: uniform code

replace all $html by $form with exceptions "$htmlname, $htmltooltip"
This commit is contained in:
Regis Houssin
2011-11-08 17:18:45 +08:00
parent 9549c0c608
commit f0c327c070
214 changed files with 1401 additions and 1401 deletions

View File

@@ -3070,7 +3070,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
* Fonction utilisee dans les pdf et les pages html
*
* @param float $amount Montant a formater
* @param string $html Type de formatage, html ou pas (par defaut)
* @param string $form Type de formatage, html ou pas (par defaut)
* @param Translate $outlangs Objet langs pour formatage text
* @param int $trunc 1=Tronque affichage si trop de decimales,0=Force le non troncage
* @param int $rounding Minimum number of decimal. If not defined we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
@@ -3079,7 +3079,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
*
* @see price2num Revert function of price
*/
function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1)
function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1)
{
global $langs,$conf;
@@ -3098,7 +3098,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
if ($outlangs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$outlangs->trans("SeparatorDecimal");
if ($outlangs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$outlangs->trans("SeparatorThousand");
if ($thousand == 'None') $thousand='';
//print "amount=".$amount." html=".$html." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'<br>";
//print "amount=".$amount." html=".$form." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'<br>";
//print "amount=".$amount."-";
$amount = str_replace(',','.',$amount); // should be useless
@@ -3126,7 +3126,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
if ($forcerounding >= 0) $nbdecimal = $forcerounding;
// Format number
if ($html)
if ($form)
{
$output=preg_replace('/\s/','&nbsp;',number_format($amount, $nbdecimal, $dec, $thousand));
}
@@ -3165,7 +3165,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
if ($langs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->trans("SeparatorDecimal");
if ($langs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$langs->trans("SeparatorThousand");
if ($thousand == 'None') $thousand='';
//print "amount=".$amount." html=".$html." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'<br>";
//print "amount=".$amount." html=".$form." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'<br>";
// Convert value to universal number format (no thousand separator, '.' as decimal separator)
if ($alreadysqlnb != 1) // If not a PHP number or unknown, we change format