Add volume unit "ounce".
This commit is contained in:
parent
38cbd12d92
commit
7a053b3bda
@ -15,6 +15,7 @@ For users:
|
||||
- New: For germany, we invert order of address.
|
||||
- New: Add hidden option MAIN_SERVICES_ARE_ECOMMERCE_200238EC.
|
||||
- New: Support NPR in customer product prices.
|
||||
- New: Add more volume units (ounce, gallon, inch, feet, ...)
|
||||
- Perf: Avoid reading database to determine country code after each
|
||||
page call.
|
||||
- Fix: Better Postgresql compatibility.
|
||||
|
||||
@ -96,6 +96,7 @@ VolumeUnitm3=m3
|
||||
VolumeUnitdm3=dm3
|
||||
VolumeUnitcm3=cm3
|
||||
VolumeUnitmm3=mm3
|
||||
VolumeUnitounce=ounce
|
||||
VolumeUnitlitre=litre
|
||||
VolumeUnitgallon=gallon
|
||||
Size=size
|
||||
|
||||
@ -96,6 +96,7 @@ VolumeUnitm3=m3
|
||||
VolumeUnitdm3=dm3 (l)
|
||||
VolumeUnitcm3=cm3 (ml)
|
||||
VolumeUnitmm3=mm3 (µl)
|
||||
VolumeUnitounce=once
|
||||
VolumeUnitlitre=litre
|
||||
VolumeUnitgallon=gallon
|
||||
Size=taille
|
||||
|
||||
@ -272,9 +272,10 @@ function show_stats_for_company($product,$socid)
|
||||
|
||||
/**
|
||||
* Return translation label of a unit key
|
||||
* @param int Unit key (-3,0,3,98,99...)
|
||||
* @param measuring_style Style of unit: weight, volume,...
|
||||
* @return string Unit string
|
||||
* @param int Unit key (-3,0,3,98,99...)
|
||||
* @param measuring_style Style of unit: weight, volume,...
|
||||
* @return string Unit string
|
||||
* @see load_measuring_units
|
||||
*/
|
||||
function measuring_units_string($unit,$measuring_style='')
|
||||
{
|
||||
@ -310,7 +311,8 @@ function measuring_units_string($unit,$measuring_style='')
|
||||
$measuring_units[-3] = $langs->trans("VolumeUnitdm3");
|
||||
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
||||
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
||||
$measuring_units[98] = $langs->trans("VolumeUnitlitre");
|
||||
$measuring_units[97] = $langs->trans("VolumeUnitounce");
|
||||
$measuring_units[98] = $langs->trans("VolumeUnitlitre");
|
||||
$measuring_units[99] = $langs->trans("VolumeUnitgallon");
|
||||
}
|
||||
|
||||
|
||||
@ -149,12 +149,12 @@ class FormProduct
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return a combo box with list of units
|
||||
* \param name Name of HTML field
|
||||
* \param measuring_style Unit to show: weight, size, surface, volume
|
||||
* \param default Force unit
|
||||
* \param adddefault Add empty unit called "Default"
|
||||
* \remarks pour l'instant on ne definit pas les unites dans la base
|
||||
* Return a combo box with list of units
|
||||
* @param name Name of HTML field
|
||||
* @param measuring_style Unit to show: weight, size, surface, volume
|
||||
* @param default Force unit
|
||||
* @param adddefault Add empty unit called "Default"
|
||||
* @see For the moment, units labels are defined in measuring_units_string
|
||||
*/
|
||||
function load_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0)
|
||||
{
|
||||
@ -167,7 +167,7 @@ class FormProduct
|
||||
if ($measuring_style == 'weight') $measuring_units=array(-6=>1,-3=>1,0=>1,3=>1,99=>1);
|
||||
else if ($measuring_style == 'size') $measuring_units=array(-3=>1,-2=>1,-1=>1,0=>1,99=>1,98=>1);
|
||||
else if ($measuring_style == 'surface') $measuring_units=array(-6=>1,-4=>1,-2=>1,0=>1);
|
||||
else if ($measuring_style == 'volume') $measuring_units=array(-9=>1,-6=>1,-3=>1,0=>1,99=>1,/* 98=>1 */); // Liter is not used as already available with dm3
|
||||
else if ($measuring_style == 'volume') $measuring_units=array(-9=>1,-6=>1,-3=>1,0=>1,97=>1,99=>1,/* 98=>1 */); // Liter is not used as already available with dm3
|
||||
|
||||
$return.= '<select class="flat" name="'.$name.'">';
|
||||
if ($adddefault) $return.= '<option value="0">'.$langs->trans("Default").'</option>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user