/** * confirm delete for multiple entries */ public function confirmDelete() { global $tpl; if (!isset($_REQUEST['apps'])) { ilUtil::sendFailure($this->lng->txt('select_one')); return $this->appointmentList(); } include_once './Services/Utilities/classes/class.ilConfirmationGUI.php'; $this->ctrl->saveParameter($this, array('seed', 'app_id', 'dt')); $confirm = new ilConfirmationGUI(); $confirm->setFormAction($this->ctrl->getFormAction($this)); $confirm->setHeaderText($this->lng->txt('cal_delete_app_sure')); $confirm->setCancel($this->lng->txt('cancel'), 'cancel'); include_once 'Services/Calendar/classes/class.ilCalendarEntry.php'; $bookings_available = array(); foreach ((array) $_REQUEST['apps'] as $entry_id) { $entry = new ilCalendarEntry($entry_id); $confirm->addItem('apps[]', $entry_id, ilDatePresentation::formatDate($entry->getStart()) . ', ' . $entry->getTitle()); include_once './Services/Booking/classes/class.ilBookingEntry.php'; if (ilBookingEntry::lookupBookingsForAppointment($entry_id)) { $bookings_available[] = ilDatePresentation::formatDate($entry->getStart()) . ', ' . $entry->getTitle(); } } if ($bookings_available) { ilUtil::sendInfo($this->lng->txt('cal_ch_delete_app_booking_info') . '<br />' . implode('<br />', $bookings_available)); } $confirm->setConfirm($this->lng->txt('delete'), 'delete'); $confirm->setCancel($this->lng->txt('cancel'), 'appointmentList'); $tpl->setContent($confirm->getHTML()); }
/** * Parse Groups * @param array $groups */ public function parse(array $appointments) { global $ilCtrl; $rows = array(); $counter = 0; foreach ($appointments as $app) { include_once './Services/Calendar/classes/class.ilCalendarEntry.php'; $cal_entry = new ilCalendarEntry($app); include_once './Services/Booking/classes/class.ilBookingEntry.php'; foreach (ilBookingEntry::lookupBookingsForAppointment($app) as $user_id) { include_once './Services/User/classes/class.ilUserUtil.php'; $rows[$counter]['name'] = ilUserUtil::getNamePresentation($user_id, true, true, $ilCtrl->getLinkTarget($this->getParentObject(), $this->getParentCmd()), true, true); $message = ilBookingEntry::lookupBookingMessage($app, $user_id); if (strlen(trim($message))) { $rows[$counter]['comment'] = '"' . $message . '"'; } $rows[$counter]['title'] = $cal_entry->getTitle(); $rows[$counter]['start'] = $cal_entry->getStart()->get(IL_CAL_UNIX); $rows[$counter]['start_str'] = ilDatePresentation::formatDate($cal_entry->getStart()); $rows[$counter]['id'] = $app . '_' . $user_id; ++$counter; } } $this->setData($rows); }