ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 

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.

Member Function Documentation

◆ __read()

ilEventParticipants::__read ( )

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

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

Referenced by ilEventParticipants().

393  {
394  global $ilDB;
395 
396  include_once "Services/Tracking/classes/class.ilLPMarks.php";
397 
398 
399 
400  $query = "SELECT * FROM event_participants ".
401  "WHERE event_id = ".$ilDB->quote($this->getEventId())." ";
402  $res = $this->db->query($query);
403  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
404  {
405  $this->participants[$row->usr_id]['usr_id'] = $row->usr_id;
406  $this->participants[$row->usr_id]['registered'] = $row->registered;
407  $this->participants[$row->usr_id]['participated'] = $row->participated;
408  /*
409  $this->participants[$row->usr_id]['mark'] = $row->mark;
410  $this->participants[$row->usr_id]['comment'] = $row->e_comment;
411  */
412 
413  $lp_mark = new ilLPMarks($this->getEventId(), $row->usr_id);
414  $this->participants[$row->usr_id]['mark'] = $lp_mark->getMark();
415  $this->participants[$row->usr_id]['comment'] = $lp_mark->getComment();
416 
417 
418  if($row->registered)
419  {
420  $this->registered[] = $row->usr_id;
421  }
422  if($row->participated)
423  {
424  $this->participated[] = $row->usr_id;
425  }
426  }
427  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteByEvent()

ilEventParticipants::_deleteByEvent (   $a_event_id)

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

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

Referenced by ilObjSession\delete().

368  {
369  global $ilDB;
370 
371  $query = "DELETE FROM event_participants ".
372  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ";
373  $res = $ilDB->manipulate($query);
374 
375  include_once "Services/Tracking/classes/class.ilLPMarks.php";
376  ilLPMarks::deleteObject($a_event_id);
377 
378  return true;
379  }
static deleteObject($a_obj_id)
Delete object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteByUser()

ilEventParticipants::_deleteByUser (   $a_usr_id)

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

References $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

381  {
382  global $ilDB;
383 
384  $query = "DELETE FROM event_participants ".
385  "WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
386  $res = $ilDB->manipulate($query);
387  return true;
388  }
+ Here is the caller graph for this function:

◆ _getParticipated()

ilEventParticipants::_getParticipated (   $a_event_id)

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

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

Referenced by ilLPStatusEvent\_getStatusInfo().

191  {
192  global $ilDB;
193 
194  $query = "SELECT * FROM event_participants ".
195  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
196  "AND participated = 1";
197  $res = $ilDB->query($query);
198  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
199  {
200  $user_ids[] = $row->usr_id;
201  }
202  return $user_ids ? $user_ids : array();
203  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ _getRegistered()

ilEventParticipants::_getRegistered (   $a_event_id)

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

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

Referenced by ilLPStatusEvent\_getStatusInfo().

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(DB_FETCHMODE_OBJECT))
184  {
185  $user_ids[] = $row->usr_id;
186  }
187  return $user_ids ? $user_ids : array();
188  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ _hasParticipated()

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

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

References $ilDB, $query, and $res.

Referenced by ilLPStatusEvent\determineStatus().

206  {
207  global $ilDB;
208 
209  $query = "SELECT participated FROM event_participants ".
210  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
211  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
212  $res = $ilDB->query($query);
213  if ($rec = $ilDB->fetchAssoc($res))
214  {
215  return (bool) $rec["participated"];
216  }
217  return false;
218  }
+ Here is the caller graph for this function:

◆ _isRegistered()

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

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

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

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

221  {
222  global $ilDB;
223 
224  $query = "SELECT * FROM event_participants ".
225  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
226  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
227  $res = $ilDB->query($query);
228  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
229  {
230  return (bool) $row->registered;
231  }
232  return false;
233  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ _lookupComment()

ilEventParticipants::_lookupComment (   $a_event_id,
  $a_usr_id 
)

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

337  {
338  include_once "Services/Tracking/classes/class.ilLPMarks.php";
339  $lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
340  return $lp_mark->getComment();
341 
342  /*
343  global $ilDB;
344 
345  $query = "SELECT * FROM event_participants ".
346  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
347  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
348  $res = $ilDB->query($query);
349  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
350  {
351  return $row->e_comment;
352  }
353  return '';
354  */
355  }

◆ _lookupMark()

ilEventParticipants::_lookupMark (   $a_event_id,
  $a_usr_id 
)

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

316  {
317  include_once "Services/Tracking/classes/class.ilLPMarks.php";
318  $lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
319  return $lp_mark->getMark();
320 
321  /*
322  global $ilDB;
323 
324  $query = "SELECT * FROM event_participants ".
325  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
326  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
327  $res = $ilDB->query($query);
328  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
329  {
330  return $row->mark;
331  }
332  return '';
333  */
334  }

◆ _register()

ilEventParticipants::_register (   $a_usr_id,
  $a_event_id 
)

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

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

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

236  {
237  global $ilDB;
238 
239  $query = "SELECT * FROM event_participants ".
240  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
241  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
242  $res = $ilDB->query($query);
243  if($res->numRows())
244  {
245  $query = "UPDATE event_participants ".
246  "SET registered = '1' ".
247  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
248  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
249  $res = $ilDB->manipulate($query);
250  }
251  else
252  {
253  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
254  "VALUES( ".
255  "1, ".
256  "0, ".
257  $ilDB->quote($a_event_id ,'integer').", ".
258  $ilDB->quote($a_usr_id ,'integer')." ".
259  ")";
260  $res = $ilDB->manipulate($query);
261  }
262 
263  // refresh learning progress status after updating participant
264  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
265  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
266 
267  return true;
268  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _unregister()

ilEventParticipants::_unregister (   $a_usr_id,
  $a_event_id 
)

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

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

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

275  {
276  global $ilDB;
277 
278  $query = "SELECT * FROM event_participants ".
279  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
280  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
281  $res = $ilDB->query($query);
282  if($res->numRows())
283  {
284  $query = "UPDATE event_participants ".
285  "SET registered = 0 ".
286  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
287  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
288  $res = $ilDB->manipulate($query);
289  }
290  else
291  {
292  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
293  "VALUES( ".
294  "0, ".
295  "0, ".
296  $ilDB->quote($a_event_id ,'integer').", ".
297  $ilDB->quote($a_usr_id ,'integer')." ".
298  ")";
299  $res = $ilDB->manipulate($query);
300  }
301 
302  // refresh learning progress status after updating participant
303  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
304  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
305 
306  self::handleAutoFill($a_event_id);
307 
308  return true;
309  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateParticipation()

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

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

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

Referenced by updateParticipation().

141  {
142  global $ilDB;
143 
144  $query = "SELECT * FROM event_participants ".
145  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
146  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
147  $res = $ilDB->query($query);
148  if($res->numRows())
149  {
150  $query = "UPDATE event_participants ".
151  "SET participated = ".$ilDB->quote($a_status ,'integer')." ".
152  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
153  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
154  $res = $ilDB->manipulate($query);
155  }
156  else
157  {
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  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComment()

ilEventParticipants::getComment ( )

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

References $comment.

Referenced by updateUser().

58  {
59  return $this->comment;
60  }
$comment
Definition: buildRTE.php:83
+ Here is the caller graph for this function:

◆ getEventId()

ilEventParticipants::getEventId ( )

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

References $event_id.

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

359  {
360  return $this->event_id;
361  }
+ Here is the caller graph for this function:

◆ getMark()

ilEventParticipants::getMark ( )

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

Referenced by updateUser().

50  {
51  return $this->mark;
52  }
+ Here is the caller graph for this function:

◆ getParticipants()

ilEventParticipants::getParticipants ( )

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

121  {
122  return $this->participants ? $this->participants : array();
123  }

◆ getParticipated()

ilEventParticipants::getParticipated ( )

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

References $participated.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getRegistered()

ilEventParticipants::getRegistered ( )

Definition at line 73 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 115 of file class.ilEventParticipants.php.

116  {
117  return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
118  }

◆ getUserId()

ilEventParticipants::getUserId ( )

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

Referenced by updateUser().

42  {
43  return $this->user_id;
44  }
+ 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 434 of file class.ilEventParticipants.php.

References $sess.

435  {
436  $sess = new ilObjSession($a_obj_id, false);
437  $sess->handleAutoFill();
438  }

◆ hasParticipated()

ilEventParticipants::hasParticipated (   $a_usr_id)

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

131  {
132  return $this->participants[$a_usr_id]['participated'] ? true : false;
133  }

◆ ilEventParticipants()

ilEventParticipants::ilEventParticipants (   $a_event_id)

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

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

26  {
27  global $ilErr,$ilDB,$lng,$tree;
28 
29  $this->ilErr =& $ilErr;
30  $this->db =& $ilDB;
31  $this->lng =& $lng;
32 
33  $this->event_id = $a_event_id;
34  $this->__read();
35  }
+ Here is the call graph for this function:

◆ isRegistered()

ilEventParticipants::isRegistered (   $a_usr_id)

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

126  {
127  return $this->participants[$a_usr_id]['registered'] ? true : false;
128  }

◆ register()

ilEventParticipants::register (   $a_usr_id)

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

References _register(), and getEventId().

Referenced by ilObjSessionGUI\assignFromWaitingListObject().

270  {
271  return ilEventParticipants::_register($a_usr_id,$this->getEventId());
272  }
_register($a_usr_id, $a_event_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setComment()

ilEventParticipants::setComment (   $a_comment)

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

54  {
55  $this->comment = $a_comment;
56  }

◆ setEventId()

ilEventParticipants::setEventId (   $a_event_id)

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

363  {
364  $this->event_id = $a_event_id;
365  }

◆ setMark()

ilEventParticipants::setMark (   $a_mark)

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

46  {
47  $this->mark = $a_mark;
48  }

◆ setParticipated()

ilEventParticipants::setParticipated (   $a_status)

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

62  {
63  $this->participated = $a_status;
64  }

◆ setRegistered()

ilEventParticipants::setRegistered (   $a_status)

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

70  {
71  $this->registered = $a_status;
72  }

◆ setUserId()

ilEventParticipants::setUserId (   $a_usr_id)

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

Referenced by ilObjSessionGUI\updateMembersObject().

38  {
39  $this->user_id = $a_usr_id;
40  }
+ Here is the caller graph for this function:

◆ unregister()

ilEventParticipants::unregister (   $a_usr_id)

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

References _unregister(), and getEventId().

311  {
312  return ilEventParticipants::_unregister($a_usr_id,$this->getEventId());
313  }
_unregister($a_usr_id, $a_event_id)
+ Here is the call graph for this function:

◆ updateParticipation()

ilEventParticipants::updateParticipation (   $a_usr_id,
  $a_status 
)

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

References _updateParticipation(), and getEventId().

136  {
137  ilEventParticipants::_updateParticipation($a_usr_id,$this->getEventId(),$a_status);
138  }
_updateParticipation($a_usr_id, $a_event_id, $a_status)
+ Here is the call graph for this function:

◆ updateUser()

ilEventParticipants::updateUser ( )

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

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

78  {
79  global $ilDB;
80 
81  $query = "DELETE FROM event_participants ".
82  "WHERE event_id = ".$ilDB->quote($this->getEventId() ,'integer')." ".
83  "AND usr_id = ".$ilDB->quote($this->getUserId() ,'integer')." ";
84  $res = $ilDB->manipulate($query);
85 
86  $query = "INSERT INTO event_participants (event_id,usr_id,registered,participated". // ,mark,e_comment
87  ") VALUES( ".
88  $ilDB->quote($this->getEventId() ,'integer').", ".
89  $ilDB->quote($this->getUserId() ,'integer').", ".
90  $ilDB->quote($this->getRegistered() ,'integer').", ".
91  $ilDB->quote($this->getParticipated() ,'integer'). /* .", ".
92  $ilDB->quote($this->getMark() ,'text').", ".
93  $ilDB->quote($this->getComment() ,'text')." ". */
94  ")";
95  $res = $ilDB->manipulate($query);
96 
97  include_once "Services/Tracking/classes/class.ilLPMarks.php";
98  $lp_mark = new ilLPMarks($this->getEventId(), $this->getUserId());
99  $lp_mark->setComment($this->getComment());
100  $lp_mark->setMark($this->getMark());
101  $lp_mark->update();
102 
103  // refresh learning progress status after updating participant
104  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
106 
107  if(!$this->getRegistered())
108  {
109  self::handleAutoFill($this->getEventId());
110  }
111 
112  return true;
113  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
+ 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 ilEventParticipants().

◆ $lng

ilEventParticipants::$lng

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

Referenced by ilEventParticipants().

◆ $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 ilEventParticipants().


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