Skip to content
Snippets Groups Projects
Commit 74293cd7 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

git push origin developMerge branch 'GPCsolutions-dolibarr-cifix' into develop

parents 98cd4f83 d0ec3f11
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,8 @@ $action=(GETPOST('action','alpha') ? GETPOST('action','alpha') : 'view'); ...@@ -64,6 +64,8 @@ $action=(GETPOST('action','alpha') ? GETPOST('action','alpha') : 'view');
$cancel=GETPOST('cancel'); $cancel=GETPOST('cancel');
$confirm=GETPOST('confirm','alpha'); $confirm=GETPOST('confirm','alpha');
$socid=GETPOST('socid','int'); $socid=GETPOST('socid','int');
$duration_value = GETPOST('duration_value');
$duration_unit = GETPOST('duration_unit');
if (! empty($user->societe_id)) $socid=$user->societe_id; if (! empty($user->societe_id)) $socid=$user->societe_id;
$object = new Product($db); $object = new Product($db);
...@@ -184,7 +186,7 @@ if (empty($reshook)) ...@@ -184,7 +186,7 @@ if (empty($reshook))
$action = "create"; $action = "create";
$error++; $error++;
} }
if (GETPOST('duration_value') && ! GETPOST('duration_unit')) if (! empty($duration_value) && empty($duration_unit))
{ {
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Unit')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Unit')), 'errors');
$action = "create"; $action = "create";
...@@ -242,8 +244,8 @@ if (empty($reshook)) ...@@ -242,8 +244,8 @@ if (empty($reshook))
$object->note = dol_htmlcleanlastbr(GETPOST('note')); $object->note = dol_htmlcleanlastbr(GETPOST('note'));
$object->customcode = GETPOST('customcode'); $object->customcode = GETPOST('customcode');
$object->country_id = GETPOST('country_id'); $object->country_id = GETPOST('country_id');
$object->duration_value = GETPOST('duration_value'); $object->duration_value = $duration_value;
$object->duration_unit = GETPOST('duration_unit'); $object->duration_unit = $duration_unit;
$object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0; $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0;
$object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0; $object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0;
$object->canvas = GETPOST('canvas'); $object->canvas = GETPOST('canvas');
...@@ -329,8 +331,8 @@ if (empty($reshook)) ...@@ -329,8 +331,8 @@ if (empty($reshook))
$object->status_batch = GETPOST('status_batch'); $object->status_batch = GETPOST('status_batch');
$object->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
$object->desiredstock = GETPOST('desiredstock'); $object->desiredstock = GETPOST('desiredstock');
$object->duration_value = GETPOST('duration_value'); $object->duration_value = $duration_value;
$object->duration_unit = GETPOST('duration_unit'); $object->duration_unit = $duration_unit;
$object->canvas = GETPOST('canvas'); $object->canvas = GETPOST('canvas');
$object->weight = GETPOST('weight'); $object->weight = GETPOST('weight');
$object->weight_units = GETPOST('weight_units'); $object->weight_units = GETPOST('weight_units');
...@@ -898,7 +900,7 @@ else ...@@ -898,7 +900,7 @@ else
// Duration // Duration
if ($type == 1) if ($type == 1)
{ {
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3"><input name="duration_value" size="6" maxlength="5" value="'.GETPOST('duration_value').'"> &nbsp;'; print '<tr><td>' . $langs->trans("Duration") . '</td><td colspan="3"><input name="duration_value" size="6" maxlength="5" value="' . $duration_value . '"> &nbsp;';
print '<input name="duration_unit" type="radio" value="h">'.$langs->trans("Hour").'&nbsp;'; print '<input name="duration_unit" type="radio" value="h">'.$langs->trans("Hour").'&nbsp;';
print '<input name="duration_unit" type="radio" value="d">'.$langs->trans("Day").'&nbsp;'; print '<input name="duration_unit" type="radio" value="d">'.$langs->trans("Day").'&nbsp;';
print '<input name="duration_unit" type="radio" value="w">'.$langs->trans("Week").'&nbsp;'; print '<input name="duration_unit" type="radio" value="w">'.$langs->trans("Week").'&nbsp;';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment