ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSkillAppEventListener Class Reference

Update skill from Services/Tracking events. More...

+ Inheritance diagram for ilSkillAppEventListener:
+ Collaboration diagram for ilSkillAppEventListener:

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_params)
 Handle an event in a listener. More...
 

Detailed Description

Update skill from Services/Tracking events.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Member Function Documentation

◆ handleEvent()

static ilSkillAppEventListener::handleEvent (   $a_component,
  $a_event,
  $a_params 
)
static

Handle an event in a listener.

Parameters
string$a_componentcomponent, e.g. "Modules/Forum" or "Services/User"
string$a_eventevent e.g. "createUser", "updateUser", "deleteUser", ...
array$a_parameterparameter array (assoc), array("name" => ..., "phone_office" => ...)

Implements ilAppEventListener.

Definition at line 23 of file class.ilSkillAppEventListener.php.

References $handler, ilObject\_getAllReferences(), ilSkillResources\getTriggerLevelsForRefId(), ilLPStatus\LP_STATUS_COMPLETED_NUM, and ilBasicSkill\writeUserSkillLevelStatus().

24  {
25  switch ($a_component) {
26  case 'Services/Tracking':
27  switch ($a_event) {
28  case 'updateStatus':
29  if ($a_params["status"] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
30  $obj_id = $a_params["obj_id"];
31  $usr_id = $a_params["usr_id"];
32  include_once("./Services/Skill/classes/class.ilSkillResources.php");
33  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
34  foreach (ilObject::_getAllReferences($obj_id) as $ref_id) {
35  foreach (ilSkillResources::getTriggerLevelsForRefId($ref_id) as $sk) {
37  $sk["level_id"],
38  $usr_id,
39  $ref_id,
40  $sk["tref_id"]
41  );
42  }
43  }
44  }
45  break;
46  }
47  break;
48 
49  case "Services/Object":
50  switch ($a_event) {
51  case "beforeDeletion":
52  $handler = new ilSkillObjDeletionHandler($a_params["object"]->getId(), $a_params["object"]->getType());
53  $handler->processDeletion();
54  break;
55  }
56  break;
57 
58  }
59 
60  return true;
61  }
const LP_STATUS_COMPLETED_NUM
Handles deletion of (user) objects.
static _getAllReferences($a_id)
get all reference ids of object
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=false, $a_unique_identifier="")
Write skill level status.
$handler
static getTriggerLevelsForRefId($a_ref_id)
Get levels for trigger per ref id.
+ Here is the call graph for this function:

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