49 0 => self::TYPE_GLOBAL,
59 protected $type = self::TYPE_USR;
83 $this->cat_id = $a_cat_id;
99 $query =
"SELECT cat_id FROM cal_categories " .
100 "WHERE obj_id = " . $ilDB->quote($a_obj_id,
'integer') .
" " .
101 "AND type = " . $ilDB->quote(self::TYPE_OBJ,
'integer');
116 if (!self::$instances[$a_cat_id]) {
119 return self::$instances[$a_cat_id];
127 return array_search($a_type_id, self::$SORTED_TYPES);
138 $query =
"SELECT * FROM cal_cat_assignments " .
139 'WHERE cat_id = ' . $ilDB->quote($a_category_id,
'integer');
142 $apps[] =
$row->cal_id;
144 return $apps ? $apps :
array();
168 $this->title = $a_title;
191 $this->
color = $a_color;
235 $this->obj_id = $a_obj_id;
271 $this->remote_url = $a_url;
281 $this->remote_user = $a_user;
291 $this->remote_pass = $a_pass;
305 $this->remote_sync = $dt;
314 if ($this->remote_sync instanceof
ilDateTime) {
317 return new ilDateTime();
331 $next_id = $ilDB->nextId(
'cal_categories');
333 $query =
"INSERT INTO cal_categories (cat_id,obj_id,color,type,title,loc_type,remote_url,remote_user,remote_pass,remote_sync) " .
335 $ilDB->quote($next_id,
'integer') .
", " .
336 $this->db->quote($this->
getObjId(),
'integer') .
", " .
337 $this->db->quote($this->
getColor(),
'text') .
", " .
338 $this->db->quote($this->
getType(),
'integer') .
", " .
339 $this->db->quote($this->
getTitle(),
'text') .
", " .
341 $this->db->quote($this->
getRemoteUrl(),
'text') .
', ' .
347 $ilDB->manipulate(
$query);
349 $this->cat_id = $next_id;
363 $query =
"UPDATE cal_categories " .
364 "SET obj_id = " . $this->db->quote($this->
getObjId(),
'integer') .
", " .
365 "color = " . $this->db->quote($this->
getColor(),
'text') .
", " .
366 "type = " . $this->db->quote($this->
getType(),
'integer') .
", " .
367 "title = " . $this->db->quote($this->
getTitle(),
'text') .
", " .
368 "loc_type = " . $this->db->quote($this->
getLocationType(),
'integer') .
', ' .
369 "remote_url = " . $this->db->quote($this->
getRemoteUrl(),
'text') .
', ' .
370 "remote_user = " . $this->db->quote($this->
getRemoteUser(),
'text') .
', ' .
371 "remote_pass = " . $this->db->quote($this->
getRemotePass(),
'text') .
', ' .
373 "WHERE cat_id = " . $this->db->quote($this->cat_id,
'integer') .
" ";
384 public function delete()
388 $query =
"DELETE FROM cal_categories " .
389 "WHERE cat_id = " . $this->db->quote($this->cat_id,
'integer') .
" ";
392 include_once(
'./Services/Calendar/classes/class.ilCalendarVisibility.php');
395 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
397 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
429 if (!$this->cat_id) {
433 $query =
"SELECT * FROM cal_categories " .
434 "WHERE cat_id = " . $this->db->quote($this->
getCategoryID(),
'integer') .
" ";
437 $this->cat_id =
$row->cat_id;
438 $this->obj_id =
$row->obj_id;
439 $this->type =
$row->type;
441 $this->title =
$row->title;
442 $this->location =
$row->loc_type;
443 $this->remote_url =
$row->remote_url;
444 $this->remote_user =
$row->remote_user;
445 $this->remote_pass =
$row->remote_pass;
447 if (
$row->remote_sync) {
453 if ($this->
getType() == self::TYPE_OBJ) {
static lookupCategorySortIndex($a_type_id)
Lookup sort index of calendar type.
static _deleteCategories($a_cat_id)
delete by category
setObjId($a_obj_id)
set obj id
setColor($a_color)
set color
getRemoteSyncLastExecution()
Get last execution date of remote sync.
static _lookupTitle($a_id)
lookup object title
Stores calendar categories.
__construct($a_cat_id=0)
Constructor.
static _delete($a_entry_id)
delete entry
Set the worksheet tab color
static lookupAppointments($a_category_id)
get all assigned appointment ids
foreach($_POST as $key=> $value) $res
static _getInstanceByObjId($a_obj_id)
get instance by obj_id
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _deleteByCategoryId($a_cat_id)
Delete assignments by category id.
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
setTitle($a_title)
set title
getCategoryID()
get category id
setRemoteSyncLastExecution(ilDateTime $dt=null)
Set remote sync last execution.