ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSEnrolmentStatusCommandQueueHandler Class Reference

Description of class. More...

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

Public Member Functions

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

Protected Member Functions

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

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

ilECSEnrolmentStatusCommandQueueHandler::__construct ( ilECSSetting  $server)

Constructor.

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

References $server.

{
$this->server = $server;
}

Member Function Documentation

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.

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

{
include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
$obj_id = end($obj_ids);
$ref_ids = ilObject::_getAllReferences($obj_id);
$ref_id = end($ref_ids);
if(!$ref_id)
{
// Remote object not found
return TRUE;
}
switch($status->getStatus())
{
// nothing todo in the moment: maybe send mail
break;
$GLOBALS['ilLog']->write(__METHOD__.': Add desktop item: '.$a_usr_id.' '.$ref_id.' '.$obj_id);
break;
$GLOBALS['ilLog']->write(__METHOD__.': Remove desktop item: '.$a_usr_id.' '.$ref_id.' '.$obj_id);
break;
}
return TRUE;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSEnrolmentStatusCommandQueueHandler::getMid ( )

Get mid.

Returns
type

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

References $mid.

{
return $this->mid;
}
ilECSEnrolmentStatusCommandQueueHandler::getServer ( )

Get server.

Returns
ilECSServerSetting

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

References $server.

{
return $this->server;
}
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().

{
try
{
include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatus.php';
include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatusConnector.php';
$enrolment_con = new ilECSEnrolmentStatusConnector($server);
$status = $enrolment_con->getEnrolmentStatus($a_content_id);
$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($status,TRUE));
$GLOBALS['ilLog']->write(__METHOD__.': '.$status->getPersonIdType());
$GLOBALS['ilLog']->write(__METHOD__.': '.$status->getPersonId());
switch($status->getPersonIdType())
{
$id_arr = ilUtil::parseImportId($status->getPersonId());
$GLOBALS['ilLog']->write(__METHOD__.': Handling status change to '.$status->getStatus().' for user '.$id_arr['id']);
$this->doUpdate($id_arr['id'],$status);
break;
default:
$GLOBALS['ilLog']->write(__METHOD__.': not implemented yes: person id type: '.$status->getPersonIdType());
break;
}
}
{
$GLOBALS['ilLog']->write(__METHOD__.': Enrolment status change failed with messsage: '.$e->getMessage());
}
return TRUE;
}

+ Here is the call graph for this function:

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.

{
// nothing todo
return true;
}
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.

{
// Shouldn't happen
return true;
}

Field Documentation

ilECSEnrolmentStatusCommandQueueHandler::$mid = 0
private

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

Referenced by getMid().

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: