diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 5ee8c502009..f8f64decbfa 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -73,6 +73,7 @@ $ref=GETPOST('ref', 'alpha');
$type=GETPOST('type', 'int');
$action=(GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view');
$cancel=GETPOST('cancel', 'alpha');
+$backtopage = GETPOST('backtopage', 'alpha');
$confirm=GETPOST('confirm', 'alpha');
$socid=GETPOST('socid', 'int');
$duration_value = GETPOST('duration_value', 'int');
@@ -357,8 +358,18 @@ if (empty($reshook))
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
- header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
- exit;
+ if (! empty($backtopage))
+ {
+ $backtopage = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation
+ if (preg_match('/\?/', $backtopage)) $backtopage.='&socid='.$object->id; // Old method
+ header("Location: ".$backtopage);
+ exit;
+ }
+ else
+ {
+ header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
+ exit;
+ }
}
else
{
@@ -950,6 +961,7 @@ else
print '';
if (! empty($modBarCodeProduct->code_auto))
print '';
+ print '';
if ($type==1) $title=$langs->trans("NewService");
else $title=$langs->trans("NewProduct");
@@ -1070,12 +1082,6 @@ else
print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1);
print '';
- // Net Measure
- print '
| '.$langs->trans("NetMeasure").' | ';
- print '';
- print $formproduct->selectMeasuringUnits("net_measure_units", "net_measure", GETPOSTISSET('net_measure_units')?GETPOST('net_measure_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
- print ' |
';
-
// Brut Weight
print '| '.$langs->trans("Weight").' | ';
print '';
@@ -1108,6 +1114,15 @@ else
print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units')?GETPOST('volume_units', 'alpha'):'0', 0, 2);
print ' |
';
}
+
+ if (! empty($conf->global->PRODUCT_ADD_NET_MEASURE))
+ {
+ // Net Measure
+ print '| '.$langs->trans("NetMeasure").' | ';
+ print '';
+ print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units')?GETPOST('net_measure_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), '');
+ print ' |
';
+ }
}
// Units
@@ -1450,18 +1465,12 @@ else
print $form->selectarray('finished', $statutarray, $object->finished);
print '';
- // Net Measure
- print '| '.$langs->trans("NetMeasure").' | ';
- print ' ';
- print $form->selectUnits($object->net_measure_units, 'units');
- //print $formproduct->selectMeasuringUnits("net_measure_units", "weight", $object->net_measure_units, 0, 2);
- print ' |
';
-
// Brut Weight
print '| '.$langs->trans("Weight").' | ';
print ' ';
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
print ' |
';
+
if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{
// Brut Length
@@ -1488,6 +1497,15 @@ else
print $formproduct->selectMeasuringUnits("volume_units", "volume", $object->volume_units, 0, 2);
print '';
}
+
+ if (! empty($conf->global->PRODUCT_ADD_NET_MEASURE))
+ {
+ // Net Measure
+ print '| '.$langs->trans("NetMeasure").' | ';
+ print ' ';
+ print $formproduct->selectMeasuringUnits($object->net_measure_units, '');
+ print ' |
';
+ }
}
// Units
if($conf->global->PRODUCT_USE_UNITS)
@@ -1863,17 +1881,6 @@ else
print $object->getLibFinished();
print '';
- // Net Measure
- print '| '.$langs->trans("NetMeasure").' | ';
- if ($object->net_measure != '')
- {
- print $object->net_measure." ".measuring_units_string(0, "weight", $object->net_measure_units);
- }
- else
- {
- print ' ';
- }
-
// Brut Weight
print ' |
| '.$langs->trans("Weight").' | ';
if ($object->weight != '')
@@ -1885,6 +1892,7 @@ else
print ' ';
}
print " |
\n";
+
if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{
// Brut Length
@@ -1930,6 +1938,20 @@ else
}
print "\n";
}
+
+ if (! empty($conf->global->PRODUCT_ADD_NET_MEASURE))
+ {
+ // Net Measure
+ print '| '.$langs->trans("NetMeasure").' | ';
+ if ($object->net_measure != '')
+ {
+ print $object->net_measure." ".measuring_units_string(0, "weight", $object->net_measure_units);
+ }
+ else
+ {
+ print ' ';
+ }
+ }
}
// Unit
|