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

Base class for course and group participant. More...

+ Inheritance diagram for ilParticipant:
+ Collaboration diagram for ilParticipant:

Public Member Functions

 getUserId ()
 get user id More...
 
 isBlocked ()
 
 isContact ()
 Check if user is contact for current object. More...
 
 isAssigned ()
 
 isMember ()
 
 isAdmin ()
 
 isTutor ()
 
 isParticipant ()
 
 getNumberOfMembers ()
 
 add ($a_usr_id, $a_role)
 Add user to course/group. More...
 
 delete ($a_usr_id)
 Drop user from all roles. More...
 
 deleteSubscriber ($a_usr_id)
 Delete subsciber. More...
 
 addDesktopItem ($a_usr_id)
 Add desktop item. More...
 
 dropDesktopItem ($a_usr_id)
 Drop desktop item. More...
 
 updateContact ($a_usr_id, $a_contact)
 ilDB $ilDB More...
 
 updateNotification ($a_usr_id, $a_notification)
 Update notification status. More...
 
 checkLastAdmin ($a_usr_ids)
 Check if user for deletion are last admins. More...
 

Static Public Member Functions

static updateMemberRoles ($a_obj_id, $a_usr_id, $a_role_id, $a_status)
 Update member roles ilDB $ilDB. More...
 
static getMembershipRoleType ($a_role_id)
 
static lookupStatusByMembershipRoleType ($a_obj_id, $a_usr_id, $a_membership_role_type)
 lookup assignment status ilDB $ilDB More...
 

Data Fields

const MEMBERSHIP_ADMIN = 1
 
const MEMBERSHIP_TUTOR = 2
 
const MEMBERSHIP_MEMBER = 3
 

Protected Member Functions

 __construct ($a_component_name, $a_obj_id, $a_usr_id)
 Singleton Constructor. More...
 
 getComponent ()
 Get component name Used for event handling. More...
 
 readParticipant ()
 Read participant. More...
 
 readParticipantStatus ()
 Read participant status ilDB $ilDB. More...
 

Protected Attributes

 $type = ''
 

Private Attributes

 $obj_id = 0
 
 $usr_id = 0
 
 $ref_id = 0
 
 $component = ''
 
 $participants = false
 
 $admins = false
 
 $tutors = false
 
 $members = false
 
 $numMembers = null
 
 $member_roles = []
 
 $participants_status = array()
 

Detailed Description

Base class for course and group participant.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilParticipant::__construct (   $a_component_name,
  $a_obj_id,
  $a_usr_id 
)
protected

Singleton Constructor.

protected

Parameters
intobj_id of container

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

References $ilDB, $lng, ilObject\_getAllReferences(), ilObject\_lookupType(), readParticipant(), and readParticipantStatus().

66  {
67  global $ilDB,$lng;
68 
69  $this->obj_id = $a_obj_id;
70  $this->usr_id = $a_usr_id;
71  $this->type = ilObject::_lookupType($a_obj_id);
72  $ref_ids = ilObject::_getAllReferences($this->obj_id);
73  $this->ref_id = current($ref_ids);
74 
75  $this->component = $a_component_name;
76 
77  $this->readParticipant();
78  $this->readParticipantStatus();
79  }
readParticipantStatus()
Read participant status ilDB $ilDB.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
readParticipant()
Read participant.
global $lng
Definition: privfeed.php:17
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilParticipant::add (   $a_usr_id,
  $a_role 
)

Add user to course/group.

public

Parameters
intuser id
introle IL_CRS_ADMIN || IL_CRS_TUTOR || IL_CRS_MEMBER

global ilRbacReview $rbacreview

Definition at line 400 of file class.ilParticipant.php.

References $ilLog, addDesktopItem(), array, deleteSubscriber(), ilWaitingList\deleteUserEntry(), getComponent(), IL_CRS_ADMIN, IL_CRS_MEMBER, IL_CRS_TUTOR, IL_GRP_ADMIN, and IL_GRP_MEMBER.

401  {
402  global $rbacadmin,$ilLog,$ilAppEventHandler,$rbacreview;
403 
404 
405  if ($rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $this->roles)) {
406  return false;
407  }
408 
409  switch ($a_role) {
410  case IL_CRS_ADMIN:
411  $this->admins = true;
412  break;
413 
414  case IL_CRS_TUTOR:
415  $this->tutors = true;
416  break;
417 
418  case IL_CRS_MEMBER:
419  $this->members = true;
420  break;
421 
422  case IL_GRP_ADMIN:
423  $this->admins = true;
424  break;
425 
426  case IL_GRP_MEMBER:
427  $this->members = true;
428  break;
429  }
430 
431  $rbacadmin->assignUser($this->role_data[$a_role], $a_usr_id);
432  $this->addDesktopItem($a_usr_id);
433 
434  // Delete subscription request
435  $this->deleteSubscriber($a_usr_id);
436 
437  include_once './Services/Membership/classes/class.ilWaitingList.php';
438  ilWaitingList::deleteUserEntry($a_usr_id, $this->obj_id);
439 
440  $ilLog->write(__METHOD__ . ': Raise new event: ' . $this->getComponent() . ' addParticipant');
441  $ilAppEventHandler->raise(
442  $this->getComponent(),
443  "addParticipant",
444  array(
445  'obj_id' => $this->obj_id,
446  'usr_id' => $a_usr_id,
447  'role_id' => $a_role)
448  );
449  return true;
450  }
const IL_GRP_ADMIN
const IL_CRS_TUTOR
deleteSubscriber($a_usr_id)
Delete subsciber.
const IL_GRP_MEMBER
getComponent()
Get component name Used for event handling.
const IL_CRS_MEMBER
const IL_CRS_ADMIN
Base class for course and group participants.
Create styles array
The data for the language used.
addDesktopItem($a_usr_id)
Add desktop item.
static deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.
+ Here is the call graph for this function:

◆ addDesktopItem()

ilParticipant::addDesktopItem (   $a_usr_id)

Add desktop item.

public

Parameters
intusr_id

Definition at line 507 of file class.ilParticipant.php.

References ilObjUser\_addDesktopItem(), and ilObjUser\_isDesktopItem().

Referenced by add().

508  {
509  if (!ilObjUser::_isDesktopItem($a_usr_id, $this->ref_id, $this->type)) {
510  ilObjUser::_addDesktopItem($a_usr_id, $this->ref_id, $this->type);
511  }
512  return true;
513  }
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
static _isDesktopItem($a_usr_id, $a_item_id, $a_type)
check wether an item is on the users desktop or not
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLastAdmin()

ilParticipant::checkLastAdmin (   $a_usr_ids)

Check if user for deletion are last admins.

public

Parameters
arrayarray of user ids for deletion

Definition at line 599 of file class.ilParticipant.php.

References $data, $ilDB, $query, $res, array, IL_CRS_ADMIN, and IL_GRP_ADMIN.

600  {
601  global $ilDB;
602 
603  $admin_role_id =
604  $this->type == 'crs' ?
605  $this->role_data[IL_CRS_ADMIN] :
606  $this->role_data[IL_GRP_ADMIN];
607 
608 
609  $query = "
610  SELECT COUNT(rolesusers.usr_id) cnt
611 
612  FROM object_data rdata
613 
614  LEFT JOIN rbac_ua rolesusers
615  ON rolesusers.rol_id = rdata.obj_id
616 
617  WHERE rdata.obj_id = %s
618  ";
619 
620  $query .= ' AND ' . $ilDB->in('rolesusers.usr_id', $a_usr_ids, true, 'integer');
621  $res = $ilDB->queryF($query, array('integer'), array($admin_role_id));
622 
623  $data = $ilDB->fetchAssoc($res);
624 
625  return (int) $data['cnt'] > 0;
626  }
const IL_GRP_ADMIN
foreach($_POST as $key=> $value) $res
const IL_CRS_ADMIN
Base class for course and group participants.
$query
Create styles array
The data for the language used.
global $ilDB

◆ delete()

ilParticipant::delete (   $a_usr_id)

Drop user from all roles.

public

Parameters
intusr_id

Definition at line 459 of file class.ilParticipant.php.

References $ilDB, $query, $res, array, dropDesktopItem(), and getComponent().

460  {
461  global $rbacadmin,$ilDB, $ilAppEventHandler;
462 
463  $this->dropDesktopItem($a_usr_id);
464  foreach ($this->roles as $role_id) {
465  $rbacadmin->deassignUser($role_id, $a_usr_id);
466  }
467 
468  $query = "DELETE FROM obj_members " .
469  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
470  "AND obj_id = " . $ilDB->quote($this->obj_id, 'integer');
471  $res = $ilDB->manipulate($query);
472 
473  $ilAppEventHandler->raise(
474  $this->getComponent(),
475  "deleteParticipant",
476  array(
477  'obj_id' => $this->obj_id,
478  'usr_id' => $a_usr_id)
479  );
480  return true;
481  }
getComponent()
Get component name Used for event handling.
foreach($_POST as $key=> $value) $res
dropDesktopItem($a_usr_id)
Drop desktop item.
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ deleteSubscriber()

ilParticipant::deleteSubscriber (   $a_usr_id)

Delete subsciber.

public

Definition at line 488 of file class.ilParticipant.php.

References $ilDB, $query, and $res.

Referenced by add().

489  {
490  global $ilDB;
491 
492  $query = "DELETE FROM il_subscribers " .
493  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
494  "AND obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " ";
495  $res = $ilDB->manipulate($query);
496 
497  return true;
498  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ dropDesktopItem()

ilParticipant::dropDesktopItem (   $a_usr_id)

Drop desktop item.

public

Parameters
intusr_id

Definition at line 522 of file class.ilParticipant.php.

References ilObjUser\_dropDesktopItem(), and ilObjUser\_isDesktopItem().

Referenced by delete().

523  {
524  if (ilObjUser::_isDesktopItem($a_usr_id, $this->ref_id, $this->type)) {
525  ilObjUser::_dropDesktopItem($a_usr_id, $this->ref_id, $this->type);
526  }
527 
528  return true;
529  }
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static _isDesktopItem($a_usr_id, $a_item_id, $a_type)
check wether an item is on the users desktop or not
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponent()

ilParticipant::getComponent ( )
protected

Get component name Used for event handling.

Returns
type

Definition at line 226 of file class.ilParticipant.php.

References $component.

Referenced by add(), and delete().

227  {
228  return $this->component;
229  }
+ Here is the caller graph for this function:

◆ getMembershipRoleType()

static ilParticipant::getMembershipRoleType (   $a_role_id)
static
Parameters
type$a_role_id

Definition at line 171 of file class.ilParticipant.php.

References $title, and ilObject\_lookupTitle().

172  {
173  $title = ilObject::_lookupTitle($a_role_id);
174  switch (substr($title, 0, 8)) {
175  case 'il_crs_a':
176  case 'il_grp_a':
177  return self::MEMBERSHIP_ADMIN;
178 
179  case 'il_crs_t':
180  return self::MEMBERSHIP_TUTOR;
181 
182  case 'il_crs_m':
183  default:
184  return self::MEMBERSHIP_MEMBER;
185 
186  }
187  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:

◆ getNumberOfMembers()

ilParticipant::getNumberOfMembers ( )

Definition at line 281 of file class.ilParticipant.php.

References $DIC, and $numMembers.

282  {
283  global $DIC;
284 
285  $rbacreview = $DIC['rbacreview'];
286 
287  if ($this->numMembers === null) {
288  $this->numMembers = $rbacreview->getNumberOfAssignedUsers($this->member_roles);
289  }
290  return $this->numMembers;
291  }
global $DIC
Definition: saml.php:7

◆ getUserId()

ilParticipant::getUserId ( )

get user id

Returns
int

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

References $usr_id.

Referenced by isBlocked(), isContact(), and readParticipantStatus().

236  {
237  return $this->usr_id;
238  }
+ Here is the caller graph for this function:

◆ isAdmin()

ilParticipant::isAdmin ( )

Definition at line 266 of file class.ilParticipant.php.

References $admins.

267  {
268  return $this->admins;
269  }

◆ isAssigned()

ilParticipant::isAssigned ( )

Definition at line 256 of file class.ilParticipant.php.

References $participants.

257  {
258  return (bool) $this->participants;
259  }

◆ isBlocked()

ilParticipant::isBlocked ( )

Definition at line 240 of file class.ilParticipant.php.

References getUserId().

241  {
242  return (bool) $this->participants_status[$this->getUserId()]['blocked'];
243  }
getUserId()
get user id
+ Here is the call graph for this function:

◆ isContact()

ilParticipant::isContact ( )

Check if user is contact for current object.

Returns
bool

Definition at line 250 of file class.ilParticipant.php.

References getUserId().

251  {
252  return (bool) $this->participants_status[$this->getUserId()]['contact'];
253  }
getUserId()
get user id
+ Here is the call graph for this function:

◆ isMember()

ilParticipant::isMember ( )

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

References $members.

262  {
263  return (bool) $this->members;
264  }

◆ isParticipant()

ilParticipant::isParticipant ( )

Definition at line 276 of file class.ilParticipant.php.

References $participants.

277  {
278  return (bool) $this->participants;
279  }

◆ isTutor()

ilParticipant::isTutor ( )

Definition at line 271 of file class.ilParticipant.php.

References $tutors.

272  {
273  return (bool) $this->tutors;
274  }

◆ lookupStatusByMembershipRoleType()

static ilParticipant::lookupStatusByMembershipRoleType (   $a_obj_id,
  $a_usr_id,
  $a_membership_role_type 
)
static

lookup assignment status ilDB $ilDB

Parameters
type$a_obj_id
type$a_usr_id
type$a_membership_role_type
Returns
int

Definition at line 197 of file class.ilParticipant.php.

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

198  {
199  global $ilDB;
200 
201  $query = 'SELECT * FROM obj_members ' .
202  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
203  'AND usr_id = ' . $ilDB->quote($a_usr_id) . ' ';
204  $res = $ilDB->query($query);
205  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
206  switch ($a_membership_role_type) {
207  case self::MEMBERSHIP_ADMIN:
208  return $row->admin;
209 
210  case self::MEMBERSHIP_TUTOR:
211  return $row->tutor;
212 
213  case self::MEMBERSHIP_MEMBER:
214  return $row->member;
215  }
216  }
217  return 0;
218  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB

◆ readParticipant()

ilParticipant::readParticipant ( )
protected

Read participant.

Returns
void

Definition at line 298 of file class.ilParticipant.php.

References $ilLog, $title, $users, array, IL_CRS_ADMIN, IL_CRS_MEMBER, IL_CRS_TUTOR, IL_GRP_ADMIN, and IL_GRP_MEMBER.

Referenced by __construct().

299  {
300  global $rbacreview,$ilObjDataCache,$ilLog;
301 
302  $this->roles = $rbacreview->getRolesOfRoleFolder($this->ref_id, false);
303 
304  $users = array();
305  $this->participants = array();
306  $this->members = $this->admins = $this->tutors = array();
307  $this->member_roles = [];
308 
309  foreach ($this->roles as $role_id) {
310  $title = $ilObjDataCache->lookupTitle($role_id);
311  switch (substr($title, 0, 8)) {
312  case 'il_crs_m':
313  $this->member_roles[] = $role_id;
314  $this->role_data[IL_CRS_MEMBER] = $role_id;
315  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
316  $this->participants = true;
317  $this->members = true;
318  }
319  break;
320 
321  case 'il_crs_a':
322  $this->role_data[IL_CRS_ADMIN] = $role_id;
323  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
324  $this->participants = true;
325  $this->admins = true;
326  }
327  break;
328 
329  case 'il_crs_t':
330  $this->role_data[IL_CRS_TUTOR] = $role_id;
331  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
332  $this->participants = true;
333  $this->tutors = true;
334  }
335  break;
336 
337  case 'il_grp_a':
338  $this->role_data[IL_GRP_ADMIN] = $role_id;
339  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
340  $this->participants = true;
341  $this->admins = true;
342  }
343  break;
344 
345  case 'il_grp_m':
346  $this->member_roles[] = $role_id;
347  $this->role_data[IL_GRP_MEMBER] = $role_id;
348  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
349  $this->participants = true;
350  $this->members = true;
351  }
352  break;
353 
354  default:
355 
356  $this->member_roles[] = $role_id;
357  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
358  $this->participants = true;
359  $this->members = true;
360  }
361  break;
362  }
363  }
364  }
const IL_GRP_ADMIN
const IL_CRS_TUTOR
const IL_GRP_MEMBER
const IL_CRS_MEMBER
const IL_CRS_ADMIN
Base class for course and group participants.
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
+ Here is the caller graph for this function:

◆ readParticipantStatus()

ilParticipant::readParticipantStatus ( )
protected

Read participant status ilDB $ilDB.

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

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

Referenced by __construct().

371  {
372  global $ilDB;
373 
374  $query = "SELECT * FROM obj_members " .
375  "WHERE obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " " .
376  'AND usr_id = ' . $ilDB->quote($this->getUserId(), 'integer');
377 
378  $res = $ilDB->query($query);
379  $this->participants_status = array();
380  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
381  $this->participants_status[$this->getUserId()]['blocked'] = $row->blocked;
382  $this->participants_status[$this->getUserId()]['notification'] = $row->notification;
383  $this->participants_status[$this->getUserId()]['passed'] = $row->passed;
384  // cognos-blu-patch: begin
385  $this->participants_status[$this->getUserId()]['contact'] = $row->contact;
386  // cognos-blu-patch: end
387  }
388  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
getUserId()
get user id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateContact()

ilParticipant::updateContact (   $a_usr_id,
  $a_contact 
)

ilDB $ilDB

Parameters
type$a_usr_id
type$a_contact
Returns
boolean

Definition at line 539 of file class.ilParticipant.php.

References $ilDB.

540  {
541  global $ilDB;
542 
543  $ilDB->manipulate(
544  'UPDATE obj_members SET ' .
545  'contact = ' . $ilDB->quote($a_contact, 'integer') . ' ' .
546  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer') . ' ' .
547  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer')
548  );
549 
550  $this->participants_status[$a_usr_id]['contact'] = $a_contact;
551  return true;
552  }
global $ilDB

◆ updateMemberRoles()

static ilParticipant::updateMemberRoles (   $a_obj_id,
  $a_usr_id,
  $a_role_id,
  $a_status 
)
static

Update member roles ilDB $ilDB.

Parameters
type$a_obj_id
type$a_role_id
type$a_status

Definition at line 88 of file class.ilParticipant.php.

References $ilDB, $query, $res, $row, array, ilDBConstants\FETCHMODE_OBJECT, ilLoggerFactory\getInstance(), and ilLoggerFactory\getLogger().

Referenced by ilGroupAppEventListener\handleUserAssignments(), and ilCourseAppEventListener\handleUserAssignments().

89  {
90  global $ilDB;
91 
92  $a_membership_role_type = self::getMembershipRoleType($a_role_id);
93 
94  ilLoggerFactory::getInstance()->getLogger('crs')->debug($a_membership_role_type);
95 
96  switch ($a_membership_role_type) {
97  case self::MEMBERSHIP_ADMIN:
98  $update_fields = array('admin' => array('integer', $a_status ? 1 : 0));
99  $update_string = ('admin = ' . $ilDB->quote($a_status ? 1 : 0, 'integer'));
100  break;
101 
102  case self::MEMBERSHIP_TUTOR:
103  $update_fields = array('tutor' => array('integer', $a_status ? 1 : 0));
104  $update_string = ('tutor = ' . $ilDB->quote($a_status ? 1 : 0, 'integer'));
105  break;
106 
107  case self::MEMBERSHIP_MEMBER:
108  default:
109  $current_status = self::lookupStatusByMembershipRoleType($a_obj_id, $a_usr_id, $a_membership_role_type);
110  ilLoggerFactory::getInstance()->getLogger('crs')->debug($current_status);
111 
112  if ($a_status) {
113  $new_status = $current_status + 1;
114  }
115  if (!$a_status) {
116  $new_status = $current_status - 1;
117  if ($new_status < 0) {
118  $new_status = 0;
119  }
120  }
121 
122  $update_fields = array('member' => array('integer', $new_status));
123  $update_string = ('member = ' . $ilDB->quote($new_status, 'integer'));
124  break;
125  }
126 
127  $query = 'SELECT count(*) num FROM obj_members ' .
128  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
129  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
130  $res = $ilDB->query($query);
131 
132  $found = false;
133  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
134  if ($row->num) {
135  $found = true;
136  }
137  }
138  if (!$found) {
139  $ilDB->replace(
140  'obj_members',
141  array(
142  'obj_id' => array('integer',$a_obj_id),
143  'usr_id' => array('integer',$a_usr_id)
144  ),
145  $update_fields
146  );
147  } else {
148  $query = 'UPDATE obj_members SET ' .
149  $update_string . ' ' .
150  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
151  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
152 
153  $ilDB->manipulate($query);
154  }
155 
156  $query = 'DELETE from obj_members ' .
157  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
158  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer') . ' ' .
159  'AND admin = ' . $ilDB->quote(0, 'integer') . ' ' .
160  'AND tutor = ' . $ilDB->quote(0, 'integer') . ' ' .
161  'AND member = ' . $ilDB->quote(0, 'integer');
162  $ilDB->manipulate($query);
163 
164  ilLoggerFactory::getLogger('mem')->debug($query);
165  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateNotification()

ilParticipant::updateNotification (   $a_usr_id,
  $a_notification 
)

Update notification status.

public

Parameters
intusr_id
boolpassed

Definition at line 563 of file class.ilParticipant.php.

References $ilDB, $query, and $res.

564  {
565  global $ilDB;
566 
567  $this->participants_status[$a_usr_id]['notification'] = (int) $a_notification;
568 
569  $query = "SELECT * FROM obj_members " .
570  "WHERE obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " " .
571  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer');
572  $res = $ilDB->query($query);
573  if ($res->numRows()) {
574  $query = "UPDATE obj_members SET " .
575  "notification = " . $ilDB->quote((int) $a_notification, 'integer') . " " .
576  "WHERE obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " " .
577  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer');
578  } else {
579  $query = "INSERT INTO obj_members (notification,obj_id,usr_id,passed,blocked) " .
580  "VALUES ( " .
581  $ilDB->quote((int) $a_notification, 'integer') . ", " .
582  $ilDB->quote($this->obj_id, 'integer') . ", " .
583  $ilDB->quote($a_usr_id, 'integer') . ", " .
584  $ilDB->quote(0, 'integer') . ", " .
585  $ilDB->quote(0, 'integer') .
586  ")";
587  }
588  $res = $ilDB->manipulate($query);
589  return true;
590  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB

Field Documentation

◆ $admins

ilParticipant::$admins = false
private

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

Referenced by isAdmin().

◆ $component

ilParticipant::$component = ''
private

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

Referenced by getComponent().

◆ $member_roles

ilParticipant::$member_roles = []
private

Definition at line 55 of file class.ilParticipant.php.

◆ $members

ilParticipant::$members = false
private

Definition at line 51 of file class.ilParticipant.php.

Referenced by isMember().

◆ $numMembers

ilParticipant::$numMembers = null
private

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

Referenced by getNumberOfMembers().

◆ $obj_id

ilParticipant::$obj_id = 0
private

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

◆ $participants

ilParticipant::$participants = false
private

Definition at line 48 of file class.ilParticipant.php.

Referenced by isAssigned(), and isParticipant().

◆ $participants_status

ilParticipant::$participants_status = array()
private

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

◆ $ref_id

ilParticipant::$ref_id = 0
private

Definition at line 44 of file class.ilParticipant.php.

◆ $tutors

ilParticipant::$tutors = false
private

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

Referenced by isTutor().

◆ $type

ilParticipant::$type = ''
protected

Definition at line 43 of file class.ilParticipant.php.

◆ $usr_id

ilParticipant::$usr_id = 0
private

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

Referenced by getUserId().

◆ MEMBERSHIP_ADMIN

const ilParticipant::MEMBERSHIP_ADMIN = 1

Definition at line 36 of file class.ilParticipant.php.

◆ MEMBERSHIP_MEMBER

const ilParticipant::MEMBERSHIP_MEMBER = 3

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

◆ MEMBERSHIP_TUTOR

const ilParticipant::MEMBERSHIP_TUTOR = 2

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


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