/** * Update object dataset */ function update() { global $tpl, $lng; $form = $this->initForm('edit', (int) $_POST['object_id']); if ($form->checkInput()) { include_once 'Modules/BookingManager/classes/class.ilBookingObject.php'; $obj = new ilBookingObject((int) $_POST['object_id']); $obj->setTitle($form->getInput("title")); $obj->setDescription($form->getInput("desc")); $obj->setNrOfItems($form->getInput("items")); $obj->setPostText($form->getInput("post_text")); $file = $form->getItemByPostVar("file"); if ($_FILES["file"]["tmp_name"]) { $obj->uploadFile($_FILES["file"]); } else { if ($file->getDeletionFlag()) { $obj->deleteFile(); } } $pfile = $form->getItemByPostVar("post_file"); if ($_FILES["post_file"]["tmp_name"]) { $obj->uploadPostFile($_FILES["post_file"]); } else { if ($pfile->getDeletionFlag()) { $obj->deletePostFile(); } } if ($this->pool_has_schedule) { $obj->setScheduleId($form->getInput("schedule")); } $obj->update(); ilUtil::sendSuccess($lng->txt("book_object_updated")); $this->render(); } else { $form->setValuesByPost(); $tpl->setContent($form->getHTML()); } }