/**
  * Update multiple sequence items
  * @return
  */
 protected function updateMulti()
 {
     global $ilObjDataCache;
     $this->initFormSequence(self::MODE_MULTI);
     if ($this->form->checkInput()) {
         $this->form->setValuesByPost();
         $apps = explode(';', $_POST['apps']);
         include_once 'Services/Booking/classes/class.ilBookingEntry.php';
         include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
         // do collision-check if max bookings were reduced
         $first = $apps;
         $first = array_shift($first);
         $entry = ilBookingEntry::getInstanceByCalendarEntryId($first);
         if ($this->form->getInput('bo') < $entry->getNumberOfBookings()) {
             $this->edit();
             return;
         }
         // create new context
         $booking = new ilBookingEntry();
         $booking->setObjId($this->getUserId());
         $booking->setNumberOfBookings($this->form->getInput('bo'));
         $deadline = $this->form->getInput('dead');
         $deadline = $deadline['dd'] * 24 + $deadline['hh'];
         $booking->setDeadlineHours($deadline);
         $tgt = $this->form->getInput('tgt');
         if ($tgt) {
             // if value was not changed, we already have an object id
             if ($tgt != $entry->getTargetObjId()) {
                 $obj_id = $ilObjDataCache->lookupObjId($tgt);
                 if (!$obj_id) {
                     ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_repository_object'), true);
                     $this->edit();
                     return;
                 }
                 $booking->setTargetObjId($obj_id);
             } else {
                 $booking->setTargetObjId($tgt);
             }
         }
         $booking->save();
         // update entries
         $title = $this->form->getInput('ti');
         $location = $this->form->getInput('lo');
         $description = $this->form->getInput('de');
         foreach ($apps as $item_id) {
             $entry = new ilCalendarEntry($item_id);
             $entry->setContextId($booking->getId());
             $entry->setTitle($title);
             $entry->setLocation($location);
             $entry->setDescription($description);
             $entry->update();
         }
         ilBookingEntry::removeObsoleteEntries();
         ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
         $this->ctrl->redirect($this, 'appointmentList');
     }
     $this->tpl->setContent($this->form->getHTML());
 }