ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilConsultationHourAppointments Class Reference

Consultation hour appointments. More...

+ Collaboration diagram for ilConsultationHourAppointments:

Static Public Member Functions

static getAppointmentIds ($a_user_id, $a_context_id=NULL, $a_start=NULL, $a_type=NULL)
 Get all appointment ids.
static getAppointments ($a_user_id)
 Get all appointments.
static getManager ($a_as_name=false)
 Get consultation hour manager for current user.
static setManager ($a_user_name)
 Set consultation hour manager for current user.
static getManagedUsers ()
 Get all managed consultation hours users for current users.

Detailed Description

Consultation hour appointments.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilConsultationHourAppointments.php.

Member Function Documentation

static ilConsultationHourAppointments::getAppointmentIds (   $a_user_id,
  $a_context_id = NULL,
  $a_start = NULL,
  $a_type = NULL 
)
static

Get all appointment ids.

Parameters
object$a_user_id
int$a_context_id
string$a_start
int$a_type
Returns

Definition at line 26 of file class.ilConsultationHourAppointments.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, IL_CAL_DATETIME, and ilCalendarCategory\TYPE_CH.

Referenced by ilCalendarAppointmentGUI\cancelConfirmed(), ilCalendarAppointmentPanelGUI\getHTML(), and ilObjBookingPoolGUI\rsvCancelObject().

{
global $ilDB;
if(!$a_type)
{
include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
}
$query = "SELECT ce.cal_id FROM cal_entries ce".
" JOIN cal_cat_assignments cca ON ce.cal_id = cca.cal_id".
" JOIN cal_categories cc ON cca.cat_id = cc.cat_id".
" JOIN booking_entry be ON ce.context_id = be.booking_id".
" WHERE cc.obj_id = ".$ilDB->quote($a_user_id,'integer').
" AND be.obj_id = ".$ilDB->quote($a_user_id,'integer').
" AND cc.type = ".$ilDB->quote($a_type,'integer');
if($a_context_id)
{
$query .= " AND ce.context_id = ".$ilDB->quote($a_context_id, 'integer');
}
if($a_start)
{
$query .= " AND ce.starta = ".$ilDB->quote($a_start->get(IL_CAL_DATETIME, '', 'UTC'), 'text');
}
$res = $ilDB->query($query);
$entries = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$entries[] = $row->cal_id;
}
return $entries;
}

+ Here is the caller graph for this function:

static ilConsultationHourAppointments::getAppointments (   $a_user_id)
static

Get all appointments.

Returns

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

Referenced by ilConsultationHoursTableGUI\parse().

{
$entries = array();
foreach(self::getAppointmentIds($a_user_id) as $app_id)
{
$entries[] = new ilCalendarEntry($app_id);
}
return $entries;
}

+ Here is the caller graph for this function:

static ilConsultationHourAppointments::getManagedUsers ( )
static

Get all managed consultation hours users for current users.

Returns
array

Definition at line 134 of file class.ilConsultationHourAppointments.php.

References $ilDB, $row, and ilObjUser\_lookupLogin().

Referenced by ilConsultationHoursGUI\__construct(), and ilConsultationHoursGUI\setTabs().

{
global $ilDB, $ilUser;
$all = array();
$set = $ilDB->query('SELECT user_id FROM cal_ch_settings'.
' WHERE admin_id = '.$ilDB->quote($ilUser->getId(), 'integer'));
while($row = $ilDB->fetchAssoc($set))
{
$all[$row['user_id']] = ilObjUser::_lookupLogin($row['user_id']);
}
return $all;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilConsultationHourAppointments::getManager (   $a_as_name = false)
static

Get consultation hour manager for current user.

Parameters
string$a_as_name
Returns
int | string

Definition at line 81 of file class.ilConsultationHourAppointments.php.

References $ilDB, $row, and ilObjUser\_lookupLogin().

Referenced by ilConsultationHoursGUI\initSettingsForm().

{
global $ilDB, $ilUser;
$set = $ilDB->query('SELECT admin_id FROM cal_ch_settings'.
' WHERE user_id = '.$ilDB->quote($ilUser->getId(), 'integer'));
$row = $ilDB->fetchAssoc($set);
if($row && $row['admin_id'])
{
if($a_as_name)
{
return ilObjUser::_lookupLogin($row['admin_id']);
}
return (int)$row['admin_id'];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilConsultationHourAppointments::setManager (   $a_user_name)
static

Set consultation hour manager for current user.

Parameters
string$a_user_name
Returns
bool

Definition at line 103 of file class.ilConsultationHourAppointments.php.

References $ilDB, and ilObjUser\_loginExists().

Referenced by ilConsultationHoursGUI\updateSettings().

{
global $ilDB, $ilUser;
$user_id = false;
if($a_user_name)
{
$user_id = ilObjUser::_loginExists($a_user_name);
if(!$user_id)
{
return false;
}
}
$ilDB->manipulate('DELETE FROM cal_ch_settings'.
' WHERE user_id = '.$ilDB->quote($ilUser->getId(), 'integer'));
if($user_id && $user_id != $ilUser->getId())
{
$ilDB->manipulate('INSERT INTO cal_ch_settings (user_id, admin_id)'.
' VALUES ('.$ilDB->quote($ilUser->getId(), 'integer').','.
$ilDB->quote($user_id, 'integer').')');
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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