13 private const TYPE =
'location';
18 private ?
string $dateFrom =
null;
20 private ?
string $dateTo =
null;
22 private ?
array $datesRange =
null;
24 private ?
array $locationList =
null;
37 $this->locationList = $locationList;
44 $this->dateFrom = $dateFrom;
51 $this->dateTo = $dateTo;
58 $this->datesRange = $range;
65 return $this->locationList;
70 return $this->dateFrom;
80 return $this->datesRange;
95 $location = Util::parseLocation($locationId);
100 $dateFrom = DateTime::createFromTimestamp(\CCalendar::TimestampUTC(
$params[
'fields'][
'DATE_FROM']))
101 ->setTimeZone(
new \DateTimeZone(
'UTC'));
102 $dateTo = DateTime::createFromTimestamp(\CCalendar::TimestampUTC(
$params[
'fields'][
'DATE_TO']))
103 ->setTimeZone(
new \DateTimeZone(
'UTC'));
107 if (
$params[
'fields'][
'SKIP_TIME'])
109 $toTs += \CCalendar::GetDayLen();
112 $eventId = (int)
$params[
'fields'][
'ID'];
121 if (!empty($additionalLocationConnection))
125 ...$additionalLocationConnection,
157 foreach ($entries as $entry)
160 (
int)$entry[
'ID'] !== (
int)$roomEventId
161 && (
int)$entry[
'PARENT_ID'] !== $eventId
165 new DateTime($entry[
'DATE_FROM']), $entry[
'TZ_FROM']
168 new DateTime($entry[
'DATE_TO']), $entry[
'TZ_FROM']
170 if ($entry[
'DT_SKIP_TIME'] ===
'Y')
172 $entryToTs += \CCalendar::GetDayLen();
175 if ($entryFromTs < $toTs && $entryToTs > $fromTs)
194 $currentOption = Option::get(
'calendar', self::ADDITIONAL_LOCATION_CONNECTION_OPTION);
195 $decodedOption = unserialize($currentOption, [
'allowed_classes' =>
false]);
197 return $decodedOption[$roomId] ?? [];
209 $result = serialize($additionalRoomConnectionInfo);
211 Option::set(
'calendar', self::ADDITIONAL_LOCATION_CONNECTION_OPTION,
$result);
223 $currentOption = Option::get(
'calendar', self::ADDITIONAL_LOCATION_CONNECTION_OPTION);
224 $decodedOption = unserialize($currentOption, [
'allowed_classes' =>
false]);
226 if (!is_array($decodedOption))
231 $decodedOption[$roomId] = $additionalRoomId;
232 $result = serialize($decodedOption);
234 Option::set(
'calendar', self::ADDITIONAL_LOCATION_CONNECTION_OPTION,
$result);
249 'allowReserveMeeting' =>
true,
251 'from' => \CCalendar::Date($fromTs - \CCalendar::DAY_LENGTH,
false),
252 'to' => \CCalendar::Date($toTs + \CCalendar::DAY_LENGTH,
false),
256 foreach ($meetingRoomRes as $entry)
258 if ((
int)$entry[
'ID'] !== (
int)
$location[
'mrevid'])
260 $entryFromTs = \CCalendar::Timestamp($entry[
'DT_FROM']);
261 $entryToTs = \CCalendar::Timestamp($entry[
'DT_TO']);
263 if ($entryFromTs < $toTs && $entryToTs > $fromTs)
283 return \CCalendarEvent::GetList([
285 'FROM_LIMIT' => $from,
287 'CAL_TYPE' => self::TYPE,
288 'ACTIVE_SECTION' =>
'Y',
289 'SECTION' => $roomIds,
291 'arSelect' => \CCalendarEvent::$defaultSelectEvent,
292 'parseRecursion' =>
true,
293 'fetchSection' =>
true,
294 'setDefaultLimit' =>
false,
295 'fetchAttendees' =>
false,
305 if (!is_array($this->datesRange) || !is_array($this->locationList) || empty($this->datesRange))
310 $roomIds = array_map(
static fn($room) => (
int)$room[
'ID'], $this->locationList);
311 $from = $this->datesRange[0];
312 $to = $this->datesRange[
count($this->datesRange) - 1];
318 foreach ($this->datesRange as $date)
323 foreach ($entries as $entry)
325 $roomId = (int)$entry[
'SECTION_ID'];
327 $dateStart =
new DateTime($entry[
'DATE_FROM']);
328 $dateEnd =
new DateTime($entry[
'DATE_TO']);
329 while ($dateStart->getTimestamp() <= $dateEnd->getTimestamp())
331 $date = $dateStart->format(
'd.m.Y');
332 $dateStart->add(
'1 day');
338 $result[$date][$roomId] ??= [];
339 $result[$date][$roomId][] = $entry;
setDateFrom(?string $dateFrom='')
setDatesRange(?array $range=[])
const ADDITIONAL_LOCATION_CONNECTION_OPTION
static checkIBlockAccessibility(array $location, int $fromTs, int $toTs)
static setFullAdditionalLocationAccessibilityConnection(array $additionalRoomConnectionInfo)
static checkAccessibility(string $locationId='', array $params=[])
setLocationList(?array $locationList=[])
static getAdditionalLocationAccessibilityConnection(int $roomId)
static getRoomAccessibility(array $roomIds, $from, $to)
static setAdditionalLocationAccessibilityConnection(int $roomId, array $additionalRoomId)
setDateTo(?string $dateTo='')
static checkLocationAccessibility(array $entries, int $fromTs, int $toTs, mixed $roomEventId, mixed $eventId)
getLocationAccessibility()
static getAccessibilityForMeetingRoom(array $params)
static formatDateTimestampUTC(int $timestamp)
static getDateTimestampUtc(DateTime $date, ?string $eventTimezone=null)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']