5include_once(
'./Services/Calendar/interfaces/interface.ilDatePeriod.php');
 
    6include_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') . 
" ";
 
   62            $info[
'start'] =  $date->getUnixTime();
 
   64            $info[
'end'] = $date->getUnixTime();
 
   84        $sessions = 
$tree->getChildsByType($a_ref_id, 
'sess');
 
   86        foreach ($sessions as $tree_data) {
 
   87            $obj_ids[] = $tree_data[
'obj_id'];
 
   89        if (!count($obj_ids)) {
 
   95        $tomorrow = clone $now;
 
   98        $query = 
"SELECT event_id FROM event_appointment " .
 
   99            "WHERE e_start > " . 
$ilDB->quote($now->get(
IL_CAL_DATE, 
'timestamp')) . 
' ' .
 
  100            "AND e_start < " . 
$ilDB->quote($tomorrow->get(
IL_CAL_DATE, 
'timestamp')) . 
' ' .
 
  101            "AND " . 
$ilDB->in(
'event_id', $obj_ids, 
false, 
'integer') . 
' ' .
 
  104        $event_ids = array();
 
  108            $event_ids[] = 
$row->event_id;
 
  111        if (count($event_ids)) {
 
  116        $query = 
"SELECT event_id FROM event_appointment " .
 
  117            "WHERE e_start > " . 
$ilDB->now() . 
" " .
 
  118            "AND " . 
$ilDB->in(
'event_id', $obj_ids, 
false, 
'integer') . 
" " .
 
  123            $event_id = 
$row->event_id;
 
  125        return isset($event_id) ? array($event_id) : array();
 
  140        $sessions = 
$tree->getChildsByType($a_ref_id, 
'sess');
 
  142        foreach ($sessions as $tree_data) {
 
  143            $obj_ids[] = $tree_data[
'obj_id'];
 
  145        if (!count($obj_ids)) {
 
  148        $query = 
"SELECT event_id FROM event_appointment " .
 
  149            "WHERE e_start < " . 
$ilDB->now() . 
" " .
 
  150            "AND " . 
$ilDB->in(
'event_id', $obj_ids, 
false, 
'integer') . 
" " .
 
  151            "ORDER BY e_start DESC ";
 
  155            $event_id = 
$row->event_id;
 
  157        return isset($event_id) ? $event_id : 0;
 
  193        $this->start = $a_start;
 
  221        $this->appointment_id = $a_appointment_id;
 
  225        return $this->appointment_id;
 
  230        $this->session_id = $a_session_id;
 
  234        return $this->session_id;
 
  239        $this->starting_time = $a_starting_time;
 
  244        return isset($this->starting_time) ? $this->starting_time : mktime(8, 0, 0, 
date(
'n', time()), 
date(
'd', time()), 
date(
'Y', time()));
 
  249        $this->ending_time = $a_ending_time;
 
  254        return isset($this->ending_time) ? $this->ending_time : mktime(16, 0, 0, 
date(
'n', time()), 
date(
'd', time()), 
date(
'Y', time()));
 
  259        $this->fulltime = $a_status;
 
  263        return $this->fulltime;
 
  276        $end = 
date($this->lng->txt(
'lang_timeformat_no_sec'), 
$end);
 
  314        $new_app->setSessionId($new_id);
 
  317        $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;
 
  351        $query = 
"UPDATE event_appointment " .
 
  352            "SET event_id = " . $ilDB->quote($this->
getSessionId(), 
'integer') . 
", " .
 
  355            "fulltime = " . $ilDB->quote($this->
enabledFullTime(), 
'integer') . 
" " .
 
  356            "WHERE appointment_id = " . $ilDB->quote($this->
getAppointmentId(), 
'integer') . 
" ";
 
  361    public function delete()
 
  366    public static function _delete($a_appointment_id)
 
  370        $query = 
"DELETE FROM event_appointment " .
 
  371            "WHERE appointment_id = " . 
$ilDB->quote($a_appointment_id, 
'integer') . 
" ";
 
  381        $query = 
"DELETE FROM event_appointment " .
 
  382            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" ";
 
  392        $query = 
"SELECT * FROM event_appointment " .
 
  393            "WHERE event_id = " . 
$ilDB->quote($a_event_id, 
'integer') . 
" " .
 
  394            "ORDER BY starting_time";
 
  400        return is_array($appointments) ? $appointments : array();
 
  405        if ($this->starting_time > $this->ending_time) {
 
  406            $this->ilErr->appendMessage($this->lng->txt(
'event_etime_smaller_stime'));
 
  421        $query = 
"SELECT * FROM event_appointment " .
 
  422            "WHERE appointment_id = " . $ilDB->quote($this->
getAppointmentId(), 
'integer') . 
" ";
 
  435            $this->starting_time = $this->start->getUnixTime();
 
  436            $this->ending_time = $this->end->getUnixTime();
 
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
@classDescription Date and time handling
class ilSessionAppointment
cloneObject($new_id)
clone appointment
static _readAppointmentsBySession($a_event_id)
static lookupLastSessionByCourse($a_ref_id)
@access public
static _delete($a_appointment_id)
__construct($a_appointment_id=null)
Consructor.
static _lookupAppointment($a_obj_id)
lookup appointment
setSessionId($a_session_id)
static _appointmentToString($start, $end, $fulltime)
setEndingTime($a_ending_time)
static _deleteBySession($a_event_id)
setAppointmentId($a_appointment_id)
toggleFullTime($a_status)
static lookupNextSessionByCourse($a_ref_id)
@access public
setStartingTime($a_starting_time)
setStart($a_start)
set start
_timeToString($start, $end)
foreach($_POST as $key=> $value) $res