ILIAS  release_4-4 Revision
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
 

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

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

Referenced by ilEventParticipants().

383  {
384  global $ilDB;
385 
386  include_once "Services/Tracking/classes/class.ilLPMarks.php";
387 
388  $query = "SELECT * FROM event_participants ".
389  "WHERE event_id = ".$ilDB->quote($this->getEventId())." ";
390  $res = $this->db->query($query);
391  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
392  {
393  $this->participants[$row->usr_id]['usr_id'] = $row->usr_id;
394  $this->participants[$row->usr_id]['registered'] = $row->registered;
395  $this->participants[$row->usr_id]['participated'] = $row->participated;
396  /*
397  $this->participants[$row->usr_id]['mark'] = $row->mark;
398  $this->participants[$row->usr_id]['comment'] = $row->e_comment;
399  */
400 
401  $lp_mark = new ilLPMarks($this->getEventId(), $row->usr_id);
402  $this->participants[$row->usr_id]['mark'] = $lp_mark->getMark();
403  $this->participants[$row->usr_id]['comment'] = $lp_mark->getComment();
404  }
405  }
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 357 of file class.ilEventParticipants.php.

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

Referenced by ilObjSession\delete().

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

References $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

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  }
+ Here is the caller graph for this function:

◆ _getParticipated()

ilEventParticipants::_getParticipated (   $a_event_id)

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

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

Referenced by ilLPStatusEvent\_getStatusInfo().

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

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

Referenced by ilLPStatusEvent\_getStatusInfo().

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

References $ilDB, $query, and $res.

Referenced by ilLPStatusEvent\determineStatus().

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

◆ _isRegistered()

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

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

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

Referenced by ilLPStatusEvent\determineStatus(), ilObjSessionGUI\infoScreen(), and ilObjSessionGUI\joinObject().

213  {
214  global $ilDB;
215 
216  $query = "SELECT * FROM event_participants ".
217  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
218  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
219  $res = $ilDB->query($query);
220  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
221  {
222  return (bool) $row->registered;
223  }
224  return false;
225  }
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 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(DB_FETCHMODE_OBJECT))
340  {
341  return $row->e_comment;
342  }
343  return '';
344  */
345  }

◆ _lookupMark()

ilEventParticipants::_lookupMark (   $a_event_id,
  $a_usr_id 
)

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(DB_FETCHMODE_OBJECT))
319  {
320  return $row->mark;
321  }
322  return '';
323  */
324  }

◆ _register()

ilEventParticipants::_register (   $a_usr_id,
  $a_event_id 
)

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

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

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

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

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

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

267  {
268  global $ilDB;
269 
270  $query = "SELECT * FROM event_participants ".
271  "WHERE event_id = ".$ilDB->quote($a_event_id ,'integer')." ".
272  "AND usr_id = ".$ilDB->quote($a_usr_id ,'integer')." ";
273  $res = $ilDB->query($query);
274  if($res->numRows())
275  {
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  }
282  else
283  {
284  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
285  "VALUES( ".
286  "0, ".
287  "0, ".
288  $ilDB->quote($a_event_id ,'integer').", ".
289  $ilDB->quote($a_usr_id ,'integer')." ".
290  ")";
291  $res = $ilDB->manipulate($query);
292  }
293 
294  // refresh learning progress status after updating participant
295  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
296  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
297 
298  return true;
299  }
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 132 of file class.ilEventParticipants.php.

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

Referenced by updateParticipation().

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

References $comment.

Referenced by updateUser().

55  {
56  return $this->comment;
57  }
$comment
Definition: buildRTE.php:83
+ 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().

349  {
350  return $this->event_id;
351  }
+ Here is the caller graph for this function:

◆ getMark()

ilEventParticipants::getMark ( )

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

Referenced by updateUser().

47  {
48  return $this->mark;
49  }
+ Here is the caller graph for this function:

◆ getParticipants()

ilEventParticipants::getParticipants ( )

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

113  {
114  return $this->participants ? $this->participants : array();
115  }

◆ getParticipated()

ilEventParticipants::getParticipated ( )

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

Referenced by updateUser().

63  {
64  return $this->participated;
65  }
+ Here is the caller graph for this function:

◆ getRegistered()

ilEventParticipants::getRegistered ( )

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

Referenced by updateUser().

71  {
72  return $this->registered;
73  }
+ Here is the caller graph for this function:

◆ getUser()

ilEventParticipants::getUser (   $a_usr_id)

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

108  {
109  return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
110  }

◆ getUserId()

ilEventParticipants::getUserId ( )

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

Referenced by updateUser().

39  {
40  return $this->user_id;
41  }
+ Here is the caller graph for this function:

◆ hasParticipated()

ilEventParticipants::hasParticipated (   $a_usr_id)

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

123  {
124  return $this->participants[$a_usr_id]['participated'] ? true : false;
125  }

◆ ilEventParticipants()

ilEventParticipants::ilEventParticipants (   $a_event_id)

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

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

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

◆ isRegistered()

ilEventParticipants::isRegistered (   $a_usr_id)

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

118  {
119  return $this->participants[$a_usr_id]['registered'] ? true : false;
120  }

◆ register()

ilEventParticipants::register (   $a_usr_id)

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

References _register(), and getEventId().

262  {
263  return ilEventParticipants::_register($a_usr_id,$this->getEventId());
264  }
_register($a_usr_id, $a_event_id)
+ Here is the call graph for this function:

◆ setComment()

ilEventParticipants::setComment (   $a_comment)

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

51  {
52  $this->comment = $a_comment;
53  }

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

43  {
44  $this->mark = $a_mark;
45  }

◆ setParticipated()

ilEventParticipants::setParticipated (   $a_status)

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

59  {
60  $this->participated = $a_status;
61  }

◆ setRegistered()

ilEventParticipants::setRegistered (   $a_status)

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

67  {
68  $this->registered = $a_status;
69  }

◆ setUserId()

ilEventParticipants::setUserId (   $a_usr_id)

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

Referenced by ilObjSessionGUI\updateMembersObject().

35  {
36  $this->user_id = $a_usr_id;
37  }
+ Here is the caller graph for this function:

◆ unregister()

ilEventParticipants::unregister (   $a_usr_id)

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

References _unregister(), and getEventId().

301  {
302  return ilEventParticipants::_unregister($a_usr_id,$this->getEventId());
303  }
_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 127 of file class.ilEventParticipants.php.

References _updateParticipation(), and getEventId().

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

◆ updateUser()

ilEventParticipants::updateUser ( )

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

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

75  {
76  global $ilDB;
77 
78  $query = "DELETE FROM event_participants ".
79  "WHERE event_id = ".$ilDB->quote($this->getEventId() ,'integer')." ".
80  "AND usr_id = ".$ilDB->quote($this->getUserId() ,'integer')." ";
81  $res = $ilDB->manipulate($query);
82 
83  $query = "INSERT INTO event_participants (event_id,usr_id,registered,participated". // ,mark,e_comment
84  ") VALUES( ".
85  $ilDB->quote($this->getEventId() ,'integer').", ".
86  $ilDB->quote($this->getUserId() ,'integer').", ".
87  $ilDB->quote($this->getRegistered() ,'integer').", ".
88  $ilDB->quote($this->getParticipated() ,'integer'). /* .", ".
89  $ilDB->quote($this->getMark() ,'text').", ".
90  $ilDB->quote($this->getComment() ,'text')." ". */
91  ")";
92  $res = $ilDB->manipulate($query);
93 
94  include_once "Services/Tracking/classes/class.ilLPMarks.php";
95  $lp_mark = new ilLPMarks($this->getEventId(), $this->getUserId());
96  $lp_mark->setComment($this->getComment());
97  $lp_mark->setMark($this->getMark());
98  $lp_mark->update();
99 
100  // refresh learning progress status after updating participant
101  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
103 
104  return true;
105  }
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 20 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().

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