function rsvCancelObject()
 {
     global $ilAccess, $ilUser;
     $this->tabs_gui->setTabActive('log');
     $id = (int) $_GET['reservation_id'];
     include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
     $obj = new ilBookingReservation($id);
     if (!$ilAccess->checkAccess("write", "", $this->ref_id) && $obj->getUserId() != $ilUser->getId()) {
         ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
         $this->ctrl->redirect($this, 'log');
     }
     $obj->setStatus(ilBookingReservation::STATUS_CANCELLED);
     $obj->update();
     if ($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE) {
         // remove user calendar entry (#11086)
         $cal_entry_id = $obj->getCalendarEntry();
         if ($cal_entry_id) {
             include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
             $entry = new ilCalendarEntry($cal_entry_id);
             $entry->delete();
         }
     }
     ilUtil::sendSuccess($this->lng->txt('settings_saved'));
     $this->logObject();
 }
 function rsvCancelObject()
 {
     global $ilAccess, $ilUser, $tpl, $lng, $ilCtrl;
     $ids = $_POST["rsv_id"];
     // parse aggregation form
     if ($_POST["rsv_aggr"]) {
         $form = $this->rsvConfirmCancelAggregationForm($_POST["rsv_aggr"]);
         if (!$form->checkInput()) {
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "log"));
             return $tpl->setContent($form->getHTML());
         }
         $ids = array();
         foreach ($_POST["rsv_aggr"] as $idx => $aggr_ids) {
             $max = (int) $_POST["rsv_id_" . $idx];
             if ($max) {
                 if (!is_array($aggr_ids)) {
                     $ids[] = $aggr_ids;
                 } else {
                     $aggr_ids = array_slice($aggr_ids, 0, $max);
                     $ids = array_merge($ids, $aggr_ids);
                 }
             }
         }
     }
     if ($ids) {
         include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
         foreach ($ids as $id) {
             $obj = new ilBookingReservation($id);
             if (!$ilAccess->checkAccess("write", "", $this->ref_id) && $obj->getUserId() != $ilUser->getId()) {
                 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
                 $this->ctrl->redirect($this, 'log');
             }
             $obj->setStatus(ilBookingReservation::STATUS_CANCELLED);
             $obj->update();
             if ($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE) {
                 // remove user calendar entry (#11086)
                 $cal_entry_id = $obj->getCalendarEntry();
                 if ($cal_entry_id) {
                     include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
                     $entry = new ilCalendarEntry($cal_entry_id);
                     $entry->delete();
                 }
             }
         }
     }
     ilUtil::sendSuccess($this->lng->txt('settings_saved'));
     $this->logObject();
 }