ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarCategoryAssignments Class Reference
+ Collaboration diagram for ilCalendarCategoryAssignments:

Public Member Functions

 __construct ($a_cal_entry_id)
 Constructor.
 getFirstAssignment ()
 get first assignment
 getAssignments ()
 get assignments
 addAssignment ($a_cal_cat_id)
 add assignment
 deleteAssignment ($a_cat_id)
 delete assignment
 deleteAssignments ()
 delete assignments

Static Public Member Functions

static _lookupCategories ($a_cal_id)
 lookup categories
static _lookupCategory ($a_cal_id)
 Lookup category id.
static _getAppointmentCalendars ($a_cal_ids)
 lookup calendars for appointment ids
static _getAssignedAppointments ($a_cat_id)
 Get assigned apointments.
static _getAutoGeneratedAppointmentsByObjId ($a_obj_id)
 get automatic generated appointments of category
static _deleteByAppointmentId ($a_app_id)
 Delete appointment assignment.
static _deleteByCategoryId ($a_cat_id)
 Delete assignments by category id.

Protected Attributes

 $db
 $cal_entry_id = 0
 $assignments = array()

Private Member Functions

 read ()
 read assignments

Detailed Description

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

Definition at line 32 of file class.ilCalendarCategoryAssignments.php.

Constructor & Destructor Documentation

ilCalendarCategoryAssignments::__construct (   $a_cal_entry_id)

Constructor.

public

Parameters
intcalendar entry id

Definition at line 45 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, and read().

{
global $ilDB;
$this->db = $ilDB;
$this->cal_entry_id = $a_cal_entry_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilCalendarCategoryAssignments::_deleteByAppointmentId (   $a_app_id)
static

Delete appointment assignment.

public

Parameters
intappointment id

Definition at line 169 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $query, and $res.

Referenced by ilConsultationHoursGUI\delete(), ilCalendarAppointmentGUI\delete(), ilCalendarAppEventListener\deleteAppointments(), and ilCalendarCategoryGUI\deleteAppointments().

{
global $ilDB;
$query = "DELETE FROM cal_cat_assignments ".
"WHERE cal_id = ".$ilDB->quote($a_app_id ,'integer')." ";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilCalendarCategoryAssignments::_deleteByCategoryId (   $a_cat_id)
static

Delete assignments by category id.

public

Parameters
intcategory_id
Returns

Definition at line 188 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $query, and $res.

Referenced by ilCalendarCategory\delete().

{
global $ilDB;
$query = "DELETE FROM cal_cat_assignments ".
"WHERE cat_id = ".$ilDB->quote($a_cat_id ,'integer')." ";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilCalendarCategoryAssignments::_getAppointmentCalendars (   $a_cal_ids)
static

lookup calendars for appointment ids

public

Parameters
array$a_cal_ids

Definition at line 101 of file class.ilCalendarCategoryAssignments.php.

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

Referenced by ilCalendarSchedule\calculate().

{
global $ilDB;
$query = "SELECT * FROM cal_cat_assignments ".
"WHERE ".$ilDB->in('cal_id',$a_cal_ids,false,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$map[$row->cal_id] = $row->cat_id;
}
return $map ? $map : array();
}

+ Here is the caller graph for this function:

static ilCalendarCategoryAssignments::_getAssignedAppointments (   $a_cat_id)
static

Get assigned apointments.

public

Parameters
array$a_cat_id

Definition at line 122 of file class.ilCalendarCategoryAssignments.php.

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

Referenced by ilCalendarExport\addCategories(), ilCalendarCategory\delete(), ilCalendarInboxSharedTableGUI\parse(), and ilCalendarCategoryGUI\showAssignedAppointments().

{
global $ilDB;
$query = "SELECT * FROM cal_cat_assignments ".
"WHERE ".$ilDB->in('cat_id',$a_cat_id,false,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$cal_ids[] = $row->cal_id;
}
return $cal_ids ? $cal_ids : array();
}

+ Here is the caller graph for this function:

static ilCalendarCategoryAssignments::_getAutoGeneratedAppointmentsByObjId (   $a_obj_id)
static

get automatic generated appointments of category

public

Parameters
intobj_id
Returns

Definition at line 145 of file class.ilCalendarCategoryAssignments.php.

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

Referenced by ilCalendarAppEventListener\deleteAppointments().

{
global $ilDB;
$query = "SELECT ce.cal_id FROM cal_categories cc ".
"JOIN cal_cat_assignments cca ON cc.cat_id = cca.cat_id ".
"JOIN cal_entries ce ON cca.cal_id = ce.cal_id ".
"WHERE auto_generated = 1 ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$apps[] = $row->cal_id;
}
return $apps ? $apps : array();
}

+ Here is the caller graph for this function:

static ilCalendarCategoryAssignments::_lookupCategories (   $a_cal_id)
static

lookup categories

public

Parameters
intcal_id
Returns
array of categories

Definition at line 63 of file class.ilCalendarCategoryAssignments.php.

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

Referenced by ilCalendarExport\buildAppointmentUrl(), and ilCalendarHidden\isAppointmentVisible().

{
global $ilDB;
$query = "SELECT cat_id FROM cal_cat_assignments ".
"WHERE cal_id = ".$ilDB->quote($a_cal_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$cat_ids[] = $row->cat_id;
}
return $cat_ids ? $cat_ids : array();
}

+ Here is the caller graph for this function:

static ilCalendarCategoryAssignments::_lookupCategory (   $a_cal_id)
static

Lookup category id.

public

Parameters
@return

Definition at line 85 of file class.ilCalendarCategoryAssignments.php.

Referenced by ilCalendarAppointmentGUI\edit(), ilCalendarAppointmentGUI\editResponsibleUsers(), ilCalendarAppointmentPanelGUI\getHTML(), and ilCalendarAppointmentGUI\showInfoScreen().

{
if(count($cats = self::_lookupCategories($a_cal_id)))
{
return $cats[0];
}
return 0;
}

+ Here is the caller graph for this function:

ilCalendarCategoryAssignments::addAssignment (   $a_cal_cat_id)

add assignment

public

Parameters
intcalendar category id
Returns

Definition at line 227 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $query, and $res.

Referenced by ilCalendarAppointmentGUI\bookconfirmed(), ilCalendarAppEventListener\createAppointments(), ilConsultationHoursGUI\createAppointments(), ilObjBookingPoolGUI\processBooking(), ilCalendarAppointmentGUI\save(), and ilICalParser\writeEvent().

{
global $ilDB;
$query = "INSERT INTO cal_cat_assignments (cal_id,cat_id) ".
"VALUES ( ".
$this->db->quote($this->cal_entry_id ,'integer').", ".
$this->db->quote($a_cal_cat_id ,'integer')." ".
")";
$res = $ilDB->manipulate($query);
$this->assignments[] = (int) $a_cal_cat_id;
return true;
}

+ Here is the caller graph for this function:

ilCalendarCategoryAssignments::deleteAssignment (   $a_cat_id)

delete assignment

public

Parameters
intcalendar category id
Returns

Definition at line 249 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $query, and $res.

{
global $ilDB;
$query = "DELETE FROM cal_cat_assignments ".
"WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,'integer').", ".
"AND cat_id = ".$this->db->quote($a_cat_id ,'integer')." ";
$res = $ilDB->manipulate($query);
if(($key = array_search($a_cat_id,$this->assignments)) !== false)
{
unset($this->assignments[$key]);
}
return true;
}
ilCalendarCategoryAssignments::deleteAssignments ( )

delete assignments

public

Definition at line 270 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $query, and $res.

Referenced by ilCalendarAppointmentGUI\update().

{
global $ilDB;
$query = "DELETE FROM cal_cat_assignments ".
"WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,'integer')." ";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilCalendarCategoryAssignments::getAssignments ( )

get assignments

public

Returns

Definition at line 215 of file class.ilCalendarCategoryAssignments.php.

{
return $this->assignments ? $this->assignments : array();
}
ilCalendarCategoryAssignments::getFirstAssignment ( )

get first assignment

public

Returns

Definition at line 204 of file class.ilCalendarCategoryAssignments.php.

Referenced by ilCalendarAppointmentGUI\calendarEntryToCategory(), and ilCalendarAppointmentGUI\initForm().

{
return isset($this->assignments[0]) ? $this->assignments[0] : false;
}

+ Here is the caller graph for this function:

ilCalendarCategoryAssignments::read ( )
private

read assignments

private

Returns

Definition at line 287 of file class.ilCalendarCategoryAssignments.php.

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

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM cal_cat_assignments ".
"WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,'integer')." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->assignments[] = $row->cat_id;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilCalendarCategoryAssignments::$assignments = array()
protected

Definition at line 37 of file class.ilCalendarCategoryAssignments.php.

ilCalendarCategoryAssignments::$cal_entry_id = 0
protected

Definition at line 36 of file class.ilCalendarCategoryAssignments.php.

ilCalendarCategoryAssignments::$db
protected

Definition at line 34 of file class.ilCalendarCategoryAssignments.php.


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