ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSEnrolmentStatusCommandQueueHandler Class Reference

Description of class. More...

+ Inheritance diagram for ilECSEnrolmentStatusCommandQueueHandler:
+ Collaboration diagram for ilECSEnrolmentStatusCommandQueueHandler:

Public Member Functions

 __construct (ilECSSetting $server)
 Constructor. More...
 
 getServer ()
 Get server. More...
 
 getMid ()
 Get mid. More...
 
 checkAllocationActivation (ilECSSetting $server, $a_content_id)
 Check if course allocation is activated for one recipient of the. More...
 
 handleCreate (ilECSSetting $server, $a_content_id)
 Handle create. More...
 
 handleDelete (ilECSSetting $server, $a_content_id)
 Handle delete. More...
 
 handleUpdate (ilECSSetting $server, $a_content_id)
 Handle update. More...
 

Protected Member Functions

 doUpdate ($a_usr_id, ilECSEnrolmentStatus $status)
 Perform update. More...
 

Private Attributes

 $server = null
 
 $mid = 0
 

Detailed Description

Description of class.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 15 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSEnrolmentStatusCommandQueueHandler::__construct ( ilECSSetting  $server)

Constructor.

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

References $server.

Member Function Documentation

◆ checkAllocationActivation()

ilECSEnrolmentStatusCommandQueueHandler::checkAllocationActivation ( ilECSSetting  $server,
  $a_content_id 
)

Check if course allocation is activated for one recipient of the.

Parameters
ilECSSetting$server
type$a_content_id

Definition at line 52 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

53  {
54  }

◆ doUpdate()

ilECSEnrolmentStatusCommandQueueHandler::doUpdate (   $a_usr_id,
ilECSEnrolmentStatus  $status 
)
protected

Perform update.

Parameters
type$a_content_id
type$course

Definition at line 119 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

References $GLOBALS, ilObjUser\_addDesktopItem(), ilObjUser\_dropDesktopItem(), ilObject\_getAllReferences(), ilObject\_lookupType(), ilECSEnrolmentStatus\getId(), ilECSEnrolmentStatus\getStatus(), ilECSImport\lookupObjIdsByContentId(), ilECSEnrolmentStatus\STATUS_ACCOUNT_DEACTIVATED, ilECSEnrolmentStatus\STATUS_ACTIVE, ilECSEnrolmentStatus\STATUS_DENIED, ilECSEnrolmentStatus\STATUS_PENDING, ilECSEnrolmentStatus\STATUS_REJECTED, and ilECSEnrolmentStatus\STATUS_UNSUBSCRIBED.

Referenced by handleCreate().

120  {
121  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
122  $obj_ids = ilECSImport::lookupObjIdsByContentId($status->getId());
123  $obj_id = end($obj_ids);
124  $ref_ids = ilObject::_getAllReferences($obj_id);
125  $ref_id = end($ref_ids);
126 
127 
128  if (!$ref_id) {
129  // Remote object not found
130  return true;
131  }
132 
133  switch ($status->getStatus()) {
135  // nothing todo in the moment: maybe send mail
136  break;
137 
139  $GLOBALS['ilLog']->write(__METHOD__ . ': Add desktop item: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
140  ilObjUser::_addDesktopItem($a_usr_id, $ref_id, ilObject::_lookupType($obj_id));
141  break;
142 
147  $GLOBALS['ilLog']->write(__METHOD__ . ': Remove desktop item: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
148  ilObjUser::_dropDesktopItem($a_usr_id, $ref_id, ilObject::_lookupType($obj_id));
149  break;
150  }
151  return true;
152  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getAllReferences($a_id)
get all reference ids of object
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static _lookupType($a_id, $a_reference=false)
lookup object type
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
static lookupObjIdsByContentId($a_content_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMid()

ilECSEnrolmentStatusCommandQueueHandler::getMid ( )

Get mid.

Returns
type

Definition at line 42 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

References $mid.

◆ getServer()

ilECSEnrolmentStatusCommandQueueHandler::getServer ( )

Get server.

Returns
ilECSServerSetting

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

References $server.

◆ handleCreate()

ilECSEnrolmentStatusCommandQueueHandler::handleCreate ( ilECSSetting  $server,
  $a_content_id 
)

Handle create.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 62 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

References $GLOBALS, doUpdate(), ilECSEnrolmentStatus\ID_UID, and ilUtil\parseImportId().

63  {
64  try {
65  include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatus.php';
66  include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatusConnector.php';
67  $enrolment_con = new ilECSEnrolmentStatusConnector($server);
68  $status = $enrolment_con->getEnrolmentStatus($a_content_id);
69  $GLOBALS['ilLog']->write(__METHOD__ . ': ' . print_r($status, true));
70  $GLOBALS['ilLog']->write(__METHOD__ . ': ' . $status->getPersonIdType());
71  $GLOBALS['ilLog']->write(__METHOD__ . ': ' . $status->getPersonId());
72  switch ($status->getPersonIdType()) {
74  $id_arr = ilUtil::parseImportId($status->getPersonId());
75  $GLOBALS['ilLog']->write(__METHOD__ . ': Handling status change to ' . $status->getStatus() . ' for user ' . $id_arr['id']);
76  $this->doUpdate($id_arr['id'], $status);
77  break;
78 
79 
80 
81  default:
82  $GLOBALS['ilLog']->write(__METHOD__ . ': not implemented yes: person id type: ' . $status->getPersonIdType());
83  break;
84  }
85  } catch (ilECSConnectorException $e) {
86  $GLOBALS['ilLog']->write(__METHOD__ . ': Enrolment status change failed with messsage: ' . $e->getMessage());
87  }
88  return true;
89  }
static parseImportId($a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
doUpdate($a_usr_id, ilECSEnrolmentStatus $status)
Perform update.
Connector for course member ressource.
+ Here is the call graph for this function:

◆ handleDelete()

ilECSEnrolmentStatusCommandQueueHandler::handleDelete ( ilECSSetting  $server,
  $a_content_id 
)

Handle delete.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 96 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

97  {
98  // nothing todo
99  return true;
100  }

◆ handleUpdate()

ilECSEnrolmentStatusCommandQueueHandler::handleUpdate ( ilECSSetting  $server,
  $a_content_id 
)

Handle update.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 107 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

108  {
109  // Shouldn't happen
110  return true;
111  }

Field Documentation

◆ $mid

ilECSEnrolmentStatusCommandQueueHandler::$mid = 0
private

Definition at line 18 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

Referenced by getMid().

◆ $server

ilECSEnrolmentStatusCommandQueueHandler::$server = null
private

Definition at line 17 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

Referenced by __construct(), and getServer().


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