From 9bed55a029ec4c3ba86fe80ab02c6fb1177fb5db Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Wed, 1 Jun 2022 15:44:25 +0200 Subject: [PATCH] Fix ajax select fasce orarie --- modules/eventi/ajax/select.php | 2 +- modules/fasce_orarie/ajax/select.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/eventi/ajax/select.php b/modules/eventi/ajax/select.php index d1d9dab8c..618d7bcb9 100644 --- a/modules/eventi/ajax/select.php +++ b/modules/eventi/ajax/select.php @@ -20,7 +20,7 @@ include_once __DIR__.'/../../../core.php'; switch ($resource) { - case 'fasce_orarie': + case 'eventi': $query = 'SELECT id, nome AS descrizione FROM zz_events |where| ORDER BY nome ASC'; foreach ($elements as $element) { diff --git a/modules/fasce_orarie/ajax/select.php b/modules/fasce_orarie/ajax/select.php index 26261053e..645221792 100644 --- a/modules/fasce_orarie/ajax/select.php +++ b/modules/fasce_orarie/ajax/select.php @@ -26,6 +26,9 @@ switch ($resource) { foreach ($elements as $element) { $filter[] = 'id='.prepare($element); } + if (empty($filter)) { + $where[] = 'in_fasceorarie.deleted_at IS NULL'; + } if (!empty($search)) { $search_fields[] = 'nome LIKE '.prepare('%'.$search.'%');