3namespace Bitrix\Calendar\Rooms;
5use Bitrix\Calendar\Access\ActionDictionary;
6use Bitrix\Calendar\Access\Model\TypeModel;
7use Bitrix\Calendar\Access\TypeAccessController;
8use Bitrix\Calendar\Core\Event\Tools\Dictionary;
9use Bitrix\Calendar\Integration\Bitrix24\FeatureDictionary;
10use Bitrix\Main\Access\Exception\UnknownActionException;
11use Bitrix\Main\LoaderException;
12use Bitrix\Main\Localization\Loc;
13use Bitrix\Main\Loader;
14use Bitrix\Main\Text\Emoji;
16use Bitrix\Calendar\Integration\Bitrix24Manager;
35 'room_event_id' =>
false,
53 $parsedLocation = explode(
'_',
$location);
54 if (
count($parsedLocation) >= 2)
56 if ((
int)$parsedLocation[1] > 0)
58 $res[
'mrid'] = (int)$parsedLocation[1];
60 if ((
int)$parsedLocation[2] > 0)
62 $res[
'mrevid'] = (int)$parsedLocation[2];
68 $parsedLocation = explode(
'_',
$location);
69 if (
count($parsedLocation) >= 2)
71 if ((
int)$parsedLocation[1] > 0)
73 $res[
'room_id'] = (int)$parsedLocation[1];
75 if (isset($parsedLocation[2]) && (
int)$parsedLocation[2] > 0)
77 $res[
'room_event_id'] = (int)$parsedLocation[2];
101 $loc_ = mb_strtolower(trim($loc));
102 foreach($MRList as $MR)
104 if (mb_strtolower(trim($MR[
'NAME'])) === $loc_)
106 $result[
'NEW'] =
'ECMR_'.$MR[
'ID'];
111 if (Bitrix24Manager::isFeatureEnabled(FeatureDictionary::CALENDAR_LOCATION))
114 foreach($locationList as $room)
116 if (mb_strtolower(trim($room[
'NAME'])) === $loc_)
118 $result[
'NEW'] =
'calendar_'.$room[
'ID'];
152 return $room ? ($room[0][
'NAME'] ??
null) :
'';
156 foreach ($MRList as $MR)
158 if ((
int)$MR[
'ID'] === (
int)
$location[
'mrid'])
181 'bRecreateReserveMeetings' =>
$params[
'bRecreateReserveMeetings'] ??
null,
182 'dateFrom' =>
$params[
'dateFrom'] ??
null,
183 'dateTo' =>
$params[
'dateTo'] ??
null,
184 'name' =>
$params[
'name'] ??
null,
185 'persons' =>
$params[
'persons'] ??
null,
186 'attendees' =>
$params[
'attendees'] ??
null,
187 'parentParams' =>
$params[
'parentParams'] ??
null,
188 'checkPermission' =>
$params[
'checkPermission'] ??
null,
191 $tzEnabled = CTimeZone::Enabled();
194 CTimeZone::Disable();
198 $locOld = self::parseLocation($old);
199 $locNew = self::parseLocation(
$new);
200 $res = $locNew[
'mrid'] ? $locNew[
'str'] :
$new;
201 $settings = CCalendar::GetSettings([
'request' =>
false]);
202 $RMiblockId =
$settings[
'rm_iblock_id'] ??
null;
204 if ($RMiblockId && $locOld[
'mrid'] !==
false && $locOld[
'mrevid'] !==
false)
206 Util::releaseLocation($locOld);
209 if ($locNew[
'mrid'] !==
false)
212 if (
$params[
'bRecreateReserveMeetings'])
215 'RMiblockId' => $RMiblockId,
216 'mrid' => $locNew[
'mrid'],
217 'dateFrom' =>
$params[
'dateFrom'],
220 'description' => Loc::getMessage(
'EC_RESERVE_FOR_EVENT').
': '.
$params[
'name'],
221 'persons' =>
$params[
'persons'],
222 'members' =>
$params[
'attendees']
226 else if($locNew[
'mrevid'] !==
false)
228 $mrevid = $locNew[
'mrevid'];
232 ($mrevid && $mrevid !==
'reserved' && $mrevid !==
'expire' && $mrevid > 0)
233 ?
'ECMR_' . $locNew[
'mrid'] .
'_' . $mrevid
239 $locOld[
'room_id'] !==
false
240 && $locOld[
'room_event_id'] !==
false
241 && $locNew[
'room_id'] ===
false
244 self::releaseLocation($locOld);
246 $locNew = $locNew[
'str'];
249 else if($locNew[
'room_id'] && $locOld[
'room_id'] ===
false)
252 'room_id' => $locNew[
'room_id'],
253 'room_event_id' =>
false,
254 'parentParams' =>
$params[
'parentParams']
257 $locNew = $roomEventId ?
'calendar_'.$locNew[
'room_id'].
'_'.$roomEventId :
'';
262 && $locOld[
'room_id']
263 && $locOld[
'room_event_id']
267 'room_id' => $locNew[
'room_id'],
268 'room_event_id' => $locOld[
'room_event_id'],
269 'parentParams' =>
$params[
'parentParams'],
270 'checkPermission' =>
$params[
'checkPermission'],
273 $locNew = $roomEventId ?
'calendar_' . $locNew[
'room_id'] .
'_' . $roomEventId :
'';
278 $locNew = $locNew[
'str'];
302 'room_id' => $loc[
'room_id'] ??
false,
303 'room_event_id' => $loc[
'room_event_id'] ??
false,
304 'mrevid' => $loc[
'mrevid'] ??
false,
305 'mrid' => $loc[
'mrid'] ??
false,
308 if ($loc[
'room_id'] && $loc[
'room_event_id'] !==
false)
311 'room_id' => $loc[
'room_id'],
312 'room_event_id' => $loc[
'room_event_id']
317 if($loc[
'mrevid'] && $loc[
'mrid'])
319 $set = CCalendar::GetSettings([
'request' =>
false]);
320 if ($set[
'rm_iblock_id'] ??
null)
323 'mrevid' => $loc[
'mrevid'],
324 'mrid' => $loc[
'mrid'],
325 'RMiblockId' => $set[
'rm_iblock_id']
340 $typeModel = TypeModel::createFromXmlId(Dictionary::CALENDAR_TYPE[
'location']);
344 if (Loader::includeModule(
'extranet'))
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static getMeetingRoomList(array $params=[])
static reserveMeetingRoom(array $params)
static releaseMeetingRoom(array $params)
static getRoomById(int $id, array $params=[])
static releaseRoom(array $params=[])
static reserveRoom(array $params=[])
static setLocation($old='', $new='', array $params=[])
static releaseLocation($loc)
static parseLocation($location)
static unParseTextLocation($loc='')
static getTextLocation($loc='')
static getLocationAccess($userId)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(!is_array($deviceNotifyCodes)) $access
</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']