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;
 
  229                 $this->subtitle = $a_subtitle;
 
  252                 $this->description = $a_description;
 
  274                 $this->location = $a_location;
 
  296                 $this->further_informations = $a_informations;
 
  320                 $this->fullday = (bool) $a_fullday;
 
  354                 $this->is_auto_generated = $a_status;
 
  378                 $this->is_milestone = $a_status;
 
  388                 $this->completion = $a_completion;
 
  410                 $this->context_id = $a_context_id;
 
  433                 $this->translation_type = $a_type;
 
  453                 $this->notification = $a_status;
 
  479                 $query = 
"UPDATE cal_entries ".
 
  480                         "SET title = ".$this->db->quote($this->
getTitle() ,
'text').
", ".
 
  481                         "last_update = ".$ilDB->quote($utc_timestamp,
'timestamp').
", ".
 
  482                         "subtitle = ".$this->db->quote($this->
getSubtitle() ,
'text').
", ".
 
  483                         "description = ".$this->db->quote($this->
getDescription(),
'text').
", ".
 
  484                         "location = ".$this->db->quote($this->
getLocation() ,
'text').
", ".
 
  485                         "fullday = ".$ilDB->quote($this->
isFullday() ? 1 : 0,
'integer').
", ".
 
  489                         "auto_generated =  ".$this->db->quote($this->
isAutoGenerated() ,
'integer').
", ".
 
  491                         "context_id = ".$this->db->quote($this->
getContextId() ,
'integer').
", ".
 
  492                         "completion = ".$this->db->quote($this->
getCompletion(), 
'integer').
", ".
 
  493                         "is_milestone = ".$this->db->quote($this->
isMilestone() ? 1 : 0, 
'integer').
", ".
 
  495                         "WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
 
  511                 $next_id = $ilDB->nextId(
'cal_entries');
 
  515                 $query = 
"INSERT INTO cal_entries (cal_id,title,last_update,subtitle,description,location,fullday,starta,enda, ".
 
  516                         "informations,auto_generated,context_id,translation_type, completion, is_milestone, notification) ".
 
  518                         $ilDB->quote($next_id,
'integer').
", ".
 
  519                         $this->db->quote($this->
getTitle(),
'text').
", ".
 
  520                         $ilDB->quote($utc_timestamp,
'timestamp').
", ".
 
  521                         $this->db->quote($this->
getSubtitle(),
'text').
", ".
 
  523                         $this->db->quote($this->
getLocation() ,
'text').
", ".
 
  524                         $ilDB->quote($this->
isFullday() ? 1 : 0,
'integer').
", ".
 
  529                         $this->db->quote($this->
getContextId() ,
'integer').
", ".
 
  532                         $this->db->quote($this->
isMilestone() ? 1 : 0, 
'integer').
", ".
 
  537                 $this->entry_id = $next_id;             
 
  547         public function delete()
 
  551                 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
 
  554                 $query = 
"DELETE FROM cal_entries ".
 
  555                         "WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
 
  572                 $ilErr->setMessage(
'');
 
  576                         $ilErr->appendMessage($lng->txt(
'err_missing_title'));
 
  581                         $ilErr->appendMessage($lng->txt(
'err_end_before_start'));
 
  597                 $query = 
"SELECT * FROM cal_entries WHERE cal_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
 
  636                 $body = 
$lng->txt(
'cal_details');
 
  638                 $body .= 
$lng->txt(
'title').
': '.$this->
getTitle().
"\n";
 
  664                 $ilDB->manipulateF(
"DELETE FROM cal_entry_responsible WHERE cal_id = %s",
 
  665                         array(
"integer"), array($this->
getEntryId()));
 
  667                 if (is_array($a_users))
 
  669                         foreach ($a_users as $user_id)
 
  671                                 $ilDB->manipulateF(
"INSERT INTO cal_entry_responsible (cal_id, user_id) ".
 
  672                                         " VALUES (%s,%s)", array(
"integer", 
"integer"),
 
  677                 $this->responsible_users = $a_users;
 
  687                 $set = $ilDB->queryF(
"SELECT * FROM cal_entry_responsible WHERE cal_id = %s",
 
  688                         array(
"integer"), array($this->
getEntryId()));
 
  691                 while($rec = $ilDB->fetchAssoc($set))
 
  694                         $return[] = array_merge(
$n,