49 $select =
'SELECT sktree.title as skill_title, skill_node_id, ulvl.trigger_obj_id, ulvl.user_id, login, firstname, lastname, email, lvl.title as skill_level';
52 ' FROM skl_personal_skill sk ' .
53 ' INNER JOIN usr_data ud ON ud.usr_id = sk.user_id ' .
54 ' INNER JOIN skl_tree_node sktree ON sktree.obj_id = sk.skill_node_id ' .
55 ' INNER JOIN (SELECT user_id, trigger_obj_id, skill_id, MAX(level_id) AS level_id ' .
56 ' FROM skl_user_has_level WHERE self_eval = 0 GROUP BY skill_id, user_id) ulvl ON sk.skill_node_id = ulvl.skill_id AND sk.user_id = ulvl.user_id ' .
57 ' INNER JOIN skl_level lvl ON lvl.id = ulvl.level_id ' .
60 $users_per_position = ilMyStaffAccess::getInstance()->getUsersForUserPerPosition($this->dic->user()->getId());
62 if (empty($users_per_position)) {
67 foreach ($users_per_position as $position_id => $users) {
68 $obj_ids = ilMyStaffAccess::getInstance()->getIdsForUserAndOperation(
69 $this->dic->user()->getId(),
72 $arr_query[] = $query . $this->dic->database()->in(
73 'ulvl.trigger_obj_id',
77 ) .
" AND " . $this->dic->database()->in(
'sk.user_id ', $users,
false,
'integer')
81 $union_query =
"SELECT * FROM ((" . implode(
') UNION (', $arr_query) .
")) as a_table";
83 $set = $this->dic->database()->query($union_query);
84 $numRows = $this->dic->database()->numRows($set);
91 $sort_field = (string) (
$options[
'sort'][
'field'] ??
'');
93 $union_query .=
" ORDER BY " . $this->dic->database()->quoteIdentifier($sort_field) .
" " . $sort_direction;
97 $union_query .=
" LIMIT " . (
int)
$options[
'limit'][
'start'] .
"," . (
int)
$options[
'limit'][
'end'];
100 $set = $this->dic->database()->query($union_query);
103 while ($rec = $this->dic->database()->fetchAssoc($set)) {
105 intval($rec[
'skill_node_id']),
112 intval($rec[
'user_id'])
123 if (!empty($filters[
'skill'])) {
124 $wheres[] = $this->dic->database()->like(
127 "%" . $filters[
'skill'] .
"%"
131 if (!empty($filters[
'skill_level'])) {
132 $wheres[] = $this->dic->database()->like(
135 "%" . $filters[
'skill_level'] .
"%"
139 if (!empty($filters[
'user'])) {
140 $wheres[] =
"(" . $this->dic->database()->like(
143 "%" . $filters[
'user'] .
"%"
144 ) .
" " .
"OR " . $this->dic->database()
148 "%" . $filters[
'user'] .
"%"
149 ) .
" " .
"OR " . $this->dic->database()
153 "%" . $filters[
'user'] .
"%"
154 ) .
" " .
"OR " . $this->dic->database()
158 "%" . $filters[
'user'] .
"%"
162 if (!empty($filters[
'org_unit'])) {
163 $wheres[] =
'ud.usr_id IN (SELECT user_id FROM il_orgu_ua WHERE orgu_id = ' .
164 $this->dic->database()->quote($filters[
'org_unit'],
'integer') .
')';
167 return empty($wheres) ?
'' :
' AND ' . implode(
' AND ', $wheres);
172 return strtolower($sort_direction) ===
'asc'
Customizing of pimple-DIC for ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilMStListCompetencesSkills.
getSafeSortDirection(string $sort_direction)
getAdditionalWhereStatement(array $filters)
__construct(Container $dic)
ilMStListCompetencesSkills constructor.
const OP_VIEW_COMPETENCES