$action = 're-edit'; setEventMessage($object->error, 'errors'); } } } if (!$error) { header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . $object->id); exit; } } else { if ($action === 'save_composed_product') { $TProduct = GETPOST('TProduct', 'array'); if (!empty($TProduct)) { foreach ($TProduct as $id_product => $row) { if ($row['qty'] > 0) { $object->update_sousproduit($id, $id_product, $row['qty'], isset($row['incdec']) ? 1 : 0); } else { $object->del_sousproduit($id, $id_product); } } } $action = ''; } } /* * View */ $product_fourn = new ProductFournisseur($db); $productstatic = new Product($db); $form = new Form($db); // action recherche des produits par mot-cle et/ou par categorie