ILIAS  Release_4_0_x_branch Revision 61816
 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 _getAssignedAppointments ($a_cat_id)
 lookup appointment ids by calendar
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 149 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $query, and $res.

Referenced by 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 168 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::_getAssignedAppointments (   $a_cat_id)
static

lookup appointment ids by calendar

public

Parameters
arraycalendar category id(s)
Returns
array int cal entry ids

Definition at line 102 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 125 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 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 207 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $query, and $res.

Referenced by ilCalendarAppEventListener\createAppointments(), 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 229 of file class.ilCalendarCategoryAssignments.php.

References $ilDB, $key, $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 250 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 195 of file class.ilCalendarCategoryAssignments.php.

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

get first assignment

public

Returns

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

Referenced by 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 267 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: