24 if (!empty(
$options[
'filters'][
'lp_status']) ||
$options[
'filters'][
'lp_status'] === 0) {
38 $select =
'SELECT crs_ref.ref_id AS crs_ref_id, crs.title AS crs_title, reg_status, lp_status, usr_data.usr_id AS usr_id, usr_data.login AS usr_login, usr_data.lastname AS usr_lastname, usr_data.firstname AS usr_firstname, usr_data.email AS usr_email FROM ( 41 LEFT JOIN ut_lp_marks AS lp on lp.obj_id = reg.obj_id AND lp.usr_id = reg.usr_id 42 WHERE ' . $DIC->database()->in(
'reg.usr_id', $arr_usr_ids,
false,
'integer') .
' 45 WHERE ' . $DIC->database()->in(
'waiting.usr_id', $arr_usr_ids,
false,
'integer') .
' 48 WHERE ' . $DIC->database()->in(
'requested.usr_id', $arr_usr_ids,
false,
'integer') .
' 51 INNER JOIN object_data AS crs on crs.obj_id = memb.obj_id AND crs.type = ' . $DIC->database()
52 ->quote(ilMyStaffAccess::DEFAULT_CONTEXT,
'text') .
' 53 INNER JOIN object_reference AS crs_ref on crs_ref.obj_id = crs.obj_id 54 INNER JOIN usr_data on usr_data.usr_id = memb.usr_id AND usr_data.active = 1';
56 $select .= static::createWhereStatement($arr_usr_ids,
$options[
'filters'], $tmp_table_user_matrix);
59 $result = $DIC->database()->query($select);
61 return $DIC->database()->numRows(
$result);
65 $select .=
" ORDER BY " .
$options[
'sort'][
'field'] .
" " .
$options[
'sort'][
'direction'];
69 $select .=
" LIMIT " .
$options[
'limit'][
'start'] .
"," .
$options[
'limit'][
'end'];
71 $result = $DIC->database()->query($select);
74 while ($crs = $DIC->database()->fetchAssoc(
$result)) {
76 $list_course->setCrsRefId($crs[
'crs_ref_id']);
77 $list_course->setCrsTitle($crs[
'crs_title']);
78 $list_course->setUsrRegStatus($crs[
'reg_status']);
79 $list_course->setUsrLpStatus($crs[
'lp_status']);
80 $list_course->setUsrLogin($crs[
'usr_login']);
81 $list_course->setUsrLastname($crs[
'usr_lastname']);
82 $list_course->setUsrFirstname($crs[
'usr_firstname']);
83 $list_course->setUsrEmail($crs[
'usr_email']);
84 $list_course->setUsrId($crs[
'usr_id']);
86 $crs_data[] = $list_course;
108 $where[] =
'(crs_ref.ref_id, usr_data.usr_id) IN (SELECT * FROM ' . $tmp_table_user_matrix .
')';
110 if (count($arr_usr_ids)) {
111 $where[] = $DIC->database()->in(
'usr_data.usr_id', $arr_usr_ids,
false,
'integer');
114 if (!empty($arr_filter[
'crs_title'])) {
115 $where[] =
'(crs.title LIKE ' . $DIC->database()->quote(
'%' . $arr_filter[
'crs_title'] .
'%',
'text') .
')';
118 if ($arr_filter[
'course'] > 0) {
119 $where[] =
'(crs_ref.ref_id = ' . $DIC->database()->quote($arr_filter[
'course'],
'integer') .
')';
122 if (!empty($arr_filter[
'lp_status']) || $arr_filter[
'lp_status'] === 0) {
123 switch ($arr_filter[
'lp_status']) {
126 $where[] =
'(lp_status = ' . $DIC->database()->quote($arr_filter[
'lp_status'],
'integer') .
' OR lp_status is NULL)';
129 $where[] =
'(lp_status = ' . $DIC->database()->quote($arr_filter[
'lp_status'],
'integer') .
')';
134 if (!empty($arr_filter[
'memb_status'])) {
135 $where[] =
'(reg_status = ' . $DIC->database()->quote($arr_filter[
'memb_status'],
'integer') .
')';
138 if (!empty($arr_filter[
'user'])) {
139 $where[] =
"(" . $DIC->database()->like(
"usr_data.login",
"text",
"%" . $arr_filter[
'user'] .
"%") .
" " .
"OR " . $DIC->database()
140 ->like(
"usr_data.firstname",
"text",
"%" . $arr_filter[
'user'] .
"%") .
" " .
"OR " . $DIC->database()
141 ->like(
"usr_data.lastname",
"text",
"%" . $arr_filter[
'user'] .
"%") .
" " .
"OR " . $DIC->database()
142 ->like(
"usr_data.email",
"text",
"%" . $arr_filter[
'user'] .
"%") .
") ";
145 if (!empty($arr_filter[
'org_unit'])) {
146 $where[] =
'usr_data.usr_id IN (SELECT user_id FROM il_orgu_ua WHERE orgu_id = ' . $DIC->database()
147 ->quote($arr_filter[
'org_unit'],
'integer') .
')';
150 if (!empty($where)) {
151 return ' WHERE ' . implode(
' AND ', $where) .
' ';
const MEMBERSHIP_STATUS_REGISTERED
const OP_READ_LEARNING_PROGRESS
const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX
Create styles array
The data for the language used.
static getData(array $arr_usr_ids=array(), array $options=array())
const LP_STATUS_NOT_ATTEMPTED_NUM
const OP_ACCESS_ENROLMENTS
static createWhereStatement(array $arr_usr_ids, array $arr_filter, $tmp_table_user_matrix)
Returns the WHERE Part for the Queries using parameter $user_ids AND local variable $filters...
const MEMBERSHIP_STATUS_WAITINGLIST
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
const MEMBERSHIP_STATUS_REQUESTED