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