public function parseAdminTable(ilDateTime $start, ilDateTime $end) { $booking_list = array(); try { $con = new ilViteroBookingSoapConnector(); $bookings = $con->getBookingListByDate(ilViteroSettings::getInstance()->getCustomer(), $start, $end); } catch (Exception $e) { throw $e; } $booking_arr = array(); if (is_object($bookings->booking)) { $booking_arr = array($bookings->booking); } elseif (is_array($bookings->booking)) { $booking_arr = $bookings->booking; } $counter = 0; foreach ($booking_arr as $booking) { $fstart = ilViteroUtils::parseSoapDate($booking->start); $fend = ilViteroUtils::parseSoapDate($booking->end); $duration = $fend->get(IL_CAL_UNIX) - $fstart->get(IL_CAL_UNIX); $booking_list[$counter]['rec'] = $booking->repetitionpattern; $booking_list[$counter]['id'] = $booking->bookingid; $booking_list[$counter]['start'] = $fstart; $booking_list[$counter]['startt'] = $fstart->get(IL_CAL_UNIX); $bend = ilViteroUtils::parseSoapDate($booking->end); $booking_list[$counter]['end'] = $bend; if ($booking->cafe) { $booking_list[$counter]['start'] = new ilDate($booking_list[$counter]['startt'], IL_CAL_UNIX); $booking_list[$counter]['time'] = ilDatePresentation::formatDate($booking_list[$counter]['start']); } else { $booking_list[$counter]['time'] = ilDatePresentation::formatPeriod($booking_list[$counter]['start'], $booking_list[$counter]['end']); } $booking_list[$counter]['duration'] = ilFormat::_secondsToString($booking_list[$counter]['end']->get(IL_CAL_UNIX) - $booking_list[$counter]['start']->get(IL_CAL_UNIX), false); if ($booking->repetitionpattern) { $repend = ilViteroUtils::parseSoapDate($booking->repetitionenddate); $booking_list[$counter]['ends'] = ilDatePresentation::formatDate(new ilDate($repend->get(IL_CAL_UNIX), IL_CAL_UNIX)); } $booking_list[$counter]['group'] = ilObjVitero::lookupObjIdByGroupId($booking->groupid); $counter++; } $this->setMaxCount(count($booking_list)); $this->setData($booking_list); }