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);
58 if($this->entry_id = $a_id)
69 $this->entry_id = NULL;
79 public static function _delete($a_entry_id)
83 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
86 $query =
"DELETE FROM cal_entries ".
87 "WHERE cal_id = ".$ilDB->quote($a_entry_id ,
'integer').
" ";
125 $this->last_update = $a_date;
137 return $this->start ? $this->start : $this->start =
new ilDateTime();
149 $this->start = $a_start;
159 return $this->end ? $this->end : $this->end =
new ilDateTime();
181 $this->title = $a_title;
235 $this->subtitle = $a_subtitle;
258 $this->description = $a_description;
280 $this->location = $a_location;
302 $this->further_informations = $a_informations;
326 $this->fullday = (bool) $a_fullday;
360 $this->is_auto_generated = $a_status;
384 $this->is_milestone = $a_status;
394 $this->completion = $a_completion;
416 $this->context_id = $a_context_id;
439 $this->translation_type = $a_type;
459 $this->notification = $a_status;
485 $query =
"UPDATE cal_entries ".
486 "SET title = ".$this->db->quote($this->
getTitle() ,
'text').
", ".
487 "last_update = ".$ilDB->quote($utc_timestamp,
'timestamp').
", ".
488 "subtitle = ".$this->db->quote($this->
getSubtitle() ,
'text').
", ".
489 "description = ".$this->db->quote($this->
getDescription(),
'text').
", ".
490 "location = ".$this->db->quote($this->
getLocation() ,
'text').
", ".
491 "fullday = ".$ilDB->quote($this->
isFullday() ? 1 : 0,
'integer').
", ".
495 "auto_generated = ".$this->db->quote($this->
isAutoGenerated() ,
'integer').
", ".
497 "context_id = ".$this->db->quote($this->
getContextId() ,
'integer').
", ".
498 "completion = ".$this->db->quote($this->
getCompletion(),
'integer').
", ".
499 "is_milestone = ".$this->db->quote($this->
isMilestone() ? 1 : 0,
'integer').
", ".
501 "WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
517 $next_id = $ilDB->nextId(
'cal_entries');
521 $query =
"INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, ".
522 "informations,auto_generated,context_id,translation_type, completion, is_milestone, notification) ".
524 $ilDB->quote($next_id,
'integer').
", ".
525 $this->db->quote($this->
getTitle(),
'text').
", ".
526 $ilDB->quote($utc_timestamp,
'timestamp').
", ".
527 $this->db->quote($this->
getSubtitle(),
'text').
", ".
529 $this->db->quote($this->
getLocation() ,
'text').
", ".
530 $ilDB->quote($this->
isFullday() ? 1 : 0,
'integer').
", ".
535 $this->db->quote($this->
getContextId() ,
'integer').
", ".
538 $this->db->quote($this->
isMilestone() ? 1 : 0,
'integer').
", ".
543 $this->entry_id = $next_id;
553 public function delete()
557 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
560 $query =
"DELETE FROM cal_entries ".
561 "WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
578 $ilErr->setMessage(
'');
582 $ilErr->appendMessage($lng->txt(
'err_missing_title'));
587 $ilErr->appendMessage($lng->txt(
'err_end_before_start'));
603 $query =
"SELECT * FROM cal_entries WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
642 $body =
$lng->txt(
'cal_details');
644 $body .=
$lng->txt(
'title').
': '.$this->
getTitle().
"\n";
670 $ilDB->manipulateF(
"DELETE FROM cal_entry_responsible WHERE cal_id = %s",
671 array(
"integer"), array($this->
getEntryId()));
673 if (is_array($a_users))
675 foreach ($a_users as $user_id)
677 $ilDB->manipulateF(
"INSERT INTO cal_entry_responsible (cal_id, user_id) ".
678 " VALUES (%s,%s)", array(
"integer",
"integer"),
683 $this->responsible_users = $a_users;
693 $set = $ilDB->queryF(
"SELECT * FROM cal_entry_responsible WHERE cal_id = %s",
694 array(
"integer"), array($this->
getEntryId()));
697 while($rec = $ilDB->fetchAssoc($set))
700 $return[] = array_merge(
$n,