19 declare(strict_types=1);
47 $this->object_repo = $repo->
objects();
48 $this->object_repo->loadDataOfPool($pool_id);
54 return $this->object_repo->getNrOfItemsForObject($book_obj_id);
60 foreach ($this->object_repo->getObjectDataForPool($this->pool_id) as
$d) {
61 $titles[
$d[
"booking_object_id"]] = $d[
"title"];
69 return (
int)
$d[
"booking_object_id"];
70 }, $this->object_repo->getObjectDataForPool($this->pool_id));
75 return $this->object_repo->getColorNrForObject($book_obj_id);
80 $rows = explode(
"\n", $input);
82 foreach ($rows as $row) {
83 $cells = explode(
";", $row);
84 if (count($cells) === 1) {
85 $cells = explode(
"\t", $row);
88 "title" => trim($cells[0] ??
""),
89 "description" => trim($cells[1] ??
""),
90 "nr" => trim($cells[2] ??
""),
99 $object = new \ilBookingObject();
100 $object->setTitle($data[
"title"]);
101 $object->setDescription($data[
"description"]);
102 $object->setNrOfItems((
int) $data[
"nr"]);
103 $object->setPoolId($this->pool_id);
104 if ($schedule_id > 0) {
105 $object->setScheduleId($schedule_id);
117 if (!isset($file_input[
"tmp_name"])) {
120 return $this->object_repo->importObjectInfoFromLegacyUpload(
123 $this->object_info_stakeholder
129 if (!isset($file_input[
"tmp_name"])) {
132 return $this->object_repo->importBookingInfoFromLegacyUpload(
135 $this->book_info_stakeholder
141 return $this->object_repo->hasObjectInfo($booking_obj_id);
146 if ($this->object_repo->hasObjectInfo($booking_obj_id)) {
147 $this->object_repo->deliverObjectInfo($booking_obj_id);
153 return $this->object_repo->hasBookingInfo($booking_obj_id);
158 if ($this->object_repo->hasBookingInfo($booking_obj_id)) {
159 $this->object_repo->deliverBookingInfo($booking_obj_id);
165 return $this->object_repo->getObjectInfoFilename($booking_obj_id);
170 return $this->object_repo->getBookingInfoFilename($booking_obj_id);
175 if ($this->object_repo->hasObjectInfo($booking_obj_id)) {
176 $this->object_repo->deleteObjectInfo($booking_obj_id, $this->object_info_stakeholder);
182 if ($this->object_repo->hasBookingInfo($booking_obj_id)) {
183 $this->object_repo->deleteBookingInfo($booking_obj_id, $this->book_info_stakeholder);
188 int $from_booking_obj_id,
189 int $to_booking_obj_id
191 if ($this->object_repo->hasObjectInfo($from_booking_obj_id) ||
192 $this->object_repo->hasBookingInfo($from_booking_obj_id)) {
193 $this->object_repo->clone($from_booking_obj_id, $to_booking_obj_id);
199 return $this->object_repo->getObjectInfoPath($booking_object_id);
204 return $this->object_repo->getBookingInfoPath($booking_object_id);
getBookingInfoPath(int $booking_object_id)
cloneTo(int $from_booking_obj_id, int $to_booking_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
deliverObjectInfo(int $booking_obj_id)
getColorNrForObject(int $book_obj_id)
InternalRepoService $repo
getObjectInfoFilename(int $booking_obj_id)
hasBookingInfo(int $booking_obj_id)
InternalDomainService $domain
getBookingInfoFilename(int $booking_obj_id)
deleteObjectInfo(int $booking_obj_id)
getNrOfItemsForObject(int $book_obj_id)
Author: Alexander Killing killing@leifos.de
importBookingInfoFromLegacyUpload(int $booking_obj_id, array $file_input)
createObjectsFromBulkInputString(string $input, int $schedule_id)
InternalDataService $data
Repository internal data service.
deleteBookingInfo(int $booking_obj_id)
importObjectInfoFromLegacyUpload(int $booking_obj_id, array $file_input)
__construct(InternalDataService $data, InternalRepoService $repo, InternalDomainService $domain, protected ResourceStakeholder $object_info_stakeholder, protected ResourceStakeholder $book_info_stakeholder, int $pool_id)
getObjectInfoPath(int $booking_object_id)
deliverBookingInfo(int $booking_obj_id)
ObjectsDBRepository $object_repo
getDataArrayFromInputString(string $input)
Interface ResourceStakeholder.
Repo class for booking objects.
hasObjectInfo(int $booking_obj_id)