diff --git a/htdocs/core/ajax/productonoff.php b/htdocs/core/ajax/productonoff.php index 227a9ef9001..a6c63507f21 100644 --- a/htdocs/core/ajax/productonoff.php +++ b/htdocs/core/ajax/productonoff.php @@ -35,6 +35,7 @@ $id=GETPOST('id', 'int'); $value=GETPOST('value', 'int'); $object = new GenericObject($db); + /* * View */ @@ -43,16 +44,10 @@ top_httphead(); print ''."\n"; -// Registering the location of boxes -if (! empty($action) && ! empty($id)) -{ - //$entity = GETPOST('entity','int'); - - if ($user->rights->produit->creer) { - if ($action == 'setstatus') - $object->setValueFrom('tosell', $value, 'product', $id); - else if ($action == 'setstatus_buy') - $object->setValueFrom('tobuy', $value, 'product', $id); - - } +// Registering new values +if (! empty($action) && ! empty($id) && $user->rights->produit->creer) { + if ($action == 'setstatus') + $object->setValueFrom('tosell', $value, 'product', $id); + else if ($action == 'setstatus_buy') + $object->setValueFrom('tobuy', $value, 'product', $id); }