Fix message shown to many times

This commit is contained in:
Laurent Destailleur 2017-03-10 11:30:46 +01:00
parent 80702e4c0a
commit 46eedeafe8
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}
}
}

View File

@ -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
});
}