ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilConsultationHourGroups Class Reference

Description of class. More...

+ Collaboration diagram for ilConsultationHourGroups:

Static Public Member Functions

static getGroupsOfUser ($a_user_id)
 Get a all groups of an user. More...
 
static getCountGroupsOfUser ($a_user_id)
 Get number of consultation hour groups type $ilDB. More...
 
static lookupAssignedAppointments ()
 Lookup number of assigned appointments. More...
 
static lookupTitle ($a_group_id)
 Lookup group title. More...
 
static lookupMaxBookings ($a_group_id)
 Lookup max number of bookings for group type $ilDB. More...
 
static getGroupSelectOptions ($a_user_id)
 Get group selection options. More...
 

Detailed Description

Description of class.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 10 of file class.ilConsultationHourGroups.php.

Member Function Documentation

◆ getCountGroupsOfUser()

static ilConsultationHourGroups::getCountGroupsOfUser (   $a_user_id)
static

Get number of consultation hour groups type $ilDB.

Parameters
type$a_user_id
Returns
int

Definition at line 41 of file class.ilConsultationHourGroups.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilConsultationHoursTableGUI\__construct(), and ilConsultationHoursGUI\createNewBookingEntry().

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);
53  return (int) $row->num;
54  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getGroupSelectOptions()

static ilConsultationHourGroups::getGroupSelectOptions (   $a_user_id)
static

Get group selection options.

Parameters
type$a_user_id

Definition at line 112 of file class.ilConsultationHourGroups.php.

References $DIC, $key, $lng, and PHPMailer\PHPMailer\$options.

Referenced by ilConsultationHoursGUI\initFormSequence().

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  }
global $DIC
Definition: saml.php:7
$lng
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ getGroupsOfUser()

static ilConsultationHourGroups::getGroupsOfUser (   $a_user_id)
static

Get a all groups of an user.

Parameters
int$a_user_id
Returns
array

Definition at line 18 of file class.ilConsultationHourGroups.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilConsultationHoursGUI\groupList(), ilPCConsultationHoursGUI\initForm(), and ilConsultationHoursGUI\saveSequence().

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ lookupAssignedAppointments()

static ilConsultationHourGroups::lookupAssignedAppointments ( )
static

Lookup number of assigned appointments.

Definition at line 59 of file class.ilConsultationHourGroups.php.

References $DIC, and $ilDB.

60  {
61  global $DIC;
62 
63  $ilDB = $DIC['ilDB'];
64 
65  //@todo
66  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ lookupMaxBookings()

static ilConsultationHourGroups::lookupMaxBookings (   $a_group_id)
static

Lookup max number of bookings for group type $ilDB.

Parameters
type$a_group_id
Returns
int

Definition at line 92 of file class.ilConsultationHourGroups.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilBookingEntry\isAppointmentBookableForUser().

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ lookupTitle()

static ilConsultationHourGroups::lookupTitle (   $a_group_id)
static

Lookup group title.

Definition at line 71 of file class.ilConsultationHourGroups.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilConsultationHoursTableGUI\parse(), and ilPortfolioPageGUI\renderConsultationHoursTeaser().

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: