ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilEventParticipants Class Reference

class ilEventMembers More...

+ Collaboration diagram for ilEventParticipants:

Public Member Functions

 __construct ($a_event_id)
 Constructor. More...
 
 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)
 
 register ($a_usr_id)
 
 unregister ($a_usr_id)
 
 _lookupComment ($a_event_id, $a_usr_id)
 
 getEventId ()
 
 setEventId ($a_event_id)
 
 __read ()
 

Static Public Member Functions

static _updateParticipation ($a_usr_id, $a_event_id, $a_status)
 
static _getRegistered ($a_event_id)
 
static _getParticipated ($a_event_id)
 
static _hasParticipated ($a_usr_id, $a_event_id)
 
static _isRegistered ($a_usr_id, $a_event_id)
 
static _register ($a_usr_id, $a_event_id)
 
static _unregister ($a_usr_id, $a_event_id)
 
static _lookupMark ($a_event_id, $a_usr_id)
 
static _deleteByEvent ($a_event_id)
 
static _deleteByUser ($a_usr_id)
 

Data Fields

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

Static Protected Member Functions

static handleAutoFill ($a_obj_id)
 Trigger auto-fill from waiting list. More...
 

Protected Attributes

 $registered = array()
 
 $participated = array()
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilEventParticipants::__construct (   $a_event_id)

Constructor.

Parameters
int$a_event_id

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

30 {
31 global $ilErr,$ilDB,$lng,$tree;
32
33 $this->ilErr = $ilErr;
34 $this->db = $ilDB;
35 $this->lng = $lng;
36
37 $this->event_id = $a_event_id;
38 $this->__read();
39 }

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

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilEventParticipants::__read ( )

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

383 {
384 global $ilDB;
385
386 $query = "SELECT * FROM event_participants " .
387 "WHERE event_id = " . $ilDB->quote($this->getEventId()) . " ";
388 $res = $this->db->query($query);
389 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
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;
393 /*
394 $this->participants[$row->usr_id]['mark'] = $row->mark;
395 $this->participants[$row->usr_id]['comment'] = $row->e_comment;
396 */
397
398 $lp_mark = new ilLPMarks($this->getEventId(), $row->usr_id);
399 $this->participants[$row->usr_id]['mark'] = $lp_mark->getMark();
400 $this->participants[$row->usr_id]['comment'] = $lp_mark->getComment();
401
402
403 if ($row->registered) {
404 $this->registered[] = $row->usr_id;
405 }
406 if ($row->participated) {
407 $this->participated[] = $row->usr_id;
408 }
409 }
410 }
$query
foreach($_POST as $key=> $value) $res

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and getEventId().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteByEvent()

static ilEventParticipants::_deleteByEvent (   $a_event_id)
static

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

358 {
359 global $ilDB;
360
361 $query = "DELETE FROM event_participants " .
362 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " ";
363 $res = $ilDB->manipulate($query);
364
365 include_once "Services/Tracking/classes/class.ilLPMarks.php";
366 ilLPMarks::deleteObject($a_event_id);
367
368 return true;
369 }
static deleteObject($a_obj_id)
Delete object.

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

Referenced by ilObjSession\delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteByUser()

static ilEventParticipants::_deleteByUser (   $a_usr_id)
static

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

371 {
372 global $ilDB;
373
374 $query = "DELETE FROM event_participants " .
375 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
376 $res = $ilDB->manipulate($query);
377 return true;
378 }

References $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

+ Here is the caller graph for this function:

◆ _getParticipated()

static ilEventParticipants::_getParticipated (   $a_event_id)
static

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

190 {
191 global $ilDB;
192
193 $query = "SELECT * FROM event_participants " .
194 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
195 "AND participated = 1";
196 $res = $ilDB->query($query);
197 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
198 $user_ids[] = $row->usr_id;
199 }
200 return $user_ids ? $user_ids : array();
201 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\_getStatusInfo().

+ Here is the caller graph for this function:

◆ _getRegistered()

static ilEventParticipants::_getRegistered (   $a_event_id)
static

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

176 {
177 global $ilDB;
178
179 $query = "SELECT * FROM event_participants " .
180 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
181 "AND registered = " . $ilDB->quote(1, 'integer');
182 $res = $ilDB->query($query);
183 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
184 $user_ids[] = $row->usr_id;
185 }
186 return $user_ids ? $user_ids : array();
187 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\_getStatusInfo().

+ Here is the caller graph for this function:

◆ _hasParticipated()

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

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

204 {
205 global $ilDB;
206
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') . " ";
210 $res = $ilDB->query($query);
211 if ($rec = $ilDB->fetchAssoc($res)) {
212 return (bool) $rec["participated"];
213 }
214 return false;
215 }

References $ilDB, $query, and $res.

Referenced by ilLPStatusEvent\determineStatus().

+ Here is the caller graph for this function:

◆ _isRegistered()

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

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

218 {
219 global $ilDB;
220
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') . " ";
224 $res = $ilDB->query($query);
225 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
226 return (bool) $row->registered;
227 }
228 return false;
229 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilSessionParticipants\_isParticipant(), ilLPStatusEvent\determineStatus(), ilObjSessionGUI\joinObject(), and ilObjSessionGUI\showJoinRequestButton().

+ Here is the caller graph for this function:

◆ _lookupComment()

ilEventParticipants::_lookupComment (   $a_event_id,
  $a_usr_id 
)

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

327 {
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();
331
332 /*
333 global $ilDB;
334
335 $query = "SELECT * FROM event_participants ".
336 "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
337 "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
338 $res = $ilDB->query($query);
339 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
340 {
341 return $row->e_comment;
342 }
343 return '';
344 */
345 }

◆ _lookupMark()

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

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

306 {
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();
310
311 /*
312 global $ilDB;
313
314 $query = "SELECT * FROM event_participants ".
315 "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
316 "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
317 $res = $ilDB->query($query);
318 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
319 {
320 return $row->mark;
321 }
322 return '';
323 */
324 }

◆ _register()

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

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

232 {
233 global $ilDB;
234
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') . " ";
238 $res = $ilDB->query($query);
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') . " ";
244 $res = $ilDB->manipulate($query);
245 } else {
246 $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
247 "VALUES( " .
248 "1, " .
249 "0, " .
250 $ilDB->quote($a_event_id, 'integer') . ", " .
251 $ilDB->quote($a_usr_id, 'integer') . " " .
252 ")";
253 $res = $ilDB->manipulate($query);
254 }
255
256 // refresh learning progress status after updating participant
257 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
258 ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
259
260 return true;
261 }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _unregister()

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

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

268 {
269 global $ilDB;
270
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') . " ";
274 $res = $ilDB->query($query);
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') . " ";
280 $res = $ilDB->manipulate($query);
281 } else {
282 $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
283 "VALUES( " .
284 "0, " .
285 "0, " .
286 $ilDB->quote($a_event_id, 'integer') . ", " .
287 $ilDB->quote($a_usr_id, 'integer') . " " .
288 ")";
289 $res = $ilDB->manipulate($query);
290 }
291
292 // refresh learning progress status after updating participant
293 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
294 ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
295
296 self::handleAutoFill($a_event_id);
297
298 return true;
299 }
static handleAutoFill($a_obj_id)
Trigger auto-fill from waiting list.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateParticipation()

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

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

144 {
145 global $ilDB;
146
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') . " ";
150 $res = $ilDB->query($query);
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') . " ";
156 $res = $ilDB->manipulate($query);
157 } else {
158 $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
159 "VALUES( " .
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') . " " .
164 ")";
165 $res = $ilDB->manipulate($query);
166 }
167
168 // refresh learning progress status after updating participant
169 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
170 ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
171
172 return true;
173 }

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

Referenced by updateParticipation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComment()

ilEventParticipants::getComment ( )

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

62 {
63 return $this->comment;
64 }
$comment
Definition: buildRTE.php:83

References $comment.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getEventId()

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:

◆ getMark()

ilEventParticipants::getMark ( )

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

54 {
55 return $this->mark;
56 }

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getParticipants()

ilEventParticipants::getParticipants ( )

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

124 {
125 return $this->participants ? $this->participants : array();
126 }

◆ getParticipated()

ilEventParticipants::getParticipated ( )

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

References $participated.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getRegistered()

ilEventParticipants::getRegistered ( )

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

References $registered.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getUser()

ilEventParticipants::getUser (   $a_usr_id)

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

119 {
120 return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
121 }

◆ getUserId()

ilEventParticipants::getUserId ( )

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

46 {
47 return $this->user_id;
48 }

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ handleAutoFill()

static ilEventParticipants::handleAutoFill (   $a_obj_id)
staticprotected

Trigger auto-fill from waiting list.

Parameters
int$a_obj_id

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

418 {
419 $sess = new ilObjSession($a_obj_id, false);
420 $sess->handleAutoFill();
421 }

References $sess.

Referenced by _unregister(), and updateUser().

+ Here is the caller graph for this function:

◆ hasParticipated()

ilEventParticipants::hasParticipated (   $a_usr_id)

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

134 {
135 return $this->participants[$a_usr_id]['participated'] ? true : false;
136 }

◆ isRegistered()

ilEventParticipants::isRegistered (   $a_usr_id)

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

129 {
130 return $this->participants[$a_usr_id]['registered'] ? true : false;
131 }

◆ register()

ilEventParticipants::register (   $a_usr_id)

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

263 {
264 return ilEventParticipants::_register($a_usr_id, $this->getEventId());
265 }
static _register($a_usr_id, $a_event_id)

References _register(), and getEventId().

+ Here is the call graph for this function:

◆ setComment()

ilEventParticipants::setComment (   $a_comment)

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

58 {
59 $this->comment = $a_comment;
60 }
comment()
Definition: comment.php:2

References comment().

+ Here is the call graph for this function:

◆ setEventId()

ilEventParticipants::setEventId (   $a_event_id)

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

353 {
354 $this->event_id = $a_event_id;
355 }

◆ setMark()

ilEventParticipants::setMark (   $a_mark)

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

50 {
51 $this->mark = $a_mark;
52 }

◆ setParticipated()

ilEventParticipants::setParticipated (   $a_status)

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

66 {
67 $this->participated = $a_status;
68 }

◆ setRegistered()

ilEventParticipants::setRegistered (   $a_status)

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

74 {
75 $this->registered = $a_status;
76 }

◆ setUserId()

ilEventParticipants::setUserId (   $a_usr_id)

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

42 {
43 $this->user_id = $a_usr_id;
44 }

◆ unregister()

ilEventParticipants::unregister (   $a_usr_id)

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

301 {
302 return ilEventParticipants::_unregister($a_usr_id, $this->getEventId());
303 }
static _unregister($a_usr_id, $a_event_id)

References _unregister(), and getEventId().

+ Here is the call graph for this function:

◆ updateParticipation()

ilEventParticipants::updateParticipation (   $a_usr_id,
  $a_status 
)

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

139 {
140 ilEventParticipants::_updateParticipation($a_usr_id, $this->getEventId(), $a_status);
141 }
static _updateParticipation($a_usr_id, $a_event_id, $a_status)

References _updateParticipation(), and getEventId().

+ Here is the call graph for this function:

◆ updateUser()

ilEventParticipants::updateUser ( )

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

82 {
83 global $ilDB;
84
85 $query = "DELETE FROM event_participants " .
86 "WHERE event_id = " . $ilDB->quote($this->getEventId(), 'integer') . " " .
87 "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " ";
88 $res = $ilDB->manipulate($query);
89
90 $query = "INSERT INTO event_participants (event_id,usr_id,registered,participated" . // ,mark,e_comment
91 ") VALUES( " .
92 $ilDB->quote($this->getEventId(), 'integer') . ", " .
93 $ilDB->quote($this->getUserId(), 'integer') . ", " .
94 $ilDB->quote($this->getRegistered(), 'integer') . ", " .
95 $ilDB->quote($this->getParticipated(), 'integer') . /* .", ".
96 $ilDB->quote($this->getMark() ,'text').", ".
97 $ilDB->quote($this->getComment() ,'text')." ". */
98 ")";
99 $res = $ilDB->manipulate($query);
100
101 include_once "Services/Tracking/classes/class.ilLPMarks.php";
102 $lp_mark = new ilLPMarks($this->getEventId(), $this->getUserId());
103 $lp_mark->setComment($this->getComment());
104 $lp_mark->setMark($this->getMark());
105 $lp_mark->update();
106
107 // refresh learning progress status after updating participant
108 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
110
111 if (!$this->getRegistered()) {
113 }
114
115 return true;
116 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $event_id

ilEventParticipants::$event_id = null

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

Referenced by getEventId().

◆ $ilDB

◆ $ilErr

ilEventParticipants::$ilErr

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

Referenced by __construct().

◆ $lng

ilEventParticipants::$lng

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

Referenced by __construct().

◆ $participated

ilEventParticipants::$participated = array()
protected

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

Referenced by getParticipated().

◆ $registered

ilEventParticipants::$registered = array()
protected

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

Referenced by getRegistered().

◆ $tree

ilEventParticipants::$tree

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

Referenced by __construct().


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