40 "SELECT booking_pool_id FROM booking_settings " .
41 " WHERE schedule_type = %s " .
42 " AND pref_deadline < %s " .
43 " AND pref_booking_hash = %s ",
44 array(
"integer",
"integer",
"text"),
47 while ($rec =
$db->fetchAssoc($set)) {
48 $pool_ids[] = $rec[
"booking_pool_id"];
64 $hash = uniqid(
"",
true);
66 $db->update(
"booking_settings", array(
67 "pref_booking_hash" => array(
"text", $hash)
69 "booking_pool_id" => array(
"integer", $pool_id),
70 "pref_booking_hash" => array(
"text",
"0"),
74 "SELECT pref_booking_hash FROM booking_settings " .
75 " WHERE booking_pool_id = %s ",
79 $rec =
$db->fetchAssoc($set);
81 if ($rec[
"pref_booking_hash"] == $hash) {
97 foreach ($bookings as $user_id => $obj_ids) {
98 foreach ($obj_ids as $obj_id) {
102 $reservation->setObjectId($obj_id);
103 $reservation->setUserId($user_id);
104 $reservation->setAssignerId($user_id);
105 $reservation->setFrom(null);
106 $reservation->setTo(null);
107 $reservation->save();
128 )[
"data"] as $book) {
129 $bookings[$book[
"user_id"]][] = $book[
"object_id"];
static isObjectAvailableNoSchedule($a_obj_id)
checkProcessHash($pool_id)
Semaphore like hash setting/checking to ensure that no other process is doing the same...
storeBookings(int $pool_id, $bookings)
Store bookings see similar code in ilObjBookingPoolGUI::confirmedBookingObject this should got to a r...
static getObjectReservationForUser($a_object_id, $a_user_id, $a_multi=false)
getBookings(array $obj_ids)
Get bookings.
Manages the booking storage of the preference based calculated bookings.
static getList($a_object_ids, $a_limit=10, $a_offset=0, array $filter=[])
List all reservations.
getPoolsWithOverdueBooking()
Get pools with overdue preference booking.
const TYPE_NO_SCHEDULE_PREFERENCES
__construct(ilDBInterface $db=null)
Constructor.