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;
54 include_once
'./Services/Language/classes/class.ilLanguageFactory.php';
56 $cal_lang->loadLanguageModule(
'dateplaner');
58 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
59 include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
63 $cal_lang->txt(
'cal_ch_personal_ch'),
68 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
70 $personal_app = clone $app;
71 $personal_app->save();
74 include_once
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
79 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
81 $booking->
book($app->getEntryId(), $a_usr_id);
91 public static function cancelBooking($a_usr_id, $a_app_id, $a_send_notification =
true)
94 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
97 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
100 $app->getContextId(),
105 foreach ($user_apps as $uapp_id) {
109 include_once
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
118 if ($a_send_notification) {
121 $booking->deleteBooking($a_app_id, $a_usr_id);
134 $query =
'SELECT user_id FROM cal_ch_settings ' .
135 '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
Create styles array
The data for the language used.
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.