ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
 

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 385 of file class.ilEventParticipants.php.

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

Referenced by ilEventParticipants().

386  {
387  global $ilDB;
388 
389  include_once "Services/Tracking/classes/class.ilLPMarks.php";
390 
391 
392 
393  $query = "SELECT * FROM event_participants ".
394  "WHERE event_id = ".$ilDB->quote($this->getEventId())." ";
395  $res = $this->db->query($query);
396  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
397  {
398  $this->participants[$row->usr_id]['usr_id'] = $row->usr_id;
399  $this->participants[$row->usr_id]['registered'] = $row->registered;
400  $this->participants[$row->usr_id]['participated'] = $row->participated;
401  /*
402  $this->participants[$row->usr_id]['mark'] = $row->mark;
403  $this->participants[$row->usr_id]['comment'] = $row->e_comment;
404  */
405 
406  $lp_mark = new ilLPMarks($this->getEventId(), $row->usr_id);
407  $this->participants[$row->usr_id]['mark'] = $lp_mark->getMark();
408  $this->participants[$row->usr_id]['comment'] = $lp_mark->getComment();
409 
410 
411  if($row->registered)
412  {
413  $this->registered[] = $row->usr_id;
414  }
415  if($row->participated)
416  {
417  $this->participated[] = $row->usr_id;
418  }
419  }
420  }
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 360 of file class.ilEventParticipants.php.

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

Referenced by ilObjSession\delete().

361  {
362  global $ilDB;
363 
364  $query = "DELETE FROM event_participants ".
365  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ";
366  $res = $ilDB->manipulate($query);
367 
368  include_once "Services/Tracking/classes/class.ilLPMarks.php";
369  ilLPMarks::deleteObject($a_event_id);
370 
371  return true;
372  }
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 373 of file class.ilEventParticipants.php.

References $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

374  {
375  global $ilDB;
376 
377  $query = "DELETE FROM event_participants ".
378  "WHERE usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
379  $res = $ilDB->manipulate($query);
380  return true;
381  }
+ Here is the caller graph for this function:

◆ _getParticipated()

ilEventParticipants::_getParticipated (   $a_event_id)

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

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

Referenced by ilLPStatusEvent\_getStatusInfo().

186  {
187  global $ilDB;
188 
189  $query = "SELECT * FROM event_participants ".
190  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
191  "AND participated = 1";
192  $res = $ilDB->query($query);
193  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
194  {
195  $user_ids[] = $row->usr_id;
196  }
197  return $user_ids ? $user_ids : array();
198  }
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 170 of file class.ilEventParticipants.php.

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

Referenced by ilLPStatusEvent\_getStatusInfo().

171  {
172  global $ilDB;
173 
174  $query = "SELECT * FROM event_participants ".
175  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
176  "AND registered = ".$ilDB->quote(1 ,'integer');
177  $res = $ilDB->query($query);
178  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
179  {
180  $user_ids[] = $row->usr_id;
181  }
182  return $user_ids ? $user_ids : array();
183  }
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 200 of file class.ilEventParticipants.php.

References $ilDB, $query, and $res.

Referenced by ilLPStatusEvent\determineStatus().

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

◆ _isRegistered()

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

Definition at line 215 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().

216  {
217  global $ilDB;
218 
219  $query = "SELECT * FROM event_participants ".
220  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
221  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
222  $res = $ilDB->query($query);
223  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
224  {
225  return (bool) $row->registered;
226  }
227  return false;
228  }
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 329 of file class.ilEventParticipants.php.

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

◆ _lookupMark()

ilEventParticipants::_lookupMark (   $a_event_id,
  $a_usr_id 
)

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

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

◆ _register()

ilEventParticipants::_register (   $a_usr_id,
  $a_event_id 
)

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

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

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

231  {
232  global $ilDB;
233 
234  $query = "SELECT * FROM event_participants ".
235  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
236  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
237  $res = $ilDB->query($query);
238  if($res->numRows())
239  {
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  }
246  else
247  {
248  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
249  "VALUES( ".
250  "1, ".
251  "0, ".
252  $ilDB->quote($a_event_id ,'integer').", ".
253  $ilDB->quote($a_usr_id ,'integer')." ".
254  ")";
255  $res = $ilDB->manipulate($query);
256  }
257 
258  // refresh learning progress status after updating participant
259  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
260  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
261 
262  return true;
263  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=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 269 of file class.ilEventParticipants.php.

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

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

270  {
271  global $ilDB;
272 
273  $query = "SELECT * FROM event_participants ".
274  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
275  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
276  $res = $ilDB->query($query);
277  if($res->numRows())
278  {
279  $query = "UPDATE event_participants ".
280  "SET registered = 0 ".
281  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
282  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
283  $res = $ilDB->manipulate($query);
284  }
285  else
286  {
287  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
288  "VALUES( ".
289  "0, ".
290  "0, ".
291  $ilDB->quote($a_event_id ,'integer').", ".
292  $ilDB->quote($a_usr_id ,'integer')." ".
293  ")";
294  $res = $ilDB->manipulate($query);
295  }
296 
297  // refresh learning progress status after updating participant
298  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
299  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
300 
301  return true;
302  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=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 135 of file class.ilEventParticipants.php.

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

Referenced by updateParticipation().

136  {
137  global $ilDB;
138 
139  $query = "SELECT * FROM event_participants ".
140  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
141  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
142  $res = $ilDB->query($query);
143  if($res->numRows())
144  {
145  $query = "UPDATE event_participants ".
146  "SET participated = ".$ilDB->quote($a_status ,'integer')." ".
147  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
148  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
149  $res = $ilDB->manipulate($query);
150  }
151  else
152  {
153  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
154  "VALUES( ".
155  $ilDB->quote(0 ,'integer').", ".
156  $ilDB->quote($a_status ,'integer').", ".
157  $ilDB->quote($a_event_id ,'integer').", ".
158  $ilDB->quote($a_usr_id ,'integer')." ".
159  ")";
160  $res = $ilDB->manipulate($query);
161  }
162 
163  // refresh learning progress status after updating participant
164  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
165  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
166 
167  return true;
168  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=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 351 of file class.ilEventParticipants.php.

References $event_id.

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

352  {
353  return $this->event_id;
354  }
+ 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 115 of file class.ilEventParticipants.php.

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

◆ 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 110 of file class.ilEventParticipants.php.

111  {
112  return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
113  }

◆ 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:

◆ hasParticipated()

ilEventParticipants::hasParticipated (   $a_usr_id)

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

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

◆ 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 120 of file class.ilEventParticipants.php.

121  {
122  return $this->participants[$a_usr_id]['registered'] ? true : false;
123  }

◆ register()

ilEventParticipants::register (   $a_usr_id)

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

References _register(), and getEventId().

Referenced by ilObjSessionGUI\assignFromWaitingListObject().

265  {
266  return ilEventParticipants::_register($a_usr_id,$this->getEventId());
267  }
_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 355 of file class.ilEventParticipants.php.

356  {
357  $this->event_id = $a_event_id;
358  }

◆ 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 303 of file class.ilEventParticipants.php.

References _unregister(), and getEventId().

304  {
305  return ilEventParticipants::_unregister($a_usr_id,$this->getEventId());
306  }
_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 130 of file class.ilEventParticipants.php.

References _updateParticipation(), and getEventId().

131  {
132  ilEventParticipants::_updateParticipation($a_usr_id,$this->getEventId(),$a_status);
133  }
_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  return true;
108  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=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: