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);
86 if ($options[
'sort']) {
87 $union_query .=
" ORDER BY " . $options[
'sort'][
'field'] .
" " . $options[
'sort'][
'direction'];
90 if (isset($options[
'limit'][
'start']) && isset($options[
'limit'][
'end'])) {
91 $union_query .=
" LIMIT " . $options[
'limit'][
'start'] .
"," . $options[
'limit'][
'end'];
94 $set = $this->dic->database()->query($union_query);
97 while ($rec = $this->dic->database()->fetchAssoc($set)) {
99 intval($rec[
'skill_node_id']),
106 intval($rec[
'user_id'])
117 if (!empty($filters[
'skill'])) {
118 $wheres[] =
"sktree.title LIKE '%" . $filters[
'skill'] .
"%'";
121 if (!empty($filters[
'skill_level'])) {
122 $wheres[] =
"lvl.title LIKE '%" . $filters[
'skill_level'] .
"%'";
125 if (!empty($filters[
'user'])) {
126 $wheres[] =
"(" . $this->dic->database()->like(
129 "%" . $filters[
'user'] .
"%" 130 ) .
" " .
"OR " . $this->dic->database()
134 "%" . $filters[
'user'] .
"%" 135 ) .
" " .
"OR " . $this->dic->database()
139 "%" . $filters[
'user'] .
"%" 140 ) .
" " .
"OR " . $this->dic->database()
144 "%" . $filters[
'user'] .
"%" 148 if (!empty($filters[
'org_unit'])) {
149 $wheres[] =
'ud.usr_id IN (SELECT user_id FROM il_orgu_ua WHERE orgu_id = ' .
150 $this->dic->database()->quote($filters[
'org_unit'],
'integer') .
')';
153 return empty($wheres) ?
'' :
' AND ' . implode(
' AND ', $wheres);
Customizing of pimple-DIC for ILIAS.
const OP_VIEW_COMPETENCES
__construct(Container $dic)
ilMStListCompetencesSkills constructor.
getAdditionalWhereStatement(array $filters)