ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 addRecommendation ($a_usr_id)
 Add 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 = ''
 
 $recommended_content_manager
 

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 70 of file class.ilParticipant.php.

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

71  {
72  global $DIC;
73 
74  $ilDB = $DIC['ilDB'];
75  $lng = $DIC['lng'];
76 
77  $this->obj_id = $a_obj_id;
78  $this->usr_id = $a_usr_id;
79  $this->type = ilObject::_lookupType($a_obj_id);
80  $ref_ids = ilObject::_getAllReferences($this->obj_id);
81  $this->ref_id = current($ref_ids);
82 
83  $this->component = $a_component_name;
84 
85  $this->recommended_content_manager = new ilRecommendedContentManager();
86 
87  $this->readParticipant();
88  $this->readParticipantStatus();
89  }
readParticipantStatus()
Read participant status ilDB $ilDB.
static _getAllReferences($a_id)
get all reference ids of object
$lng
static _lookupType($a_id, $a_reference=false)
lookup object type
readParticipant()
Read participant.
global $ilDB
$DIC
Definition: xapitoken.php:46
Recommended content manager (business logic)
+ 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 414 of file class.ilParticipant.php.

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

415  {
416  global $DIC;
417 
418  $rbacadmin = $DIC['rbacadmin'];
419  $ilLog = $DIC->logger()->mmbr();
420  $ilAppEventHandler = $DIC['ilAppEventHandler'];
421  $rbacreview = $DIC['rbacreview'];
422 
423 
424  if ($rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $this->roles)) {
425  return false;
426  }
427 
428  switch ($a_role) {
429  case IL_CRS_ADMIN:
430  $this->admins = true;
431  break;
432 
433  case IL_CRS_TUTOR:
434  $this->tutors = true;
435  break;
436 
437  case IL_CRS_MEMBER:
438  $this->members = true;
439  break;
440 
441  case IL_GRP_ADMIN:
442  $this->admins = true;
443  break;
444 
445  case IL_GRP_MEMBER:
446  $this->members = true;
447  break;
448  }
449 
450  $rbacadmin->assignUser($this->role_data[$a_role], $a_usr_id);
451  $this->addRecommendation($a_usr_id);
452 
453  // Delete subscription request
454  $this->deleteSubscriber($a_usr_id);
455 
456  include_once './Services/Membership/classes/class.ilWaitingList.php';
457  ilWaitingList::deleteUserEntry($a_usr_id, $this->obj_id);
458 
459  $ilLog->debug(': Raise new event: ' . $this->getComponent() . ' addParticipant');
460  $ilAppEventHandler->raise(
461  $this->getComponent(),
462  "addParticipant",
463  array(
464  'obj_id' => $this->obj_id,
465  'usr_id' => $a_usr_id,
466  'role_id' => $a_role)
467  );
468  return true;
469  }
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
addRecommendation($a_usr_id)
Add desktop item.
const IL_CRS_ADMIN
Base class for course and group participants.
$DIC
Definition: xapitoken.php:46
static deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.
+ Here is the call graph for this function:

◆ addRecommendation()

ilParticipant::addRecommendation (   $a_usr_id)

Add desktop item.

public

Parameters
intusr_id

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

Referenced by add().

534  {
535  // deactivated for now, see discussion at
536  // https://docu.ilias.de/goto_docu_wiki_wpage_5620_1357.html
537  //$this->recommended_content_manager->addObjectRecommendation($a_usr_id, $this->ref_id);
538  return true;
539  }
+ 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 614 of file class.ilParticipant.php.

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

615  {
616  global $DIC;
617 
618  $ilDB = $DIC['ilDB'];
619 
620  $admin_role_id =
621  $this->type == 'crs' ?
622  $this->role_data[IL_CRS_ADMIN] :
623  $this->role_data[IL_GRP_ADMIN];
624 
625 
626  $query = "
627  SELECT COUNT(rolesusers.usr_id) cnt
628 
629  FROM object_data rdata
630 
631  LEFT JOIN rbac_ua rolesusers
632  ON rolesusers.rol_id = rdata.obj_id
633 
634  WHERE rdata.obj_id = %s
635  ";
636 
637  $query .= ' AND ' . $ilDB->in('rolesusers.usr_id', $a_usr_ids, true, 'integer');
638  $res = $ilDB->queryF($query, array('integer'), array($admin_role_id));
639 
640  $data = $ilDB->fetchAssoc($res);
641 
642  return (int) $data['cnt'] > 0;
643  }
$data
Definition: storeScorm.php:23
const IL_GRP_ADMIN
foreach($_POST as $key=> $value) $res
const IL_CRS_ADMIN
Base class for course and group participants.
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ delete()

ilParticipant::delete (   $a_usr_id)

Drop user from all roles.

public

Parameters
intusr_id

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

References $DIC, $ilDB, $query, $res, and getComponent().

479  {
480  global $DIC;
481 
482  $rbacadmin = $DIC['rbacadmin'];
483  $ilDB = $DIC['ilDB'];
484  $ilAppEventHandler = $DIC['ilAppEventHandler'];
485 
486  $this->recommended_content_manager->removeObjectRecommendation($a_usr_id, $this->ref_id);
487 
488  foreach ($this->roles as $role_id) {
489  $rbacadmin->deassignUser($role_id, $a_usr_id);
490  }
491 
492  $query = "DELETE FROM obj_members " .
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  $ilAppEventHandler->raise(
498  $this->getComponent(),
499  "deleteParticipant",
500  array(
501  'obj_id' => $this->obj_id,
502  'usr_id' => $a_usr_id)
503  );
504  return true;
505  }
getComponent()
Get component name Used for event handling.
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ deleteSubscriber()

ilParticipant::deleteSubscriber (   $a_usr_id)

Delete subsciber.

public

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

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

Referenced by add().

513  {
514  global $DIC;
515 
516  $ilDB = $DIC['ilDB'];
517 
518  $query = "DELETE FROM il_subscribers " .
519  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " .
520  "AND obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " ";
521  $res = $ilDB->manipulate($query);
522 
523  return true;
524  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ getComponent()

ilParticipant::getComponent ( )
protected

Get component name Used for event handling.

Returns
type

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

References $component.

Referenced by add(), and delete().

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

◆ getMembershipRoleType()

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

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

References ilObject\_lookupTitle().

179  {
180  $title = ilObject::_lookupTitle($a_role_id);
181  switch (substr($title, 0, 8)) {
182  case 'il_crs_a':
183  case 'il_grp_a':
184  return self::MEMBERSHIP_ADMIN;
185 
186  case 'il_crs_t':
187  return self::MEMBERSHIP_TUTOR;
188 
189  case 'il_crs_m':
190  default:
191  return self::MEMBERSHIP_MEMBER;
192 
193  }
194  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:

◆ getNumberOfMembers()

ilParticipant::getNumberOfMembers ( )

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

References $DIC, and $numMembers.

291  {
292  global $DIC;
293 
294  $rbacreview = $DIC['rbacreview'];
295 
296  if ($this->numMembers === null) {
297  $this->numMembers = $rbacreview->getNumberOfAssignedUsers($this->member_roles);
298  }
299  return $this->numMembers;
300  }
$DIC
Definition: xapitoken.php:46

◆ getUserId()

ilParticipant::getUserId ( )

get user id

Returns
int

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

References $usr_id.

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

245  {
246  return $this->usr_id;
247  }
+ Here is the caller graph for this function:

◆ isAdmin()

ilParticipant::isAdmin ( )

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

References $admins.

276  {
277  return $this->admins;
278  }

◆ isAssigned()

ilParticipant::isAssigned ( )

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

References $participants.

266  {
267  return (bool) $this->participants;
268  }

◆ isBlocked()

ilParticipant::isBlocked ( )

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

References getUserId().

250  {
251  return (bool) $this->participants_status[$this->getUserId()]['blocked'];
252  }
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 259 of file class.ilParticipant.php.

References getUserId().

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

◆ isMember()

ilParticipant::isMember ( )

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

References $members.

271  {
272  return (bool) $this->members;
273  }

◆ isParticipant()

ilParticipant::isParticipant ( )

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

References $participants.

286  {
287  return (bool) $this->participants;
288  }

◆ isTutor()

ilParticipant::isTutor ( )

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

References $tutors.

281  {
282  return (bool) $this->tutors;
283  }

◆ 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 204 of file class.ilParticipant.php.

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

205  {
206  global $DIC;
207 
208  $ilDB = $DIC['ilDB'];
209 
210  $query = 'SELECT * FROM obj_members ' .
211  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
212  'AND usr_id = ' . $ilDB->quote($a_usr_id) . ' ';
213  $res = $ilDB->query($query);
214  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
215  switch ($a_membership_role_type) {
216  case self::MEMBERSHIP_ADMIN:
217  return $row->admin;
218 
219  case self::MEMBERSHIP_TUTOR:
220  return $row->tutor;
221 
222  case self::MEMBERSHIP_MEMBER:
223  return $row->member;
224  }
225  }
226  return 0;
227  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ readParticipant()

ilParticipant::readParticipant ( )
protected

Read participant.

Returns
void

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

References $DIC, IL_CRS_ADMIN, IL_CRS_MEMBER, IL_CRS_TUTOR, IL_GRP_ADMIN, and IL_GRP_MEMBER.

Referenced by __construct().

308  {
309  global $DIC;
310 
311  $rbacreview = $DIC['rbacreview'];
312  $ilObjDataCache = $DIC['ilObjDataCache'];
313 
314  $this->roles = $rbacreview->getRolesOfRoleFolder($this->ref_id, false);
315 
316  $users = array();
317  $this->participants = array();
318  $this->members = $this->admins = $this->tutors = array();
319  $this->member_roles = [];
320 
321  foreach ($this->roles as $role_id) {
322  $title = $ilObjDataCache->lookupTitle($role_id);
323  switch (substr($title, 0, 8)) {
324  case 'il_crs_m':
325  $this->member_roles[] = $role_id;
326  $this->role_data[IL_CRS_MEMBER] = $role_id;
327  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
328  $this->participants = true;
329  $this->members = true;
330  }
331  break;
332 
333  case 'il_crs_a':
334  $this->role_data[IL_CRS_ADMIN] = $role_id;
335  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
336  $this->participants = true;
337  $this->admins = true;
338  }
339  break;
340 
341  case 'il_crs_t':
342  $this->role_data[IL_CRS_TUTOR] = $role_id;
343  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
344  $this->participants = true;
345  $this->tutors = true;
346  }
347  break;
348 
349  case 'il_grp_a':
350  $this->role_data[IL_GRP_ADMIN] = $role_id;
351  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
352  $this->participants = true;
353  $this->admins = true;
354  }
355  break;
356 
357  case 'il_grp_m':
358  $this->member_roles[] = $role_id;
359  $this->role_data[IL_GRP_MEMBER] = $role_id;
360  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
361  $this->participants = true;
362  $this->members = true;
363  }
364  break;
365 
366  default:
367 
368  $this->member_roles[] = $role_id;
369  if ($rbacreview->isAssigned($this->getUserId(), $role_id)) {
370  $this->participants = true;
371  $this->members = true;
372  }
373  break;
374  }
375  }
376  }
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.
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ readParticipantStatus()

ilParticipant::readParticipantStatus ( )
protected

Read participant status ilDB $ilDB.

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

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

Referenced by __construct().

383  {
384  global $DIC;
385 
386  $ilDB = $DIC['ilDB'];
387 
388  $query = "SELECT * FROM obj_members " .
389  "WHERE obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " " .
390  'AND usr_id = ' . $ilDB->quote($this->getUserId(), 'integer');
391 
392  $res = $ilDB->query($query);
393  $this->participants_status = array();
394  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
395  $this->participants_status[$this->getUserId()]['blocked'] = $row->blocked;
396  $this->participants_status[$this->getUserId()]['notification'] = $row->notification;
397  $this->participants_status[$this->getUserId()]['passed'] = $row->passed;
398  // cognos-blu-patch: begin
399  $this->participants_status[$this->getUserId()]['contact'] = $row->contact;
400  // cognos-blu-patch: end
401  }
402  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
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 550 of file class.ilParticipant.php.

References $DIC, and $ilDB.

551  {
552  global $DIC;
553 
554  $ilDB = $DIC['ilDB'];
555 
556  $ilDB->manipulate(
557  'UPDATE obj_members SET ' .
558  'contact = ' . $ilDB->quote($a_contact, 'integer') . ' ' .
559  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer') . ' ' .
560  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer')
561  );
562 
563  $this->participants_status[$a_usr_id]['contact'] = $a_contact;
564  return true;
565  }
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ 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 98 of file class.ilParticipant.php.

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

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

99  {
100  global $DIC;
101 
102  $ilDB = $DIC['ilDB'];
103 
104  $a_membership_role_type = self::getMembershipRoleType($a_role_id);
105 
106  switch ($a_membership_role_type) {
107  case self::MEMBERSHIP_ADMIN:
108  $update_fields = array('admin' => array('integer', $a_status ? 1 : 0));
109  $update_string = ('admin = ' . $ilDB->quote($a_status ? 1 : 0, 'integer'));
110  break;
111 
112  case self::MEMBERSHIP_TUTOR:
113  $update_fields = array('tutor' => array('integer', $a_status ? 1 : 0));
114  $update_string = ('tutor = ' . $ilDB->quote($a_status ? 1 : 0, 'integer'));
115  break;
116 
117  case self::MEMBERSHIP_MEMBER:
118  default:
119  $current_status = self::lookupStatusByMembershipRoleType($a_obj_id, $a_usr_id, $a_membership_role_type);
120 
121  if ($a_status) {
122  $new_status = $current_status + 1;
123  }
124  if (!$a_status) {
125  $new_status = $current_status - 1;
126  if ($new_status < 0) {
127  $new_status = 0;
128  }
129  }
130 
131  $update_fields = array('member' => array('integer', $new_status));
132  $update_string = ('member = ' . $ilDB->quote($new_status, 'integer'));
133  break;
134  }
135 
136  $query = 'SELECT count(*) num FROM obj_members ' .
137  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
138  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
139  $res = $ilDB->query($query);
140 
141  $found = false;
142  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
143  if ($row->num) {
144  $found = true;
145  }
146  }
147  if (!$found) {
148  $ilDB->replace(
149  'obj_members',
150  array(
151  'obj_id' => array('integer',$a_obj_id),
152  'usr_id' => array('integer',$a_usr_id)
153  ),
154  $update_fields
155  );
156  } else {
157  $query = 'UPDATE obj_members SET ' .
158  $update_string . ' ' .
159  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
160  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
161 
162  $ilDB->manipulate($query);
163  }
164 
165  $query = 'DELETE from obj_members ' .
166  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
167  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer') . ' ' .
168  'AND admin = ' . $ilDB->quote(0, 'integer') . ' ' .
169  'AND tutor = ' . $ilDB->quote(0, 'integer') . ' ' .
170  'AND member = ' . $ilDB->quote(0, 'integer');
171  $ilDB->manipulate($query);
172  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ 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 576 of file class.ilParticipant.php.

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

577  {
578  global $DIC;
579 
580  $ilDB = $DIC['ilDB'];
581 
582  $this->participants_status[$a_usr_id]['notification'] = (int) $a_notification;
583 
584  $query = "SELECT * FROM obj_members " .
585  "WHERE obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " " .
586  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer');
587  $res = $ilDB->query($query);
588  if ($res->numRows()) {
589  $query = "UPDATE obj_members SET " .
590  "notification = " . $ilDB->quote((int) $a_notification, 'integer') . " " .
591  "WHERE obj_id = " . $ilDB->quote($this->obj_id, 'integer') . " " .
592  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer');
593  } else {
594  $query = "INSERT INTO obj_members (notification,obj_id,usr_id,passed,blocked) " .
595  "VALUES ( " .
596  $ilDB->quote((int) $a_notification, 'integer') . ", " .
597  $ilDB->quote($this->obj_id, 'integer') . ", " .
598  $ilDB->quote($a_usr_id, 'integer') . ", " .
599  $ilDB->quote(0, 'integer') . ", " .
600  $ilDB->quote(0, 'integer') .
601  ")";
602  }
603  $res = $ilDB->manipulate($query);
604  return true;
605  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

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.

◆ $recommended_content_manager

ilParticipant::$recommended_content_manager
protected

Definition at line 62 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: