1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
eventaddrule.php
См. документацию.
1<?php
2
4
11use Bitrix\Calendar\Access\Rule\Traits\CurrentUserTrait;
12
14{
15 use CurrentUserTrait;
16 use CategoryTrait;
17
18 public function execute(AccessibleItem $item = null, $params = null): bool
19 {
20 if (!$item instanceof EventModel)
21 {
22 return false;
23 }
24
25 if (!$this->hasCurrentUser())
26 {
27 return true;
28 }
29
30 if ($this->user->isAdmin() || $this->user->isSocNetAdmin($item->getSectionType()))
31 {
32 return true;
33 }
34
35 // on early stages of creating open event not connected to category
36 // this rule not fired on most cases, but should be presented for better consistency
37 if ($item->getSectionType() === Dictionary::CALENDAR_TYPE['open_event'])
38 {
39 return $this->checkCategoryByEvent($item, ActionDictionary::ACTION_EVENT_CATEGORY_POST);
40 }
41
42 $section = SectionModel::createFromEventModel($item);
43
44 return $this->controller->check(
46 $section,
47 );
48 }
49}
execute(AccessibleItem $item=null, $params=null)
Определения eventaddrule.php:18
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799