ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 handleCreate (ilECSSetting $server, $a_content_id)
 Handle create event. More...
 
 handleUpdate (ilECSSetting $server, $a_content_id)
 Handle update. More...
 
 handleDelete (ilECSSetting $server, $a_content_id)
 Handle delete action. 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)

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.

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 }
static lookupObjIdsByContentId($a_content_id)
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
$ref_id
Definition: sahs_server.php:39

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMid()

ilECSEnrolmentStatusCommandQueueHandler::getMid ( )

◆ getServer()

ilECSEnrolmentStatusCommandQueueHandler::getServer ( )

Get server.

Returns
ilECSServerSetting

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

34 {
35 return $this->server;
36 }

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.

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 }
91 {
92 $GLOBALS['ilLog']->write(__METHOD__.': Enrolment status change failed with messsage: '.$e->getMessage());
93 }
94 return TRUE;
95 }
doUpdate($a_usr_id, ilECSEnrolmentStatus $status)
Perform update.
Connector for course member ressource.
static parseImportId($a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...

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

+ 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

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