ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPersonalSkill Class Reference

Personal skill. More...

+ Collaboration diagram for ilPersonalSkill:

Public Member Functions

 addPersonalSkill ($a_user_id, $a_skill_node_id)
 Add personal skill.
 removeSkill ($a_user_id, $a_skill_node_id)
 Remove personal skill.

Static Public Member Functions

static getSelectedUserSkills ($a_user_id)
 Get personal selected user skills.
static assignMaterial ($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level, $a_wsp_id)
 Assign material to skill level.
static getAssignedMaterial ($a_user_id, $a_tref_id, $a_level)
 Get assigned material (for a skill level and user)
static countAssignedMaterial ($a_user_id, $a_tref_id, $a_level)
 Get assigned material (for a skill level and user)
static removeMaterial ($a_user_id, $a_tref_id, $a_level_id, $a_wsp_id)
 Remove material.
static saveSelfEvaluation ($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level)
 Save self evaluation.
static getSelfEvaluation ($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill)
 Save self evaluation.

Detailed Description

Personal skill.

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

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

Member Function Documentation

ilPersonalSkill::addPersonalSkill (   $a_user_id,
  $a_skill_node_id 
)

Add personal skill.

Parameters
int$a_user_id
int$a_skill_node_id

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

Referenced by ilPersonalSkillsGUI\addSkill().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM skl_personal_skill ".
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
" AND skill_node_id = ".$ilDB->quote($a_skill_node_id, "integer")
);
if (!$ilDB->fetchAssoc($set))
{
$ilDB->manipulate("INSERT INTO skl_personal_skill ".
"(user_id, skill_node_id) VALUES (".
$ilDB->quote($a_user_id, "integer").",".
$ilDB->quote($a_skill_node_id, "integer").
")");
}
}

+ Here is the caller graph for this function:

static ilPersonalSkill::assignMaterial (   $a_user_id,
  $a_top_skill,
  $a_tref_id,
  $a_basic_skill,
  $a_level,
  $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 100 of file class.ilPersonalSkill.php.

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM skl_assigned_material ".
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
" AND top_skill_id = ".$ilDB->quote($a_top_skill, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND skill_id = ".$ilDB->quote($a_basic_skill, "integer").
" AND level_id = ".$ilDB->quote($a_level, "integer").
" AND wsp_id = ".$ilDB->quote($a_wsp_id, "integer")
);
if (!$ilDB->fetchAssoc($set))
{
$ilDB->manipulate("INSERT INTO skl_assigned_material ".
"(user_id, top_skill_id, tref_id, skill_id, level_id, wsp_id) VALUES (".
$ilDB->quote($a_user_id, "integer").",".
$ilDB->quote($a_top_skill, "integer").",".
$ilDB->quote((int) $a_tref_id, "integer").",".
$ilDB->quote($a_basic_skill, "integer").",".
$ilDB->quote($a_level, "integer").",".
$ilDB->quote($a_wsp_id, "integer").
")");
}
}
static ilPersonalSkill::countAssignedMaterial (   $a_user_id,
  $a_tref_id,
  $a_level 
)
static

Get assigned material (for a skill level and user)

Parameters
int$a_user_iduser id
int$a_tref_idtemplate reference id
int$a_levellevel id

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

Referenced by ilPersonalSkillsGUI\getSkillHTML().

{
global $ilDB;
$set = $ilDB->query("SELECT count(*) as cnt FROM skl_assigned_material ".
" WHERE level_id = ".$ilDB->quote($a_level, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer")
);
$rec = $ilDB->fetchAssoc($set);
return $rec["cnt"];
}

+ Here is the caller graph for this function:

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

Get assigned material (for a skill level and user)

Parameters
int$a_user_iduser id
int$a_tref_idtemplate reference id
int$a_levellevel id

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

Referenced by ilCOPageHTMLExport\collectPageElements(), ilSkillAssignMaterialsTableGUI\fillRow(), and ilPersonalSkillsGUI\getSkillHTML().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM skl_assigned_material ".
" WHERE level_id = ".$ilDB->quote($a_level, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer")
);
$mat = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$mat[] = $rec;
}
return $mat;
}

+ Here is the caller graph for this function:

static ilPersonalSkill::getSelectedUserSkills (   $a_user_id)
static

Get personal selected user skills.

Parameters
int$a_user_iduser id
Returns
array

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

References ilSkillTreeNode\_lookupTitle().

Referenced by ilPersonalSkillTableGUI\__construct(), ilPCSkillsGUI\initForm(), and ilPersonalSkillsGUI\listSkills().

{
global $ilDB;
include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
include_once("./Services/Skill/classes/class.ilSkillTree.php");
$stree = new ilSkillTree();
$set = $ilDB->query("SELECT * FROM skl_personal_skill ".
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer")
);
$pskills = array();
while ($rec = $ilDB->fetchAssoc($set))
{
if ($stree->isInTree($rec["skill_node_id"]))
{
$pskills[$rec["skill_node_id"]] = array("skill_node_id" => $rec["skill_node_id"],
"title" => ilSkillTreeNode::_lookupTitle($rec["skill_node_id"]));
}
}
return $pskills;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPersonalSkill::getSelfEvaluation (   $a_user_id,
  $a_top_skill,
  $a_tref_id,
  $a_basic_skill 
)
static

Save self evaluation.

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 244 of file class.ilPersonalSkill.php.

Referenced by ilSelfEvaluationSimpleTableGUI\__construct(), and ilPersonalSkillsGUI\getSkillHTML().

{
global $ilDB;
$set = $ilDB->query("SELECT level_id FROM skl_self_eval_level ".
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
" AND top_skill_id = ".$ilDB->quote($a_top_skill, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND skill_id = ".$ilDB->quote($a_basic_skill, "integer")
);
$rec = $ilDB->fetchAssoc($set);
return (int) $rec["level_id"];
}

+ Here is the caller graph for this function:

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

Remove material.

Parameters
@return

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

References $t.

{
global $ilDB;
$t = "DELETE FROM skl_assigned_material WHERE ".
" user_id = ".$ilDB->quote($a_user_id, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND level_id = ".$ilDB->quote($a_level_id, "integer").
" AND wsp_id = ".$ilDB->quote($a_wsp_id, "integer");
$ilDB->manipulate($t);
}
ilPersonalSkill::removeSkill (   $a_user_id,
  $a_skill_node_id 
)

Remove personal skill.

Parameters
int$a_user_iduser id
int$a_skill_node_idthe "selectable" top skill

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

Referenced by ilPersonalSkillsGUI\removeSkills().

{
global $ilDB;
$ilDB->manipulate("DELETE FROM skl_personal_skill WHERE ".
" user_id = ".$ilDB->quote($a_user_id, "integer").
" AND skill_node_id = ".$ilDB->quote($a_skill_node_id, "integer")
);
}

+ Here is the caller graph for this function:

static ilPersonalSkill::saveSelfEvaluation (   $a_user_id,
  $a_top_skill,
  $a_tref_id,
  $a_basic_skill,
  $a_level 
)
static

Save self evaluation.

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 202 of file class.ilPersonalSkill.php.

References ilUtil\now().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM skl_self_eval_level ".
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
" AND top_skill_id = ".$ilDB->quote($a_top_skill, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND skill_id = ".$ilDB->quote($a_basic_skill, "integer"));
if (!$ilDB->fetchAssoc($set))
{
$ilDB->manipulate("INSERT INTO skl_self_eval_level ".
"(user_id, top_skill_id, tref_id, skill_id, level_id, last_update) VALUES (".
$ilDB->quote($a_user_id, "integer").",".
$ilDB->quote($a_top_skill, "integer").",".
$ilDB->quote((int) $a_tref_id, "integer").",".
$ilDB->quote($a_basic_skill, "integer").",".
$ilDB->quote($a_level, "integer").",".
$ilDB->quote(ilUtil::now(), "timestamp").
")");
}
else
{
$ilDB->manipulate("UPDATE skl_self_eval_level SET ".
" level_id = ".$ilDB->quote($a_level, "integer").", ".
" last_update = ".$ilDB->quote(ilUtil::now(), "timestamp").
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
" AND top_skill_id = ".$ilDB->quote($a_top_skill, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND skill_id = ".$ilDB->quote($a_basic_skill, "integer"));
}
}

+ Here is the call graph for this function:


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