Issue system: adapted to work with multiple apps per fehler

This commit is contained in:
Alexei Karpenko
2026-02-03 15:39:11 +01:00
parent 2de6278603
commit 10d52caa98
13 changed files with 226 additions and 108 deletions
@@ -15,18 +15,20 @@ class Fehlerkonfiguration_model extends DB_Model
/**
* Retrieve all set configuration parameters, optionally filtered by app.
* @param string $app
* @param string $apps
* @return object success or error
*/
public function getKonfiguration($apps = null)
{
if (is_string($apps)) $apps = [$apps];
$fehlerkonfiguration = array();
$apps = is_string($apps) ? [$apps] : $apps;
$this->addSelect('fehlercode, konfigurationstyp_kurzbz, konfiguration, fehler_kurzbz');
$this->addDistinct();
$this->addSelect('fehler.fehlercode, konftyp.konfigurationstyp_kurzbz, tbl_fehler_konfiguration.konfiguration, fehler.fehler_kurzbz');
$this->addJoin('system.tbl_fehler_konfigurationstyp konftyp', 'konfigurationstyp_kurzbz');
$this->addJoin('system.tbl_fehler fehler', 'fehlercode');
if (is_array($apps) && !isEmptyArray($apps)) $this->db->where_in('fehler.app', $apps);
$this->addJoin('system.tbl_fehler_app fe_app', 'fehlercode');
if (isset($apps) && !isEmptyArray($apps)) $this->db->where_in('fe_app.app', $apps);
$fehlerkonfigurationRes = $this->load();
if (isError($fehlerkonfigurationRes)) return $fehlerkonfigurationRes;