ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilEventParticipants Class Reference

class ilEventMembers More...

+ Collaboration diagram for ilEventParticipants:

Public Member Functions

 ilEventParticipants ($a_event_id)
 setUserId ($a_usr_id)
 getUserId ()
 setMark ($a_mark)
 getMark ()
 setComment ($a_comment)
 getComment ()
 setParticipated ($a_status)
 getParticipated ()
 setRegistered ($a_status)
 getRegistered ()
 updateUser ()
 getUser ($a_usr_id)
 getParticipants ()
 isRegistered ($a_usr_id)
 hasParticipated ($a_usr_id)
 updateParticipation ($a_usr_id, $a_status)
 _updateParticipation ($a_usr_id, $a_event_id, $a_status)
 _getRegistered ($a_event_id)
 _getParticipated ($a_event_id)
 _register ($a_usr_id, $a_event_id)
 register ($a_usr_id)
 _unregister ($a_usr_id, $a_event_id)
 unregister ($a_usr_id)
 _lookupMark ($a_event_id, $a_usr_id)
 _lookupComment ($a_event_id, $a_usr_id)
 getEventId ()
 setEventId ($a_event_id)
 _deleteByEvent ($a_event_id)
 _deleteByUser ($a_usr_id)
 __read ()

Static Public Member Functions

static _hasParticipated ($a_usr_id, $a_event_id)
static _isRegistered ($a_usr_id, $a_event_id)

Data Fields

 $ilErr
 $ilDB
 $tree
 $lng
 $event_id = null

Detailed Description

class ilEventMembers

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilEventParticipants.php 15697 2008-01-08 20:04:33Z hschottm

Definition at line 13 of file class.ilEventParticipants.php.

Member Function Documentation

ilEventParticipants::__read ( )

Definition at line 382 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getEventId().

Referenced by ilEventParticipants().

{
global $ilDB;
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($this->getEventId())." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->participants[$row->usr_id]['usr_id'] = $row->usr_id;
$this->participants[$row->usr_id]['registered'] = $row->registered;
$this->participants[$row->usr_id]['participated'] = $row->participated;
/*
$this->participants[$row->usr_id]['mark'] = $row->mark;
$this->participants[$row->usr_id]['comment'] = $row->e_comment;
*/
$lp_mark = new ilLPMarks($this->getEventId(), $row->usr_id);
$this->participants[$row->usr_id]['mark'] = $lp_mark->getMark();
$this->participants[$row->usr_id]['comment'] = $lp_mark->getComment();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEventParticipants::_deleteByEvent (   $a_event_id)

Definition at line 357 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, and ilLPMarks\deleteObject().

Referenced by ilObjSession\delete().

{
global $ilDB;
$query = "DELETE FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ";
$res = $ilDB->manipulate($query);
include_once "Services/Tracking/classes/class.ilLPMarks.php";
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEventParticipants::_deleteByUser (   $a_usr_id)

Definition at line 370 of file class.ilEventParticipants.php.

References $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

{
global $ilDB;
$query = "DELETE FROM event_participants ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilEventParticipants::_getParticipated (   $a_event_id)

Definition at line 182 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\_getStatusInfo().

{
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND participated = 1";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$user_ids[] = $row->usr_id;
}
return $user_ids ? $user_ids : array();
}

+ Here is the caller graph for this function:

ilEventParticipants::_getRegistered (   $a_event_id)

Definition at line 167 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\_getStatusInfo().

{
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND registered = ".$ilDB->quote(1 ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$user_ids[] = $row->usr_id;
}
return $user_ids ? $user_ids : array();
}

+ Here is the caller graph for this function:

static ilEventParticipants::_hasParticipated (   $a_usr_id,
  $a_event_id 
)
static

Definition at line 197 of file class.ilEventParticipants.php.

References $ilDB, $query, and $res.

Referenced by ilLPStatusEvent\determineStatus().

{
global $ilDB;
$query = "SELECT participated FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->query($query);
if ($rec = $ilDB->fetchAssoc($res))
{
return (bool) $rec["participated"];
}
return false;
}

+ Here is the caller graph for this function:

static ilEventParticipants::_isRegistered (   $a_usr_id,
  $a_event_id 
)
static

Definition at line 212 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\determineStatus(), ilObjSessionGUI\infoScreen(), ilObjSessionGUI\joinObject(), and ilObjSessionGUI\updateMembersObject().

{
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return (bool) $row->registered;
}
return false;
}

+ Here is the caller graph for this function:

ilEventParticipants::_lookupComment (   $a_event_id,
  $a_usr_id 
)

Definition at line 326 of file class.ilEventParticipants.php.

{
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
return $lp_mark->getComment();
/*
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->e_comment;
}
return '';
*/
}
ilEventParticipants::_lookupMark (   $a_event_id,
  $a_usr_id 
)

Definition at line 305 of file class.ilEventParticipants.php.

{
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
return $lp_mark->getMark();
/*
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->mark;
}
return '';
*/
}
ilEventParticipants::_register (   $a_usr_id,
  $a_event_id 
)

Definition at line 227 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, and ilLPStatusWrapper\_updateStatus().

Referenced by ilObjSessionGUI\joinObject(), register(), and ilObjSessionGUI\registerObject().

{
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->query($query);
if($res->numRows())
{
$query = "UPDATE event_participants ".
"SET registered = '1' ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->manipulate($query);
}
else
{
$query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
"VALUES( ".
"1, ".
"0, ".
$ilDB->quote($a_event_id ,'integer').", ".
$ilDB->quote($a_usr_id ,'integer')." ".
")";
$res = $ilDB->manipulate($query);
}
// refresh learning progress status after updating participant
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEventParticipants::_unregister (   $a_usr_id,
  $a_event_id 
)

Definition at line 266 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, and ilLPStatusWrapper\_updateStatus().

Referenced by ilObjSessionGUI\joinObject(), unregister(), and ilObjSessionGUI\unregisterObject().

{
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->query($query);
if($res->numRows())
{
$query = "UPDATE event_participants ".
"SET registered = 0 ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->manipulate($query);
}
else
{
$query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
"VALUES( ".
"0, ".
"0, ".
$ilDB->quote($a_event_id ,'integer').", ".
$ilDB->quote($a_usr_id ,'integer')." ".
")";
$res = $ilDB->manipulate($query);
}
// refresh learning progress status after updating participant
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEventParticipants::_updateParticipation (   $a_usr_id,
  $a_event_id,
  $a_status 
)

Definition at line 132 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, and ilLPStatusWrapper\_updateStatus().

Referenced by updateParticipation().

{
global $ilDB;
$query = "SELECT * FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->query($query);
if($res->numRows())
{
$query = "UPDATE event_participants ".
"SET participated = ".$ilDB->quote($a_status ,'integer')." ".
"WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
$res = $ilDB->manipulate($query);
}
else
{
$query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
"VALUES( ".
$ilDB->quote(0 ,'integer').", ".
$ilDB->quote($a_status ,'integer').", ".
$ilDB->quote($a_event_id ,'integer').", ".
$ilDB->quote($a_usr_id ,'integer')." ".
")";
$res = $ilDB->manipulate($query);
}
// refresh learning progress status after updating participant
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEventParticipants::getComment ( )

Definition at line 54 of file class.ilEventParticipants.php.

References $comment.

Referenced by updateUser().

{
}

+ Here is the caller graph for this function:

ilEventParticipants::getEventId ( )

Definition at line 348 of file class.ilEventParticipants.php.

References $event_id.

Referenced by __read(), register(), unregister(), updateParticipation(), and updateUser().

{
}

+ Here is the caller graph for this function:

ilEventParticipants::getMark ( )

Definition at line 46 of file class.ilEventParticipants.php.

Referenced by updateUser().

{
return $this->mark;
}

+ Here is the caller graph for this function:

ilEventParticipants::getParticipants ( )

Definition at line 112 of file class.ilEventParticipants.php.

{
return $this->participants ? $this->participants : array();
}
ilEventParticipants::getParticipated ( )

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

Referenced by updateUser().

{
return $this->participated;
}

+ Here is the caller graph for this function:

ilEventParticipants::getRegistered ( )

Definition at line 70 of file class.ilEventParticipants.php.

Referenced by updateUser().

{
return $this->registered;
}

+ Here is the caller graph for this function:

ilEventParticipants::getUser (   $a_usr_id)

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

{
return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
}
ilEventParticipants::getUserId ( )

Definition at line 38 of file class.ilEventParticipants.php.

Referenced by updateUser().

{
return $this->user_id;
}

+ Here is the caller graph for this function:

ilEventParticipants::hasParticipated (   $a_usr_id)

Definition at line 122 of file class.ilEventParticipants.php.

{
return $this->participants[$a_usr_id]['participated'] ? true : false;
}
ilEventParticipants::ilEventParticipants (   $a_event_id)

Definition at line 22 of file class.ilEventParticipants.php.

References $ilDB, $ilErr, $lng, $tree, and __read().

{
$this->ilErr =& $ilErr;
$this->db =& $ilDB;
$this->lng =& $lng;
$this->event_id = $a_event_id;
$this->__read();
}

+ Here is the call graph for this function:

ilEventParticipants::isRegistered (   $a_usr_id)

Definition at line 117 of file class.ilEventParticipants.php.

{
return $this->participants[$a_usr_id]['registered'] ? true : false;
}
ilEventParticipants::register (   $a_usr_id)

Definition at line 261 of file class.ilEventParticipants.php.

References _register(), and getEventId().

{
return ilEventParticipants::_register($a_usr_id,$this->getEventId());
}

+ Here is the call graph for this function:

ilEventParticipants::setComment (   $a_comment)

Definition at line 50 of file class.ilEventParticipants.php.

{
$this->comment = $a_comment;
}
ilEventParticipants::setEventId (   $a_event_id)

Definition at line 352 of file class.ilEventParticipants.php.

{
$this->event_id = $a_event_id;
}
ilEventParticipants::setMark (   $a_mark)

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

{
$this->mark = $a_mark;
}
ilEventParticipants::setParticipated (   $a_status)

Definition at line 58 of file class.ilEventParticipants.php.

{
$this->participated = $a_status;
}
ilEventParticipants::setRegistered (   $a_status)

Definition at line 66 of file class.ilEventParticipants.php.

{
$this->registered = $a_status;
}
ilEventParticipants::setUserId (   $a_usr_id)

Definition at line 34 of file class.ilEventParticipants.php.

Referenced by ilObjSessionGUI\updateMembersObject().

{
$this->user_id = $a_usr_id;
}

+ Here is the caller graph for this function:

ilEventParticipants::unregister (   $a_usr_id)

Definition at line 300 of file class.ilEventParticipants.php.

References _unregister(), and getEventId().

{
return ilEventParticipants::_unregister($a_usr_id,$this->getEventId());
}

+ Here is the call graph for this function:

ilEventParticipants::updateParticipation (   $a_usr_id,
  $a_status 
)

Definition at line 127 of file class.ilEventParticipants.php.

References _updateParticipation(), and getEventId().

{
}

+ Here is the call graph for this function:

ilEventParticipants::updateUser ( )

Definition at line 74 of file class.ilEventParticipants.php.

References $ilDB, $query, $res, ilLPStatusWrapper\_updateStatus(), getComment(), getEventId(), getMark(), getParticipated(), getRegistered(), and getUserId().

{
global $ilDB;
$query = "DELETE FROM event_participants ".
"WHERE event_id = ".$ilDB->quote($this->getEventId() ,'integer')." ".
"AND usr_id = ".$ilDB->quote($this->getUserId() ,'integer')." ";
$res = $ilDB->manipulate($query);
$query = "INSERT INTO event_participants (event_id,usr_id,registered,participated". // ,mark,e_comment
") VALUES( ".
$ilDB->quote($this->getEventId() ,'integer').", ".
$ilDB->quote($this->getUserId() ,'integer').", ".
$ilDB->quote($this->getRegistered() ,'integer').", ".
$ilDB->quote($this->getParticipated() ,'integer'). /* .", ".
$ilDB->quote($this->getMark() ,'text').", ".
$ilDB->quote($this->getComment() ,'text')." ". */
")";
$res = $ilDB->manipulate($query);
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$lp_mark = new ilLPMarks($this->getEventId(), $this->getUserId());
$lp_mark->setComment($this->getComment());
$lp_mark->setMark($this->getMark());
$lp_mark->update();
// refresh learning progress status after updating participant
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilEventParticipants::$event_id = null

Definition at line 20 of file class.ilEventParticipants.php.

Referenced by getEventId().

ilEventParticipants::$ilErr

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

Referenced by ilEventParticipants().

ilEventParticipants::$lng

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

Referenced by ilEventParticipants().

ilEventParticipants::$tree

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

Referenced by ilEventParticipants().


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