From 8f5dfcee2ead9659a732796f52226fb3208e9e00 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 7 Jul 2021 09:48:01 +0200 Subject: [PATCH] ilOrgUnit: OrgaUnit not showing in personal profile --- .../classes/PathStorage/class.ilOrgUnitPathStorage.php | 2 +- Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php index 677c960712de..f0158c83cd25 100644 --- a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php +++ b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php @@ -84,7 +84,7 @@ public static function getTextRepresentationOfUsersOrgUnits($user_id, $separator $ilDB = $DIC['ilDB']; ilObjOrgUnitTree::_getInstance()->buildTempTableWithUsrAssignements(); - $res = $ilDB->queryF("SELECT " . $ilDB->groupConcat("path", $separator) . " AS orgus FROM orgu_usr_assignements WHERE user_id = %s GROUP BY user_id;", array('integer'), array($user_id)); + $res = $ilDB->queryF("SELECT " . $ilDB->groupConcat("title", $separator) . " AS orgus FROM orgu_usr_assignements WHERE user_id = %s GROUP BY user_id;", array('integer'), array($user_id)); $dat = $ilDB->fetchObject($res); return $dat->orgus ? $dat->orgus : '-'; diff --git a/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php b/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php index c5b0baf3ffbf..11cee55f205a 100644 --- a/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php +++ b/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php @@ -484,13 +484,21 @@ public function buildTempTableWithUsrAssignements($temporary_table_name = 'orgu_ throw new ilException('there is already a temporary table for org-unit assignement: ' . self::$temporary_table_name); } - $q = "CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name . " AS ( + /* $q = "CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name . " AS ( SELECT DISTINCT object_reference.ref_id AS ref_id, il_orgu_ua.user_id AS user_id, orgu_path_storage.path AS path FROM il_orgu_ua JOIN object_reference ON object_reference.ref_id = il_orgu_ua.orgu_id JOIN object_data ON object_data.obj_id = object_reference.obj_id JOIN orgu_path_storage ON orgu_path_storage.ref_id = object_reference.ref_id WHERE object_data.type = 'orgu' AND object_reference.deleted IS NULL + );"; */ + + $q = "CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name . " AS ( + SELECT DISTINCT object_reference.ref_id AS ref_id, il_orgu_ua.user_id AS user_id, object_data.title AS title + FROM il_orgu_ua + JOIN object_reference ON object_reference.ref_id = il_orgu_ua.orgu_id + JOIN object_data ON object_data.obj_id = object_reference.obj_id + WHERE object_data.type = 'orgu' AND object_reference.deleted IS NULL );"; $this->db->manipulate($q);