3 declare(strict_types=1);
16 $cat_id = $this->
getCatId($a_app[
'event']->getEntryId());
18 $context_id = $a_app[
'event']->getContextId();
29 if ($booking->isOwner($this->user->getId())) {
31 foreach ($booking->getTargetObjIds() as
$obj_id) {
40 if (count($refs) > 1) {
41 $par_ref = $this->tree->getParentId($ref_id);
44 $buttons[] = $this->
ui->renderer()->render(
49 if (count($buttons) > 0) {
56 $this->
lng->txt(
'cal_ch_booking_owner'),
60 if ($deadline = $booking->getDeadlineHours()) {
61 $limit = $a_app[
'dstart'] - ($deadline * 60 * 60);
63 if (time() > $limit) {
78 $free = $booking->getNumberOfBookings() - $booking->getCurrentNumberOfBookings($a_app[
'event']->getEntryId());
80 $this->
lng->txt(
'cal_ch_booking_num_available'),
81 sprintf($this->
lng->txt(
'cal_ch_free_of_available'), $free, $booking->getNumberOfBookings())
84 $this->
lng->txt(
'cal_ch_booking_num_available'),
85 sprintf($this->
lng->txt(
'cal_ch_free_of_available'), $free, $booking->getNumberOfBookings())
90 $is_owner = $booking->isOwner($this->
user->getId());
91 $user_entry = ($cat_info[
'obj_id'] == $this->
user->getId());
93 if ($user_entry && !$is_owner) {
97 $a_app[
'event']->getContextId(),
98 $a_app[
'event']->getStart()
100 $ref_event = $apps[0];
102 $ref_event = $a_app[
'event']->getEntryId();
105 $cb = $booking->getCurrentNumberOfBookings($ref_event);
107 if ($booking->hasBooked($ref_event)) {
109 $this->
ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $ref_event);
112 $this->
lng->txt(
'cal_ch_cancel_booking'),
113 $this->
ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'cancelBooking')
116 } elseif ($booking->isAppointmentBookableForUser($ref_event,
$GLOBALS[
'DIC'][
'ilUser']->getId())) {
117 $this->
ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $ref_event);
120 $this->
lng->txt(
'cal_ch_book'),
121 $this->
ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'book')
127 $this->
ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $a_app[
'event']->getEntryId());
129 $this->
lng->txt(
'cal_ch_cancel_booking'),
130 $this->
ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'cancelBooking')
133 $this->
lng->txt(
'cal_ch_delete_booking'),
134 $this->
ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'deleteBooking')
142 $booking_comments = [];
143 foreach ($booking->getCurrentBookings($a_app[
'event']->getEntryId()) as
$user_id) {
146 $a_app[
'event']->getEntryId(),
156 foreach ($booking_comments as $user_id =>
$comment) {
static getManager(bool $a_as_name=false, bool $a_full_name=false, int $a_user_id=null)
Get consultation hour manager for current user or specific user.
collectPropertiesAndActions()
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
static _lookupFullname(int $a_user_id)
getReadableRefIds(int $a_obj_id)
addInfoProperty(string $a_txt, string $a_val)
Add info property.
static _lookupObjId(int $ref_id)
static getAppointmentIds(int $a_user_id, int $a_context_id=null, ?ilDateTime $a_start=null, ?int $a_type=null, bool $a_check_owner=true)
static _lookupTitle(int $obj_id)
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
getUserName(int $a_user_id, bool $a_force_name=false)
Get (linked if possible) user name.
const MODE_PORTFOLIO_CONSULTATION
static _getInstance($a_usr_id=0)
get singleton instance
addCommonSection(array $a_app, int $a_obj_id=0, ?array $cat_info=null, bool $a_container_info=false)
addAction(string $a_txt, string $a_link)
Add action.
static lookupBookingMessage(int $a_entry_id, int $a_usr_id)
getCatId(int $a_entry_id)