ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBasicSkill Class Reference

Basic Skill. More...

+ Inheritance diagram for ilBasicSkill:
+ Collaboration diagram for ilBasicSkill:

Public Member Functions

 __construct ($a_id=0)
 Constructor public.
 read ()
 Read data from database.
 create ()
 Create skill.
 delete ()
 Delete skill.
 copy ()
 Copy basic skill.
 addLevel ($a_title, $a_description)
 Add new level.
 getMaxLevelNr ()
 Get maximum level nr.
 getLevelData ($a_id=0)
 Get level data.
 updateLevelOrder ($order)
 Update level order.
 deleteLevel ($a_id)
 Delete level.
 fixLevelNumbering ()
 Fix level numbering.
 lookupLevelsForTriggerRefId ($a_ref_id)
 Lookup levels for trigger.
 getSkillForLevelId ($a_level_id)
 Get skill for level id.
 getMaxLevelPerType ($a_tref_id, $a_type, $a_user_id=0, $a_self_eval=0)
 Get max levels per type.
 getAllLevelEntriesOfUser ($a_tref_id, $a_user_id=0, $a_self_eval=0)
 Get all level entries.
 getAllHistoricLevelEntriesOfUser ($a_tref_id, $a_user_id=0, $a_eval_by=0)
 Get all historic level entries.
 getMaxLevelPerObject ($a_tref_id, $a_object_id, $a_user_id=0, $a_self_eval=0)
 Get max levels per object.
 getLastLevelPerObject ($a_tref_id, $a_object_id, $a_user_id=0, $a_self_eval=0)
 Get last level set per object.
 getLastUpdatePerObject ($a_tref_id, $a_object_id, $a_user_id=0, $a_self_eval=0)
 Get last update per object.
 lookupLevelAchievementDate ($a_user_id, $a_level_id, $a_self_eval=0)
 Lookup level achievement date.
 getTitleForCertificate ()
 Get title for certificate.
 getLevelTitleForCertificate ($a_level_id)
 Get title for certificate.
 getTriggerTitleForCertificate ($a_level_id)
 Get trigger title for certificate.
 getShortTitleForCertificate ()
 Get short title for certificate.
- Public Member Functions inherited from ilSkillTreeNode
 ilSkillTreeNode ($a_id=0)
 setTitle ($a_title)
 Set title.
 getTitle ()
 Get title.
 setType ($a_type)
 Set type.
 getType ()
 Get type.
 setId ($a_id)
 Set Node ID.
 getId ()
 Get Node ID.
 setSelfEvaluation ($a_val)
 Set self evaluation.
 getSelfEvaluation ()
 Get self evaluation.
 setOrderNr ($a_val)
 Set order nr.
 getOrderNr ()
 Get order nr.
 setDataRecord ($a_record)
 this method should only be called by class ilSCORM2004NodeFactory
 setStatus ($a_val)
 Set status.
 getStatus ()
 Get status.
 update ()
 Update Node.
 clipboardCut ($a_tree_id, $a_ids)
 Cut and copy a set of skills/skill categories into the clipboard.

Static Public Member Functions

static lookupLevelTitle ($a_id)
 Lookup level title.
static lookupLevelDescription ($a_id)
 Lookup level description.
static lookupLevelTrigger ($a_id)
 Lookup level trigger.
static lookupLevelSkillId ($a_id)
 Lookup level skill id.
static writeLevelTitle ($a_id, $a_title)
 Write level title.
static writeLevelDescription ($a_id, $a_description)
 Write level description.
static writeLevelTrigger ($a_id, $a_trigger_ref_id)
 Write trigger.
static updateAllUserSkillLevels ()
 Look for all skill level that have a trigger and update the user skill level information, if it has changed.
static updateSkillLevelsByTriggerRef ($a_user_id, $a_ref_id)
 Look for all skill level that have a trigger and update the user skill level information, if it has changed.
static writeUserSkillLevelStatus ($a_level_id, $a_user_id, $a_trigger_ref_id, $a_tref_id=0, $a_status=ilBasicSkill::ACHIEVED, $a_force=false, $a_self_eval=0)
 Write skill level status.
static getCompletionDateForTriggerRefId ($a_user_id, $a_ref_id=null, $a_self_eval=0)
 Get trigger completion.
static checkUserCertificateForTriggerRefId ($a_user_id, $a_ref_id, $a_self_eval=0)
 Get trigger completion.
static getTriggerOfAllCertificates ($a_user_id, $a_self_eval=0)
 Get trigger completion.
static getSkillLevelsForTrigger ($a_ref_id)
 Get assigned skill levels for trigger.
static _lookupCertificate ($a_skill_id, $a_skill_level_id)
 Checks whether a skill level has a certificate or not.
static getUsageInfo ($a_cskill_ids, &$a_usages)
 Get usage info.
- Static Public Member Functions inherited from ilSkillTreeNode
static getAllStatus ()
 Get all status.
static getStatusInfo ($a_status)
 Get status info.
static _lookupTitle ($a_obj_id, $a_tref_id=0)
 Lookup Title.
static _lookupSelfEvaluation ($a_obj_id)
 Lookup self evaluation.
static _lookupStatus ($a_obj_id)
 Lookup Status.
static _lookupType ($a_obj_id)
 Lookup Type.
static _writeTitle ($a_obj_id, $a_title)
 Write Title.
static _writeOrderNr ($a_obj_id, $a_nr)
 Write Order Nr.
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 Put this object into the skill tree.
static getTree ($a_slm_obj_id)
 Get scorm module editing tree.
static uniqueTypesCheck ($a_items)
 Check for unique types.
static clipboardCopy ($a_tree_id, $a_ids)
 Copy a set of skills/skill categories into the clipboard.
static insertItemsFromClip ($a_type, $a_obj_id)
 Insert basic skills from clipboard.
static clearClipboard ()
 Remove all skill items from clipboard.
static pasteTree ($a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_add_suffix=false)
 Paste item (tree) from clipboard to skill tree.
static isInTree ($a_id)
 Is id in tree?
static getAllSelfEvaluationNodes ()
 Get all self evaluation nodes.
static getTopTemplates ()
 Get top skill templates and template categories.
static getSelectableSkills ()
 Get selectable skills.
static saveChildsOrder ($a_par_id, $a_childs_order, $a_templates=false)
 Save childs order.
static getIconPath ($a_obj_id, $a_type, $a_size="", $a_status=0)
 Get icon path.
static findSkills ($a_term)
 Find skills.

Data Fields

const ACHIEVED = 1
const NOT_ACHIEVED = 0
const EVAL_BY_OTHERS_ = 0
const EVAL_BY_SELF = 1
const EVAL_BY_ALL = 2
 $id
- Data Fields inherited from ilSkillTreeNode
const STATUS_PUBLISH = 0
const STATUS_DRAFT = 1
const STATUS_OUTDATED = 2
 $type
 $id
 $title

Static Protected Member Functions

static lookupLevelProperty ($a_id, $a_prop)
 Lookup level property.
static writeLevelProperty ($a_id, $a_prop, $a_value, $a_type)
 Write level property.
- Static Protected Member Functions inherited from ilSkillTreeNode
static _lookup ($a_obj_id, $a_field)
 Lookup Title.

Detailed Description

Basic Skill.

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

Definition at line 16 of file class.ilBasicSkill.php.

Constructor & Destructor Documentation

ilBasicSkill::__construct (   $a_id = 0)

Constructor public.

Reimplemented in ilBasicSkillTemplate.

Definition at line 31 of file class.ilBasicSkill.php.

References ilSkillTreeNode\ilSkillTreeNode(), and ilSkillTreeNode\setType().

{
$this->setType("skll");
}

+ Here is the call graph for this function:

Member Function Documentation

static ilBasicSkill::_lookupCertificate (   $a_skill_id,
  $a_skill_level_id 
)
static

Checks whether a skill level has a certificate or not.

Parameters
intskill id
intskill level id
Returns
true/false

Definition at line 1088 of file class.ilBasicSkill.php.

Referenced by checkUserCertificateForTriggerRefId(), and getTriggerOfAllCertificates().

{
$certificatefile = CLIENT_WEB_DIR."/certificates/skill/".
((int)$a_skill_id)."/".((int) $a_skill_level_id)."/certificate.xml";
if (@file_exists($certificatefile))
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

ilBasicSkill::addLevel (   $a_title,
  $a_description 
)

Add new level.

Parameters
stringtitle
stringdescription

Definition at line 109 of file class.ilBasicSkill.php.

References $ilDB, ilSkillTreeNode\getId(), and getMaxLevelNr().

{
global $ilDB;
$nr = $this->getMaxLevelNr();
$nid = $ilDB->nextId("skl_level");
$ilDB->insert("skl_level", array(
"id" => array("integer", $nid),
"skill_id" => array("integer", $this->getId()),
"nr" => array("integer", $nr+1),
"title" => array("text", $a_title),
"description" => array("clob", $a_description)
));
}

+ Here is the call graph for this function:

static ilBasicSkill::checkUserCertificateForTriggerRefId (   $a_user_id,
  $a_ref_id,
  $a_self_eval = 0 
)
static

Get trigger completion.

Parameters
@return

Definition at line 898 of file class.ilBasicSkill.php.

References $ilDB, $ref_id, and _lookupCertificate().

Referenced by ilObjSkillManagementGUI\testCert().

{
global $ilDB;
die("ilBasicSkill::checkUserCertificateForTriggerRefId is deprecated.");
if (!is_array($a_ref_id))
{
$a_ref_id = array($a_ref_id);
}
if (!is_array($a_user_id))
{
$a_user_id = array($a_user_id);
}
$set = $ilDB->query($q = "SELECT user_id, status_date, trigger_ref_id, level_id, skill_id FROM skl_user_has_level WHERE ".
$ilDB->in("user_id", $a_user_id, false, "integer")." AND ".
$ilDB->in("trigger_ref_id", $a_ref_id, false, "integer")
);
$completion = array();
$completion = array();
while ($rec = $ilDB->fetchAssoc($set))
{
if (!isset($completion[$rec["user_id"]][$rec["trigger_ref_id"]])
&& ilBasicSkill::_lookupCertificate($rec["skill_id"], $rec["level_id"]))
{
$completion[$rec["user_id"]][$rec["trigger_ref_id"]] = true;
}
}
foreach ($a_ref_id as $ref_id)
{
foreach ($a_user_id as $user_id)
{
if (!isset($completion[$user_id][$ref_id]))
{
$completion[$user_id][$ref_id] = false;
}
}
}
return $completion;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBasicSkill::copy ( )

Copy basic skill.

Reimplemented in ilBasicSkillTemplate.

Definition at line 75 of file class.ilBasicSkill.php.

References getLevelData(), ilSkillTreeNode\getOrderNr(), ilSkillTreeNode\getSelfEvaluation(), ilSkillTreeNode\getTitle(), and ilSkillTreeNode\getType().

{
$skill = new ilBasicSkill();
$skill->setTitle($this->getTitle());
$skill->setType($this->getType());
$skill->setSelfEvaluation($this->getSelfEvaluation());
$skill->setOrderNr($this->getOrderNr());
$skill->create();
$levels = $this->getLevelData();
if (sizeof($levels))
{
foreach($levels as $item)
{
$skill->addLevel($item["title"], $item["description"]);
}
}
$skill->update();
return $skill;
}

+ Here is the call graph for this function:

ilBasicSkill::create ( )

Create skill.

Reimplemented from ilSkillTreeNode.

Definition at line 49 of file class.ilBasicSkill.php.

ilBasicSkill::delete ( )

Delete skill.

Reimplemented from ilSkillTreeNode.

Definition at line 57 of file class.ilBasicSkill.php.

References $ilDB.

{
global $ilDB;
$ilDB->manipulate("DELETE FROM skl_level WHERE "
." skill_id = ".$ilDB->quote($this->getId(), "integer")
);
$ilDB->manipulate("DELETE FROM skl_user_has_level WHERE "
." skill_id = ".$ilDB->quote($this->getId(), "integer")
);
}
ilBasicSkill::deleteLevel (   $a_id)

Delete level.

Parameters
@return

Definition at line 322 of file class.ilBasicSkill.php.

References $ilDB.

{
global $ilDB;
$ilDB->manipulate("DELETE FROM skl_level WHERE "
." id = ".$ilDB->quote($a_id, "integer")
);
}
ilBasicSkill::fixLevelNumbering ( )

Fix level numbering.

Parameters
@return

Definition at line 338 of file class.ilBasicSkill.php.

References $ilDB.

{
global $ilDB;
$set = $ilDB->query("SELECT id, nr FROM skl_level WHERE ".
" skill_id = ".$ilDB->quote($this->getId(), "integer").
" ORDER BY nr ASC"
);
$cnt = 1;
while ($rec = $ilDB->fetchAssoc($set))
{
$ilDB->manipulate("UPDATE skl_level SET ".
" nr = ".$ilDB->quote($cnt, "integer").
" WHERE id = ".$ilDB->quote($rec["id"], "integer")
);
$cnt++;
}
}
ilBasicSkill::getAllHistoricLevelEntriesOfUser (   $a_tref_id,
  $a_user_id = 0,
  $a_eval_by = 0 
)

Get all historic level entries.

Parameters
@return

Definition at line 668 of file class.ilBasicSkill.php.

References $ilDB, $ilUser, and EVAL_BY_ALL.

{
global $ilDB, $ilUser;
if ($a_user_id == 0)
{
$a_user_id = $ilUser->getId();
}
$by = ($a_eval_by != self::EVAL_BY_ALL)
? " AND self_eval = ".$ilDB->quote($a_self_eval, "integer")
: "";
$set = $ilDB->query($q = "SELECT * FROM skl_user_skill_level ".
" WHERE skill_id = ".$ilDB->quote($this->getId(), "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
$by.
" ORDER BY status_date DESC"
);
$levels = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$levels[] = $rec;
}
return $levels;
}
ilBasicSkill::getAllLevelEntriesOfUser (   $a_tref_id,
  $a_user_id = 0,
  $a_self_eval = 0 
)

Get all level entries.

Parameters
@return

Definition at line 637 of file class.ilBasicSkill.php.

References $ilDB, and $ilUser.

{
global $ilDB, $ilUser;
if ($a_user_id == 0)
{
$a_user_id = $ilUser->getId();
}
$set = $ilDB->query($q = "SELECT * FROM skl_user_has_level ".
" WHERE skill_id = ".$ilDB->quote($this->getId(), "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND self_eval = ".$ilDB->quote($a_self_eval, "integer").
" ORDER BY status_date DESC"
);
$levels = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$levels[] = $rec;
}
return $levels;
}
static ilBasicSkill::getCompletionDateForTriggerRefId (   $a_user_id,
  $a_ref_id = null,
  $a_self_eval = 0 
)
static

Get trigger completion.

Parameters
@return

Definition at line 802 of file class.ilBasicSkill.php.

References $ilDB, $ref_id, and ilParticipants\_getMembershipByType().

Referenced by ilObjSkillManagementGUI\test().

{
global $ilDB;
die("ilBasicSkill::getCompletionDateForTriggerRefId is deprecated.");
if ($a_ref_id == "")
{
$a_ref_id = null;
}
else if (!is_array($a_ref_id))
{
$a_ref_id = array($a_ref_id);
}
if (!is_array($a_user_id))
{
$a_user_id = array($a_user_id);
}
if ($a_ref_id != null)
{
if (!is_array($a_ref_id))
{
$a_ref_id = array($a_ref_id);
}
$set = $ilDB->query($q = "SELECT user_id, status_date, trigger_ref_id FROM skl_user_has_level WHERE ".
$ilDB->in("user_id", $a_user_id, false, "integer")." AND ".
$ilDB->in("trigger_ref_id", $a_ref_id, false, "integer")
);
$completion = array();
while ($rec = $ilDB->fetchAssoc($set))
{
if (!isset($completion[$rec["user_id"]][$rec["trigger_ref_id"]]))
{
$completion[$rec["user_id"]][$rec["trigger_ref_id"]] = $rec["status_date"];
}
else if ($rec["status_date"] < $completion[$rec["user_id"]][$rec["trigger_ref_id"]])
{
$completion[$rec["user_id"]][$rec["trigger_ref_id"]] = $rec["status_date"];
}
}
foreach ($a_ref_id as $ref_id)
{
foreach ($a_user_id as $user_id)
{
if (!isset($completion[$user_id][$ref_id]))
{
$completion[$user_id][$ref_id] = false;
}
}
}
}
else
{
$completion = array();
foreach ($a_user_id as $user_id)
{
include_once 'Services/Membership/classes/class.ilParticipants.php';
$a_ref_id = ilParticipants::_getMembershipByType($user_id, 'crs', true);
$set = $ilDB->query($q = "SELECT user_id, status_date, trigger_ref_id FROM skl_user_has_level WHERE ".
"user_id = ".$ilDB->quote($user_id, "integer")." AND ".
$ilDB->in("trigger_ref_id", $a_ref_id, false, "integer")
);
while ($rec = $ilDB->fetchAssoc($set))
{
if (!isset($completion[$user_id][$rec["trigger_ref_id"]]))
{
$completion[$user_id][$rec["trigger_ref_id"]] = $rec["status_date"];
}
else if ($rec["status_date"] < $completion[$user_id][$rec["trigger_ref_id"]])
{
$completion[$user_id][$rec["trigger_ref_id"]] = $rec["status_date"];
}
}
foreach ($a_ref_id as $ref_id)
{
if (!isset($completion[$user_id][$ref_id]))
{
$completion[$user_id][$ref_id] = false;
}
}
}
}
return $completion;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBasicSkill::getLastLevelPerObject (   $a_tref_id,
  $a_object_id,
  $a_user_id = 0,
  $a_self_eval = 0 
)

Get last level set per object.

Parameters
@return

Definition at line 742 of file class.ilBasicSkill.php.

References $ilDB, $ilUser, and ilSkillTreeNode\getId().

{
global $ilDB, $ilUser;
if ($a_user_id == 0)
{
$a_user_id = $ilUser->getId();
}
$ilDB->setLimit(1);
$set = $ilDB->query($q = "SELECT level_id FROM skl_user_has_level ".
" WHERE trigger_obj_id = ".$ilDB->quote($a_object_id, "integer").
" AND skill_id = ".$ilDB->quote($this->getId(), "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND self_eval = ".$ilDB->quote($a_self_eval, "integer").
" ORDER BY status_date DESC"
);
$rec = $ilDB->fetchAssoc($set);
return $rec["level_id"];
}

+ Here is the call graph for this function:

ilBasicSkill::getLastUpdatePerObject (   $a_tref_id,
  $a_object_id,
  $a_user_id = 0,
  $a_self_eval = 0 
)

Get last update per object.

Parameters
@return

Definition at line 772 of file class.ilBasicSkill.php.

References $ilDB, $ilUser, and ilSkillTreeNode\getId().

{
global $ilDB, $ilUser;
if ($a_user_id == 0)
{
$a_user_id = $ilUser->getId();
}
$ilDB->setLimit(1);
$set = $ilDB->query($q = "SELECT status_date FROM skl_user_has_level ".
" WHERE trigger_obj_id = ".$ilDB->quote($a_object_id, "integer").
" AND skill_id = ".$ilDB->quote($this->getId(), "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND self_eval = ".$ilDB->quote($a_self_eval, "integer").
" ORDER BY status_date DESC"
);
$rec = $ilDB->fetchAssoc($set);
return $rec["status_date"];
}

+ Here is the call graph for this function:

ilBasicSkill::getLevelData (   $a_id = 0)

Get level data.

Returns
array level data

Definition at line 146 of file class.ilBasicSkill.php.

References $ilDB.

Referenced by ilBasicSkillTemplate\copy(), copy(), getMaxLevelPerObject(), and getMaxLevelPerType().

{
global $ilDB;
if ($a_id > 0)
{
$and = " AND id = ".$ilDB->quote($a_id, "integer");
}
$set = $ilDB->query("SELECT * FROM skl_level WHERE ".
" skill_id = ".$ilDB->quote($this->getId(), "integer").
$and.
" ORDER BY nr"
);
$levels = array();
while ($rec = $ilDB->fetchAssoc($set))
{
if ($a_id > 0)
{
return $rec;
}
$levels[] = $rec;
}
return $levels;
}

+ Here is the caller graph for this function:

ilBasicSkill::getLevelTitleForCertificate (   $a_level_id)

Get title for certificate.

Parameters
@return

Definition at line 1052 of file class.ilBasicSkill.php.

References lookupLevelTitle().

{
die("ilBasicSkill::getLevelTitleForCertificate is deprecated.");
return ilBasicSkill::lookupLevelTitle($a_level_id);
}

+ Here is the call graph for this function:

ilBasicSkill::getMaxLevelNr ( )

Get maximum level nr.

Returns
int maximum level nr of skill

Definition at line 130 of file class.ilBasicSkill.php.

References $ilDB.

Referenced by addLevel().

{
global $ilDB;
$set = $ilDB->query("SELECT MAX(nr) mnr FROM skl_level WHERE ".
" skill_id = ".$ilDB->quote($this->getId(), "integer")
);
$rec = $ilDB->fetchAssoc($set);
return (int) $rec["mnr"];
}

+ Here is the caller graph for this function:

ilBasicSkill::getMaxLevelPerObject (   $a_tref_id,
  $a_object_id,
  $a_user_id = 0,
  $a_self_eval = 0 
)

Get max levels per object.

Parameters
@return

Definition at line 703 of file class.ilBasicSkill.php.

References $ilDB, $ilUser, ilSkillTreeNode\getId(), and getLevelData().

{
global $ilDB, $ilUser;
if ($a_user_id == 0)
{
$a_user_id = $ilUser->getId();
}
$set = $ilDB->query($q = "SELECT level_id FROM skl_user_has_level ".
" WHERE trigger_obj_id = ".$ilDB->quote($a_object_id, "integer").
" AND skill_id = ".$ilDB->quote($this->getId(), "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND self_eval = ".$ilDB->quote($a_self_eval, "integer")
);
$has_level = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$has_level[$rec["level_id"]] = true;
}
$max_level = 0;
foreach ($this->getLevelData() as $l)
{
if (isset($has_level[$l["id"]]))
{
$max_level = $l["id"];
}
}
return $max_level;
}

+ Here is the call graph for this function:

ilBasicSkill::getMaxLevelPerType (   $a_tref_id,
  $a_type,
  $a_user_id = 0,
  $a_self_eval = 0 
)

Get max levels per type.

Parameters
@return

Definition at line 598 of file class.ilBasicSkill.php.

References $ilDB, $ilUser, ilSkillTreeNode\getId(), and getLevelData().

{
global $ilDB, $ilUser;
if ($a_user_id == 0)
{
$a_user_id = $ilUser->getId();
}
$set = $ilDB->query($q = "SELECT level_id FROM skl_user_has_level ".
" WHERE trigger_obj_type = ".$ilDB->quote($a_type, "text").
" AND skill_id = ".$ilDB->quote($this->getId(), "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND self_eval = ".$ilDB->quote($a_self_eval, "integer")
);
$has_level = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$has_level[$rec["level_id"]] = true;
}
$max_level = 0;
foreach ($this->getLevelData() as $l)
{
if (isset($has_level[$l["id"]]))
{
$max_level = $l["id"];
}
}
return $max_level;
}

+ Here is the call graph for this function:

ilBasicSkill::getShortTitleForCertificate ( )

Get short title for certificate.

Parameters
@return

Definition at line 1077 of file class.ilBasicSkill.php.

{
return "Skill";
}
ilBasicSkill::getSkillForLevelId (   $a_level_id)

Get skill for level id.

Parameters
@return

Definition at line 384 of file class.ilBasicSkill.php.

References $ilDB, and ilSkillTreeNode\isInTree().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM skl_level WHERE ".
" id = ".$ilDB->quote($a_level_id, "integer")
);
$skill = null;
if ($rec = $ilDB->fetchAssoc($set))
{
if (ilSkillTreeNode::isInTree($rec["skill_id"]))
{
$skill = new ilBasicSkill($rec["skill_id"]);
}
}
return $skill;
}

+ Here is the call graph for this function:

static ilBasicSkill::getSkillLevelsForTrigger (   $a_ref_id)
static

Get assigned skill levels for trigger.

Parameters
@return

Definition at line 1012 of file class.ilBasicSkill.php.

References $ilDB.

Referenced by ilObjSkillManagementGUI\testLevels().

{
global $ilDB;
die("ilBasicSkill::getSkillLevelsForTrigger is deprecated.");
$set = $ilDB->query($q = "SELECT id FROM skl_level".
" WHERE trigger_ref_id = ".$ilDB->quote($a_ref_id, "integer"));
$skill_levels = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$skill_levels[] = $rec["id"];
}
return $skill_levels;
}

+ Here is the caller graph for this function:

ilBasicSkill::getTitleForCertificate ( )

Get title for certificate.

Parameters
@return

Definition at line 1041 of file class.ilBasicSkill.php.

References ilSkillTreeNode\getTitle().

{
return $this->getTitle();
}

+ Here is the call graph for this function:

static ilBasicSkill::getTriggerOfAllCertificates (   $a_user_id,
  $a_self_eval = 0 
)
static

Get trigger completion.

Parameters
@return

Definition at line 969 of file class.ilBasicSkill.php.

References $ilDB, and _lookupCertificate().

Referenced by ilObjSkillManagementGUI\testAllCert().

{
global $ilDB, $tree;
die("ilBasicSkill::getTriggerOfAllCertificates is deprecated.");
if (!is_array($a_user_id))
{
$a_user_id = array($a_user_id);
}
$set = $ilDB->query($q = "SELECT user_id, status_date, trigger_ref_id, level_id, skill_id FROM skl_user_has_level WHERE ".
$ilDB->in("user_id", $a_user_id, false, "integer")
);
$completion = array();
while ($rec = $ilDB->fetchAssoc($set))
{
if ((!is_array($completion[$rec["user_id"]]) || !in_array($rec["trigger_ref_id"], $completion[$rec["user_id"]]))
&& ilBasicSkill::_lookupCertificate($rec["skill_id"], $rec["level_id"]))
{
if ($tree->isInTree($rec["trigger_ref_id"]))
{
$completion[$rec["user_id"]][] = $rec["trigger_ref_id"];
}
}
}
foreach ($a_user_id as $user_id)
{
if (!is_array($completion[$user_id]))
{
$completion[$user_id] = array();
}
}
return $completion;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBasicSkill::getTriggerTitleForCertificate (   $a_level_id)

Get trigger title for certificate.

Parameters
@return

Definition at line 1064 of file class.ilBasicSkill.php.

References ilSkillTreeNode\_lookupTitle(), and lookupLevelTrigger().

{
die("ilBasicSkill::getTriggerTitleForCertificate is deprecated.");
return ilObject::_lookupTitle($tr["obj_id"]);
}

+ Here is the call graph for this function:

static ilBasicSkill::getUsageInfo (   $a_cskill_ids,
$a_usages 
)
static

Get usage info.

Parameters
@return

Implements ilSkillUsageInfo.

Definition at line 1108 of file class.ilBasicSkill.php.

References $ilDB, ilSkillUsage\getUsageInfoGeneric(), and ilSkillUsage\USER_ASSIGNED.

{
global $ilDB;
include_once("./Services/Skill/classes/class.ilSkillUsage.php");
"skl_user_skill_level", "user_id");
}

+ Here is the call graph for this function:

ilBasicSkill::lookupLevelAchievementDate (   $a_user_id,
  $a_level_id,
  $a_self_eval = 0 
)

Lookup level achievement date.

Parameters
@return

Definition at line 947 of file class.ilBasicSkill.php.

References $ilDB.

Referenced by ilSkillCertificateAdapter\getCertificateVariablesForPresentation().

{
global $ilDB;
die("ilBasicSkill::lookupLevelAchievementDate is deprecated.");
$set = $ilDB->query("SELECT user_id, status_date, trigger_ref_id, level_id, skill_id FROM skl_user_has_level WHERE ".
" user_id = ".$ilDB->quote($a_user_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer")
);
if ($rec = $ilDB->fetchAssoc($set))
{
return $rec["status_date"];
}
return false;
}

+ Here is the caller graph for this function:

static ilBasicSkill::lookupLevelDescription (   $a_id)
static

Lookup level description.

Parameters
intlevel id
Returns
string level description

Definition at line 206 of file class.ilBasicSkill.php.

References lookupLevelProperty().

{
return ilBasicSkill::lookupLevelProperty($a_id, "description");
}

+ Here is the call graph for this function:

static ilBasicSkill::lookupLevelProperty (   $a_id,
  $a_prop 
)
staticprotected

Lookup level property.

Parameters
idlevel id
Returns
mixed property value

Definition at line 178 of file class.ilBasicSkill.php.

References $ilDB.

Referenced by lookupLevelDescription(), lookupLevelSkillId(), lookupLevelTitle(), and lookupLevelTrigger().

{
global $ilDB;
$set = $ilDB->query("SELECT $a_prop FROM skl_level WHERE ".
" id = ".$ilDB->quote($a_id, "integer")
);
$rec = $ilDB->fetchAssoc($set);
return $rec[$a_prop];
}

+ Here is the caller graph for this function:

ilBasicSkill::lookupLevelsForTriggerRefId (   $a_ref_id)

Lookup levels for trigger.

Parameters
@return

Definition at line 363 of file class.ilBasicSkill.php.

References $ilDB.

{
global $ilDB;
die("ilBasicSkill::lookupLevelsForTriggerRefId is deprecated.");
$set = $ilDB->query("SELECT id FROM skl_level WHERE ".
" trigger_ref_id = ".$ilDB->quote($a_ref_id, "integer")
);
$levels = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$levels[] = $rec["id"];
}
return $levels;
}
static ilBasicSkill::lookupLevelSkillId (   $a_id)
static

Lookup level skill id.

Parameters
intlevel id
Returns
string skill id

Definition at line 231 of file class.ilBasicSkill.php.

References lookupLevelProperty().

Referenced by writeUserSkillLevelStatus().

{
return ilBasicSkill::lookupLevelProperty($a_id, "skill_id");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBasicSkill::lookupLevelTitle (   $a_id)
static

Lookup level title.

Parameters
intlevel id
Returns
string level title

Definition at line 195 of file class.ilBasicSkill.php.

References lookupLevelProperty().

Referenced by ilSkillProfileGUI\confirmLevelAssignmentRemoval(), ilBasicSkillGUI\confirmLevelDeletion(), ilSkillProfileLevelsTableGUI\fillRow(), getLevelTitleForCertificate(), ilPersonalSkillsGUI\renderSuggestedResources(), ilBasicSkillTemplateGUI\setLevelHead(), and ilBasicSkillGUI\setLevelHead().

{
return ilBasicSkill::lookupLevelProperty($a_id, "title");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBasicSkill::lookupLevelTrigger (   $a_id)
static

Lookup level trigger.

Parameters
intlevel id
Returns
array trigger ref id and obj id

Definition at line 217 of file class.ilBasicSkill.php.

References $ref_id, and lookupLevelProperty().

Referenced by ilBasicSkillGUI\editLevelTrigger(), and getTriggerTitleForCertificate().

{
die("ilBasicSkill::lookupLevelTrigger is deprecated.");
$ref_id = ilBasicSkill::lookupLevelProperty($a_id, "trigger_ref_id");
$obj_id = ilBasicSkill::lookupLevelProperty($a_id, "trigger_obj_id");
return array("ref_id" => $ref_id, "obj_id" => $obj_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBasicSkill::read ( )

Read data from database.

Reimplemented from ilSkillTreeNode.

Definition at line 40 of file class.ilBasicSkill.php.

{
}
static ilBasicSkill::updateAllUserSkillLevels ( )
static

Look for all skill level that have a trigger and update the user skill level information, if it has changed.

Definition at line 413 of file class.ilBasicSkill.php.

References $ilDB, ilObject\_hasUntrashedReference(), ilLPStatusWrapper\_lookupCompletedForObject(), ACHIEVED, and writeUserSkillLevelStatus().

{
global $ilDB;
die("ilBasicSkill::updateAllUserSkillLevels is deprecated.");
$set = $ilDB->query("SELECT id, trigger_obj_id FROM skl_level WHERE ".
" trigger_obj_id > ".$ilDB->quote(0, "integer")
);
while ($rec = $ilDB->fetchAssoc($set)) // all trigger objects
{
$skill_level_id = $rec["id"];
$tr_obj_id = $rec["trigger_obj_id"];
{
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
foreach ($completed as $user_id)
{
}
}
}
}

+ Here is the call graph for this function:

ilBasicSkill::updateLevelOrder (   $order)

Update level order.

Parameters
@return

Definition at line 299 of file class.ilBasicSkill.php.

References $id, and $ilDB.

{
global $ilDB;
asort($order);
$cnt = 1;
foreach ($order as $id => $o)
{
$ilDB->manipulate("UPDATE skl_level SET ".
" nr = ".$ilDB->quote($cnt, "integer").
" WHERE id = ".$ilDB->quote($id, "integer")
);
$cnt++;
}
}
static ilBasicSkill::updateSkillLevelsByTriggerRef (   $a_user_id,
  $a_ref_id 
)
static

Look for all skill level that have a trigger and update the user skill level information, if it has changed.

Definition at line 442 of file class.ilBasicSkill.php.

References $ilDB, ilObject\_hasUntrashedReference(), ilLPStatusWrapper\_lookupCompletedForObject(), ACHIEVED, and writeUserSkillLevelStatus().

{
global $ilDB;
die("ilBasicSkill::updateSkillLevelsByTriggerRef is deprecated.");
$set = $ilDB->query("SELECT id, trigger_obj_id FROM skl_level WHERE ".
" trigger_ref_id = ".$ilDB->quote($a_ref_id, "integer")
);
while ($rec = $ilDB->fetchAssoc($set)) // all trigger objects
{
$skill_level_id = $rec["id"];
$tr_obj_id = $rec["trigger_obj_id"];
{
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
foreach ($completed as $user_id)
{
if ($a_user_id == $user_id)
{
}
}
}
}
}

+ Here is the call graph for this function:

static ilBasicSkill::writeLevelDescription (   $a_id,
  $a_description 
)
static

Write level description.

Parameters
intlevel id
textlevel description

Definition at line 270 of file class.ilBasicSkill.php.

References writeLevelProperty().

{
ilBasicSkill::writeLevelProperty($a_id, "description", $a_description, "clob");
}

+ Here is the call graph for this function:

static ilBasicSkill::writeLevelProperty (   $a_id,
  $a_prop,
  $a_value,
  $a_type 
)
staticprotected

Write level property.

Parameters
@return

Definition at line 242 of file class.ilBasicSkill.php.

References $ilDB.

Referenced by writeLevelDescription(), writeLevelTitle(), and writeLevelTrigger().

{
global $ilDB;
$ilDB->update("skl_level", array(
$a_prop => array($a_type, $a_value),
), array(
"id" => array("integer", $a_id),
));
}

+ Here is the caller graph for this function:

static ilBasicSkill::writeLevelTitle (   $a_id,
  $a_title 
)
static

Write level title.

Parameters
intlevel id
textlevel title

Definition at line 259 of file class.ilBasicSkill.php.

References writeLevelProperty().

{
ilBasicSkill::writeLevelProperty($a_id, "title", $a_title, "text");
}

+ Here is the call graph for this function:

static ilBasicSkill::writeLevelTrigger (   $a_id,
  $a_trigger_ref_id 
)
static

Write trigger.

Parameters
intlevel id
textlevel description

Definition at line 281 of file class.ilBasicSkill.php.

References ilObject\_lookupObjId(), and writeLevelProperty().

Referenced by ilBasicSkillGUI\removeLevelTrigger(), and ilBasicSkillGUI\saveLevelTrigger().

{
die("ilBasicSkill::writeLevelTrigger is deprecated.");
$a_trigger_obj_id = 0;
if ($a_trigger_ref_id > 0)
{
$a_trigger_obj_id = ilObject::_lookupObjId($a_trigger_ref_id);
}
ilBasicSkill::writeLevelProperty($a_id, "trigger_ref_id", $a_trigger_ref_id, "integer");
ilBasicSkill::writeLevelProperty($a_id, "trigger_obj_id", $a_trigger_obj_id, "integer");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBasicSkill::writeUserSkillLevelStatus (   $a_level_id,
  $a_user_id,
  $a_trigger_ref_id,
  $a_tref_id = 0,
  $a_status = ilBasicSkill::ACHIEVED,
  $a_force = false,
  $a_self_eval = 0 
)
static

Write skill level status.

Parameters
intskill level id
intuser id
intstatus

Definition at line 477 of file class.ilBasicSkill.php.

References $ilDB, ilObject\_lookupObjId(), ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), ACHIEVED, lookupLevelSkillId(), and ilUtil\now().

Referenced by ilTestSkillEvaluation\invokeSkillLevelTrigger(), ilPersonalSkill\saveSelfEvaluation(), updateAllUserSkillLevels(), updateSkillLevelsByTriggerRef(), ilSurveySkill\writeAppraiseeSkills(), and ilSurveySkillDeterminationGUI\writeSkills().

{
global $ilDB;
$skill_id = ilBasicSkill::lookupLevelSkillId($a_level_id);
$trigger_ref_id = $a_trigger_ref_id;
$trigger_obj_id = ilObject::_lookupObjId($trigger_ref_id);
$trigger_title = ilObject::_lookupTitle($trigger_obj_id);
$trigger_type = ilObject::_lookupType($trigger_obj_id);
$update = false;
// check whether current skill user level is identical
// to the one that should be set (-> no change required)
/* $ilDB->setLimit(1);
$set = $ilDB->query("SELECT status, valid FROM skl_user_skill_level WHERE ".
"level_id = ".$ilDB->quote($a_level_id, "integer")." AND ".
"user_id = ".$ilDB->quote($a_user_id, "integer")." AND ".
"tref_id = ".$ilDB->quote((int) $a_tref_id, "integer")." AND ".
"trigger_obj_id = ".$ilDB->quote($trigger_obj_id, "integer")." AND ".
"self_eval = ".$ilDB->quote($a_self_eval, "integer").
" ORDER BY status_date DESC"
);
$rec = $ilDB->fetchAssoc($set);
if (!$rec["valid"] || $rec["status"] != $a_status)
{
$save = true;
}*/
if ($a_self_eval)
{
$ilDB->setLimit(1);
$set = $ilDB->query("SELECT * FROM skl_user_skill_level WHERE ".
"skill_id = ".$ilDB->quote($skill_id, "integer")." AND ".
"user_id = ".$ilDB->quote($a_user_id, "integer")." AND ".
"tref_id = ".$ilDB->quote((int) $a_tref_id, "integer")." AND ".
"trigger_obj_id = ".$ilDB->quote($trigger_obj_id, "integer")." AND ".
"self_eval = ".$ilDB->quote($a_self_eval, "integer").
" ORDER BY status_date DESC"
);
$rec = $ilDB->fetchAssoc($set);
$status_day = substr($rec["status_date"], 0, 10);
$today = substr(ilUtil::now(), 0, 10);
if ($rec["valid"] && $rec["status"] == $a_status && $status_day == $today)
{
$update = true;
}
}
if ($update)
{
$now = ilUtil::now();
$ilDB->manipulate("UPDATE skl_user_skill_level SET ".
" level_id = ".$ilDB->quote($a_level_id, "integer").",".
" status_date = ".$ilDB->quote($now, "timestamp").
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
" AND status_date = ".$ilDB->quote($rec["status_date"], "timestamp").
" AND skill_id = ".$ilDB->quote($rec["skill_id"], "integer").
" AND status = ".$ilDB->quote($a_status, "integer").
" AND trigger_obj_id = ".$ilDB->quote($trigger_obj_id, "integer").
" AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer").
" AND self_eval = ".$ilDB->quote($a_self_eval, "integer")
);
}
else
{
$now = ilUtil::now();
$ilDB->manipulate("INSERT INTO skl_user_skill_level ".
"(level_id, user_id, tref_id, status_date, skill_id, status, valid, trigger_ref_id,".
"trigger_obj_id, trigger_obj_type, trigger_title, self_eval) VALUES (".
$ilDB->quote($a_level_id, "integer").",".
$ilDB->quote($a_user_id, "integer").",".
$ilDB->quote((int) $a_tref_id, "integer").",".
$ilDB->quote($now, "timestamp").",".
$ilDB->quote($skill_id, "integer").",".
$ilDB->quote($a_status, "integer").",".
$ilDB->quote(1, "integer").",".
$ilDB->quote($trigger_ref_id, "integer").",".
$ilDB->quote($trigger_obj_id, "integer").",".
$ilDB->quote($trigger_type, "text").",".
$ilDB->quote($trigger_title, "text").",".
$ilDB->quote($a_self_eval, "integer").
")");
}
// fix (removed level_id and added skill id, since table should hold only
// one entry per skill)
$ilDB->manipulate("DELETE FROM skl_user_has_level WHERE "
." user_id = ".$ilDB->quote($a_user_id, "integer")
." AND skill_id = ".$ilDB->quote($skill_id, "integer")
." AND tref_id = ".$ilDB->quote((int) $a_tref_id, "integer")
." AND trigger_obj_id = ".$ilDB->quote($trigger_obj_id, "integer")
." AND self_eval = ".$ilDB->quote($a_self_eval, "integer")
);
if ($a_status == ilBasicSkill::ACHIEVED)
{
$ilDB->manipulate("INSERT INTO skl_user_has_level ".
"(level_id, user_id, tref_id, status_date, skill_id, trigger_ref_id, trigger_obj_id, trigger_obj_type, trigger_title, self_eval) VALUES (".
$ilDB->quote($a_level_id, "integer").",".
$ilDB->quote($a_user_id, "integer").",".
$ilDB->quote($a_tref_id, "integer").",".
$ilDB->quote($now, "timestamp").",".
$ilDB->quote($skill_id, "integer").",".
$ilDB->quote($trigger_ref_id, "integer").",".
$ilDB->quote($trigger_obj_id, "integer").",".
$ilDB->quote($trigger_type, "text").",".
$ilDB->quote($trigger_title, "text").",".
$ilDB->quote($a_self_eval, "integer").
")");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilBasicSkill::$id

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

Referenced by updateLevelOrder().

const ilBasicSkill::EVAL_BY_ALL = 2
const ilBasicSkill::EVAL_BY_OTHERS_ = 0

Definition at line 21 of file class.ilBasicSkill.php.

const ilBasicSkill::EVAL_BY_SELF = 1

Definition at line 22 of file class.ilBasicSkill.php.

const ilBasicSkill::NOT_ACHIEVED = 0

Definition at line 19 of file class.ilBasicSkill.php.


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