diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php index 39bef2c4d656..88fd2185d623 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php @@ -60,7 +60,7 @@ public function getData(array $arr_usr_ids = array(), array $options = array()) SELECT reg.obj_id, reg.usr_id, ' . ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED . ' AS reg_status, lp.status AS lp_status FROM obj_members AS reg LEFT JOIN ut_lp_marks AS lp on lp.obj_id = reg.obj_id AND lp.usr_id = reg.usr_id - WHERE ' . $this->dic->database()->in('reg.usr_id', $arr_usr_ids, false, 'integer') . ' + WHERE ' . $this->dic->database()->in('reg.usr_id', $arr_usr_ids, false, 'integer') . ' AND (reg.admin = 1 OR reg.tutor = 1 OR reg.member = 1) UNION SELECT obj_id, usr_id, ' . ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST . ' AS reg_status, 0 AS lp_status FROM crs_waiting_list AS waiting WHERE ' . $this->dic->database()->in('waiting.usr_id', $arr_usr_ids, false, 'integer') . ' @@ -181,6 +181,10 @@ protected function createWhereStatement(array $arr_filter) ->quote($arr_filter['org_unit'], 'integer') . ')'; } + if (isset($arr_filter['usr_id']) && is_numeric($arr_filter['usr_id'])) { + $where[] = 'usr_id = ' . $this->dic->database()->quote($arr_filter['usr_id'], \ilDBConstants::T_INTEGER); + } + if (!empty($where)) { return ' WHERE ' . implode(' AND ', $where) . ' '; } else { diff --git a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php index 2c9f9f63260a..4912aa908ec8 100644 --- a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php +++ b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php @@ -38,7 +38,8 @@ class ilMStShowUserCoursesTableGUI extends ilTable2GUI * @var ilMyStaffAccess */ protected $access; - + /** @var null|array */ + protected $columnDefinition = null; /** * @param ilMStShowUserCoursesGUI $parent_obj @@ -182,6 +183,10 @@ public function getSelectableColumns() { global $DIC; + if ($this->columnDefinition !== null) { + return $this->columnDefinition; + } + $cols = array(); $cols['crs_title'] = array( @@ -205,7 +210,9 @@ public function getSelectableColumns() ); } - return $cols; + $this->columnDefinition = $cols; + + return $this->columnDefinition; }