From 889dbec97b12f813a54af41902d1a11aa7f82fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 15:07:38 +0200 Subject: [PATCH] Use javascript On/Off tosell-tobuy if enabled --- htdocs/product/stock/product.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index a2096c49f14..ae8afe696bc 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -276,15 +276,23 @@ if ($id > 0 || $ref) print ''.$langs->trans("Label").''.$product->libelle.''; print ''; - // Status (to sell) - print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; - print $product->getLibStatut(2,0); - print ''; + // Status (to sell) + print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_productonoff($product->id, 'status'); + } else { + print $product->getLibStatut(2,0); + } + print ''; - // Status (to buy) - print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - print $product->getLibStatut(2,1); - print ''; + // Status (to buy) + print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_productonoff($product->id, 'status_buy'); + } else { + print $product->getLibStatut(2,1); + } + print ''; if ($conf->productbatch->enabled) { print ''.$langs->trans("Status").' ('.$langs->trans("l_sellby").')';