From 244d30faa96c0d9f5257f47c1ee53fcf1acee364 Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Mon, 1 Aug 2022 22:56:28 +0200 Subject: [PATCH] Bugfix display of open tickets in sidebar --- www/lib/class.erpapi.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index b81f26bf..7e4c28d2 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -2631,7 +2631,8 @@ public function NavigationHooks(&$menu) public function AnzahlOffeneTickets($eigene=true) { - return (int)$this->app->DB->Select("SELECT COUNT(t.id) FROM ticket t WHERE t.status = 'neu' AND (t.warteschlange = 0 OR t.warteschlange IN (SELECT w.adresse FROM warteschlangen w WHERE w.adresse = '".$this->app->User->GetAdresse()."'))"); + $sql = "SELECT COUNT(t.id) FROM ticket t WHERE t.status = 'neu' AND ((t.warteschlange = '') OR (t.warteschlange IN (SELECT w.label FROM warteschlangen w WHERE w.adresse = '".$this->app->User->GetAdresse()."')))"; + return (int)$this->app->DB->Select($sql); }