1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
manager.php
См. документацию.
1<?php
2
3namespace Bitrix\Bizproc\Integration\Intranet\Settings;
4
5use Bitrix\Main\Config\Option;
6use Bitrix\Intranet\Settings\Controls\Switcher;
7use Bitrix\Intranet\Settings\Controls\Section;
8use Bitrix\Main\Localization\Loc;
9
11{
12 private array $controls = [];
13
14 const WAIT_FOR_CLOSURE_TASK_OPTION = 'crm_activity_wait_for_closure_task';
15 const WAIT_FOR_CLOSURE_COMMENTS_OPTION = 'crm_activity_wait_for_closure_comments';
16
17 public function __construct()
18 {
19 $this->initializeDefaults();
20 }
21
22 private function initializeDefaults(): void
23 {
24 $this->controls['SECTION_MAIN'] = new Section(
25 'settings-automation-section-main',
26 Loc::getMessage('BIZPROC_AUTOMATION_SETTINGS_SECTION_TITLE_MAIN_1') ?? '',
27 'ui-icon-set --apps',
28 canCollapse: false
29 );
30
31 $this->controls[self::WAIT_FOR_CLOSURE_TASK_OPTION] = new Switcher(
32 'settings-automation-field-' . self::WAIT_FOR_CLOSURE_TASK_OPTION,
33 self::WAIT_FOR_CLOSURE_TASK_OPTION,
34 Loc::getMessage('BIZPROC_AUTOMATION_SETTINGS_WAIT_FOR_CLOSURE_TASK_1') ?? '',
35 Option::get('bizproc', self::WAIT_FOR_CLOSURE_TASK_OPTION),
36 [
37 'on' => Loc::getMessage('BIZPROC_AUTOMATION_SETTINGS_WAIT_FOR_CLOSURE_TASK_DESCR') ?? '',
38 ]
39 );
40
41 $this->controls[self::WAIT_FOR_CLOSURE_COMMENTS_OPTION] = new Switcher(
42 'settings-automation-field-' . self::WAIT_FOR_CLOSURE_COMMENTS_OPTION,
43 self::WAIT_FOR_CLOSURE_COMMENTS_OPTION,
44 Loc::getMessage('BIZPROC_AUTOMATION_SETTINGS_WAIT_FOR_CLOSURE_COMMENTS_1') ?? '',
45 Option::get('bizproc', self::WAIT_FOR_CLOSURE_COMMENTS_OPTION),
46 [
47 'on' => Loc::getMessage('BIZPROC_AUTOMATION_SETTINGS_WAIT_FOR_CLOSURE_COMMENTS_DESCR') ?? '',
48 ]
49 );
50 }
51
55 public function getList(): array
56 {
57 return $this->controls;
58 }
59
66 public function saveControlValue(string $code, $value): void
67 {
68 Option::set('bizproc', $code, $value);
69 }
70
71 public function getControlValue(string $code): ?string
72 {
73 $control = $this->getControl($code);
74 if ($control)
75 {
76 return $control?->getValue();
77 }
78
79 return null;
80 }
81
86 public function getControl(string $code): ?\Bitrix\Intranet\Settings\Controls\Control
87 {
88 $item = $this->controls[$code] ?? null;
89 if ($item)
90 {
91 return $item;
92 }
93
94 return null;
95 }
96}
saveControlValue(string $code, $value)
Определения manager.php:66
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$control
Определения iblock_catalog_edit.php:61
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195