ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilConsultationHourGroups.php
Go to the documentation of this file.
1
<?
php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
10
class
ilConsultationHourGroups
11
{
12
18
public
static
function
getGroupsOfUser
($a_user_id)
19
{
20
global
$DIC
;
21
22
$ilDB
= $DIC[
'ilDB'
];
23
24
$query
=
'SELECT grp_id FROM cal_ch_group '
.
25
'WHERE usr_id = '
.
$ilDB
->quote($a_user_id,
'integer'
);
26
$res
=
$ilDB
->query(
$query
);
27
$groups = array();
28
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
29
include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php'
;
30
$groups[] =
new
ilConsultationHourGroup
(
$row
->grp_id);
31
}
32
return
$groups;
33
}
34
41
public
static
function
getCountGroupsOfUser
($a_user_id)
42
{
43
global
$DIC
;
44
45
$ilDB
= $DIC[
'ilDB'
];
46
47
$query
=
'SELECT COUNT(grp_id) num FROM cal_ch_group '
.
48
'WHERE usr_id = '
.
$ilDB
->quote($a_user_id,
'integer'
) .
' '
.
49
'GROUP BY grp_id'
;
50
51
$res
=
$ilDB
->query(
$query
);
52
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
);
53
return
(
int
)
$row
->num;
54
}
55
59
public
static
function
lookupAssignedAppointments
()
60
{
61
global
$DIC
;
62
63
$ilDB
= $DIC[
'ilDB'
];
64
65
//@todo
66
}
67
71
public
static
function
lookupTitle
($a_group_id)
72
{
73
global
$DIC
;
74
75
$ilDB
= $DIC[
'ilDB'
];
76
77
$query
=
'SELECT title from cal_ch_group '
.
78
'WHERE grp_id = '
.
$ilDB
->quote($a_group_id,
'integer'
);
79
$res
=
$ilDB
->query(
$query
);
80
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
81
return
$row
->title;
82
}
83
return
''
;
84
}
85
92
public
static
function
lookupMaxBookings
($a_group_id)
93
{
94
global
$DIC
;
95
96
$ilDB
= $DIC[
'ilDB'
];
97
98
$query
=
'SELECT multiple_assignments from cal_ch_group '
.
99
'WHERE grp_id = '
.
$ilDB
->quote($a_group_id,
'integer'
);
100
$res
=
$ilDB
->query(
$query
);
101
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
102
return
$row
->multiple_assignments;
103
}
104
return
0;
105
}
106
107
112
public
static
function
getGroupSelectOptions
($a_user_id)
113
{
114
global
$DIC
;
115
116
$lng
= $DIC[
'lng'
];
117
118
$groups = self::getGroupsOfUser($a_user_id);
119
if
(!count($groups)) {
120
return
array();
121
}
122
$options
= array();
123
foreach
($groups as $group) {
124
$options
[(string) $group->getGroupId()] = $group->getTitle();
125
}
126
asort(
$options
, SORT_STRING);
127
$sorted_options = array();
128
$sorted_options[0] =
$lng
->txt(
'cal_ch_grp_no_assignment'
);
129
foreach
(
$options
as
$key
=> $opt) {
130
$sorted_options[
$key
] = $opt;
131
}
132
return
$sorted_options;
133
}
134
}
ilConsultationHourGroups
Description of class.
Definition:
class.ilConsultationHourGroups.php:10
ilConsultationHourGroups\lookupTitle
static lookupTitle($a_group_id)
Lookup group title.
Definition:
class.ilConsultationHourGroups.php:71
$DIC
global $DIC
Definition:
saml.php:7
PHPMailer\PHPMailer\$options
$options
Definition:
get_oauth_token.php:91
ilConsultationHourGroups\getGroupSelectOptions
static getGroupSelectOptions($a_user_id)
Get group selection options.
Definition:
class.ilConsultationHourGroups.php:112
ilConsultationHourGroups\getGroupsOfUser
static getGroupsOfUser($a_user_id)
Get a all groups of an user.
Definition:
class.ilConsultationHourGroups.php:18
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
$lng
$lng
Definition:
save_question_post_data.php:23
ilConsultationHourGroup
Description of class.
Definition:
class.ilConsultationHourGroup.php:10
$query
$query
Definition:
proxy_ylocal.php:13
ilConsultationHourGroups\lookupAssignedAppointments
static lookupAssignedAppointments()
Lookup number of assigned appointments.
Definition:
class.ilConsultationHourGroups.php:59
$row
$row
Definition:
migrateto20.php:360
ilConsultationHourGroups\lookupMaxBookings
static lookupMaxBookings($a_group_id)
Lookup max number of bookings for group type $ilDB.
Definition:
class.ilConsultationHourGroups.php:92
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilConsultationHourGroups\getCountGroupsOfUser
static getCountGroupsOfUser($a_user_id)
Get number of consultation hour groups type $ilDB.
Definition:
class.ilConsultationHourGroups.php:41
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$key
$key
Definition:
croninfo.php:18
Services
Calendar
classes
ConsultationHours
class.ilConsultationHourGroups.php
Generated on Thu Jan 16 2025 19:02:18 for ILIAS by
1.8.13 (using
Doxyfile
)