From c2642acdba5716dbd65ded8231d7ecef294998c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 17 Dec 2015 10:01:21 +0100 Subject: [PATCH] Fix CI build 578 (Syntax error) empty() only supports variables in PHP < 5.5 --- htdocs/product/card.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index bdb19e39a6d..ba548cacd26 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -64,6 +64,8 @@ $action=(GETPOST('action','alpha') ? GETPOST('action','alpha') : 'view'); $cancel=GETPOST('cancel'); $confirm=GETPOST('confirm','alpha'); $socid=GETPOST('socid','int'); +$duration_value = GETPOST('duration_value'); +$duration_unit = GETPOST('duration_unit'); if (! empty($user->societe_id)) $socid=$user->societe_id; $object = new Product($db); @@ -184,7 +186,7 @@ if (empty($reshook)) $action = "create"; $error++; } - if (! empty(GETPOST('duration_value')) && empty(GETPOST('duration_unit'))) + if (! empty($duration_value) && empty($duration_unit)) { setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Unit')), 'errors'); $action = "create"; @@ -242,8 +244,8 @@ if (empty($reshook)) $object->note = dol_htmlcleanlastbr(GETPOST('note')); $object->customcode = GETPOST('customcode'); $object->country_id = GETPOST('country_id'); - $object->duration_value = GETPOST('duration_value'); - $object->duration_unit = GETPOST('duration_unit'); + $object->duration_value = $duration_value; + $object->duration_unit = $duration_unit; $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0; $object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0; $object->canvas = GETPOST('canvas'); @@ -329,8 +331,8 @@ if (empty($reshook)) $object->status_batch = GETPOST('status_batch'); $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $object->desiredstock = GETPOST('desiredstock'); - $object->duration_value = GETPOST('duration_value'); - $object->duration_unit = GETPOST('duration_unit'); + $object->duration_value = $duration_value; + $object->duration_unit = $duration_unit; $object->canvas = GETPOST('canvas'); $object->weight = GETPOST('weight'); $object->weight_units = GETPOST('weight_units'); @@ -898,7 +900,7 @@ else // Duration if ($type == 1) { - print ''.$langs->trans("Duration").'  '; + print '' . $langs->trans("Duration") . '  '; print ''.$langs->trans("Hour").' '; print ''.$langs->trans("Day").' '; print ''.$langs->trans("Week").' ';