From 46eedeafe82073253709d07eb166915078f8c7fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Mar 2017 11:30:46 +0100 Subject: [PATCH] Fix message shown to many times --- htdocs/core/ajax/box.php | 5 ++++- htdocs/core/class/html.formother.class.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index be4d9231c5f..fbb8fc759ad 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -73,7 +73,10 @@ if ($boxorder && $zone != '' && $userid > 0) if ($result > 0) { $langs->load("boxes"); - setEventMessages($langs->trans("BoxAdded"), null); + if (empty(GETPOST('closing'))) + { + setEventMessages($langs->trans("BoxAdded"), null); + } } } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index bcad9dbac44..5f8fe76e320 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1046,7 +1046,7 @@ class FormOther if (boxorder==\'A:A-B:B\' && closing == 1) // There is no more boxes on screen, and we are after a delete of a box so we must hide title { jQuery.ajax({ - url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?closing=\'+closing+\'&boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', async: false }); // We force reload to be sure to get all boxes into list @@ -1055,7 +1055,7 @@ class FormOther else { jQuery.ajax({ - url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', + url: \''.DOL_URL_ROOT.'/core/ajax/box.php?closing=\'+closing+\'&boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.', async: true }); }