34 $ilDB = $DIC->database();
36 $repo = $DIC->skills()->internal()->repo()->getTreeRepo();
39 "SELECT * FROM skl_personal_skill " .
40 " WHERE user_id = " .
$ilDB->quote($a_user_id,
"integer")
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"],
58 $ilDB = $DIC->database();
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")
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") .
74 public static function removeSkill(
int $a_user_id,
int $a_skill_node_id): void
78 $ilDB = $DIC->database();
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")
91 $ilDB = $DIC->database();
94 "DELETE FROM skl_personal_skill WHERE " .
95 " user_id = " .
$ilDB->quote($a_user_id,
"integer")
124 $ilDB = $DIC->database();
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")
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") .
156 $ilDB = $DIC->database();
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")
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'];
184 $ilDB = $DIC->database();
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")
192 $rec =
$ilDB->fetchAssoc($set);
193 return (
int) $rec[
"cnt"];
196 public static function removeMaterial(
int $a_user_id,
int $a_tref_id,
int $a_level_id,
int $a_wsp_id): void
200 $ilDB = $DIC->database();
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");
208 $ilDB->manipulate($t);
215 $ilDB = $DIC->database();
217 $t =
"DELETE FROM skl_assigned_material WHERE " .
218 " user_id = " .
$ilDB->quote($a_user_id,
"integer");
219 $ilDB->manipulate($t);
269 return $bs->getLastLevelPerObject($a_tref_id, 0, $a_user_id, 1);
286 return $bs->getLastUpdatePerObject($a_tref_id, 0, $a_user_id, 1);
298 $ilDB = $DIC->database();
304 "skl_assigned_material",
311 foreach ($a_cskill_ids as $cs) {
312 if ($cs[
"tref_id"] > 0) {
314 $pskill_ids[$cs[
"tref_id"]] = $cs[
"tref_id"];
315 $tref_ids[(
int) $cs[
"tref_id"]] = $cs[
"skill_id"];
318 $pskill_ids[$cs[
"skill_id"]] = $cs[
"skill_id"];
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" 326 while ($rec =
$ilDB->fetchAssoc($set)) {
327 if (isset($tref_ids[(
int) $rec[
"skill_node_id"]])) {
329 array(
"key" => $rec[
"user_id"]);
332 array(
"key" => $rec[
"user_id"]);
Get info on usages of skills.
static getAssignedMaterial(int $a_user_id, int $a_tref_id, int $a_level)
Get assigned material (for a skill level and user)
static _lookupTemplateId(int $a_obj_id)
static removeSkills(int $a_user_id)
static getUsageInfo(array $a_cskill_ids)
static getSelfEvaluationDate(int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill)
static removeSkill(int $a_user_id, int $a_skill_node_id)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static removeMaterial(int $a_user_id, int $a_tref_id, int $a_level_id, int $a_wsp_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 getSelectedUserSkills(int $a_user_id)
static countAssignedMaterial(int $a_user_id, int $a_tref_id, int $a_level)
Count assigned material (for a skill level and user)
static removeMaterials(int $a_user_id)
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.
static addPersonalSkill(int $a_user_id, int $a_skill_node_id)
static saveSelfEvaluation(int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill, int $a_level)
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
static getSelfEvaluation(int $a_user_id, int $a_top_skill, int $a_tref_id, int $a_basic_skill)