ILIAS  release_8 Revision v8.24
ilPersonalSkill Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPersonalSkill:
+ Collaboration diagram for ilPersonalSkill:

Static Public Member Functions

static getSelectedUserSkills (int $a_user_id)
 
static addPersonalSkill (int $a_user_id, int $a_skill_node_id)
 
static removeSkill (int $a_user_id, int $a_skill_node_id)
 
static removeSkills (int $a_user_id)
 
static assignMaterial (int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill, int $a_level, int $a_wsp_id)
 Assign material to skill level. More...
 
static getAssignedMaterial (int $a_user_id, int $a_tref_id, int $a_level)
 Get assigned material (for a skill level and user) More...
 
static countAssignedMaterial (int $a_user_id, int $a_tref_id, int $a_level)
 Count assigned material (for a skill level and user) More...
 
static removeMaterial (int $a_user_id, int $a_tref_id, int $a_level_id, int $a_wsp_id)
 
static removeMaterials (int $a_user_id)
 
static saveSelfEvaluation (int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill, int $a_level)
 
static getSelfEvaluation (int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill)
 
static getSelfEvaluationDate (int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill)
 
static getUsageInfo (array $a_cskill_ids)
 
static getUsageInfo (array $a_cskill_ids)
 Get title of an assigned item. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Personal skill

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 25 of file class.ilPersonalSkill.php.

Member Function Documentation

◆ addPersonalSkill()

static ilPersonalSkill::addPersonalSkill ( int  $a_user_id,
int  $a_skill_node_id 
)
static

Definition at line 54 of file class.ilPersonalSkill.php.

54 : void
55 {
56 global $DIC;
57
58 $ilDB = $DIC->database();
59
60 $set = $ilDB->query(
61 "SELECT * FROM skl_personal_skill " .
62 " WHERE user_id = " . $ilDB->quote($a_user_id, "integer") .
63 " AND skill_node_id = " . $ilDB->quote($a_skill_node_id, "integer")
64 );
65 if (!$ilDB->fetchAssoc($set)) {
66 $ilDB->manipulate("INSERT INTO skl_personal_skill " .
67 "(user_id, skill_node_id) VALUES (" .
68 $ilDB->quote($a_user_id, "integer") . "," .
69 $ilDB->quote($a_skill_node_id, "integer") .
70 ")");
71 }
72 }
global $DIC
Definition: feed.php:28

References $DIC, and $ilDB.

Referenced by ilPersonalSkillsGUI\addSkill(), ilSkillAppEventListener\handleEvent(), ilTestSkillEvaluation\handleSkillTriggering(), ilContainerMemberSkills\publish(), ilSurveySkill\writeAndAddAppraiseeSkills(), ilSurveySkill\writeAndAddIndFeedbackSkills(), and ilSurveySkill\writeAndAddSelfEvalSkills().

+ Here is the caller graph for this function:

◆ assignMaterial()

static ilPersonalSkill::assignMaterial ( int  $a_user_id,
int  $a_top_skill,
int  $a_tref_id,
int  $a_basic_skill,
int  $a_level,
int  $a_wsp_id 
)
static

Assign material to skill level.

Parameters
int$a_user_iduser id
int$a_top_skillthe "selectable" top skill
int$a_tref_idtemplate reference id
int$a_basic_skillthe basic skill the level belongs to
int$a_levellevel id
int$a_wsp_idworkspace object

Definition at line 114 of file class.ilPersonalSkill.php.

121 : void {
122 global $DIC;
123
124 $ilDB = $DIC->database();
125
126 $set = $ilDB->query(
127 "SELECT * FROM skl_assigned_material " .
128 " WHERE user_id = " . $ilDB->quote($a_user_id, "integer") .
129 " AND top_skill_id = " . $ilDB->quote($a_top_skill, "integer") .
130 " AND tref_id = " . $ilDB->quote($a_tref_id, "integer") .
131 " AND skill_id = " . $ilDB->quote($a_basic_skill, "integer") .
132 " AND level_id = " . $ilDB->quote($a_level, "integer") .
133 " AND wsp_id = " . $ilDB->quote($a_wsp_id, "integer")
134 );
135 if (!$ilDB->fetchAssoc($set)) {
136 $ilDB->manipulate("INSERT INTO skl_assigned_material " .
137 "(user_id, top_skill_id, tref_id, skill_id, level_id, wsp_id) VALUES (" .
138 $ilDB->quote($a_user_id, "integer") . "," .
139 $ilDB->quote($a_top_skill, "integer") . "," .
140 $ilDB->quote($a_tref_id, "integer") . "," .
141 $ilDB->quote($a_basic_skill, "integer") . "," .
142 $ilDB->quote($a_level, "integer") . "," .
143 $ilDB->quote($a_wsp_id, "integer") .
144 ")");
145 }
146 }

References $ilDB.

Referenced by ilPersonalSkillsGUI\selectMaterial().

+ Here is the caller graph for this function:

◆ countAssignedMaterial()

static ilPersonalSkill::countAssignedMaterial ( int  $a_user_id,
int  $a_tref_id,
int  $a_level 
)
static

Count assigned material (for a skill level and user)

Definition at line 180 of file class.ilPersonalSkill.php.

180 : int
181 {
182 global $DIC;
183
184 $ilDB = $DIC->database();
185
186 $set = $ilDB->query(
187 "SELECT count(*) as cnt FROM skl_assigned_material " .
188 " WHERE level_id = " . $ilDB->quote($a_level, "integer") .
189 " AND tref_id = " . $ilDB->quote($a_tref_id, "integer") .
190 " AND user_id = " . $ilDB->quote($a_user_id, "integer")
191 );
192 $rec = $ilDB->fetchAssoc($set);
193 return (int) $rec["cnt"];
194 }

References $DIC, and $ilDB.

Referenced by ilPersonalSkillsGUI\getMaterials().

+ Here is the caller graph for this function:

◆ getAssignedMaterial()

static ilPersonalSkill::getAssignedMaterial ( int  $a_user_id,
int  $a_tref_id,
int  $a_level 
)
static

Get assigned material (for a skill level and user)

Returns
array{user_id: int, top_skill_id: int, skill_id: int, level_id: int, wsp_id: int, tref_id: int}[]

Definition at line 152 of file class.ilPersonalSkill.php.

152 : array
153 {
154 global $DIC;
155
156 $ilDB = $DIC->database();
157
158 $set = $ilDB->query(
159 "SELECT * FROM skl_assigned_material " .
160 " WHERE level_id = " . $ilDB->quote($a_level, "integer") .
161 " AND tref_id = " . $ilDB->quote($a_tref_id, "integer") .
162 " AND user_id = " . $ilDB->quote($a_user_id, "integer")
163 );
164 $mat = [];
165 while ($rec = $ilDB->fetchAssoc($set)) {
166 $rec['user_id'] = (int) $rec['user_id'];
167 $rec['top_skill_id'] = (int) $rec['top_skill_id'];
168 $rec['skill_id'] = (int) $rec['skill_id'];
169 $rec['level_id'] = (int) $rec['level_id'];
170 $rec['wsp_id'] = (int) $rec['wsp_id'];
171 $rec['tref_id'] = (int) $rec['tref_id'];
172 $mat[] = $rec;
173 }
174 return $mat;
175 }

References $DIC, $ilDB, and ILIAS\Repository\int().

Referenced by ilSkillAssignMaterialsTableGUI\fillRow(), and ilPersonalSkillsGUI\getMaterials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedUserSkills()

static ilPersonalSkill::getSelectedUserSkills ( int  $a_user_id)
static
Returns
array<int, array{skill_node_id: int, title: string}>

Definition at line 30 of file class.ilPersonalSkill.php.

30 : array
31 {
32 global $DIC;
33
34 $ilDB = $DIC->database();
35
36 $repo = $DIC->skills()->internal()->repo()->getTreeRepo();
37
38 $set = $ilDB->query(
39 "SELECT * FROM skl_personal_skill " .
40 " WHERE user_id = " . $ilDB->quote($a_user_id, "integer")
41 );
42 $pskills = [];
43 while ($rec = $ilDB->fetchAssoc($set)) {
44 if ($repo->isInAnyTree($rec["skill_node_id"])) {
45 $pskills[(int) $rec["skill_node_id"]] = array(
46 "skill_node_id" => (int) $rec["skill_node_id"],
47 "title" => ilSkillTreeNode::_lookupTitle($rec["skill_node_id"])
48 );
49 }
50 }
51 return $pskills;
52 }
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)

References $DIC, $ilDB, ilSkillTreeNode\_lookupTitle(), and ILIAS\Repository\int().

Referenced by ilPersonalSkillTableGUI\__construct(), ilObjPortfolioGUI\createPortfolioFromAssignment(), ilPersonalSkillsGUI\listSkills(), and ilMStShowUserCompetencesGUI\showSkills().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelfEvaluation()

static ilPersonalSkill::getSelfEvaluation ( int  $a_user_id,
int  $a_top_skill,
int  $a_tref_id,
int  $a_basic_skill 
)
static
Parameters
int$a_user_iduser id
int$a_top_skillthe "selectable" top skill
int$a_tref_idtemplate reference id
int$a_basic_skillthe basic skill the level belongs to
Returns
int|null level id

Definition at line 262 of file class.ilPersonalSkill.php.

267 : ?int {
268 $bs = new ilBasicSkill($a_basic_skill);
269 return $bs->getLastLevelPerObject($a_tref_id, 0, $a_user_id, 1);
270 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by ilSelfEvaluationSimpleTableGUI\__construct().

+ Here is the caller graph for this function:

◆ getSelfEvaluationDate()

static ilPersonalSkill::getSelfEvaluationDate ( int  $a_user_id,
int  $a_top_skill,
int  $a_tref_id,
int  $a_basic_skill 
)
static
Parameters
int$a_user_iduser id
int$a_top_skillthe "selectable" top skill
int$a_tref_idtemplate reference id
int$a_basic_skillthe basic skill the level belongs to
Returns
string|null status date

Definition at line 279 of file class.ilPersonalSkill.php.

284 : ?string {
285 $bs = new ilBasicSkill($a_basic_skill);
286 return $bs->getLastUpdatePerObject($a_tref_id, 0, $a_user_id, 1);
287 }

◆ getUsageInfo()

static ilPersonalSkill::getUsageInfo ( array  $a_cskill_ids)
static
Parameters
array{skill_idint, tref_id: int}[] $a_cskill_ids
Returns
array<string, array<string, array{key: string}[]>>

Implements ilSkillUsageInfo.

Definition at line 294 of file class.ilPersonalSkill.php.

294 : array
295 {
296 global $DIC;
297
298 $ilDB = $DIC->database();
299
300 // material
302 $a_cskill_ids,
304 "skl_assigned_material",
305 "user_id"
306 );
307
308 // users that use the skills as personal skills
309 $pskill_ids = [];
310 $tref_ids = [];
311 foreach ($a_cskill_ids as $cs) {
312 if ($cs["tref_id"] > 0) {
313 if (ilSkillTemplateReference::_lookupTemplateId($cs["tref_id"]) == $cs["skill_id"]) {
314 $pskill_ids[$cs["tref_id"]] = $cs["tref_id"];
315 $tref_ids[(int) $cs["tref_id"]] = $cs["skill_id"];
316 }
317 } else {
318 $pskill_ids[$cs["skill_id"]] = $cs["skill_id"];
319 }
320 }
321 $set = $ilDB->query(
322 "SELECT skill_node_id, user_id FROM skl_personal_skill " .
323 " WHERE " . $ilDB->in("skill_node_id", $pskill_ids, false, "integer") .
324 " GROUP BY skill_node_id, user_id"
325 );
326 while ($rec = $ilDB->fetchAssoc($set)) {
327 if (isset($tref_ids[(int) $rec["skill_node_id"]])) {
328 $a_usages[$tref_ids[$rec["skill_node_id"]] . ":" . $rec["skill_node_id"]][ilSkillUsage::PERSONAL_SKILL][] =
329 array("key" => $rec["user_id"]);
330 } else {
331 $a_usages[$rec["skill_node_id"] . ":0"][ilSkillUsage::PERSONAL_SKILL][] =
332 array("key" => $rec["user_id"]);
333 }
334 }
335
336 return $a_usages;
337 }
static getUsageInfoGeneric(array $a_cskill_ids, string $a_usage_type, string $a_table, string $a_key_field, string $a_skill_field="skill_id", string $a_tref_field="tref_id")
Get standard usage query.

References $DIC, $ilDB, ilSkillTemplateReference\_lookupTemplateId(), ilSkillUsage\getUsageInfoGeneric(), ILIAS\Repository\int(), ilSkillUsage\PERSONAL_SKILL, and ilSkillUsage\USER_MATERIAL.

+ Here is the call graph for this function:

◆ removeMaterial()

static ilPersonalSkill::removeMaterial ( int  $a_user_id,
int  $a_tref_id,
int  $a_level_id,
int  $a_wsp_id 
)
static

Definition at line 196 of file class.ilPersonalSkill.php.

196 : void
197 {
198 global $DIC;
199
200 $ilDB = $DIC->database();
201
202 $t = "DELETE FROM skl_assigned_material WHERE " .
203 " user_id = " . $ilDB->quote($a_user_id, "integer") .
204 " AND tref_id = " . $ilDB->quote($a_tref_id, "integer") .
205 " AND level_id = " . $ilDB->quote($a_level_id, "integer") .
206 " AND wsp_id = " . $ilDB->quote($a_wsp_id, "integer");
207
208 $ilDB->manipulate($t);
209 }

References $DIC, and $ilDB.

Referenced by ilPersonalSkillsGUI\removeMaterial().

+ Here is the caller graph for this function:

◆ removeMaterials()

static ilPersonalSkill::removeMaterials ( int  $a_user_id)
static

Definition at line 211 of file class.ilPersonalSkill.php.

211 : void
212 {
213 global $DIC;
214
215 $ilDB = $DIC->database();
216
217 $t = "DELETE FROM skl_assigned_material WHERE " .
218 " user_id = " . $ilDB->quote($a_user_id, "integer");
219 $ilDB->manipulate($t);
220 }

References $DIC, and $ilDB.

Referenced by ilSkillObjDeletionHandler\processDeletion().

+ Here is the caller graph for this function:

◆ removeSkill()

static ilPersonalSkill::removeSkill ( int  $a_user_id,
int  $a_skill_node_id 
)
static

Definition at line 74 of file class.ilPersonalSkill.php.

74 : void
75 {
76 global $DIC;
77
78 $ilDB = $DIC->database();
79
80 $ilDB->manipulate(
81 "DELETE FROM skl_personal_skill WHERE " .
82 " user_id = " . $ilDB->quote($a_user_id, "integer") .
83 " AND skill_node_id = " . $ilDB->quote($a_skill_node_id, "integer")
84 );
85 }

References $DIC, and $ilDB.

Referenced by ilPersonalSkillsGUI\removeSkills().

+ Here is the caller graph for this function:

◆ removeSkills()

static ilPersonalSkill::removeSkills ( int  $a_user_id)
static

Definition at line 87 of file class.ilPersonalSkill.php.

87 : void
88 {
89 global $DIC;
90
91 $ilDB = $DIC->database();
92
93 $ilDB->manipulate(
94 "DELETE FROM skl_personal_skill WHERE " .
95 " user_id = " . $ilDB->quote($a_user_id, "integer")
96 );
97 }

References $DIC, and $ilDB.

Referenced by ilSkillObjDeletionHandler\processDeletion().

+ Here is the caller graph for this function:

◆ saveSelfEvaluation()

static ilPersonalSkill::saveSelfEvaluation ( int  $a_user_id,
int  $a_top_skill,
int  $a_tref_id,
int  $a_basic_skill,
int  $a_level 
)
static
Parameters
int$a_user_iduser id
int$a_top_skillthe "selectable" top skill
int$a_tref_idtemplate reference id
int$a_basic_skillthe basic skill the level belongs to
int$a_levellevel id

Definition at line 233 of file class.ilPersonalSkill.php.

239 : void {
240 if ($a_level > 0) {
242 $a_level,
243 $a_user_id,
244 0,
245 $a_tref_id,
247 false,
248 1
249 );
250 } else {
251 ilBasicSkill::resetUserSkillLevelStatus($a_user_id, $a_basic_skill, $a_tref_id, 0, true);
252 }
253 }
static writeUserSkillLevelStatus(int $a_level_id, int $a_user_id, int $a_trigger_ref_id, int $a_tref_id=0, int $a_status=ilBasicSkill::ACHIEVED, bool $a_force=false, bool $a_self_eval=false, string $a_unique_identifier="", float $a_next_level_fulfilment=0.0, string $trigger_user_id="")
static resetUserSkillLevelStatus(int $a_user_id, int $a_skill_id, int $a_tref_id=0, int $a_trigger_ref_id=0, bool $a_self_eval=false)

References ilBasicSkill\ACHIEVED, and ilBasicSkill\writeUserSkillLevelStatus().

Referenced by ilPersonalSkillsGUI\saveSelfEvaluation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: