Skip to content

Commit

Permalink
Protection to avoid mass action execution when not required
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 13, 2017
1 parent 9127892 commit 0b4a1d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 14 additions & 1 deletion htdocs/commande/list.php
Expand Up @@ -191,6 +191,11 @@
$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';
Expand Down Expand Up @@ -776,7 +781,15 @@
print $langs->trans('ValidateInvoices');
print '</td>';
print '<td>';
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 '</td>';
print '</tr>';
print '</table>';
Expand Down
5 changes: 5 additions & 0 deletions htdocs/modulebuilder/template/myobject_list.php
Expand Up @@ -163,6 +163,11 @@
$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';
Expand Down

0 comments on commit 0b4a1d9

Please sign in to comment.