1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
roomfilter.php
См. документацию.
1
<?php
2
namespace
Bitrix\Calendar\Integration\UI\EntitySelector;
3
4
use Bitrix\Im\User;
5
use Bitrix\Main\Localization\Loc;
6
use Bitrix\UI\EntitySelector\BaseFilter;
7
use Bitrix\UI\EntitySelector\Dialog;
8
use Bitrix\UI\EntitySelector\Item;
9
10
class
RoomFilter
extends
BaseFilter
11
{
12
public
function
__construct
()
13
{
14
parent::__construct();
15
}
16
17
public
function
isAvailable
(): bool
18
{
19
return
$GLOBALS
[
'USER'
]->isAuthorized();
20
}
21
22
public
function
apply
(
array
$items
,
Dialog
$dialog): void
23
{
24
$categories =
\Bitrix\Calendar\Rooms\Categories\Manager::getCategoryList
();
25
$rooms =
\Bitrix\Calendar\Rooms\Manager::getRoomsList
();
26
foreach
(
$items
as $item)
27
{
28
if
(!($item instanceof
Item
))
29
{
30
continue
;
31
}
32
$categoryId = 0;
33
$color =
''
;
34
foreach
($rooms as $room)
35
{
36
if
($item->getId() === $room[
'ID'
])
37
{
38
$categoryId = $room[
'CATEGORY_ID'
];
39
$color = $room[
'COLOR'
];
40
break
;
41
}
42
}
43
44
$customData = $item->getCustomData();
45
$customData->set(
'room'
, [
'COLOR'
=> $color]);
46
$item->setAvatarOptions([
47
'bgColor'
=> $color,
48
'bgSize'
=>
'22px'
,
49
'bgImage'
=>
'none'
,
50
]);
51
$item->setBadgesOptions([
52
'fitContent'
=>
true
,
53
'maxWidth'
=>
'230px'
,
54
]);
55
if
(!$categoryId)
56
{
57
continue
;
58
}
59
60
foreach
($categories as $category)
61
{
62
if
($categoryId === $category[
'ID'
])
63
{
64
$item->addBadges([[
65
'id'
=>
'CATEGORY'
,
66
'title'
=> $category[
'NAME'
],
67
]]);
68
break
;
69
}
70
}
71
}
72
}
73
}
Bitrix\Calendar\Integration\UI\EntitySelector\RoomFilter
Определения
roomfilter.php:11
Bitrix\Calendar\Integration\UI\EntitySelector\RoomFilter\__construct
__construct()
Определения
roomfilter.php:12
Bitrix\Calendar\Integration\UI\EntitySelector\RoomFilter\apply
apply(array $items, Dialog $dialog)
Определения
roomfilter.php:22
Bitrix\Calendar\Integration\UI\EntitySelector\RoomFilter\isAvailable
isAvailable()
Определения
roomfilter.php:17
Bitrix\Calendar\Rooms\Categories\Manager\getCategoryList
static getCategoryList()
Определения
manager.php:206
Bitrix\Calendar\Rooms\Manager\getRoomsList
static getRoomsList()
Определения
manager.php:161
Bitrix\UI\EntitySelector\BaseFilter
Определения
basefilter.php:5
Bitrix\UI\EntitySelector\Dialog
Определения
dialog.php:10
Bitrix\UI\EntitySelector\Item
Определения
item.php:8
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main\$GLOBALS
$GLOBALS['____1690880296']
Определения
license.php:1
$items
$items
Определения
template.php:224
bitrix
modules
calendar
lib
integration
ui
entityselector
roomfilter.php
Создано системой
1.14.0