24 include_once(
'Services/Calendar/classes/class.ilDate.php');
25 include_once(
'./Services/Calendar/interfaces/interface.ilDatePeriod.php');
27 define(
'IL_CAL_TRANSLATION_NONE',0);
28 define(
'IL_CAL_TRANSLATION_SYSTEM',1);
74 if($this->entry_id = $a_id)
88 public static function _delete($a_entry_id)
92 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
95 $query =
"DELETE FROM cal_entries ".
96 "WHERE cal_id = ".$ilDB->quote($a_entry_id).
" ";
133 $this->last_update = $a_date;
145 return $this->start ? $this->start : $this->start =
new ilDateTime();
157 $this->start = $a_start;
167 return $this->end ? $this->end : $this->end =
new ilDateTime();
189 $this->title = $a_title;
237 $this->subtitle = $a_subtitle;
260 $this->description = $a_description;
282 $this->location = $a_location;
304 $this->further_informations = $a_informations;
328 $this->fullday = (bool) $a_fullday;
362 $this->is_auto_generated = $a_status;
374 $this->context_id = $a_context_id;
397 $this->translation_type = $a_type;
419 $query =
"UPDATE cal_entries ".
420 "SET title = ".$this->db->quote($this->
getTitle()).
", ".
421 "last_update = UTC_TIMESTAMP(), ".
422 "subtitle = ".$this->db->quote($this->
getSubtitle()).
", ".
424 "location = ".$this->db->quote($this->
getLocation()).
", ".
425 "fullday = ".($this->isFullday() ? 1 : 0).
", ".
426 "start = ".$this->db->quote($this->getStart()->get(
IL_CAL_DATETIME,
'',
'UTC')).
", ".
427 "end = ".$this->db->quote($this->getEnd()->get(
IL_CAL_DATETIME,
'',
'UTC')).
", ".
428 "informations = ".$this->db->quote($this->getFurtherInformations()).
", ".
429 "auto_generated = ".$this->db->quote($this->isAutoGenerated()).
", ".
430 "translation_type = ".$this->db->quote($this->getTranslationType()).
", ".
431 "context_id = ".$this->db->quote($this->getContextId()).
" ".
432 "WHERE cal_id = ".$this->db->quote($this->getEntryId()).
" ";
435 $res = $this->db->query($query);
447 $query =
"INSERT INTO cal_entries ".
448 "SET title = ".$this->db->quote($this->
getTitle()).
", ".
449 "last_update = UTC_TIMESTAMP(), ".
450 "subtitle = ".$this->db->quote($this->
getSubtitle()).
", ".
452 "location = ".$this->db->quote($this->
getLocation()).
", ".
453 "fullday = ".($this->isFullday() ? 1 : 0).
", ".
454 "start = ".$this->db->quote($this->getStart()->get(
IL_CAL_DATETIME,
'',
'UTC')).
", ".
455 "end = ".$this->db->quote($this->getEnd()->get(
IL_CAL_DATETIME,
'',
'UTC')).
", ".
456 "informations = ".$this->db->quote($this->getFurtherInformations()).
", ".
457 "auto_generated = ".$this->db->quote($this->isAutoGenerated()).
", ".
458 "context_id = ".$this->db->quote($this->getContextId()).
", ".
459 "translation_type = ".$this->db->quote($this->getTranslationType()).
" ";
461 $res = $this->db->query($query);
462 $this->entry_id = $this->db->getLastInsertId();
472 public function delete()
474 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
477 $query =
"DELETE FROM cal_entries ".
478 "WHERE cal_id = ".$this->db->quote($this->
getEntryId()).
" ";
479 $this->db->query($query);
494 $ilErr->setMessage(
'');
498 $ilErr->appendMessage($lng->txt(
'err_missing_title'));
503 $ilErr->appendMessage($lng->txt(
'err_end_before_start'));
517 $query =
"SELECT * FROM cal_entries WHERE cal_id = ".$this->db->quote($this->
getEntryId()).
" ";
518 $res = $this->db->query($query);