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()) {
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) {
79 $this->
addInfoProperty($this->
lng->txt(
'cal_ch_num_bookings'), (string) $booking->getNumberOfBookings());
80 $this->
addListItemProperty($this->
lng->txt(
'cal_ch_num_bookings'), (string) $booking->getNumberOfBookings());
84 $is_owner = $booking->isOwner();
85 $user_entry = ($cat_info[
'obj_id'] == $this->
user->getId());
87 if ($user_entry && !$is_owner) {
91 $a_app[
'event']->getContextId(),
92 $a_app[
'event']->getStart()
94 $ref_event = $apps[0];
96 $ref_event = $a_app[
'event']->getEntryId();
99 $cb = $booking->getCurrentNumberOfBookings($ref_event);
106 if ($booking->hasBooked($ref_event)) {
108 $this->
ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $ref_event);
111 $this->
lng->txt(
'cal_ch_cancel_booking'),
112 $this->
ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'cancelBooking')
115 } elseif ($booking->isAppointmentBookableForUser($ref_event,
$GLOBALS[
'DIC'][
'ilUser']->getId())) {
116 $this->
ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $ref_event);
119 $this->
lng->txt(
'cal_ch_book'),
120 $this->
ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'book')
130 foreach ($booking->getCurrentBookings($a_app[
'event']->getEntryId()) as $user_id) {
138 $this->
addInfoProperty($this->
lng->txt(
'cal_ch_current_bookings'), implode(
'<br>', $users));
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()
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
static _lookupFullname(int $a_user_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getReadableRefIds(int $a_obj_id)
addInfoProperty(string $a_txt, string $a_val)
Add info property.
static _lookupObjId(int $ref_id)
addLastUpdate(array $a_app)
Add last update.
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="")
Get static link.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
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.
getCatId(int $a_entry_id)