24 include_once(
'./Services/Calendar/interfaces/interface.ilDatePeriod.php');
25 include_once(
'./Services/Calendar/classes/class.ilDate.php');
55 $this->appointment_id = $a_appointment_id;
70 $query =
"SELECT * FROM event_appointment ".
71 "WHERE event_id = ".$ilDB->quote($a_obj_id).
" ";
72 $res = $ilDB->query($query);
75 $info[
'fullday'] = $row->fulltime;
78 $info[
'start'] = $date->getUnixTime();
80 $info[
'end'] = $date->getUnixTime();
99 $sessions = $tree->getChildsByType($a_ref_id,
'sess');
101 foreach($sessions as $tree_data)
103 $obj_ids[] = $tree_data[
'obj_id'];
109 $query =
"SELECT event_id FROM event_appointment ".
110 "WHERE start > NOW() ".
112 "ORDER BY start LIMIT 1";
113 $res = $ilDB->query($query);
116 $event_id = $row->event_id;
118 return isset($event_id) ? $event_id : 0;
133 $sessions = $tree->getChildsByType($a_ref_id,
'sess');
135 foreach($sessions as $tree_data)
137 $obj_ids[] = $tree_data[
'obj_id'];
143 $query =
"SELECT event_id FROM event_appointment ".
144 "WHERE start < NOW() ".
146 "ORDER BY start DESC LIMIT 1";
147 $res = $ilDB->query($query);
150 $event_id = $row->event_id;
152 return isset($event_id) ? $event_id : 0;
188 $this->start = $a_start;
216 $this->appointment_id = $a_appointment_id;
220 return $this->appointment_id;
225 $this->session_id = $a_session_id;
229 return $this->session_id;
234 $this->starting_time = $a_starting_time;
240 return isset($this->starting_time) ? $this->starting_time : mktime(8,0,0,date(
'n',time()),date(
'd',time()),date(
'Y',time()));
245 $this->ending_time = $a_ending_time;
250 return isset($this->ending_time) ? $this->ending_time : mktime(16,0,0,date(
'n',time()),date(
'd',time()),date(
'Y',time()));
255 $this->fulltime = $a_status;
259 return $this->fulltime;
271 $start = date($this->lng->txt(
'lang_timeformat_no_sec'),
$start);
272 $end = date($this->lng->txt(
'lang_timeformat_no_sec'),
$end);
310 $new_app->setSessionId($new_id);
313 $new_app->toggleFullTime($this->
isFullday());
326 $query =
"INSERT INTO event_appointment ".
327 "SET event_id = ".$ilDB->quote($this->
getSessionId()).
", ".
332 $this->appointment_id = $ilDB->getLastInsertId();
334 $this->db->query($query);
348 $query =
"UPDATE event_appointment ".
349 "SET event_id = ".$ilDB->quote($this->
getSessionId()).
", ".
355 $this->db->query($query);
368 $query =
"DELETE FROM event_appointment ".
369 "WHERE appointment_id = ".$ilDB->quote($a_appointment_id).
" ";
370 $this->db->query($query);
379 $query =
"DELETE FROM event_appointment ".
380 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ";
381 $ilDB->query($query);
390 $query =
"SELECT * FROM event_appointment ".
391 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
392 "ORDER BY starting_time";
394 $res = $ilDB->query($query);
399 return is_array($appointments) ? $appointments : array();
404 if($this->starting_time > $this->ending_time)
406 $this->ilErr->appendMessage($this->lng->txt(
'event_etime_smaller_stime'));
422 $query =
"SELECT * FROM event_appointment ".
424 $res = $this->db->query($query);
440 $this->starting_time = $this->start->getUnixTime();
441 $this->ending_time = $this->end->getUnixTime();