4 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
26 public static function getAppointmentIds($a_user_id, $a_context_id = NULL, $a_start = NULL, $a_type = NULL)
32 include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
36 $query =
"SELECT ce.cal_id FROM cal_entries ce".
37 " JOIN cal_cat_assignments cca ON ce.cal_id = cca.cal_id".
38 " JOIN cal_categories cc ON cca.cat_id = cc.cat_id".
39 " JOIN booking_entry be ON ce.context_id = be.booking_id".
40 " WHERE cc.obj_id = ".$ilDB->quote($a_user_id,
'integer').
41 " AND be.obj_id = ".$ilDB->quote($a_user_id,
'integer').
42 " AND cc.type = ".$ilDB->quote($a_type,
'integer');
46 $query .=
" AND ce.context_id = ".$ilDB->quote($a_context_id,
'integer');
57 $entries[] =
$row->cal_id;
69 foreach(self::getAppointmentIds($a_user_id) as $app_id)
85 $set = $ilDB->query(
'SELECT admin_id FROM cal_ch_settings'.
86 ' WHERE user_id = '.$ilDB->quote($ilUser->getId(),
'integer'));
87 $row = $ilDB->fetchAssoc($set);
94 return (
int)
$row[
'admin_id'];
117 $ilDB->manipulate(
'DELETE FROM cal_ch_settings'.
118 ' WHERE user_id = '.$ilDB->quote($ilUser->getId(),
'integer'));
120 if($user_id && $user_id != $ilUser->getId())
122 $ilDB->manipulate(
'INSERT INTO cal_ch_settings (user_id, admin_id)'.
123 ' VALUES ('.$ilDB->quote($ilUser->getId(),
'integer').
','.
124 $ilDB->quote($user_id,
'integer').
')');
139 $set = $ilDB->query(
'SELECT user_id FROM cal_ch_settings'.
140 ' WHERE admin_id = '.$ilDB->quote($ilUser->getId(),
'integer'));
141 while(
$row = $ilDB->fetchAssoc($set))