ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 66 of file class.ilCalendarScheduleFilterBookings.php.

67  {
68  }

◆ 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 $DIC, $group_ids, $ilUser, $user_id, ilCalendarEntry\getContextId(), ilCalendarEntry\getEntryId(), ilCalendarCategories\MODE_PORTFOLIO_CONSULTATION, and ilBookingEntry\setTargetObjIds().

36  {
37  global $DIC;
38 
39  $ilUser = $DIC['ilUser'];
40 
41  $booking = new ilBookingEntry($a_event->getContextId());
42 
43  // do not show bookings of foreign users
44  if ($booking->getObjId() != $this->user_id) {
45  return false;
46  }
47 
48  // portfolio embedded: filter by consultation hour groups?
49  if (!is_array($this->group_ids) ||
50  in_array($booking->getBookingGroup(), $this->group_ids)) {
51  // do not filter against course/group in portfolio
52  if ($this->cats->getMode() == ilCalendarCategories::MODE_PORTFOLIO_CONSULTATION) {
53  $booking->setTargetObjIds(null);
54  }
55 
56  if (($this->user_id == $ilUser->getId() ||
57  !$booking->isBookedOut($a_event->getEntryId(), true)) &&
58  $booking->isTargetObjectVisible($this->cats->getTargetRefId())) {
59  return $a_event;
60  }
61  }
62 
63  return false;
64  }
global $DIC
Definition: saml.php:7
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: