ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
55  }

◆ doUpdate()

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

Perform update.

Parameters
type$a_content_id
type$course

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

References $GLOBALS, $ref_id, 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().

126  {
127  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
128  $obj_ids = ilECSImport::lookupObjIdsByContentId($status->getId());
129  $obj_id = end($obj_ids);
130  $ref_ids = ilObject::_getAllReferences($obj_id);
131  $ref_id = end($ref_ids);
132 
133 
134  if(!$ref_id)
135  {
136  // Remote object not found
137  return TRUE;
138  }
139 
140  switch($status->getStatus())
141  {
143  // nothing todo in the moment: maybe send mail
144  break;
145 
147  $GLOBALS['ilLog']->write(__METHOD__.': Add desktop item: '.$a_usr_id.' '.$ref_id.' '.$obj_id);
149  break;
150 
155  $GLOBALS['ilLog']->write(__METHOD__.': Remove desktop item: '.$a_usr_id.' '.$ref_id.' '.$obj_id);
157  break;
158  }
159  return TRUE;
160  }
$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
$ref_id
Definition: sahs_server.php:39
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 63 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

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

64  {
65  try
66  {
67  include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatus.php';
68  include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatusConnector.php';
69  $enrolment_con = new ilECSEnrolmentStatusConnector($server);
70  $status = $enrolment_con->getEnrolmentStatus($a_content_id);
71  $GLOBALS['ilLog']->write(__METHOD__.': '.print_r($status,TRUE));
72  $GLOBALS['ilLog']->write(__METHOD__.': '.$status->getPersonIdType());
73  $GLOBALS['ilLog']->write(__METHOD__.': '.$status->getPersonId());
74  switch($status->getPersonIdType())
75  {
77  $id_arr = ilUtil::parseImportId($status->getPersonId());
78  $GLOBALS['ilLog']->write(__METHOD__.': Handling status change to '.$status->getStatus().' for user '.$id_arr['id']);
79  $this->doUpdate($id_arr['id'],$status);
80  break;
81 
82 
83 
84  default:
85  $GLOBALS['ilLog']->write(__METHOD__.': not implemented yes: person id type: '.$status->getPersonIdType());
86  break;
87  }
88 
89  }
90  catch (ilECSConnectorException $e)
91  {
92  $GLOBALS['ilLog']->write(__METHOD__.': Enrolment status change failed with messsage: '.$e->getMessage());
93  }
94  return TRUE;
95  }
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 102 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

103  {
104  // nothing todo
105  return true;
106  }

◆ handleUpdate()

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

Handle update.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

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

114  {
115  // Shouldn't happen
116  return true;
117  }

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: