5 include_once(
'./Services/Calendar/interfaces/interface.ilDatePeriod.php');
6 include_once(
'./Services/Calendar/classes/class.ilDate.php');
36 $this->appointment_id = $a_appointment_id;
51 $query =
"SELECT * FROM event_appointment ".
52 "WHERE event_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
56 $info[
'fullday'] =
$row->fulltime;
59 $info[
'start'] = $date->getUnixTime();
61 $info[
'end'] = $date->getUnixTime();
81 $sessions = $tree->getChildsByType($a_ref_id,
'sess');
83 foreach($sessions as $tree_data)
85 $obj_ids[] = $tree_data[
'obj_id'];
94 $tomorrow = clone $now;
97 $query =
"SELECT event_id FROM event_appointment ".
98 "WHERE e_start > ".$ilDB->quote($now->get(
IL_CAL_DATE,
'timestamp')).
' '.
99 "AND e_start < ".$ilDB->quote($tomorrow->get(
IL_CAL_DATE,
'timestamp')).
' '.
100 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
' '.
103 $event_ids = array();
108 $event_ids[] =
$row->event_id;
111 if(count($event_ids))
117 $query =
"SELECT event_id FROM event_appointment ".
118 "WHERE e_start > ".$ilDB->now().
" ".
119 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
" ".
125 $event_id =
$row->event_id;
127 return isset($event_id) ? array($event_id) : array();
142 $sessions = $tree->getChildsByType($a_ref_id,
'sess');
144 foreach($sessions as $tree_data)
146 $obj_ids[] = $tree_data[
'obj_id'];
152 $query =
"SELECT event_id FROM event_appointment ".
153 "WHERE e_start < ".$ilDB->now().
" ".
154 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
" ".
155 "ORDER BY e_start DESC ";
160 $event_id =
$row->event_id;
162 return isset($event_id) ? $event_id : 0;
198 $this->start = $a_start;
226 $this->appointment_id = $a_appointment_id;
230 return $this->appointment_id;
235 $this->session_id = $a_session_id;
239 return $this->session_id;
244 $this->starting_time = $a_starting_time;
250 return isset($this->starting_time) ? $this->starting_time : mktime(8,0,0,date(
'n',time()),date(
'd',time()),date(
'Y',time()));
255 $this->ending_time = $a_ending_time;
260 return isset($this->ending_time) ? $this->ending_time : mktime(16,0,0,date(
'n',time()),date(
'd',time()),date(
'Y',time()));
265 $this->fulltime = $a_status;
269 return $this->fulltime;
281 $start = date($this->lng->txt(
'lang_timeformat_no_sec'),
$start);
282 $end = date($this->lng->txt(
'lang_timeformat_no_sec'),
$end);
321 $new_app->setSessionId($new_id);
324 $new_app->toggleFullTime($this->
isFullday());
337 $next_id = $ilDB->nextId(
'event_appointment');
338 $query =
"INSERT INTO event_appointment (appointment_id,event_id,e_start,e_end,fulltime) ".
340 $ilDB->quote($next_id,
'integer').
", ".
346 $this->appointment_id = $next_id;
360 $query =
"UPDATE event_appointment ".
361 "SET event_id = ".$ilDB->quote($this->
getSessionId() ,
'integer').
", ".
365 "WHERE appointment_id = ".$ilDB->quote($this->
getAppointmentId() ,
'integer').
" ";
379 $query =
"DELETE FROM event_appointment ".
380 "WHERE appointment_id = ".$ilDB->quote($a_appointment_id ,
'integer').
" ";
390 $query =
"DELETE FROM event_appointment ".
391 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ";
401 $query =
"SELECT * FROM event_appointment ".
402 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
403 "ORDER BY starting_time";
410 return is_array($appointments) ? $appointments : array();
415 if($this->starting_time > $this->ending_time)
417 $this->ilErr->appendMessage($this->lng->txt(
'event_etime_smaller_stime'));
433 $query =
"SELECT * FROM event_appointment ".
434 "WHERE appointment_id = ".$ilDB->quote($this->
getAppointmentId() ,
'integer').
" ";
451 $this->starting_time = $this->start->getUnixTime();
452 $this->ending_time = $this->end->getUnixTime();