Class ilMStListCompetencesSkills.
More...
◆ __construct()
ilMStListCompetencesSkills::__construct |
( |
Container |
$dic | ) |
|
◆ getAdditionalWhereStatement()
ilMStListCompetencesSkills::getAdditionalWhereStatement |
( |
array |
$filters | ) |
|
|
protected |
- Parameters
-
- Returns
- string
Definition at line 110 of file class.ilMStListCompetencesSkills.php.
Referenced by getData().
114 if (!empty($filters[
'skill'])) {
115 $wheres[] =
"sktree.title LIKE '%" . $filters[
'skill'] .
"%'";
118 if (!empty($filters[
'skill_level'])) {
119 $wheres[] =
"lvl.title LIKE '%" . $filters[
'skill_level'] .
"%'";
122 if (!empty($filters[
'user'])) {
123 $wheres[] =
"(" . $this->dic->database()->like(
"ud.login",
"text",
"%" . $filters[
'user'] .
"%") .
" " .
"OR " . $this->dic->database()
124 ->like(
"ud.firstname",
"text",
"%" . $filters[
'user'] .
"%") .
" " .
"OR " . $this->dic->database()
125 ->like(
"ud.lastname",
"text",
"%" . $filters[
'user'] .
"%") .
" " .
"OR " . $this->dic->database()
126 ->like(
"ud.email",
"text",
"%" . $filters[
'user'] .
"%") .
") ";
129 if (!empty($arr_filter[
'org_unit'])) {
130 $wheres[] =
'ud.usr_id IN (SELECT user_id FROM il_orgu_ua WHERE orgu_id = ' .
131 $this->dic->database()->quote($filters[
'org_unit'],
'integer') .
')';
134 return empty($wheres) ?
'' :
' AND ' . implode(
' AND ', $wheres);
◆ getData()
ilMStListCompetencesSkills::getData |
( |
array |
$options | ) |
|
- Parameters
-
- Returns
- ilMStListCompetencesSkill[]
Definition at line 36 of file class.ilMStListCompetencesSkills.php.
References $data, $query, getAdditionalWhereStatement(), and ilOrgUnitOperation\OP_VIEW_COMPETENCES.
41 $select = $options[
'count'] ===
true ?
42 'SELECT count(*)' :
'SELECT sktree.title as skill_title, skill_node_id, ulvl.trigger_obj_id, user_id, login, firstname, lastname, lvl.title as skill_level';
45 ' FROM skl_personal_skill sk ' .
46 ' INNER JOIN usr_data ud ON ud.usr_id = sk.user_id ' .
47 ' INNER JOIN skl_tree_node sktree ON sktree.obj_id = sk.skill_node_id ' .
48 ' INNER JOIN (SELECT trigger_obj_id, skill_id, MAX(level_id) AS level_id ' .
49 ' FROM skl_user_has_level WHERE self_eval = 0 GROUP BY skill_id) ulvl ON sk.skill_node_id = ulvl.skill_id ' .
50 ' INNER JOIN skl_level lvl ON lvl.id = ulvl.level_id ' .
54 $users_per_position = ilMyStaffAccess::getInstance()->getUsersForUserPerPosition($this->dic->user()->getId());
56 if (empty($users_per_position)) {
57 if ($options[
"count"]) {
65 foreach ($users_per_position as $position_id => $users) {
66 $obj_ids = ilMyStaffAccess::getInstance()->getIdsForUserAndOperation($this->dic->user()->getId(), $operation_access);
67 $arr_query[] =
$query . $this->dic->database()->in(
'ulvl.trigger_obj_id', $obj_ids,
false,
'integer') .
" AND " . $this->dic->database()->in(
'sk.user_id ', $users,
false,
'integer')
71 $union_query =
"SELECT * FROM ((" . implode(
') UNION (', $arr_query) .
")) as a_table";
73 if ($options[
'count'] ===
true) {
74 $set = $this->dic->database()->query($union_query);
76 return $this->dic->database()->numRows($set);
79 if ($options[
'sort']) {
80 $union_query .=
" ORDER BY " . $options[
'sort'][
'field'] .
" " . $options[
'sort'][
'direction'];
83 if (isset($options[
'limit'][
'start']) && isset($options[
'limit'][
'end'])) {
84 $union_query .=
" LIMIT " . $options[
'limit'][
'start'] .
"," . $options[
'limit'][
'end'];
87 $set = $this->dic->database()->query($union_query);
90 while ($rec = $this->dic->database()->fetchAssoc($set)) {
const OP_VIEW_COMPETENCES
getAdditionalWhereStatement(array $filters)
◆ $dic
ilMStListCompetencesSkills::$dic |
|
protected |
The documentation for this class was generated from the following file: