4 include_once(
'Services/Calendar/classes/class.ilDate.php');
5 include_once(
'./Services/Calendar/interfaces/interface.ilDatePeriod.php');
7 define(
'IL_CAL_TRANSLATION_NONE',0);
8 define(
'IL_CAL_TRANSLATION_SYSTEM',1);
56 if($this->entry_id = $a_id)
70 public static function _delete($a_entry_id)
74 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
77 $query =
"DELETE FROM cal_entries ".
78 "WHERE cal_id = ".$ilDB->quote($a_entry_id ,
'integer').
" ";
116 $this->last_update = $a_date;
128 return $this->start ? $this->start : $this->start =
new ilDateTime();
140 $this->start = $a_start;
150 return $this->end ? $this->end : $this->end =
new ilDateTime();
172 $this->title = $a_title;
220 $this->subtitle = $a_subtitle;
243 $this->description = $a_description;
265 $this->location = $a_location;
287 $this->further_informations = $a_informations;
311 $this->fullday = (bool) $a_fullday;
345 $this->is_auto_generated = $a_status;
369 $this->is_milestone = $a_status;
379 $this->completion = $a_completion;
401 $this->context_id = $a_context_id;
424 $this->translation_type = $a_type;
452 $query =
"UPDATE cal_entries ".
453 "SET title = ".$this->db->quote($this->
getTitle() ,
'text').
", ".
454 "last_update = ".$ilDB->quote($utc_timestamp,
'timestamp').
", ".
455 "subtitle = ".$this->db->quote($this->
getSubtitle() ,
'text').
", ".
456 "description = ".$this->db->quote($this->
getDescription(),
'text').
", ".
457 "location = ".$this->db->quote($this->
getLocation() ,
'text').
", ".
458 "fullday = ".$ilDB->quote($this->
isFullday() ? 1 : 0,
'integer').
", ".
462 "auto_generated = ".$this->db->quote($this->
isAutoGenerated() ,
'integer').
", ".
464 "context_id = ".$this->db->quote($this->
getContextId() ,
'integer').
", ".
465 "completion = ".$this->db->quote($this->
getCompletion(),
'integer').
", ".
466 "is_milestone = ".$this->db->quote($this->
isMilestone() ? 1 : 0,
'integer').
" ".
467 "WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
483 $next_id = $ilDB->nextId(
'cal_entries');
487 $query =
"INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, ".
488 "informations,auto_generated,context_id,translation_type, completion, is_milestone) ".
490 $ilDB->quote($next_id,
'integer').
", ".
491 $this->db->quote($this->
getTitle(),
'text').
", ".
492 $ilDB->quote($utc_timestamp,
'timestamp').
", ".
493 $this->db->quote($this->
getSubtitle(),
'text').
", ".
495 $this->db->quote($this->
getLocation() ,
'text').
", ".
496 $ilDB->quote($this->
isFullday() ? 1 : 0,
'integer').
", ".
501 $this->db->quote($this->
getContextId() ,
'integer').
", ".
504 $this->db->quote($this->
isMilestone() ? 1 : 0,
'integer').
" ".
508 $this->entry_id = $next_id;
518 public function delete()
522 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
525 $query =
"DELETE FROM cal_entries ".
526 "WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
543 $ilErr->setMessage(
'');
547 $ilErr->appendMessage($lng->txt(
'err_missing_title'));
552 $ilErr->appendMessage($lng->txt(
'err_end_before_start'));
568 $query =
"SELECT * FROM cal_entries WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
606 $ilDB->manipulateF(
"DELETE FROM cal_entry_responsible WHERE cal_id = %s",
607 array(
"integer"), array($this->
getEntryId()));
609 if (is_array($a_users))
611 foreach ($a_users as $user_id)
613 $ilDB->manipulateF(
"INSERT INTO cal_entry_responsible (cal_id, user_id) ".
614 " VALUES (%s,%s)", array(
"integer",
"integer"),
619 $this->responsible_users = $a_users;
629 $set = $ilDB->queryF(
"SELECT * FROM cal_entry_responsible WHERE cal_id = %s",
630 array(
"integer"), array($this->
getEntryId()));
633 while($rec = $ilDB->fetchAssoc($set))
636 $return[] = array_merge(
$n,