49        $this->event_id = $a_event_id;
 
   55        $this->user_id = $a_usr_id;
 
   59        return $this->user_id;
 
   63        $this->mark = $a_mark;
 
   79        $this->participated = $a_status;
 
   87        $this->registered = $a_status;
 
   99        $this->contact = (int) $a_status;
 
  117        $query = 
"DELETE FROM event_participants " .
 
  118            "WHERE event_id = " . 
$ilDB->quote($this->
getEventId(), 
'integer') . 
" " .
 
  119            "AND usr_id = " . 
$ilDB->quote($this->
getUserId(), 
'integer') . 
" ";
 
  122        $query = 
"INSERT INTO event_participants (event_id,usr_id,registered,participated,contact " .
 
  132        include_once 
"Services/Tracking/classes/class.ilLPMarks.php";
 
  135        $lp_mark->setMark($this->
getMark());
 
  139        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  151        return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
 
  156        return $this->participants ? $this->participants : array();
 
  161        return $this->participants[$a_usr_id][
'registered'] ? true : 
false;
 
  166        return $this->participants[$a_usr_id][
'participated'] ? true : 
false;
 
  177        return $this->participants[$a_usr_id][
'contact'] ? true : 
false;
 
  192        $query = 
"SELECT * FROM event_participants " .
 
  193            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  194            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  196        if (
$res->numRows()) {
 
  197            $query = 
"UPDATE event_participants " .
 
  198                "SET participated = " . 
$ilDB->quote($a_status, 
'integer') . 
" " .
 
  199                "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  200                "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  203            $query = 
"INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
 
  205                $ilDB->quote(0, 
'integer') . 
", " .
 
  206                $ilDB->quote($a_status, 
'integer') . 
", " .
 
  207                $ilDB->quote($a_event_id, 
'integer') . 
", " .
 
  208                $ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
  214        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  226        $query = 
"SELECT * FROM event_participants " .
 
  227            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  228            "AND registered = " . 
$ilDB->quote(1, 
'integer');
 
  231            $user_ids[] = 
$row->usr_id;
 
  233        return $user_ids ? $user_ids : array();
 
  242        $query = 
"SELECT * FROM event_participants " .
 
  243            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  244            "AND participated = 1";
 
  247            $user_ids[] = 
$row->usr_id;
 
  249        return $user_ids ? $user_ids : array();
 
  258        $query = 
"SELECT participated FROM event_participants " .
 
  259            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  260            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  263            return (
bool) $rec[
"participated"];
 
  274        $query = 
"SELECT * FROM event_participants " .
 
  275            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  276            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  279            return (
bool) 
$row->registered;
 
  284    public static function _register($a_usr_id, $a_event_id)
 
  290        $query = 
"SELECT * FROM event_participants " .
 
  291            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  292            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  294        if (
$res->numRows()) {
 
  295            $query = 
"UPDATE event_participants " .
 
  296                "SET registered = '1' " .
 
  297                "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  298                "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  301            $query = 
"INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
 
  305                $ilDB->quote($a_event_id, 
'integer') . 
", " .
 
  306                $ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
  312        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  317    public function register($a_usr_id)
 
  328        $query = 
"SELECT * FROM event_participants " .
 
  329            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  330            "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  332        if (
$res->numRows()) {
 
  333            $query = 
"UPDATE event_participants " .
 
  334                "SET registered = 0 " .
 
  335                "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  336                "AND usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  339            $query = 
"INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
 
  343                $ilDB->quote($a_event_id, 
'integer') . 
", " .
 
  344                $ilDB->quote($a_usr_id, 
'integer') . 
" " .
 
  350        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  364        include_once 
"Services/Tracking/classes/class.ilLPMarks.php";
 
  365        $lp_mark = 
new ilLPMarks($a_event_id, $a_usr_id);
 
  366        return $lp_mark->getMark();
 
  371        include_once 
"Services/Tracking/classes/class.ilLPMarks.php";
 
  372        $lp_mark = 
new ilLPMarks($a_event_id, $a_usr_id);
 
  373        return $lp_mark->getComment();
 
  383        $this->event_id = $a_event_id;
 
  392        $query = 
"DELETE FROM event_participants " .
 
  393            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" ";
 
  396        include_once 
"Services/Tracking/classes/class.ilLPMarks.php";
 
  407        $query = 
"DELETE FROM event_participants " .
 
  408            "WHERE usr_id = " . 
$ilDB->quote($a_usr_id, 
'integer') . 
" ";
 
  421        $query = 
"SELECT * FROM event_participants " .
 
  425            $this->participants[
$row->usr_id][
'usr_id'] = 
$row->usr_id;
 
  426            $this->participants[
$row->usr_id][
'registered'] = 
$row->registered;
 
  427            $this->participants[
$row->usr_id][
'participated'] = 
$row->participated;
 
  428            $this->participants[
$row->usr_id][
'contact'] = 
$row->contact;
 
  431            $this->participants[
$row->usr_id][
'mark'] = $lp_mark->getMark();
 
  432            $this->participants[
$row->usr_id][
'comment'] = $lp_mark->getComment();
 
  435            if (
$row->registered) {
 
  436                $this->registered[] = 
$row->usr_id;
 
  438            if (
$row->participated) {
 
  439                $this->participated[] = 
$row->usr_id;
 
  452        $sess->handleAutoFill();
 
An exception for terminatinating execution or to throw for unit testing.
static _updateParticipation($a_usr_id, $a_event_id, $a_status)
static _lookupMark($a_event_id, $a_usr_id)
static _isRegistered($a_usr_id, $a_event_id)
static _deleteByEvent($a_event_id)
setParticipated($a_status)
static _hasParticipated($a_usr_id, $a_event_id)
static _deleteByUser($a_usr_id)
_lookupComment($a_event_id, $a_usr_id)
static _getParticipated($a_event_id)
static _getRegistered($a_event_id)
isContact($a_usr_id)
Check if user is contact.
__construct($a_event_id)
Constructor.
static _register($a_usr_id, $a_event_id)
hasParticipated($a_usr_id)
static _unregister($a_usr_id, $a_event_id)
static handleAutoFill($a_obj_id)
Trigger auto-fill from waiting list.
updateParticipation($a_usr_id, $a_status)
static deleteObject($a_obj_id)
Delete object.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
foreach($_POST as $key=> $value) $res