4 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
33 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') .
57 $query .= (
' ORDER BY ce.starta ASC');
62 $entries[] =
$row->cal_id;
82 include_once
'./Services/Calendar/classes/class.ilCalendarCategory.php';
90 $query =
'SELECT ce.cal_id FROM cal_entries ce ' .
91 'JOIN cal_cat_assignments ca ON ce.cal_id = ca.cal_id ' .
92 'JOIN cal_categories cc ON ca.cat_id = cc.cat_id ' .
93 'JOIN booking_entry be ON ce.context_id = be.booking_id ' .
94 'WHERE cc.obj_id = ' .
$ilDB->quote($a_user_id,
'integer') .
' ' .
95 'AND cc.type = ' .
$ilDB->quote(
$type,
'integer') .
' ' .
96 'AND be.booking_group = ' .
$ilDB->quote($a_ch_group_id,
'integer') .
' ' .
98 'ORDER BY ce.starta ';
102 $app_ids[] =
$row->cal_id;
114 foreach (self::getAppointmentIds($a_user_id) as $app_id) {
127 public static function getManager($a_as_name =
false, $a_full_name =
false, $a_user_id = null)
131 $ilDB = $DIC[
'ilDB'];
137 $user_id = $a_user_id;
140 $set =
$ilDB->query(
'SELECT admin_id FROM cal_ch_settings' .
141 ' WHERE user_id = ' .
$ilDB->quote($user_id,
'integer'));
144 if ($a_as_name && $a_full_name) {
146 } elseif ($a_as_name) {
149 return (
int)
$row[
'admin_id'];
162 $ilDB = $DIC[
'ilDB'];
173 $ilDB->manipulate(
'DELETE FROM cal_ch_settings' .
174 ' WHERE user_id = ' .
$ilDB->quote(
$ilUser->getId(),
'integer'));
176 if ($user_id && $user_id !=
$ilUser->getId()) {
177 $ilDB->manipulate(
'INSERT INTO cal_ch_settings (user_id, admin_id)' .
178 ' VALUES (' .
$ilDB->quote(
$ilUser->getId(),
'integer') .
',' .
179 $ilDB->quote($user_id,
'integer') .
')');
193 $ilDB = $DIC[
'ilDB'];
197 $set =
$ilDB->query(
'SELECT user_id FROM cal_ch_settings' .
198 ' WHERE admin_id = ' .
$ilDB->quote(
$ilUser->getId(),
'integer'));
static _lookupLogin($a_user_id)
lookup login
Model for a calendar entry.
static _lookupFullname($a_user_id)
Lookup Full Name.
static getAppointmentIds($a_user_id, $a_context_id=null, $a_start=null, $a_type=null, $a_check_owner=true)
Get all appointment ids.
Consultation hour appointments.
static setManager($a_user_name)
Set consultation hour manager for current user.
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
foreach($_POST as $key=> $value) $res
static getManagedUsers()
Get all managed consultation hours users for current users.
static getAppointments($a_user_id)
Get all appointments.
static getAppointmentIdsByGroup($a_user_id, $a_ch_group_id, ilDateTime $start=null)
Get appointment ids by consultation hour group.
static getManager($a_as_name=false, $a_full_name=false, $a_user_id=null)
Get consultation hour manager for current user or specific user.