ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBasicSkill Class Reference

Basic Skill. More...

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

Public Member Functions

 __construct (int $a_id=0, ilBasicSkillLevelRepository $bsc_skl_lvl_db_rep=null, ilBasicSkillUserLevelRepository $bsc_skl_usr_lvl_db_rep=null, ilBasicSkillTreeRepository $bsc_skl_tre_rep=null)
 ilBasicSkill constructor. More...
 
 read ()
 Read data from database. More...
 
 create ()
 Create skill. More...
 
 delete ()
 Delete skill. More...
 
 copy ()
 Copy basic skill. More...
 
 addLevel (string $a_title, string $a_description, string $a_import_id="")
 
 getLevelData (int $a_id=0)
 
 updateLevelOrder (array $order)
 
 deleteLevel (int $a_id)
 
 fixLevelNumbering ()
 
 getSkillForLevelId (int $a_level_id)
 
 getMaxLevelPerType (int $a_tref_id, string $a_type, int $a_user_id=0, int $a_self_eval=0)
 
 getAllLevelEntriesOfUser (int $a_tref_id, int $a_user_id=0, int $a_self_eval=0)
 
 getAllHistoricLevelEntriesOfUser (int $a_tref_id, int $a_user_id=0, int $a_eval_by=0)
 
 getMaxLevelPerObject (int $a_tref_id, int $a_object_id, int $a_user_id=0, int $a_self_eval=0)
 
 getMaxLevel (int $a_tref_id, int $a_user_id=0, int $a_self_eval=0)
 
 getLastLevelPerObject (int $a_tref_id, int $a_object_id, int $a_user_id=0, int $a_self_eval=0)
 
 getLastUpdatePerObject (int $a_tref_id, int $a_object_id, int $a_user_id=0, int $a_self_eval=0)
 
 getTitleForCertificate ()
 Get title for certificate. More...
 
 getShortTitleForCertificate ()
 Get short title for certificate. More...
 
- Public Member Functions inherited from ilSkillTreeNode
 __construct ($a_id=0)
 
 setTitle ($a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_description)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setType ($a_type)
 Set type. More...
 
 getType ()
 Get type. More...
 
 setId ($a_id)
 Set Node ID. More...
 
 getId ()
 Get Node ID. More...
 
 setSelfEvaluation ($a_val)
 Set self evaluation. More...
 
 getSelfEvaluation ()
 Get self evaluation. More...
 
 setOrderNr ($a_val)
 Set order nr. More...
 
 getOrderNr ()
 Get order nr. More...
 
 setImportId ($a_val)
 Set import id. More...
 
 getImportId ()
 Get import id. More...
 
 getCreationDate ()
 Get creation date. More...
 
 read ()
 Read Data of Node. More...
 
 setDataRecord ($a_record)
 this method should only be called by class ilSCORM2004NodeFactory More...
 
 setStatus ($a_val)
 Set status. More...
 
 getStatus ()
 Get status. More...
 
 create ()
 Create Node. More...
 
 update ()
 Update Node. More...
 
 delete ()
 Delete Node. More...
 

Static Public Member Functions

static lookupLevelTitle (int $a_id)
 
static lookupLevelDescription (int $a_id)
 
static lookupLevelSkillId (int $a_id)
 
static writeLevelTitle (int $a_id, string $a_title)
 
static writeLevelDescription (int $a_id, string $a_description)
 
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 getNewAchievementsPerUser (string $a_timestamp, string $a_timestamp_to=null, int $a_user_id=0, int $a_self_eval=0)
 
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)
 
static removeAllUserSkillLevelStatusOfObject (int $a_user_id, int $a_trigger_obj_id, bool $a_self_eval=false, string $a_unique_identifier="")
 
static removeAllUserData (int $a_user_id)
 
static hasSelfEvaluated (int $a_user_id, int $a_skill_id, int $a_tref_id)
 
static _lookupCertificate (int $a_skill_id, int $a_skill_level_id)
 Checks whether a skill level has a certificate or not. More...
 
static getUsageInfo ($a_cskill_ids, &$a_usages)
 Get usage info. More...
 
static getCommonSkillIdForImportId (int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
 
static getLevelIdForImportId (int $a_source_inst_id, int $a_level_import_id)
 
static getLevelIdForImportIdMatchSkill (int $a_source_inst_id, int $a_level_import_id, int $a_skill_import_id, int $a_tref_import_id=0)
 Get level ids for import Ids matching common skills. More...
 
- Static Public Member Functions inherited from ilSkillTreeNode
static getAllStatus ()
 Get all status. More...
 
static getStatusInfo ($a_status)
 Get status info. More...
 
static _lookupTitle ($a_obj_id, $a_tref_id=0)
 Lookup Title. More...
 
static _lookupDescription ($a_obj_id)
 Lookup Description. More...
 
static _lookupSelfEvaluation ($a_obj_id)
 Lookup self evaluation. More...
 
static _lookupStatus ($a_obj_id)
 Lookup Status. More...
 
static _lookupType ($a_obj_id)
 Lookup Type. More...
 
static _writeTitle ($a_obj_id, $a_title)
 Write Title. More...
 
static _writeDescription ($a_obj_id, $a_description)
 Write Description. More...
 
static _writeOrderNr ($a_obj_id, $a_nr)
 Write Order Nr. More...
 
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 Put this object into the skill tree. More...
 
static getTree ($a_slm_obj_id)
 Get scorm module editing tree. More...
 
static uniqueTypesCheck ($a_items)
 Check for unique types. More...
 
static clipboardCut ($a_tree_id, $a_ids)
 Cut and copy a set of skills/skill categories into the clipboard. More...
 
static clipboardCopy ($a_tree_id, $a_ids)
 Copy a set of skills/skill categories into the clipboard. More...
 
static insertItemsFromClip ($a_type, $a_obj_id)
 Insert basic skills from clipboard. More...
 
static clearClipboard ()
 Remove all skill items from clipboard. More...
 
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. More...
 
static isInTree ($a_id)
 Is id in tree? More...
 
static getAllSelfEvaluationNodes ()
 Get all self evaluation nodes. More...
 
static getTopTemplates ()
 Get top skill templates and template categories. More...
 
static getSelectableSkills ()
 Get selectable skills. More...
 
static saveChildsOrder ($a_par_id, $a_childs_order, $a_templates=false)
 Save childs order. More...
 
static getIconPath ($a_obj_id, $a_type, $a_size="", $a_status=0)
 Get icon path. More...
 
static findSkills ($a_term)
 Find skills. More...
 
static getAllCSkillIdsForNodeIds (array $a_node_ids)
 Get all possible common skill IDs for node IDs. More...
 

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
 $skill_tree
 
const STATUS_PUBLISH = 0
 
const STATUS_DRAFT = 1
 
const STATUS_OUTDATED = 2
 
 $type
 
 $id
 
 $title
 
 $description
 

Static Protected Member Functions

static hasRecentSelfEvaluation (int $a_user_id, int $a_skill_id, int $a_tref_id=0, int $a_trigger_ref_id=0)
 
- Static Protected Member Functions inherited from ilSkillTreeNode
static _lookup ($a_obj_id, $a_field)
 Lookup Title. More...
 

Protected Attributes

 $user
 
 $bsc_skl_lvl_db_rep
 
 $bsc_skl_usr_lvl_db_rep
 
 $bsc_skl_tre_rep
 
- Protected Attributes inherited from ilSkillTreeNode
 $db
 

Additional Inherited Members

- Protected Member Functions inherited from ilSkillTreeNode
 setCreationDate ($a_val)
 Set creation date. More...
 

Detailed Description

Basic Skill.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkill::__construct ( int  $a_id = 0,
ilBasicSkillLevelRepository  $bsc_skl_lvl_db_rep = null,
ilBasicSkillUserLevelRepository  $bsc_skl_usr_lvl_db_rep = null,
ilBasicSkillTreeRepository  $bsc_skl_tre_rep = null 
)

ilBasicSkill constructor.

Parameters
int$a_id
ilBasicSkillLevelRepository | null$bsc_skl_lvl_db_rep
ilBasicSkillUserLevelRepository | null$bsc_skl_usr_lvl_db_rep
ilBasicSkillTreeRepository | null$bsc_skl_tre_rep

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

References $bsc_skl_lvl_db_rep, $bsc_skl_tre_rep, $bsc_skl_usr_lvl_db_rep, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilSkillTreeNode\setType(), and user().

53  {
54  global $DIC;
55 
56  $this->db = $DIC->database();
57  $this->user = $DIC->user();
58 
59  if (is_null($bsc_skl_lvl_db_rep)) {
60  $this->bsc_skl_lvl_db_rep = $DIC->skills()->internal()->repo()->getLevelRepo();
61  }
62  else {
63  $this->bsc_skl_lvl_db_rep = $bsc_skl_lvl_db_rep;
64  }
65 
66  if (is_null($bsc_skl_usr_lvl_db_rep)) {
67  $this->bsc_skl_usr_lvl_db_rep = $DIC->skills()->internal()->repo()->getUserLevelRepo();
68  }
69  else {
70  $this->bsc_skl_usr_lvl_db_rep = $bsc_skl_usr_lvl_db_rep;
71  }
72 
73  if (is_null($bsc_skl_tre_rep)) {
74  $this->bsc_skl_tre_rep = $DIC->skills()->internal()->repo()->getTreeRepo();
75  }
76  else {
77  $this->bsc_skl_tre_rep = $bsc_skl_tre_rep;
78  }
79 
80  parent::__construct($a_id);
81  $this->setType("skll");
82  }
setType($a_type)
Set type.
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _lookupCertificate()

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

Checks whether a skill level has a certificate or not.

Parameters
int$a_skill_idskill id
int$a_skill_level_idskill level id
Returns
bool

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

References CLIENT_WEB_DIR.

525  {
526  $certificatefile = CLIENT_WEB_DIR . "/certificates/skill/" .
527  ((int) $a_skill_id) . "/" . ((int) $a_skill_level_id) . "/certificate.xml";
528  if (@file_exists($certificatefile)) {
529  return true;
530  } else {
531  return false;
532  }
533  }
const CLIENT_WEB_DIR
Definition: constants.php:45

◆ addLevel()

ilBasicSkill::addLevel ( string  $a_title,
string  $a_description,
string  $a_import_id = "" 
)

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

References ilSkillTreeNode\getId().

143  {
144  $skill_id = $this->getId();
145  $this->bsc_skl_lvl_db_rep->addLevel($skill_id, $a_title, $a_description, $a_import_id);
146  }
+ Here is the call graph for this function:

◆ copy()

ilBasicSkill::copy ( )

Copy basic skill.

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

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

116  {
117  $skill = new ilBasicSkill();
118  $skill->setTitle($this->getTitle());
119  $skill->setDescription($this->getDescription());
120  $skill->setType($this->getType());
121  $skill->setSelfEvaluation($this->getSelfEvaluation());
122  $skill->setOrderNr($this->getOrderNr());
123  $skill->create();
124 
125  $levels = $this->getLevelData();
126  if (sizeof($levels)) {
127  foreach ($levels as $item) {
128  $skill->addLevel($item["title"], $item["description"]);
129  }
130  }
131  $skill->update();
132 
133  return $skill;
134  }
getDescription()
Get description.
getSelfEvaluation()
Get self evaluation.
getOrderNr()
Get order nr.
getLevelData(int $a_id=0)
Basic Skill.
+ Here is the call graph for this function:

◆ create()

ilBasicSkill::create ( )

Create skill.

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

96  {
97  parent::create();
98  }

◆ delete()

ilBasicSkill::delete ( )

Delete skill.

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

References ilSkillTreeNode\getId().

104  {
105  $skill_id = $this->getId();
106  $this->bsc_skl_lvl_db_rep->deleteLevelsOfSkill($skill_id);
107  $this->bsc_skl_usr_lvl_db_rep->deleteUserLevelsOfSkill($skill_id);
108 
109  parent::delete();
110  }
+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkill::deleteLevel ( int  $a_id)

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

215  {
216  $this->bsc_skl_lvl_db_rep->deleteLevel($a_id);
217  }

◆ fixLevelNumbering()

ilBasicSkill::fixLevelNumbering ( )

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

References ilSkillTreeNode\getId().

220  {
221  $skill_id = $this->getId();
222  $this->bsc_skl_lvl_db_rep->fixLevelNumbering($skill_id);
223  }
+ Here is the call graph for this function:

◆ getAllHistoricLevelEntriesOfUser()

ilBasicSkill::getAllHistoricLevelEntriesOfUser ( int  $a_tref_id,
int  $a_user_id = 0,
int  $a_eval_by = 0 
)

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

References ilSkillTreeNode\getId(), and user().

410  : array {
411  if ($a_user_id == 0) {
412  $a_user_id = $this->user->getId();
413  }
414  $skill_id = $this->getId();
415 
416  return $this->bsc_skl_usr_lvl_db_rep->getAllHistoricLevelEntriesOfUser($skill_id, $a_tref_id, $a_user_id,
417  $a_eval_by);
418  }
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ getAllLevelEntriesOfUser()

ilBasicSkill::getAllLevelEntriesOfUser ( int  $a_tref_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

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

References ilSkillTreeNode\getId(), and user().

397  : array {
398  if ($a_user_id == 0) {
399  $a_user_id = $this->user->getId();
400  }
401  $skill_id = $this->getId();
402 
403  return $this->bsc_skl_usr_lvl_db_rep->getAllLevelEntriesOfUser($skill_id, $a_tref_id, $a_user_id, $a_self_eval);
404  }
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ getCommonSkillIdForImportId()

static ilBasicSkill::getCommonSkillIdForImportId ( int  $a_source_inst_id,
int  $a_skill_import_id,
int  $a_tref_import_id = 0 
)
static

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

References $DIC, and $ilDB.

Referenced by ilAssQuestionSkillAssignmentImporter\getSkillIdMapping(), ilSurveyDataSet\importRecord(), and ilSkillDataSet\importRecord().

555  : array {
556  global $DIC;
557 
558  $ilDB = $DIC->database();
559 
560  $tree = new ilSkillTree();
561 
562  if ($a_source_inst_id == 0) {
563  return array();
564  }
565 
566  $repository = new ilBasicSkillTreeDBRepository($ilDB);
567  return $repository->getCommonSkillIdForImportId($tree, $a_source_inst_id, $a_skill_import_id,
568  $a_tref_import_id);
569  }
Skill tree.
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ getLastLevelPerObject()

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

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

References ilSkillTreeNode\getId(), and user().

469  {
470  if ($a_user_id == 0) {
471  $a_user_id = $this->user->getId();
472  }
473  $skill_id = $this->getId();
474 
475  return $this->bsc_skl_usr_lvl_db_rep->getLastLevelPerObject($skill_id, $a_tref_id, $a_object_id, $a_user_id,
476  $a_self_eval);
477  }
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ getLastUpdatePerObject()

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

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

References ilSkillTreeNode\getId(), and user().

484  {
485  if ($a_user_id == 0) {
486  $a_user_id = $this->user->getId();
487  }
488  $skill_id = $this->getId();
489 
490  return $this->bsc_skl_usr_lvl_db_rep->getLastUpdatePerObject($skill_id, $a_tref_id, $a_object_id, $a_user_id,
491  $a_self_eval);
492  }
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ getLevelData()

ilBasicSkill::getLevelData ( int  $a_id = 0)

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

References ilSkillTreeNode\getId().

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

148  : array
149  {
150  $skill_id = $this->getId();
151 
152  return $this->bsc_skl_lvl_db_rep->getLevelData($skill_id, $a_id);
153  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLevelIdForImportId()

static ilBasicSkill::getLevelIdForImportId ( int  $a_source_inst_id,
int  $a_level_import_id 
)
static

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

References $DIC, and $ilDB.

Referenced by ilTestSkillLevelThresholdImporter\getLevelIdMapping(), and ilSkillDataSet\importRecord().

571  : array
572  {
573  global $DIC;
574 
575  $ilDB = $DIC->database();
576 
577  $repository = new ilBasicSkillTreeDBRepository($ilDB);
578 
579  return $repository->getLevelIdForImportId($a_source_inst_id, $a_level_import_id);
580  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ getLevelIdForImportIdMatchSkill()

static ilBasicSkill::getLevelIdForImportIdMatchSkill ( int  $a_source_inst_id,
int  $a_level_import_id,
int  $a_skill_import_id,
int  $a_tref_import_id = 0 
)
static

Get level ids for import Ids matching common skills.

Parameters
int$a_source_inst_id
int$a_level_import_id
int$a_skill_import_id
int$a_tref_import_id
Returns
array

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

References lookupLevelSkillId().

Referenced by ilSurveyDataSet\importRecord().

595  : array {
596  $level_id_data = self::getLevelIdForImportId($a_source_inst_id, $a_level_import_id);
597  $skill_data = self::getCommonSkillIdForImportId($a_source_inst_id, $a_skill_import_id, $a_tref_import_id);
598  $matches = array();
599  foreach ($level_id_data as $l) {
600  reset($skill_data);
601  foreach ($skill_data as $s) {
602  if (ilBasicSkill::lookupLevelSkillId($l["level_id"]) == $s["skill_id"]) {
603  $matches[] = array(
604  "level_id" => $l["level_id"],
605  "creation_date" => $l["creation_date"],
606  "skill_id" => $s["skill_id"],
607  "tref_id" => $s["tref_id"]
608  );
609  }
610  }
611  }
612  return $matches;
613  }
static lookupLevelSkillId(int $a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaxLevel()

ilBasicSkill::getMaxLevel ( int  $a_tref_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

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

References ilSkillTreeNode\getId(), getLevelData(), and user().

440  : int {
441  if ($a_user_id == 0) {
442  $a_user_id = $this->user->getId();
443  }
444  $skill_id = $this->getId();
445  $levels = $this->getLevelData();
446 
447  return $this->bsc_skl_usr_lvl_db_rep->getMaxLevel($skill_id, $levels, $a_tref_id, $a_user_id, $a_self_eval);
448  }
user()
Definition: user.php:4
getLevelData(int $a_id=0)
+ Here is the call graph for this function:

◆ getMaxLevelPerObject()

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

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

References ilSkillTreeNode\getId(), getLevelData(), and user().

425  : int {
426  if ($a_user_id == 0) {
427  $a_user_id = $this->user->getId();
428  }
429  $skill_id = $this->getId();
430  $levels = $this->getLevelData();
431 
432  return $this->bsc_skl_usr_lvl_db_rep->getMaxLevelPerObject($skill_id, $levels, $a_tref_id, $a_object_id,
433  $a_user_id, $a_self_eval);
434  }
user()
Definition: user.php:4
getLevelData(int $a_id=0)
+ Here is the call graph for this function:

◆ getMaxLevelPerType()

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

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

References ilSkillTreeNode\getId(), getLevelData(), and user().

382  : int {
383  if ($a_user_id == 0) {
384  $a_user_id = $this->user->getId();
385  }
386  $skill_id = $this->getId();
387  $levels = $this->getLevelData();
388 
389  return $this->bsc_skl_usr_lvl_db_rep->getMaxLevelPerType($skill_id, $levels, $a_tref_id, $a_type, $a_user_id,
390  $a_self_eval);
391  }
user()
Definition: user.php:4
getLevelData(int $a_id=0)
+ Here is the call graph for this function:

◆ getNewAchievementsPerUser()

static ilBasicSkill::getNewAchievementsPerUser ( string  $a_timestamp,
string  $a_timestamp_to = null,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)
static

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

References $DIC, and $ilDB.

Referenced by ilSkillLearningHistoryProvider\getEntries(), and ilSkillNotifications\run().

292  : array {
293  global $DIC;
294 
295  $ilDB = $DIC->database();
296 
297  $repository = new ilBasicSkillUserLevelDBRepository($ilDB);
298 
299  return $repository->getNewAchievementsPerUser($a_timestamp, $a_timestamp_to, $a_user_id, $a_self_eval);
300  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ getShortTitleForCertificate()

ilBasicSkill::getShortTitleForCertificate ( )

Get short title for certificate.

Returns
string

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

514  {
515  return "Skill";
516  }

◆ getSkillForLevelId()

ilBasicSkill::getSkillForLevelId ( int  $a_level_id)

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

226  {
227  return $this->bsc_skl_lvl_db_rep->getSkillForLevelId($a_level_id);
228  }

◆ getTitleForCertificate()

ilBasicSkill::getTitleForCertificate ( )

Get title for certificate.

Returns
string

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

References ilSkillTreeNode\getTitle().

505  {
506  return $this->getTitle();
507  }
+ Here is the call graph for this function:

◆ getUsageInfo()

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

Get usage info.

Parameters
array$a_cskill_ids
array$a_usages

Implements ilSkillUsageInfo.

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

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

541  {
543  $a_cskill_ids,
544  $a_usages,
546  "skl_user_skill_level",
547  "user_id"
548  );
549  }
static getUsageInfoGeneric( $a_cskill_ids, &$a_usages, $a_usage_type, $a_table, $a_key_field, $a_skill_field="skill_id", $a_tref_field="tref_id")
Get standard usage query.
+ Here is the call graph for this function:

◆ hasRecentSelfEvaluation()

static ilBasicSkill::hasRecentSelfEvaluation ( int  $a_user_id,
int  $a_skill_id,
int  $a_tref_id = 0,
int  $a_trigger_ref_id = 0 
)
staticprotected

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

References $DIC, and $ilDB.

272  {
273  global $DIC;
274 
275  $ilDB = $DIC->database();
276 
277  $obj_adapter = new ilSkillObjectAdapter();
278  $trigger_obj_id = ($a_trigger_ref_id > 0)
279  ? $obj_adapter->getObjIdForRefId($a_trigger_ref_id)
280  : 0;
281  $repository = new ilBasicSkillUserLevelDBRepository($ilDB);
282 
283  return $repository->hasRecentSelfEvaluation($trigger_obj_id, $a_user_id, $a_skill_id, $a_tref_id,
284  $a_trigger_ref_id);
285  }
Class ilBasicSkillObjectAdapter.
global $DIC
Definition: goto.php:24
global $ilDB

◆ hasSelfEvaluated()

static ilBasicSkill::hasSelfEvaluated ( int  $a_user_id,
int  $a_skill_id,
int  $a_tref_id 
)
static

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

References $DIC, and $ilDB.

Referenced by ilPersonalSkillsGUI\getSuggestedResources(), ilPersonalSkillsGUI\listAssignedProfile(), and ilPersonalSkillsGUI\renderSkillHTML().

454  : bool {
455  global $DIC;
456 
457  $ilDB = $DIC->database();
458 
459  $repository = new ilBasicSkillUserLevelDBRepository($ilDB);
460 
461  return $repository->hasSelfEvaluated($a_user_id, $a_skill_id, $a_tref_id);
462  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ lookupLevelDescription()

static ilBasicSkill::lookupLevelDescription ( int  $a_id)
static

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

References $DIC, and $ilDB.

166  : string
167  {
168  global $DIC;
169 
170  $ilDB = $DIC->database();
171 
172  $repository = new ilBasicSkillLevelDBRepository($ilDB);
173 
174  return $repository->lookupLevelDescription($a_id);
175  }
Class ilBasicSkillLevelDBRepository.
global $DIC
Definition: goto.php:24
global $ilDB

◆ lookupLevelSkillId()

static ilBasicSkill::lookupLevelSkillId ( int  $a_id)
static

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

References $DIC, and $ilDB.

Referenced by getLevelIdForImportIdMatchSkill(), ilSkillDataSet\importRecord(), and writeUserSkillLevelStatus().

177  : int
178  {
179  global $DIC;
180 
181  $ilDB = $DIC->database();
182 
183  $repository = new ilBasicSkillLevelDBRepository($ilDB);
184 
185  return $repository->lookupLevelSkillId($a_id);
186  }
Class ilBasicSkillLevelDBRepository.
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ lookupLevelTitle()

static ilBasicSkill::lookupLevelTitle ( int  $a_id)
static

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

References $DIC, and $ilDB.

Referenced by ilSkillProfileGUI\confirmLevelAssignmentRemoval(), ilBasicSkillGUI\confirmLevelDeletion(), ilSkillProfileLevelsTableGUI\fillRow(), ilContSkillMemberTableGUI\fillRow(), ilSkillLearningHistoryProvider\getEntries(), ilPersonalSkillsGUI\getSuggestedResources(), ilSkillNotifications\sendMail(), ilBasicSkillTemplateGUI\setLevelHead(), and ilBasicSkillGUI\setLevelHead().

155  : string
156  {
157  global $DIC;
158 
159  $ilDB = $DIC->database();
160 
161  $repository = new ilBasicSkillLevelDBRepository($ilDB);
162 
163  return $repository->lookupLevelTitle($a_id);
164  }
Class ilBasicSkillLevelDBRepository.
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilBasicSkill::read ( )

Read data from database.

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

88  {
89  parent::read();
90  }

◆ removeAllUserData()

static ilBasicSkill::removeAllUserData ( int  $a_user_id)
static

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

References $DIC, and $ilDB.

Referenced by ilSkillObjDeletionHandler\processDeletion().

368  {
369  global $DIC;
370 
371  $ilDB = $DIC->database();
372 
373  $repository = new ilBasicSkillUserLevelDBRepository($ilDB);
374  $repository->removeAllUserData($a_user_id);
375  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ removeAllUserSkillLevelStatusOfObject()

static ilBasicSkill::removeAllUserSkillLevelStatusOfObject ( int  $a_user_id,
int  $a_trigger_obj_id,
bool  $a_self_eval = false,
string  $a_unique_identifier = "" 
)
static

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

References $DIC, and $ilDB.

Referenced by ilContainerMemberSkills\publish(), and ilContainerMemberSkills\removeAllSkillLevels().

353  : bool {
354  global $DIC;
355 
356  $ilDB = $DIC->database();
357 
358  if ($a_trigger_obj_id == 0) {
359  return false;
360  }
361  $repository = new ilBasicSkillUserLevelDBRepository($ilDB);
362 
363  return $repository->removeAllUserSkillLevelStatusOfObject($a_user_id, $a_trigger_obj_id, $a_self_eval,
364  $a_unique_identifier);
365  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ resetUserSkillLevelStatus()

static ilBasicSkill::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

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

References $DIC, and $ilDB.

Referenced by ilPersonalSkill\saveSelfEvaluation().

242  {
243  global $DIC;
244 
245  $ilDB = $DIC->database();
246 
247  if (!$a_self_eval) {
248  throw new ilSkillException("resetUserSkillLevelStatus currently only provided for self evaluations.");
249  }
250 
251  $obj_adapter = new ilSkillObjectAdapter();
252  $trigger_obj_id = ($a_trigger_ref_id > 0)
253  ? $obj_adapter->getObjIdForRefId($a_trigger_ref_id)
254  : 0;
255 
256  $update = false;
257  $repository = new ilBasicSkillUserLevelDBRepository($ilDB);
258  $status_date = $repository->hasRecentSelfEvaluation($a_user_id, $a_skill_id, $a_tref_id, $a_trigger_ref_id);
259  if ($status_date != "") {
260  $update = true;
261  }
262 
263  $repository->resetUserSkillLevelStatus($update, $trigger_obj_id, $status_date, $a_user_id, $a_skill_id,
264  $a_tref_id, $a_trigger_ref_id, $a_self_eval);
265  }
Class ilBasicSkillObjectAdapter.
global $DIC
Definition: goto.php:24
Skill exception class.
global $ilDB
+ Here is the caller graph for this function:

◆ updateLevelOrder()

ilBasicSkill::updateLevelOrder ( array  $order)

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

209  {
210  asort($order);
211  $this->bsc_skl_lvl_db_rep->updateLevelOrder($order);
212  }

◆ writeLevelDescription()

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

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

References $DIC, and $ilDB.

199  {
200  global $DIC;
201 
202  $ilDB = $DIC->database();
203 
204  $repository = new ilBasicSkillLevelDBRepository($ilDB);
205  $repository->writeLevelDescription($a_id, $a_description);
206  }
Class ilBasicSkillLevelDBRepository.
global $DIC
Definition: goto.php:24
global $ilDB

◆ writeLevelTitle()

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

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

References $DIC, and $ilDB.

189  {
190  global $DIC;
191 
192  $ilDB = $DIC->database();
193 
194  $repository = new ilBasicSkillLevelDBRepository($ilDB);
195  $repository->writeLevelTitle($a_id, $a_title);
196  }
Class ilBasicSkillLevelDBRepository.
global $DIC
Definition: goto.php:24
global $ilDB

◆ writeUserSkillLevelStatus()

static ilBasicSkill::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 
)
static

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

References $DIC, $ilDB, and lookupLevelSkillId().

Referenced by ilSkillAppEventListener\handleEvent(), ilTestSkillEvaluation\invokeSkillLevelTrigger(), ilContainerMemberSkills\publish(), ilPersonalSkill\saveSelfEvaluation(), ilSurveySkill\writeAndAddAppraiseeSkills(), ilSurveySkill\writeAndAddSelfEvalSkills(), and ilSurveySkillDeterminationGUI\writeAndAddSkills().

312  {
313  global $DIC;
314 
315  $ilDB = $DIC->database();
316 
317  $skill_id = ilBasicSkill::lookupLevelSkillId($a_level_id);
318  $trigger_ref_id = $a_trigger_ref_id;
319  $obj_adapter = new ilSkillObjectAdapter();
320  $trigger_obj_id = $obj_adapter->getObjIdForRefId($trigger_ref_id);
321  $trigger_title = $obj_adapter->getTitleForObjId($trigger_obj_id);
322  $trigger_type = $obj_adapter->getTypeForObjId($trigger_obj_id);
323 
324  $update = false;
325 
326  // self evaluations will update, if the last self evaluation is on the same day
327  if ($a_self_eval && self::hasRecentSelfEvaluation($a_user_id, $skill_id, $a_tref_id, $trigger_ref_id)) {
328  $status_date = self::hasRecentSelfEvaluation($a_user_id, $skill_id, $a_tref_id, $trigger_ref_id);
329  if ($status_date != "") {
330  $update = true;
331  }
332  }
333 
334  //next level percentage fulfilment value must be >=0 and <1
335  if (!($a_next_level_fulfilment >= 0) || !($a_next_level_fulfilment < 1)) {
336  throw new \UnexpectedValueException(
337  "Next level fulfilment must be equal to or greater than 0 and less than 1, '" .
338  $a_next_level_fulfilment . "' given."
339  );
340  }
341 
342  $repository = new ilBasicSkillUserLevelDBRepository($ilDB);
343  $repository->writeUserSkillLevelStatus($skill_id, $trigger_ref_id, $trigger_obj_id, $trigger_title,
344  $trigger_type, $update, $status_date, $a_level_id, $a_user_id, $a_tref_id, $a_self_eval,
345  $a_unique_identifier, $a_next_level_fulfilment);
346  }
static lookupLevelSkillId(int $a_id)
Class ilBasicSkillObjectAdapter.
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $bsc_skl_lvl_db_rep

ilBasicSkill::$bsc_skl_lvl_db_rep
protected

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

Referenced by __construct().

◆ $bsc_skl_tre_rep

ilBasicSkill::$bsc_skl_tre_rep
protected

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

Referenced by __construct().

◆ $bsc_skl_usr_lvl_db_rep

ilBasicSkill::$bsc_skl_usr_lvl_db_rep
protected

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

Referenced by __construct().

◆ $id

ilBasicSkill::$id

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

◆ $user

ilBasicSkill::$user
protected

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

◆ ACHIEVED

◆ EVAL_BY_ALL

const ilBasicSkill::EVAL_BY_ALL = 2

◆ EVAL_BY_OTHERS_

const ilBasicSkill::EVAL_BY_OTHERS_ = 0

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

◆ EVAL_BY_SELF

const ilBasicSkill::EVAL_BY_SELF = 1

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

◆ NOT_ACHIEVED

const ilBasicSkill::NOT_ACHIEVED = 0

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


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