5 include_once(
'./Services/Calendar/interfaces/interface.ilDatePeriod.php');
6 include_once(
'./Services/Calendar/classes/class.ilDate.php');
40 $this->appointment_id = $a_appointment_id;
55 $query =
"SELECT * FROM event_appointment ".
56 "WHERE event_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
63 $info[
'start'] = $date->getUnixTime();
65 $info[
'end'] = $date->getUnixTime();
85 $sessions = $tree->getChildsByType($a_ref_id,
'sess');
87 foreach($sessions as $tree_data)
89 $obj_ids[] = $tree_data[
'obj_id'];
98 $tomorrow = clone $now;
101 $query =
"SELECT event_id FROM event_appointment ".
102 "WHERE e_start > ".$ilDB->quote($now->get(
IL_CAL_DATE,
'timestamp')).
' '.
103 "AND e_start < ".$ilDB->quote($tomorrow->get(
IL_CAL_DATE,
'timestamp')).
' '.
104 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
' '.
107 $event_ids =
array();
112 $event_ids[] =
$row->event_id;
115 if(count($event_ids))
121 $query =
"SELECT event_id FROM event_appointment ".
122 "WHERE e_start > ".$ilDB->now().
" ".
123 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
" ".
129 $event_id =
$row->event_id;
131 return isset($event_id) ?
array($event_id) :
array();
146 $sessions = $tree->getChildsByType($a_ref_id,
'sess');
148 foreach($sessions as $tree_data)
150 $obj_ids[] = $tree_data[
'obj_id'];
156 $query =
"SELECT event_id FROM event_appointment ".
157 "WHERE e_start < ".$ilDB->now().
" ".
158 "AND ".$ilDB->in(
'event_id',$obj_ids,
false,
'integer').
" ".
159 "ORDER BY e_start DESC ";
164 $event_id =
$row->event_id;
166 return isset($event_id) ? $event_id : 0;
202 $this->start = $a_start;
230 $this->appointment_id = $a_appointment_id;
234 return $this->appointment_id;
239 $this->session_id = $a_session_id;
243 return $this->session_id;
248 $this->starting_time = $a_starting_time;
254 return isset($this->starting_time) ? $this->starting_time : mktime(8,0,0,
date(
'n',
time()),
date(
'd',
time()),
date(
'Y',
time()));
259 $this->ending_time = $a_ending_time;
264 return isset($this->ending_time) ? $this->ending_time : mktime(16,0,0,
date(
'n',
time()),
date(
'd',
time()),
date(
'Y',
time()));
269 $this->fulltime = $a_status;
273 return $this->fulltime;
286 $end =
date($this->lng->txt(
'lang_timeformat_no_sec'),
$end);
325 $new_app->setSessionId($new_id);
328 $new_app->toggleFullTime($this->
isFullday());
341 $next_id = $ilDB->nextId(
'event_appointment');
342 $query =
"INSERT INTO event_appointment (appointment_id,event_id,e_start,e_end,fulltime) ".
344 $ilDB->quote($next_id,
'integer').
", ".
350 $this->appointment_id = $next_id;
364 $query =
"UPDATE event_appointment ".
365 "SET event_id = ".$ilDB->quote($this->
getSessionId() ,
'integer').
", ".
369 "WHERE appointment_id = ".$ilDB->quote($this->
getAppointmentId() ,
'integer').
" ";
379 public static function _delete($a_appointment_id)
383 $query =
"DELETE FROM event_appointment ".
384 "WHERE appointment_id = ".$ilDB->quote($a_appointment_id ,
'integer').
" ";
394 $query =
"DELETE FROM event_appointment ".
395 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ";
405 $query =
"SELECT * FROM event_appointment ".
406 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
407 "ORDER BY starting_time";
414 return is_array($appointments) ? $appointments :
array();
419 if($this->starting_time > $this->ending_time)
421 $this->ilErr->appendMessage($this->lng->txt(
'event_etime_smaller_stime'));
437 $query =
"SELECT * FROM event_appointment ".
438 "WHERE appointment_id = ".$ilDB->quote($this->
getAppointmentId() ,
'integer').
" ";
455 $this->starting_time = $this->start->getUnixTime();
456 $this->ending_time = $this->end->getUnixTime();
static _delete($a_appointment_id)
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
setEndingTime($a_ending_time)
setAppointmentId($a_appointment_id)
static _deleteBySession($a_event_id)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static _appointmentToString($start, $end, $fulltime)
cloneObject($new_id)
clone appointment
Create styles array
The data for the language used.
_timeToString($start, $end)
static lookupLastSessionByCourse($a_ref_id)
public
toggleFullTime($a_status)
setSessionId($a_session_id)
setStart($a_start)
set start
__construct($a_appointment_id=null)
Consructor.
static _lookupAppointment($a_obj_id)
lookup appointment
static _readAppointmentsBySession($a_event_id)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static lookupNextSessionByCourse($a_ref_id)
public
setStartingTime($a_starting_time)
class ilSessionAppointment