Sprache bei Templatetext

This commit is contained in:
Paminger
2016-07-13 07:56:19 +02:00
parent 483d133fc1
commit ed6f9fa676
5 changed files with 25 additions and 10 deletions
@@ -11,25 +11,30 @@ class Organisationseinheit_model extends DB_Model
$this->pk = 'oe_kurzbz';
}
public function getRecursiveList()
public function getRecursiveList($typ)
{
$qry = "WITH RECURSIVE tree (oe_kurzbz, bezeichnung,path) AS
$qry = "WITH RECURSIVE tree (oe_kurzbz, bezeichnung, path, organisationseinheittyp_kurzbz) AS
(
SELECT
oe_kurzbz,
bezeichnung||' ('||organisationseinheittyp_kurzbz||')' AS bezeichnung,
oe_kurzbz||'|' AS path
oe_kurzbz||'|' AS path,
organisationseinheittyp_kurzbz
FROM tbl_organisationseinheit
WHERE oe_parent_kurzbz IS NULL AND aktiv
UNION ALL
SELECT
oe.oe_kurzbz,
oe.bezeichnung||' ('||oe.organisationseinheittyp_kurzbz||')' AS bezeichnung,
tree.path ||oe.oe_kurzbz||'|' AS path
tree.path ||oe.oe_kurzbz||'|' AS path,
oe.organisationseinheittyp_kurzbz
FROM tree
JOIN tbl_organisationseinheit oe ON (tree.oe_kurzbz=oe.oe_parent_kurzbz)
)
SELECT oe_kurzbz AS value, substring(regexp_replace(path, '[A-z]+\|', '-','g')||bezeichnung,2) AS name, path FROM tree ORDER BY path;";
SELECT oe_kurzbz AS value, substring(regexp_replace(path, '[A-z]+\|', '-','g')||bezeichnung,2) AS name, path FROM tree ";
if (!empty($typ))
$qry .= 'WHERE organisationseinheittyp_kurzbz IN ('.$typ.') ';
$qry .= 'ORDER BY path;';
if ($res = $this->db->query($qry))