1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
roomfilter.php
См. документацию.
1<?php
2namespace Bitrix\Calendar\Integration\UI\EntitySelector;
3
4use Bitrix\Im\User;
5use Bitrix\Main\Localization\Loc;
6use Bitrix\UI\EntitySelector\BaseFilter;
7use Bitrix\UI\EntitySelector\Dialog;
8use Bitrix\UI\EntitySelector\Item;
9
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 {
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}
apply(array $items, Dialog $dialog)
Определения roomfilter.php:22
static getRoomsList()
Определения manager.php:161
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$GLOBALS['____1690880296']
Определения license.php:1
$items
Определения template.php:224