49 0 => self::TYPE_GLOBAL,
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');
117 if(!self::$instances[$a_cat_id])
121 return self::$instances[$a_cat_id];
129 return array_search($a_type_id, self::$SORTED_TYPES);
140 $query =
"SELECT * FROM cal_cat_assignments ".
141 'WHERE cat_id = '.$ilDB->quote($a_category_id,
'integer');
145 $apps[] =
$row->cal_id;
147 return $apps ? $apps : array();
171 $this->title = $a_title;
194 $this->color = $a_color;
216 $this->type = $a_type;
238 $this->obj_id = $a_obj_id;
269 $this->location = $a_type;
274 $this->remote_url = $a_url;
284 $this->remote_user = $a_user;
294 $this->remote_pass = $a_pass;
308 $this->remote_sync = $dt;
321 return new ilDateTime();
335 $next_id = $ilDB->nextId(
'cal_categories');
337 $query =
"INSERT INTO cal_categories (cat_id,obj_id,color,type,title,loc_type,remote_url,remote_user,remote_pass,remote_sync) ".
339 $ilDB->quote($next_id,
'integer').
", ".
340 $this->db->quote($this->
getObjId() ,
'integer').
", ".
341 $this->db->quote($this->
getColor() ,
'text').
", ".
342 $this->db->quote($this->
getType() ,
'integer').
", ".
343 $this->db->quote($this->
getTitle() ,
'text').
", ".
351 $ilDB->manipulate(
$query);
353 $this->cat_id = $next_id;
367 $query =
"UPDATE cal_categories ".
368 "SET obj_id = ".$this->db->quote($this->
getObjId() ,
'integer').
", ".
369 "color = ".$this->db->quote($this->
getColor() ,
'text').
", ".
370 "type = ".$this->db->quote($this->
getType() ,
'integer').
", ".
371 "title = ".$this->db->quote($this->
getTitle() ,
'text').
", ".
372 "loc_type = ".$this->db->quote($this->
getLocationType(),
'integer').
', '.
373 "remote_url = ".$this->db->quote($this->
getRemoteUrl(),
'text').
', '.
374 "remote_user = ".$this->db->quote($this->
getRemoteUser(),
'text').
', '.
375 "remote_pass = ".$this->db->quote($this->
getRemotePass(),
'text').
', '.
377 "WHERE cat_id = ".$this->db->quote($this->cat_id ,
'integer').
" ";
388 public function delete()
392 $query =
"DELETE FROM cal_categories ".
393 "WHERE cat_id = ".$this->db->quote($this->cat_id ,
'integer').
" ";
396 include_once(
'./Services/Calendar/classes/class.ilCalendarHidden.php');
399 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
402 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
441 $query =
"SELECT * FROM cal_categories ".
442 "WHERE cat_id = ".$this->db->quote($this->
getCategoryID() ,
'integer').
" ";
446 $this->cat_id =
$row->cat_id;
447 $this->obj_id =
$row->obj_id;
448 $this->type =
$row->type;
449 $this->color =
$row->color;
450 $this->title =
$row->title;
451 $this->location =
$row->loc_type;
452 $this->remote_url =
$row->remote_url;
453 $this->remote_user =
$row->remote_user;
454 $this->remote_pass =
$row->remote_pass;
456 if(
$row->remote_sync)
465 if($this->
getType() == self::TYPE_OBJ)