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 ,
'integer').
" ";
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 e_start > ".$ilDB->now().
" ".
111 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
" ".
117 $event_id =
$row->event_id;
119 return isset($event_id) ? $event_id : 0;
134 $sessions = $tree->getChildsByType($a_ref_id,
'sess');
136 foreach($sessions as $tree_data)
138 $obj_ids[] = $tree_data[
'obj_id'];
144 $query =
"SELECT event_id FROM event_appointment ".
145 "WHERE e_start < ".$ilDB->now().
" ".
146 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
" ".
147 "ORDER BY e_start DESC ";
152 $event_id =
$row->event_id;
154 return isset($event_id) ? $event_id : 0;
190 $this->start = $a_start;
218 $this->appointment_id = $a_appointment_id;
222 return $this->appointment_id;
227 $this->session_id = $a_session_id;
231 return $this->session_id;
236 $this->starting_time = $a_starting_time;
242 return isset($this->starting_time) ? $this->starting_time : mktime(8,0,0,date(
'n',time()),date(
'd',time()),date(
'Y',time()));
247 $this->ending_time = $a_ending_time;
252 return isset($this->ending_time) ? $this->ending_time : mktime(16,0,0,date(
'n',time()),date(
'd',time()),date(
'Y',time()));
257 $this->fulltime = $a_status;
261 return $this->fulltime;
273 $start = date($this->lng->txt(
'lang_timeformat_no_sec'),
$start);
274 $end = date($this->lng->txt(
'lang_timeformat_no_sec'),
$end);
313 $new_app->setSessionId($new_id);
316 $new_app->toggleFullTime($this->
isFullday());
329 $next_id = $ilDB->nextId(
'event_appointment');
330 $query =
"INSERT INTO event_appointment (appointment_id,event_id,e_start,e_end,fulltime) ".
332 $ilDB->quote($next_id,
'integer').
", ".
338 $this->appointment_id = $next_id;
352 $query =
"UPDATE event_appointment ".
353 "SET event_id = ".$ilDB->quote($this->
getSessionId() ,
'integer').
", ".
357 "WHERE appointment_id = ".$ilDB->quote($this->
getAppointmentId() ,
'integer').
" ";
371 $query =
"DELETE FROM event_appointment ".
372 "WHERE appointment_id = ".$ilDB->quote($a_appointment_id ,
'integer').
" ";
382 $query =
"DELETE FROM event_appointment ".
383 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ";
393 $query =
"SELECT * FROM event_appointment ".
394 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
395 "ORDER BY starting_time";
402 return is_array($appointments) ? $appointments : array();
407 if($this->starting_time > $this->ending_time)
409 $this->ilErr->appendMessage($this->lng->txt(
'event_etime_smaller_stime'));
425 $query =
"SELECT * FROM event_appointment ".
426 "WHERE appointment_id = ".$ilDB->quote($this->
getAppointmentId() ,
'integer').
" ";
443 $this->starting_time = $this->start->getUnixTime();
444 $this->ending_time = $this->end->getUnixTime();