ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 39 of file class.ilConsultationHourGroups.php.

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

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

40  {
41  global $ilDB;
42 
43  $query = 'SELECT COUNT(grp_id) num FROM cal_ch_group ' .
44  'WHERE usr_id = ' . $ilDB->quote($a_user_id, 'integer') . ' ' .
45  'GROUP BY grp_id';
46 
47  $res = $ilDB->query($query);
49  return (int) $row->num;
50  }
foreach($_POST as $key=> $value) $res
$query
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 102 of file class.ilConsultationHourGroups.php.

References $key, $lng, $options, array, and string.

Referenced by ilConsultationHoursGUI\initFormSequence().

103  {
104  global $lng;
105 
106  $groups = self::getGroupsOfUser($a_user_id);
107  if (!count($groups)) {
108  return array();
109  }
110  $options = array();
111  foreach ($groups as $group) {
112  $options[(string) $group->getGroupId()] = $group->getTitle();
113  }
114  asort($options, SORT_STRING);
115  $sorted_options = array();
116  $sorted_options[0] = $lng->txt('cal_ch_grp_no_assignment');
117  foreach ($options as $key => $opt) {
118  $sorted_options[$key] = $opt;
119  }
120  return $sorted_options;
121  }
Add rich text string
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
$key
Definition: croninfo.php:18
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ 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 $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

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

19  {
20  global $ilDB;
21 
22  $query = 'SELECT grp_id FROM cal_ch_group ' .
23  'WHERE usr_id = ' . $ilDB->quote($a_user_id, 'integer');
24  $res = $ilDB->query($query);
25  $groups = array();
26  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
27  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
28  $groups[] = new ilConsultationHourGroup($row->grp_id);
29  }
30  return $groups;
31  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ lookupAssignedAppointments()

static ilConsultationHourGroups::lookupAssignedAppointments ( )
static

Lookup number of assigned appointments.

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

References $ilDB.

56  {
57  global $ilDB;
58 
59  //@todo
60  }
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 84 of file class.ilConsultationHourGroups.php.

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

Referenced by ilBookingEntry\isAppointmentBookableForUser().

85  {
86  global $ilDB;
87 
88  $query = 'SELECT multiple_assignments from cal_ch_group ' .
89  'WHERE grp_id = ' . $ilDB->quote($a_group_id, 'integer');
90  $res = $ilDB->query($query);
91  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
92  return $row->multiple_assignments;
93  }
94  return 0;
95  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ lookupTitle()

static ilConsultationHourGroups::lookupTitle (   $a_group_id)
static

Lookup group title.

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

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

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

66  {
67  global $ilDB;
68 
69  $query = 'SELECT title from cal_ch_group ' .
70  'WHERE grp_id = ' . $ilDB->quote($a_group_id, 'integer');
71  $res = $ilDB->query($query);
72  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
73  return $row->title;
74  }
75  return '';
76  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

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