From 0b4a1d9b653923ff29c0797df9b5f4fde63f6cc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Jul 2017 02:49:40 +0200 Subject: [PATCH] Protection to avoid mass action execution when not required --- htdocs/commande/list.php | 15 ++++++++++++++- htdocs/modulebuilder/template/myobject_list.php | 5 +++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 49496fbcaf7..9e0b04ab6e9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -191,6 +191,11 @@ if (empty($reshook)) $toselect=''; $search_array_options=array(); } + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') + || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } // Mass actions $objectclass='Commande'; @@ -776,7 +781,15 @@ if ($resql) print $langs->trans('ValidateInvoices'); print ''; print ''; - print $form->selectyesno('valdate_invoices', 0, 1); + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + print $form->selectyesno('valdate_invoices', 0, 1, 1); + print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; + } + else + { + print $form->selectyesno('valdate_invoices', 0, 1); + } print ''; print ''; print ''; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index c56ce1e8ea1..6ff6b9a7904 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -163,6 +163,11 @@ if (empty($reshook)) $toselect=''; $search_array_options=array(); } + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') + || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } // Mass actions $objectclass='MyObject';