ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 setExcused (bool $a_stat)
 
 getExcused ()
 
 updateExcusedForUser (int $a_usr_id, bool $a_status)
 Update excused status. More...
 
 setContact ($a_status)
 
 getContact ()
 
 isNotificationEnabled ()
 
 setNotificationEnabled ($value)
 
 updateUser ()
 
 getUser ($a_usr_id)
 
 getParticipants ()
 
 isRegistered ($a_usr_id)
 
 hasParticipated ($a_usr_id)
 
 isExcused (int $a_usr_id)
 
 isContact ($a_usr_id)
 Check if user is contact. More...
 
 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

 $contact = 0
 
 $registered = []
 
 $participated = []
 
 $excused = []
 
 $contacts = []
 

Private Attributes

 $notificationEnabled
 

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

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

54  {
55  global $DIC;
56 
57  $ilErr = $DIC['ilErr'];
58  $ilDB = $DIC->database();
59  $lng = $DIC->language();
60  $tree = $DIC->repositoryTree();
61 
62  $this->ilErr = $ilErr;
63  $this->db = $ilDB;
64  $this->lng = $lng;
65 
66  $this->event_id = $a_event_id;
67  $this->__read();
68  }
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilEventParticipants::__read ( )

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

References $DIC, $ilDB, $query, $res, $session, $tree, ilObject\_getAllReferences(), ilDBConstants\FETCHMODE_OBJECT, getEventId(), ilParticipants\getInstance(), ilObjectFactory\getInstanceByObjId(), and ilSessionConstants\NOTIFICATION_INHERIT_OPTION.

Referenced by __construct().

504  {
505  global $DIC;
506 
507  $ilDB = $DIC['ilDB'];
508 
509  $query = "SELECT * FROM event_participants " .
510  "WHERE event_id = " . $ilDB->quote($this->getEventId()) . " ";
511  $res = $this->db->query($query);
512 
513  global $DIC;
514  $tree = $DIC->repositoryTree();
515 
516  $parentRecipients = [];
517  $parentParticipants = [];
519  $refIdArray = array_values(ilObject::_getAllReferences($this->event_id));
520  if (true === $session->isRegistrationNotificationEnabled()) {
521  if (ilSessionConstants::NOTIFICATION_INHERIT_OPTION === $session->getRegistrationNotificationOption()) {
522  $parentRefId = $tree->checkForParentType($refIdArray[0], 'grp');
523  if (!$parentRefId) {
524  $parentRefId = $tree->checkForParentType($refIdArray[0], 'crs');
525  }
526  if ($parentRefId) {
527  $participants = \ilParticipants::getInstance($parentRefId);
528  $parentRecipients = $participants->getNotificationRecipients();
529  $parentParticipants = $participants->getParticipants();
530  }
531  }
532  }
533  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
534  $this->participants[$row->usr_id]['usr_id'] = $row->usr_id;
535  $this->participants[$row->usr_id]['registered'] = $row->registered;
536  $this->participants[$row->usr_id]['participated'] = $row->participated;
537  $this->participants[$row->usr_id]['excused'] = $row->excused;
538  $this->participants[$row->usr_id]['contact'] = $row->contact;
539 
540  $lp_mark = new ilLPMarks($this->getEventId(), $row->usr_id);
541  $this->participants[$row->usr_id]['mark'] = $lp_mark->getMark();
542  $this->participants[$row->usr_id]['comment'] = $lp_mark->getComment();
543  $this->participants[$row->usr_id]['notification_enabled'] = false;
544  if (in_array($row->usr_id, $parentRecipients)) {
545  $this->participants[$row->usr_id]['notification_enabled'] = true;
546  }
547 
548  if ($row->registered) {
549  $this->registered[] = $row->usr_id;
550  }
551  if ($row->participated) {
552  $this->participated[] = $row->usr_id;
553  }
554  }
555  // add defaults for parent participants
556  foreach ($parentParticipants as $usr_id) {
557  if (isset($this->participants[$usr_id])) {
558  continue;
559  }
560  $this->participants[$usr_id]['usr_id'] = $usr_id;
561  $this->participants[$usr_id]['registered'] = false;
562  $this->participants[$usr_id]['participated'] = false;
563  $this->participants[$usr_id]['excused'] = false;
564  $this->participants[$usr_id]['contact'] = false;
565  $lp_mark = new ilLPMarks($this->getEventId(), $usr_id);
566  $this->participants[$usr_id]['mark'] = $lp_mark->getMark();
567  $this->participants[$usr_id]['comment'] = $lp_mark->getComment();
568  $this->participants[$usr_id]['notification_enabled'] = false;
569  if (in_array($usr_id, $parentRecipients)) {
570  $this->participants[$usr_id]['notification_enabled'] = true;
571  }
572 
573  }
574  }
$session
static _getAllReferences($a_id)
get all reference ids of object
static getInstance($a_ref_id)
Get instance by ref_id.
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ 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 474 of file class.ilEventParticipants.php.

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

Referenced by ilObjSession\delete().

475  {
476  global $DIC;
477 
478  $ilDB = $DIC['ilDB'];
479 
480  $query = "DELETE FROM event_participants " .
481  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " ";
482  $res = $ilDB->manipulate($query);
483 
484  include_once "Services/Tracking/classes/class.ilLPMarks.php";
485  ilLPMarks::deleteObject($a_event_id);
486 
487  return true;
488  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
static deleteObject($a_obj_id)
Delete object.
+ 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 489 of file class.ilEventParticipants.php.

References $DIC, $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

490  {
491  global $DIC;
492 
493  $ilDB = $DIC['ilDB'];
494 
495  $query = "DELETE FROM event_participants " .
496  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
497  $res = $ilDB->manipulate($query);
498  return true;
499  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ Here is the caller graph for this function:

◆ _getParticipated()

static ilEventParticipants::_getParticipated (   $a_event_id)
static

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

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

Referenced by ilLPStatusEvent\_getStatusInfo(), and ilSessionOverviewTableGUI\getItems().

325  {
326  global $DIC;
327 
328  $ilDB = $DIC['ilDB'];
329 
330  $query = "SELECT * FROM event_participants " .
331  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
332  "AND participated = 1";
333  $res = $ilDB->query($query);
334  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
335  $user_ids[$row->usr_id] = $row->usr_id;
336  }
337  return $user_ids ? $user_ids : array();
338  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ Here is the caller graph for this function:

◆ _getRegistered()

static ilEventParticipants::_getRegistered (   $a_event_id)
static

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

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

Referenced by ilLPStatusEvent\_getStatusInfo().

309  {
310  global $DIC;
311 
312  $ilDB = $DIC['ilDB'];
313 
314  $query = "SELECT * FROM event_participants " .
315  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
316  "AND registered = " . $ilDB->quote(1, 'integer');
317  $res = $ilDB->query($query);
318  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
319  $user_ids[] = $row->usr_id;
320  }
321  return $user_ids ? $user_ids : array();
322  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ Here is the caller graph for this function:

◆ _hasParticipated()

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

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

References $DIC, $ilDB, $query, and $res.

Referenced by ilLPStatusEvent\determineStatus().

341  {
342  global $DIC;
343 
344  $ilDB = $DIC['ilDB'];
345 
346  $query = "SELECT participated FROM event_participants " .
347  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
348  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
349  $res = $ilDB->query($query);
350  if ($rec = $ilDB->fetchAssoc($res)) {
351  return (bool) $rec["participated"];
352  }
353  return false;
354  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ Here is the caller graph for this function:

◆ _isRegistered()

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

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

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

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

357  {
358  global $DIC;
359 
360  $ilDB = $DIC['ilDB'];
361 
362  $query = "SELECT * FROM event_participants " .
363  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
364  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
365  $res = $ilDB->query($query);
366  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
367  return (bool) $row->registered;
368  }
369  return false;
370  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ Here is the caller graph for this function:

◆ _lookupComment()

ilEventParticipants::_lookupComment (   $a_event_id,
  $a_usr_id 
)

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

458  {
459  include_once "Services/Tracking/classes/class.ilLPMarks.php";
460  $lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
461  return $lp_mark->getComment();
462  }

◆ _lookupMark()

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

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

451  {
452  include_once "Services/Tracking/classes/class.ilLPMarks.php";
453  $lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
454  return $lp_mark->getMark();
455  }

◆ _register()

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

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

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

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

373  {
374  global $DIC;
375 
376  $ilDB = $DIC['ilDB'];
377 
378  $query = "SELECT * FROM event_participants " .
379  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
380  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
381  $res = $ilDB->query($query);
382  if ($res->numRows()) {
383  $query = "UPDATE event_participants " .
384  "SET registered = '1' " .
385  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
386  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
387  $res = $ilDB->manipulate($query);
388  } else {
389  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
390  "VALUES( " .
391  "1, " .
392  "0, " .
393  $ilDB->quote($a_event_id, 'integer') . ", " .
394  $ilDB->quote($a_usr_id, 'integer') . " " .
395  ")";
396  $res = $ilDB->manipulate($query);
397  }
398 
399  // refresh learning progress status after updating participant
400  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
401  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
402 
403  return true;
404  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ 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 410 of file class.ilEventParticipants.php.

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

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

411  {
412  global $DIC;
413 
414  $ilDB = $DIC['ilDB'];
415 
416  $query = "SELECT * FROM event_participants " .
417  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
418  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
419  $res = $ilDB->query($query);
420  if ($res->numRows()) {
421  $query = "UPDATE event_participants " .
422  "SET registered = 0 " .
423  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
424  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
425  $res = $ilDB->manipulate($query);
426  } else {
427  $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
428  "VALUES( " .
429  "0, " .
430  "0, " .
431  $ilDB->quote($a_event_id, 'integer') . ", " .
432  $ilDB->quote($a_usr_id, 'integer') . " " .
433  ")";
434  $res = $ilDB->manipulate($query);
435  }
436 
437  // refresh learning progress status after updating participant
438  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
439  ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
440 
441  self::handleAutoFill($a_event_id);
442 
443  return true;
444  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ 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 274 of file class.ilEventParticipants.php.

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

Referenced by updateParticipation().

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

◆ getComment()

ilEventParticipants::getComment ( )

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

References $comment.

Referenced by updateUser().

91  {
92  return $this->comment;
93  }
$comment
Definition: buildRTE.php:83
+ Here is the caller graph for this function:

◆ getContact()

ilEventParticipants::getContact ( )
Returns
int

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

References $contact.

Referenced by updateUser().

168  {
169  return $this->contact;
170  }
+ Here is the caller graph for this function:

◆ getEventId()

ilEventParticipants::getEventId ( )

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

References $event_id.

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

466  {
467  return $this->event_id;
468  }
+ Here is the caller graph for this function:

◆ getExcused()

ilEventParticipants::getExcused ( )
Returns
bool

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

References $excused.

Referenced by updateUser().

122  : bool
123  {
124  return $this->excused;
125  }
+ Here is the caller graph for this function:

◆ getMark()

ilEventParticipants::getMark ( )

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

Referenced by updateUser().

83  {
84  return $this->mark;
85  }
+ Here is the caller graph for this function:

◆ getParticipants()

ilEventParticipants::getParticipants ( )

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

234  {
235  return $this->participants ? $this->participants : array();
236  }

◆ getParticipated()

ilEventParticipants::getParticipated ( )

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

References $participated.

Referenced by updateUser().

99  {
100  return $this->participated;
101  }
+ Here is the caller graph for this function:

◆ getRegistered()

ilEventParticipants::getRegistered ( )

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

References $registered.

Referenced by updateUser().

107  {
108  return $this->registered;
109  }
+ Here is the caller graph for this function:

◆ getUser()

ilEventParticipants::getUser (   $a_usr_id)

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

229  {
230  return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
231  }

◆ getUserId()

ilEventParticipants::getUserId ( )

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

Referenced by updateUser().

75  {
76  return $this->user_id;
77  }
+ 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 581 of file class.ilEventParticipants.php.

582  {
583  $sess = new ilObjSession($a_obj_id, false);
584  $sess->handleAutoFill();
585  }

◆ hasParticipated()

ilEventParticipants::hasParticipated (   $a_usr_id)

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

244  {
245  return $this->participants[$a_usr_id]['participated'] ? true : false;
246  }

◆ isContact()

ilEventParticipants::isContact (   $a_usr_id)

Check if user is contact.

Parameters
$a_usr_id
Returns
bool

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

264  {
265  return $this->participants[$a_usr_id]['contact'] ? true : false;
266  }

◆ isExcused()

ilEventParticipants::isExcused ( int  $a_usr_id)
Parameters
int$a_usr_id
Returns
bool

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

252  : bool
253  {
254  return $this->participants[$a_usr_id]['excused'] ? true : false;
255  }

◆ isNotificationEnabled()

ilEventParticipants::isNotificationEnabled ( )
Returns
boolean

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

References $notificationEnabled.

Referenced by updateUser().

176  {
177  return (bool) $this->notificationEnabled;
178  }
+ Here is the caller graph for this function:

◆ isRegistered()

ilEventParticipants::isRegistered (   $a_usr_id)

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

239  {
240  return $this->participants[$a_usr_id]['registered'] ? true : false;
241  }

◆ register()

ilEventParticipants::register (   $a_usr_id)

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

References _register(), and getEventId().

406  {
407  return ilEventParticipants::_register($a_usr_id, $this->getEventId());
408  }
static _register($a_usr_id, $a_event_id)
+ Here is the call graph for this function:

◆ setComment()

ilEventParticipants::setComment (   $a_comment)

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

References comment().

87  {
88  $this->comment = $a_comment;
89  }
comment()
Definition: comment.php:2
+ Here is the call graph for this function:

◆ setContact()

ilEventParticipants::setContact (   $a_status)
Parameters
bool$a_status

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

160  {
161  $this->contact = (int) $a_status;
162  }

◆ setEventId()

ilEventParticipants::setEventId (   $a_event_id)

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

470  {
471  $this->event_id = $a_event_id;
472  }

◆ setExcused()

ilEventParticipants::setExcused ( bool  $a_stat)
Parameters
bool$a_stat

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

115  {
116  $this->excused = $a_stat;
117  }

◆ setMark()

ilEventParticipants::setMark (   $a_mark)

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

79  {
80  $this->mark = $a_mark;
81  }

◆ setNotificationEnabled()

ilEventParticipants::setNotificationEnabled (   $value)
Parameters
boolean$value

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

184  {
185  $this->notificationEnabled = (bool) $value;
186  }

◆ setParticipated()

ilEventParticipants::setParticipated (   $a_status)

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

95  {
96  $this->participated = $a_status;
97  }

◆ setRegistered()

ilEventParticipants::setRegistered (   $a_status)

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

103  {
104  $this->registered = $a_status;
105  }

◆ setUserId()

ilEventParticipants::setUserId (   $a_usr_id)

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

71  {
72  $this->user_id = $a_usr_id;
73  }

◆ unregister()

ilEventParticipants::unregister (   $a_usr_id)

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

References _unregister(), and getEventId().

446  {
447  return ilEventParticipants::_unregister($a_usr_id, $this->getEventId());
448  }
static _unregister($a_usr_id, $a_event_id)
+ Here is the call graph for this function:

◆ updateExcusedForUser()

ilEventParticipants::updateExcusedForUser ( int  $a_usr_id,
bool  $a_status 
)

Update excused status.

Parameters
int$a_usr_id
bool$a_status

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

References $query, and ilDBConstants\T_INTEGER.

134  {
135  if (!is_array($this->participants) || !array_key_exists($a_usr_id, $this->participants)) {
136  $event_part = new \ilEventParticipants($this->event_id);
137  $event_part->setUserId($a_usr_id);
138  $event_part->setMark('');
139  $event_part->setComment('');
140  $event_part->setNotificationEnabled(false);
141  $event_part->setParticipated(false);
142  $event_part->setRegistered(false);
143  $event_part->setContact(false);
144  $event_part->setExcused($a_status);
145  $event_part->updateUser();
146  return;
147  }
148 
149  $query = 'update event_participants set excused = ' . $this->db->quote($a_status, \ilDBConstants::T_INTEGER) . ' ' .
150  'where event_id = ' . $this->db->quote($this->event_id, \ilDBConstants::T_INTEGER) . ' and ' .
151  'usr_id = ' . $this->db->quote($a_usr_id, \ilDBConstants::T_INTEGER);
152  $this->db->manipulate($query);
153  return;
154  }
$query

◆ updateParticipation()

ilEventParticipants::updateParticipation (   $a_usr_id,
  $a_status 
)

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

References _updateParticipation(), and getEventId().

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

◆ updateUser()

ilEventParticipants::updateUser ( )

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

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

189  {
190  global $DIC;
191 
192  $ilDB = $DIC['ilDB'];
193 
194  $query = "DELETE FROM event_participants " .
195  "WHERE event_id = " . $ilDB->quote($this->getEventId(), 'integer') . " " .
196  "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " ";
197  $res = $ilDB->manipulate($query);
198 
199  $query = "INSERT INTO event_participants (event_id,usr_id,registered,participated,contact,notification_enabled, excused " .
200  ") VALUES( " .
201  $ilDB->quote($this->getEventId(), 'integer') . ", " .
202  $ilDB->quote($this->getUserId(), 'integer') . ", " .
203  $ilDB->quote($this->getRegistered(), 'integer') . ", " .
204  $ilDB->quote($this->getParticipated(), 'integer') . ', ' .
205  $ilDB->quote($this->getContact(), 'integer') . ', ' .
206  $ilDB->quote($this->isNotificationEnabled(), 'integer') . ', ' .
207  $ilDB->quote((int) $this->getExcused(), 'integer') .
208  ")";
209  $res = $ilDB->manipulate($query);
210 
211  include_once "Services/Tracking/classes/class.ilLPMarks.php";
212  $lp_mark = new ilLPMarks($this->getEventId(), $this->getUserId());
213  $lp_mark->setComment($this->getComment());
214  $lp_mark->setMark($this->getMark());
215  $lp_mark->update();
216 
217  // refresh learning progress status after updating participant
218  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
220 
221  if (!$this->getRegistered()) {
222  self::handleAutoFill($this->getEventId());
223  }
224 
225  return true;
226  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
+ Here is the call graph for this function:

Field Documentation

◆ $contact

ilEventParticipants::$contact = 0
protected

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

Referenced by getContact().

◆ $contacts

ilEventParticipants::$contacts = []
protected

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

◆ $event_id

ilEventParticipants::$event_id = null

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

Referenced by getEventId().

◆ $excused

ilEventParticipants::$excused = []
protected

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

Referenced by getExcused().

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

◆ $notificationEnabled

ilEventParticipants::$notificationEnabled
private

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

Referenced by isNotificationEnabled().

◆ $participated

ilEventParticipants::$participated = []
protected

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

Referenced by getParticipated().

◆ $registered

ilEventParticipants::$registered = []
protected

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

Referenced by getRegistered().

◆ $tree

ilEventParticipants::$tree

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

Referenced by __construct(), and __read().


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