/**
  *  Returns meeting end date
  * @return ilDateTime
  */
 public function getEndDate()
 {
     $end_date = new ilDateTime($this->start_date->getUnixTime(), IL_CAL_UNIX);
     $end_date->increment(ilDateTime::HOUR, $this->duration["hours"]);
     $end_date->increment(ilDateTime::MINUTE, $this->duration["minutes"]);
     return $end_date;
 }
 /**
  * lookup appointment
  *
  * @access public
  * @param int obj_id
  * @static
  */
 public static function _lookupAppointment($a_obj_id)
 {
     global $ilDB;
     $query = "SELECT * FROM event_appointment " . "WHERE event_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
     $res = $ilDB->query($query);
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         $info['fullday'] = $row->fulltime;
         $date = new ilDateTime($row->e_start, IL_CAL_DATETIME, 'UTC');
         $info['start'] = $date->getUnixTime();
         $date = new ilDateTime($row->e_end, IL_CAL_DATETIME, 'UTC');
         $info['end'] = $date->getUnixTime();
         return $info;
     }
     return array();
 }
 private function __calculateAccessEnddate()
 {
     include_once 'Services/Calendar/classes/class.ilDateTime.php';
     $tmp_ts = new ilDateTime($this->getAccessStartdate(), IL_CAL_DATETIME);
     $start_date = $tmp_ts->getUnixTime();
     $duration = $this->getDuration();
     $startDateYear = date("Y", $start_date);
     $startDateMonth = date("m", $start_date);
     $startDateDay = date("d", $start_date);
     $startDateHour = date("H", $start_date);
     $startDateMinute = date("i", $start_date);
     $startDateSecond = date("s", $start_date);
     $access_enddate = date("Y-m-d H:i:s", mktime($startDateHour, $startDateMinute, $startDateSecond, $startDateMonth + $duration, $startDateDay, $startDateYear));
     $this->setAccessEnddate($access_enddate);
 }
Exemple #4
0
    public function getPrivateRoomSessions(ilDateTime $from = null, ilDateTime $to = null, $user_id = 0, $room_id = 0)
    {
        global $ilDB;
        $query = 'SELECT proom_id, title FROM ' . self::$privateRoomsTable . ' WHERE proom_id IN (
			SELECT proom_id FROM ' . self::$privateSessionsTable . ' WHERE connected >= %s AND disconnected <= %s AND user_id = %s

		) AND parent_id = %s';
        $rset = $ilDB->queryF($query, array('integer', 'integer', 'integer', 'integer'), array($from->getUnixTime(), $to->getUnixTime(), $user_id, $room_id));
        $result = array();
        while ($row = $ilDB->fetchAssoc($rset)) {
            $result[] = $row;
        }
        return $result;
    }
 public function checkConcurrentMeetingDates(ilDateTime $endDate, ilDateTime $startDate = null, $ignoreId = null)
 {
     /**
      * @var $ilDB ilDB
      */
     global $ilDB;
     if ($startDate == null) {
         $startDate = new ilDateTime(time(), IL_CAL_UNIX);
     }
     $sim = array();
     $srv = ilAdobeConnectServer::_getInstance();
     $new_start_date = $startDate->getUnixTime() - $srv->getBufferBefore();
     $new_end_date = $endDate->getUnixTime() + $srv->getBufferAfter();
     $query = array('SELECT * FROM rep_robj_xavc_data', 'WHERE (', '(%s > start_date AND %s < end_date) OR', '(%s > start_date AND %s < end_date) OR', '(%s < start_date AND %s > end_date)', ')');
     $types = array('integer', 'integer', 'integer', 'integer', 'integer', 'integer');
     $values = array($new_start_date, $new_start_date, $new_end_date, $new_end_date, $new_start_date, $new_end_date);
     if ($ignoreId !== null) {
         $query[] = 'AND id <> %s';
         $types[] = 'integer';
         $values[] = $ignoreId;
     }
     $res = $ilDB->queryF(join(' ', $query), $types, $values);
     while ($row = $ilDB->fetchObject($res)) {
         if (ilObject::_hasUntrashedReference($row->id)) {
             $sim[] = $row;
         }
     }
     return $sim;
 }