ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
static getCountGroupsOfUser ($a_user_id)
 Get number of consultation hour groups type $ilDB.
static lookupAssignedAppointments ()
 Lookup number of assigned appointments.
static lookupTitle ($a_group_id)
 Lookup group title.
static lookupMaxBookings ($a_group_id)
 Lookup max number of bookings for group type $ilDB.
static getGroupSelectOptions ($a_user_id)
 Get group selection options.

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

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 40 of file class.ilConsultationHourGroups.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

{
global $ilDB;
$query = 'SELECT COUNT(grp_id) num FROM cal_ch_group '.
'WHERE usr_id = '.$ilDB->quote($a_user_id,'integer').' '.
'GROUP BY grp_id';
$res = $ilDB->query($query);
return (int) $row->num;
}

+ Here is the caller graph for this function:

static ilConsultationHourGroups::getGroupSelectOptions (   $a_user_id)
static

Get group selection options.

Parameters
type$a_user_id

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

References $lng, $options, and getGroupsOfUser().

Referenced by ilConsultationHoursGUI\initFormSequence().

{
global $lng;
$groups = self::getGroupsOfUser($a_user_id);
if(!count($groups))
{
return array();
}
$options = array();
foreach($groups as $group)
{
$options[(string) $group->getGroupId()] = $group->getTitle();
}
asort($options,SORT_STRING);
$sorted_options = array();
$sorted_options[0] = $lng->txt('cal_ch_grp_no_assignment');
foreach($options as $key => $opt)
{
$sorted_options[$key] = $opt;
}
return $sorted_options;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

{
global $ilDB;
$query = 'SELECT grp_id FROM cal_ch_group '.
'WHERE usr_id = '.$ilDB->quote($a_user_id,'integer');
$res = $ilDB->query($query);
$groups = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
$groups[] = new ilConsultationHourGroup($row->grp_id);
}
return $groups;
}

+ Here is the caller graph for this function:

static ilConsultationHourGroups::lookupAssignedAppointments ( )
static

Lookup number of assigned appointments.

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

{
global $ilDB;
//@todo
}
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 86 of file class.ilConsultationHourGroups.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilBookingEntry\isAppointmentBookableForUser().

{
global $ilDB;
$query = 'SELECT multiple_assignments from cal_ch_group '.
'WHERE grp_id = '.$ilDB->quote($a_group_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->multiple_assignments;
}
return 0;
}

+ Here is the caller graph for this function:

static ilConsultationHourGroups::lookupTitle (   $a_group_id)
static

Lookup group title.

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

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

{
global $ilDB;
$query = 'SELECT title from cal_ch_group '.
'WHERE grp_id = '.$ilDB->quote($a_group_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->title;
}
return '';
}

+ Here is the caller graph for this function:


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