From d5b66aae82f6792cfda0838df60a74a0e45bfc5d Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Thu, 30 Jun 2022 14:33:48 +0200 Subject: [PATCH] bugfix ajax filter for ansprechpartneradresse filters now with adress 0 = none --- www/pages/ajax.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/www/pages/ajax.php b/www/pages/ajax.php index 5caa8a73..33234a83 100644 --- a/www/pages/ajax.php +++ b/www/pages/ajax.php @@ -1652,6 +1652,7 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku } $limit = ''; + if($adressId <= 0){ $adresse = explode(' ', $adressId); $adressId = $this->app->DB->Select("SELECT id FROM adresse WHERE name = '".$adresse[0]."' AND name != '' LIMIT 1"); @@ -1660,18 +1661,18 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku } } - if($adressId > 0){ +// if($adressId > 0){ $subwhere = " AND a.id = '$adressId'"; - }else{ - $subwhere = ''; - } +// }else{ +// $subwhere = ''; +// } $felder = array('an.name'); $subwhere2 = $this->AjaxFilterWhere($termorig,$felder); $arr = $this->app->DB->SelectArr("SELECT DISTINCT CONCAT(an.id, ' ', an.name, ' ', IF(a.lieferantennummer,CONCAT('(', a.name, ', Kdr: ', a.kundennummer, ' Liefr: ', a.lieferantennummer, ')'), CONCAT('(', a.name, ', Kdr: ', a.kundennummer, ')'))) AS name FROM ansprechpartner an - LEFT JOIN adresse a ON an.adresse = a.id + INNER JOIN adresse a ON an.adresse = a.id WHERE ($subwhere2) AND a.id > 0 AND a.geloescht = 0 $subwhere ".$this->app->erp->ProjektRechte('a.projekt').$limit); $carr = !empty($arr)?count($arr):0; for($i = 0; $i < $carr; $i++) {