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");
120 return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] :
array();
125 return $this->participants ? $this->participants :
array();
130 return $this->participants[$a_usr_id][
'registered'] ? true :
false;
135 return $this->participants[$a_usr_id][
'participated'] ? true :
false;
147 $query =
"SELECT * FROM event_participants " .
148 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
149 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
151 if (
$res->numRows()) {
152 $query =
"UPDATE event_participants " .
153 "SET participated = " . $ilDB->quote($a_status,
'integer') .
" " .
154 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
155 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
158 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
160 $ilDB->quote(0,
'integer') .
", " .
161 $ilDB->quote($a_status,
'integer') .
", " .
162 $ilDB->quote($a_event_id,
'integer') .
", " .
163 $ilDB->quote($a_usr_id,
'integer') .
" " .
169 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
179 $query =
"SELECT * FROM event_participants " .
180 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
181 "AND registered = " . $ilDB->quote(1,
'integer');
184 $user_ids[] =
$row->usr_id;
186 return $user_ids ? $user_ids :
array();
193 $query =
"SELECT * FROM event_participants " .
194 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
195 "AND participated = 1";
198 $user_ids[] =
$row->usr_id;
200 return $user_ids ? $user_ids :
array();
207 $query =
"SELECT participated FROM event_participants " .
208 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
209 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
211 if ($rec = $ilDB->fetchAssoc(
$res)) {
212 return (
bool) $rec[
"participated"];
221 $query =
"SELECT * FROM event_participants " .
222 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
223 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
226 return (
bool)
$row->registered;
231 public static function _register($a_usr_id, $a_event_id)
235 $query =
"SELECT * FROM event_participants " .
236 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
237 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
239 if (
$res->numRows()) {
240 $query =
"UPDATE event_participants " .
241 "SET registered = '1' " .
242 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
243 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
246 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
250 $ilDB->quote($a_event_id,
'integer') .
", " .
251 $ilDB->quote($a_usr_id,
'integer') .
" " .
257 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
262 public function register($a_usr_id)
271 $query =
"SELECT * FROM event_participants " .
272 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
273 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
275 if (
$res->numRows()) {
276 $query =
"UPDATE event_participants " .
277 "SET registered = 0 " .
278 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" " .
279 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
282 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
286 $ilDB->quote($a_event_id,
'integer') .
", " .
287 $ilDB->quote($a_usr_id,
'integer') .
" " .
293 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
296 self::handleAutoFill($a_event_id);
307 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
308 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
309 return $lp_mark->getMark();
328 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
329 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
330 return $lp_mark->getComment();
354 $this->event_id = $a_event_id;
361 $query =
"DELETE FROM event_participants " .
362 "WHERE event_id = " . $ilDB->quote($a_event_id,
'integer') .
" ";
365 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
374 $query =
"DELETE FROM event_participants " .
375 "WHERE usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
386 $query =
"SELECT * FROM event_participants " .
387 "WHERE event_id = " . $ilDB->quote($this->
getEventId()) .
" ";
390 $this->participants[
$row->usr_id][
'usr_id'] =
$row->usr_id;
391 $this->participants[
$row->usr_id][
'registered'] =
$row->registered;
392 $this->participants[
$row->usr_id][
'participated'] =
$row->participated;
399 $this->participants[
$row->usr_id][
'mark'] = $lp_mark->getMark();
400 $this->participants[
$row->usr_id][
'comment'] = $lp_mark->getComment();
403 if (
$row->registered) {
404 $this->registered[] =
$row->usr_id;
406 if (
$row->participated) {
407 $this->participated[] =
$row->usr_id;
420 $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)
foreach($_POST as $key=> $value) $res
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)