mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
- Fixed bug when inactive parents are not retrieved even when includeinactive = true
This commit is contained in:
@@ -119,7 +119,7 @@ class Organisationseinheit_model extends DB_Model
|
||||
/**
|
||||
* Liefert die ChildNodes einer Organisationseinheit
|
||||
* @param $oe_kurzbz
|
||||
* @param bool $includeinactive - wether to include inactive parent oes
|
||||
* @param bool $includeinactive wether to include inactive parent oes
|
||||
* @return array mit den Childs inkl dem Uebergebenen Element
|
||||
*/
|
||||
public function getChilds($oe_kurzbz, $includeinactive = false)
|
||||
@@ -131,19 +131,20 @@ class Organisationseinheit_model extends DB_Model
|
||||
WHERE oe_kurzbz=? %s
|
||||
UNION ALL
|
||||
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
|
||||
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz
|
||||
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz %s
|
||||
)
|
||||
SELECT oe_kurzbz
|
||||
FROM oes
|
||||
GROUP BY oe_kurzbz;";
|
||||
|
||||
return $this->execQuery(sprintf($query, $includeinactive === true ? "" : "AND aktiv = true"), array($oe_kurzbz));
|
||||
$aktivstring = $includeinactive === true ? "" : "AND aktiv = true";
|
||||
return $this->execQuery(sprintf($query, $aktivstring, $aktivstring), array($oe_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert die OEs die im Tree ueberhalb der uebergebene OE liegen
|
||||
* @param $oe_kurzbz
|
||||
* @param bool $includeinactive - wether to include inactive parent oes
|
||||
* @param bool $includeinactive wether to include inactive parent oes
|
||||
* @return array|null
|
||||
*/
|
||||
public function getParents($oe_kurzbz, $includeinactive = false)
|
||||
@@ -155,12 +156,13 @@ class Organisationseinheit_model extends DB_Model
|
||||
WHERE oe_kurzbz=? %s
|
||||
UNION ALL
|
||||
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
|
||||
WHERE o.oe_kurzbz=oes.oe_parent_kurzbz and aktiv = true
|
||||
WHERE o.oe_kurzbz=oes.oe_parent_kurzbz %s
|
||||
)
|
||||
SELECT oe_kurzbz
|
||||
FROM oes";
|
||||
|
||||
return $this->execQuery(sprintf($query, $includeinactive === true ? "" : "AND aktiv = true"), array($oe_kurzbz));
|
||||
$aktivstring = $includeinactive === true ? "" : "AND aktiv = true";
|
||||
return $this->execQuery(sprintf($query, $aktivstring, $aktivstring), array($oe_kurzbz));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user