From cf91674f568aa7ad062f5f45aa0feff05d7f0ea3 Mon Sep 17 00:00:00 2001 From: tnegre Date: Thu, 7 Nov 2024 10:42:03 +0100 Subject: [PATCH] move control after filtering --- htdocs/ticket/list.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 9557a72384b33..f90a02d89cdc6 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -402,6 +402,12 @@ continue; } elseif ($key == 'type_code') { $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(',', $search[$key]) : array()); + $newarrayoftypecodes = array_filter( + $newarrayoftypecodes, + function ($var) { + return !(empty($var) && $var !== '0'); + } + ); if (count($newarrayoftypecodes)) { $sql .= natural_search($key, join(',', $newarrayoftypecodes), 3); } @@ -836,7 +842,7 @@ print ''; } elseif ($key == 'type_code') { print ''; - $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 0, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'), 1); + $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'), 1); print ''; } elseif ($key == 'category_code') { print '';