24 $db = $DIC->database();
26 $query =
'select ce.cal_id from cal_entries ce ' .
27 'join cal_cat_assignments cca on ce.cal_id = cca.cal_id ' .
28 'join cal_categories cc on cca.cat_id = cc.cat_id '.
29 'where context_id = ' . $db->quote($booking->
getId(),
'integer') .
' ' .
35 $calendar_apppointments = [];
37 $calendar_apppointments[] =
$row->cal_id;
39 return $calendar_apppointments;
56 include_once
'./Services/Language/classes/class.ilLanguageFactory.php';
58 $cal_lang->loadLanguageModule(
'dateplaner');
60 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
61 include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
65 $cal_lang->txt(
'cal_ch_personal_ch'),
70 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
72 $personal_app = clone $app;
73 $personal_app->save();
76 include_once
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
81 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
83 $booking->
book($app->getEntryId(), $a_usr_id);
93 public static function cancelBooking($a_usr_id, $a_app_id, $a_send_notification =
true)
96 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
99 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
102 $app->getContextId(),
107 foreach ($user_apps as $uapp_id) {
111 include_once
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
120 if ($a_send_notification) {
123 $booking->deleteBooking($a_app_id, $a_usr_id);
136 $ilDB = $DIC[
'ilDB'];
138 $query =
'SELECT user_id FROM cal_ch_settings ' .
139 'WHERE admin_id = ' .
$ilDB->quote($a_usr_id,
'integer');
Model for a calendar entry.
static lookupManagedUsers($a_usr_id)
Lookup managed users.
static findCalendarAppointmentsForBooking(\ilBookingEntry $booking, \ilDateTime $start, \ilDateTime $end)
static getAppointmentIds($a_user_id, $a_context_id=null, $a_start=null, $a_type=null, $a_check_owner=true)
Get all appointment ids.
static _getLanguage($a_lang_key='')
Get langauge object.
foreach($_POST as $key=> $value) $res
cancelBooking($a_entry_id, $a_user_id=false)
cancel calendar booking for user
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
get($a_format, $a_format_str='', $a_tz='')
get formatted date
addAssignment($a_cal_cat_id)
add assignment
static cancelBooking($a_usr_id, $a_app_id, $a_send_notification=true)
Cancel a booking.
book($a_entry_id, $a_user_id=false)
book calendar entry for user
static initDefaultCalendarByType($a_type_id, $a_usr_id, $a_title, $a_create=false)
Init the default calendar for given type and user.
static bookAppointment($a_usr_id, $a_app_id)
Book an appointment.