From a54fe826f6b40faa7d15e49c052f2a6c38a8caeb Mon Sep 17 00:00:00 2001 From: Beppe Date: Mon, 3 Feb 2020 15:21:34 +0100 Subject: [PATCH] Miglioramento filtro nazione --- modules/anagrafiche/ajax/select.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/anagrafiche/ajax/select.php b/modules/anagrafiche/ajax/select.php index 6187c6f20..a77cc5a0e 100644 --- a/modules/anagrafiche/ajax/select.php +++ b/modules/anagrafiche/ajax/select.php @@ -283,7 +283,7 @@ switch ($resource) { break; case 'nazioni': - $query = 'SELECT id AS id, CONCAT_WS(\' - \', iso2, nome) AS descrizione FROM an_nazioni |where| ORDER BY CASE WHEN iso2=\'IT\' THEN -1 ELSE iso2 END'; + $query = 'SELECT id AS id, iso2, CONCAT_WS(\' - \', iso2, nome) AS descrizione FROM an_nazioni |where| ORDER BY CASE WHEN iso2=\'IT\' THEN -1 ELSE iso2 END'; foreach ($elements as $element) { $filter[] = 'id='.prepare($element); @@ -291,6 +291,8 @@ switch ($resource) { if (!empty($search)) { $search_fields[] = 'nome LIKE '.prepare('%'.$search.'%'); + $search_fields[] = 'iso2 LIKE '.prepare('%'.$search.'%'); + $search_fields[] = 'CONCAT_WS(\' - \', iso2, nome) LIKE '.prepare('%'.$search.'%'); } break;