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, $a_check_owner =
true)
32 include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
38 $owner =
" AND be.obj_id = ".$ilDB->quote($a_user_id,
'integer');
41 $query =
"SELECT ce.cal_id FROM cal_entries ce".
42 " JOIN cal_cat_assignments cca ON ce.cal_id = cca.cal_id".
43 " JOIN cal_categories cc ON cca.cat_id = cc.cat_id".
44 " JOIN booking_entry be ON ce.context_id = be.booking_id".
45 " WHERE cc.obj_id = ".$ilDB->quote($a_user_id,
'integer').
47 " AND cc.type = ".$ilDB->quote($a_type,
'integer');
52 $query .=
" AND ce.context_id = ".$ilDB->quote($a_context_id,
'integer');
64 $entries[] =
$row->cal_id;
82 include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
88 $start_limit =
'AND ce.starta >= '.$ilDB->quote($start->get(
IL_CAL_DATETIME,
'',
'UTC'),
'timestamp');
91 $query =
'SELECT ce.cal_id FROM cal_entries ce '.
92 'JOIN cal_cat_assignments ca ON ce.cal_id = ca.cal_id '.
93 'JOIN cal_categories cc ON ca.cat_id = cc.cat_id '.
94 'JOIN booking_entry be ON ce.context_id = be.booking_id '.
95 'WHERE cc.obj_id = '.$ilDB->quote($a_user_id,
'integer').
' '.
96 'AND cc.type = '.$ilDB->quote($type,
'integer').
' '.
97 'AND be.booking_group = '.$ilDB->quote($a_ch_group_id,
'integer').
' '.
99 'ORDER BY ce.starta ';
104 $app_ids[] =
$row->cal_id;
116 foreach(self::getAppointmentIds($a_user_id) as $app_id)
132 $set = $ilDB->query(
'SELECT admin_id FROM cal_ch_settings'.
133 ' WHERE user_id = '.$ilDB->quote($ilUser->getId(),
'integer'));
134 $row = $ilDB->fetchAssoc($set);
141 return (
int)
$row[
'admin_id'];
164 $ilDB->manipulate(
'DELETE FROM cal_ch_settings'.
165 ' WHERE user_id = '.$ilDB->quote($ilUser->getId(),
'integer'));
167 if($user_id && $user_id != $ilUser->getId())
169 $ilDB->manipulate(
'INSERT INTO cal_ch_settings (user_id, admin_id)'.
170 ' VALUES ('.$ilDB->quote($ilUser->getId(),
'integer').
','.
171 $ilDB->quote($user_id,
'integer').
')');
186 $set = $ilDB->query(
'SELECT user_id FROM cal_ch_settings'.
187 ' WHERE admin_id = '.$ilDB->quote($ilUser->getId(),
'integer'));
188 while(
$row = $ilDB->fetchAssoc($set))