37 $this->event_id = $a_event_id;
43 $this->user_id = $a_usr_id;
47 return $this->user_id;
51 $this->mark = $a_mark;
67 $this->participated = $a_status;
75 $this->registered = $a_status;
85 $query =
"DELETE FROM event_participants ".
86 "WHERE event_id = ".$ilDB->quote($this->
getEventId() ,
'integer').
" ".
87 "AND usr_id = ".$ilDB->quote($this->
getUserId() ,
'integer').
" ";
90 $query =
"INSERT INTO event_participants (event_id,usr_id,registered,participated".
92 $ilDB->quote($this->
getEventId() ,
'integer').
", ".
93 $ilDB->quote($this->
getUserId() ,
'integer').
", ".
101 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
104 $lp_mark->setMark($this->
getMark());
108 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
121 return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] :
array();
126 return $this->participants ? $this->participants :
array();
131 return $this->participants[$a_usr_id][
'registered'] ? true :
false;
136 return $this->participants[$a_usr_id][
'participated'] ? true :
false;
148 $query =
"SELECT * FROM event_participants ".
149 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
150 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
154 $query =
"UPDATE event_participants ".
155 "SET participated = ".$ilDB->quote($a_status ,
'integer').
" ".
156 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
157 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
162 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
164 $ilDB->quote(0 ,
'integer').
", ".
165 $ilDB->quote($a_status ,
'integer').
", ".
166 $ilDB->quote($a_event_id ,
'integer').
", ".
167 $ilDB->quote($a_usr_id ,
'integer').
" ".
173 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
183 $query =
"SELECT * FROM event_participants ".
184 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
185 "AND registered = ".$ilDB->quote(1 ,
'integer');
189 $user_ids[] =
$row->usr_id;
191 return $user_ids ? $user_ids :
array();
198 $query =
"SELECT * FROM event_participants ".
199 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
200 "AND participated = 1";
204 $user_ids[] =
$row->usr_id;
206 return $user_ids ? $user_ids :
array();
213 $query =
"SELECT participated FROM event_participants ".
214 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
215 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
217 if ($rec = $ilDB->fetchAssoc(
$res))
219 return (
bool) $rec[
"participated"];
228 $query =
"SELECT * FROM event_participants ".
229 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
230 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
234 return (
bool)
$row->registered;
243 $query =
"SELECT * FROM event_participants ".
244 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
245 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
249 $query =
"UPDATE event_participants ".
250 "SET registered = '1' ".
251 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
252 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
257 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
261 $ilDB->quote($a_event_id ,
'integer').
", ".
262 $ilDB->quote($a_usr_id ,
'integer').
" ".
268 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
273 function register($a_usr_id)
282 $query =
"SELECT * FROM event_participants ".
283 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
284 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
288 $query =
"UPDATE event_participants ".
289 "SET registered = 0 ".
290 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
291 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
296 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
300 $ilDB->quote($a_event_id ,
'integer').
", ".
301 $ilDB->quote($a_usr_id ,
'integer').
" ".
307 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
310 self::handleAutoFill($a_event_id);
321 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
322 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
323 return $lp_mark->getMark();
342 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
343 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
344 return $lp_mark->getComment();
368 $this->event_id = $a_event_id;
375 $query =
"DELETE FROM event_participants ".
376 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ";
379 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
388 $query =
"DELETE FROM event_participants ".
389 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
400 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
404 $query =
"SELECT * FROM event_participants ".
405 "WHERE event_id = ".$ilDB->quote($this->
getEventId()).
" ";
409 $this->participants[
$row->usr_id][
'usr_id'] =
$row->usr_id;
410 $this->participants[
$row->usr_id][
'registered'] =
$row->registered;
411 $this->participants[
$row->usr_id][
'participated'] =
$row->participated;
418 $this->participants[
$row->usr_id][
'mark'] = $lp_mark->getMark();
419 $this->participants[
$row->usr_id][
'comment'] = $lp_mark->getComment();
424 $this->registered[] =
$row->usr_id;
426 if(
$row->participated)
428 $this->participated[] =
$row->usr_id;
441 $sess->handleAutoFill();
static _getRegistered($a_event_id)
static _getParticipated($a_event_id)
updateParticipation($a_usr_id, $a_status)
static _unregister($a_usr_id, $a_event_id)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static _lookupMark($a_event_id, $a_usr_id)
static _isRegistered($a_usr_id, $a_event_id)
static _hasParticipated($a_usr_id, $a_event_id)
static _deleteByUser($a_usr_id)
static _register($a_usr_id, $a_event_id)
static _deleteByEvent($a_event_id)
Create styles array
The data for the language used.
_lookupComment($a_event_id, $a_usr_id)
hasParticipated($a_usr_id)
setParticipated($a_status)
static handleAutoFill($a_obj_id)
Trigger auto-fill from waiting list.
static deleteObject($a_obj_id)
Delete object.
__construct($a_event_id)
Constructor.
static _updateParticipation($a_usr_id, $a_event_id, $a_status)