From d4052f7b9c1e9fcec36247b05a2c148018e7f1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Fri, 5 Jul 2013 12:10:45 +0200 Subject: [PATCH] warning message if you try to create orders without selecting any product --- htdocs/langs/en_US/stocks.lang | 1 + htdocs/langs/fr_FR/stocks.lang | 1 + htdocs/product/stock/replenish.php | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index bbc5a6fe261..5f6b45cff1e 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -94,3 +94,4 @@ Replenishment=Replenishment ReplenishmentOrders=Replenishment orders UseVirtualStock=Use virtual stock instead of physical stock RuleForStockReplenishment=Rule for stocks replenishment +SelectProduct=Select at least one product diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index efdfa28a6da..643bcc955fa 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -94,3 +94,4 @@ Replenishment=Réapprovisionnement ReplenishmentOrders=Commandes de réapprovisionnement UseVirtualStock=Utiliser le stock théorique à la place du stock physique RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks +SelectProduct=Sélectionnez au moins un produit diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 65ef6f33415..cdb8e63077c 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -71,12 +71,14 @@ $offset = $limit * $page ; //could go in the lib if ($action == 'order') { $linecount = GETPOST('linecount', 'int'); + $box = 0; unset($_POST['linecount']); if ($linecount > 0) { $suppliers = array(); for ($i = 0; $i < $linecount; $i++) { if(GETPOST($i, 'alpha') === 'on' && GETPOST('fourn' . $i, 'int') > 0) { //one line + $box = $i; $supplierpriceid = GETPOST('fourn'.$i, 'int'); //get all the parameters needed to create a line $qty = GETPOST('tobuy'.$i, 'int'); @@ -135,6 +137,9 @@ if ($action == 'order') { header('Location: replenishorders.php'); exit; } + } + if ($box == 0){ + setEventMessage($langs->trans('SelectProduct'), 'warnings'); } }