Fix filter warehouse list on status

This commit is contained in:
Francis Appels 2020-08-04 17:25:35 +02:00
parent 81467e1d09
commit 587ca48312

View File

@ -50,7 +50,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_ref = GETPOST("sref", "alpha") ?GETPOST("sref", "alpha") : GETPOST("search_ref", "alpha");
$search_label = GETPOST("snom", "alpha") ?GETPOST("snom", "alpha") : GETPOST("search_label", "alpha");
$search_status = GETPOST("search_status", "int");
$search_status = GETPOST("search_statut", "int");
if (!empty($conf->categorie->enabled))
{
@ -232,7 +232,7 @@ foreach ($search as $key => $val)
if ($search[$key] == '-1') $search[$key] = '';
$mode_search = 2;
}
if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : 't.' . $key), $search[$key], (($key == 'status') ? 2 : $mode_search));
if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : 't.' . $key), $search[$key], (($key == 'statut') ? 2 : $mode_search));
}
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
// Add where from extra fields
@ -449,7 +449,7 @@ print $hookmanager->resPrint;
// Status
if (!empty($arrayfields['t.statut']['checked'])) {
print '<td class="liste_titre right">';
print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1);
print $form->selectarray('search_statut', $warehouse->statuts, $search_status, 1, 0, 0, '', 1);
print '</td>';
}