Update productonoff.php

This commit is contained in:
Frédéric FRANCE 2014-10-12 16:30:58 +02:00
parent f5f50045d6
commit 33bb150b44

View File

@ -35,6 +35,7 @@ $id=GETPOST('id', 'int');
$value=GETPOST('value', 'int');
$object = new GenericObject($db);
/*
* View
*/
@ -43,16 +44,10 @@ top_httphead();
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\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);
}