From 4f818ccb423075a764dff136734cb2c4ece79c4f Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 3 Oct 2017 11:31:02 +0200 Subject: [PATCH] - Changed method getMessagesByPerson Message_model to use the given oe_kurzbz as root of the organisation unit tree - Changed methods getStudiengangBewerbung and getAppliedStudiengangFromNowOE of model Message_model to use the given oe_kurzbz as root of the organisation unit tree - Changed methods getMessagesByUID, getCountUnreadMessages and getMessagesByPerson of model Recipient_model to use the given oe_kurzbz as root of the organisation unit tree --- application/models/organisation/Studiengang_model.php | 6 ++---- application/models/system/Message_model.php | 3 +-- application/models/system/Recipient_model.php | 9 +++------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 36e4b6992..a091c9059 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -182,8 +182,7 @@ class Studiengang_model extends DB_Model ( SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o - WHERE o.oe_parent_kurzbz IS NULL - AND o.oe_kurzbz = '.$this->escape($oe_kurzbz).' + WHERE o.oe_kurzbz = '.$this->escape($oe_kurzbz).' UNION ALL SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o INNER JOIN organizations orgs ON (o.oe_parent_kurzbz = orgs._pk) @@ -358,8 +357,7 @@ class Studiengang_model extends DB_Model ( SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o - WHERE o.oe_parent_kurzbz IS NULL - AND o.oe_kurzbz = '.$this->escape($oe_kurzbz).' + WHERE o.oe_kurzbz = '.$this->escape($oe_kurzbz).' UNION ALL SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o INNER JOIN organizations orgs ON (o.oe_parent_kurzbz = orgs._pk) diff --git a/application/models/system/Message_model.php b/application/models/system/Message_model.php index b94bc3861..a99716022 100644 --- a/application/models/system/Message_model.php +++ b/application/models/system/Message_model.php @@ -72,8 +72,7 @@ class Message_model extends DB_Model ( SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o - WHERE o.oe_parent_kurzbz IS NULL - AND o.oe_kurzbz = ? + WHERE o.oe_kurzbz = ? UNION ALL SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o INNER JOIN organizations orgs ON (o.oe_parent_kurzbz = orgs._pk) diff --git a/application/models/system/Recipient_model.php b/application/models/system/Recipient_model.php index c0fa75da2..40ef39f65 100644 --- a/application/models/system/Recipient_model.php +++ b/application/models/system/Recipient_model.php @@ -146,8 +146,7 @@ class Recipient_model extends DB_Model ( SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o - WHERE o.oe_parent_kurzbz IS NULL - AND o.oe_kurzbz = ? + WHERE o.oe_kurzbz = ? UNION ALL SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o INNER JOIN organizations orgs ON (o.oe_parent_kurzbz = orgs._pk) @@ -225,8 +224,7 @@ class Recipient_model extends DB_Model ( SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o - WHERE o.oe_parent_kurzbz IS NULL - AND o.oe_kurzbz = ? + WHERE o.oe_kurzbz = ? UNION ALL SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o INNER JOIN organizations orgs ON (o.oe_parent_kurzbz = orgs._pk) @@ -346,8 +344,7 @@ class Recipient_model extends DB_Model ( SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o - WHERE o.oe_parent_kurzbz IS NULL - AND o.oe_kurzbz = ? + WHERE o.oe_kurzbz = ? UNION ALL SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o INNER JOIN organizations orgs ON (o.oe_parent_kurzbz = orgs._pk)