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

Calendar schedule filter for consultation hour bookings. More...

+ Inheritance diagram for ilCalendarScheduleFilterBookings:
+ Collaboration diagram for ilCalendarScheduleFilterBookings:

Public Member Functions

 __construct ($a_user_id, $a_consultation_hour_group_ids=null)
 
 filterCategories (array $a_cats)
 
 modifyEvent (ilCalendarEntry $a_event)
 
 addCustomEvents (ilDate $start, ilDate $end, array $a_categories)
 

Protected Attributes

 $user_id
 
 $group_ids
 
 $cats
 

Detailed Description

Calendar schedule filter for consultation hour bookings.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilCalendarScheduleFilterBookings::__construct (   $a_user_id,
  $a_consultation_hour_group_ids = null 
)

Definition at line 23 of file class.ilCalendarScheduleFilterBookings.php.

References ilCalendarCategories\_getInstance().

24  {
25  $this->user_id = $a_user_id;
26  $this->group_ids = $a_consultation_hour_group_ids;
27  $this->cats = ilCalendarCategories::_getInstance();
28  }
static _getInstance($a_usr_id=0)
get singleton instance
+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomEvents()

ilCalendarScheduleFilterBookings::addCustomEvents ( ilDate  $start,
ilDate  $end,
array  $a_categories 
)

Implements ilCalendarScheduleFilter.

Definition at line 64 of file class.ilCalendarScheduleFilterBookings.php.

65  {
66  }

◆ filterCategories()

ilCalendarScheduleFilterBookings::filterCategories ( array  $a_cats)

Implements ilCalendarScheduleFilter.

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

31  {
32  return $a_cats;
33  }

◆ modifyEvent()

ilCalendarScheduleFilterBookings::modifyEvent ( ilCalendarEntry  $a_event)

Implements ilCalendarScheduleFilter.

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

References $group_ids, $ilUser, $user_id, ilCalendarEntry\getContextId(), ilCalendarEntry\getEntryId(), ilCalendarCategories\MODE_PORTFOLIO_CONSULTATION, and ilBookingEntry\setTargetObjIds().

36  {
37  global $ilUser;
38 
39  $booking = new ilBookingEntry($a_event->getContextId());
40 
41  // do not show bookings of foreign users
42  if ($booking->getObjId() != $this->user_id) {
43  return false;
44  }
45 
46  // portfolio embedded: filter by consultation hour groups?
47  if (!is_array($this->group_ids) ||
48  in_array($booking->getBookingGroup(), $this->group_ids)) {
49  // do not filter against course/group in portfolio
50  if ($this->cats->getMode() == ilCalendarCategories::MODE_PORTFOLIO_CONSULTATION) {
51  $booking->setTargetObjIds(null);
52  }
53 
54  if (($this->user_id == $ilUser->getId() ||
55  !$booking->isBookedOut($a_event->getEntryId(), true)) &&
56  $booking->isTargetObjectVisible($this->cats->getTargetRefId())) {
57  return $a_event;
58  }
59  }
60 
61  return false;
62  }
setTargetObjIds($a_obj_id)
set target object id
getEntryId()
get entry id
Booking definition.
$ilUser
Definition: imgupload.php:18
getContextId()
get context id
+ Here is the call graph for this function:

Field Documentation

◆ $cats

ilCalendarScheduleFilterBookings::$cats
protected

Definition at line 21 of file class.ilCalendarScheduleFilterBookings.php.

◆ $group_ids

ilCalendarScheduleFilterBookings::$group_ids
protected

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

Referenced by modifyEvent().

◆ $user_id

ilCalendarScheduleFilterBookings::$user_id
protected

Definition at line 19 of file class.ilCalendarScheduleFilterBookings.php.

Referenced by modifyEvent().


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