Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
automationtemplateprovider.php
1
<?php
2
3
namespace
Bitrix\Bizproc\Integration\UI\EntitySelector
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\ORM\Query\Filter\ConditionTree
;
7
use
Bitrix\UI\EntitySelector\Dialog
;
8
use
Bitrix\UI\EntitySelector\Tab
;
9
10
class
AutomationTemplateProvider
extends
TemplateProvider
11
{
12
protected
const
ENTITY_ID
=
'bizproc-automation-template'
;
13
protected
const
TAB_ID
=
'automation-templates'
;
14
15
public
function
__construct
(array
$options
= [])
16
{
17
parent::__construct(
$options
);
18
$this->options = [];
19
}
20
21
protected
function
addTemplatesTab
(
Dialog
$dialog): void
22
{
23
$icon =
24
'data:image/svg+xml,%3Csvg width=%2224%22 height=%2224%22 viewBox=%220 0 24 24%22 fill=%22none%22'
25
.
' xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath'
26
.
' d=%22M16.9255 8.09465L17.7877 5.19898C17.8629 4.94722 17.7995 4.67404 17.6215 4.48235C17.4435'
27
.
' 4.29066 17.1779 4.20958 16.9248 4.26966C16.6717 4.32973 16.4695 4.52183 16.3944 4.77359L15.6559'
28
.
' 7.25933C13.36 6.04719 10.6225 6.05007 8.32912 7.26705L7.58698 4.77359C7.47085 4.3844 7.0648 4.16413'
29
.
' 6.68004 4.28159C6.29529 4.39906 6.07752 4.80979 6.19365 5.19898L7.05948 8.10606C5.11513 9.67809 3.98597'
30
.
' 12.0615 3.99271 14.5793C3.99271 19.1232 7.57607 18.0082 11.9998 18.0082C16.4235 18.0082 20.0069'
31
.
' 19.1232 20.0069 14.5793C20.0147 12.0547 18.8794 9.6655 16.9255 8.09465ZM11.9925 13.9615C8.83473'
32
.
' 13.9615 6.27363 14.2927 6.27363 12.9389C6.27363 11.5851 8.83473 10.4859 11.9925 10.4859C15.1502'
33
.
' 10.4859 17.7149 11.584 17.7149 12.9389C17.7149 14.2938 15.1538 13.9615 11.9925 13.9615ZM9.37673'
34
.
' 11.4998C8.9259 11.5831 8.61713 12.0071 8.67215 12.4673C8.72717 12.9276 9.12694 13.2649 9.58441'
35
.
' 13.2371C10.0419 13.2093 10.3988 12.826 10.399 12.3624C10.3479 11.8409 9.89305 11.4571 9.37673'
36
.
' 11.4998ZM13.9023 12.4699C13.9583 12.93 14.3586 13.2666 14.8161 13.2383C15.2736 13.2099 15.6303'
37
.
' 12.8263 15.6303 12.3627C15.5792 11.8397 15.1221 11.4553 14.6044 11.5001C14.1538 11.5849 13.8462'
38
.
' 12.0097 13.9023 12.4699Z%22 fill=%22%23525C69%22/%3E%3C/svg%3E%0A'
39
;
40
41
$dialog->
addTab
(
new
Tab
([
42
'id'
=> static::TAB_ID,
43
'title'
=>
Loc::getMessage
(
'BIZPROC_ENTITY_SELECTOR_TEMPLATES_TAB_AUTOMATION_TEMPLATES_TITLE'
),
44
'itemOrder'
=> [
'sort'
=>
'asc nulls last'
],
45
'stub'
=>
true
,
46
'icon'
=> [
47
'default'
=> $icon,
// /bitrix/js/ui/icon-set/main/images/robot.svg
48
'selected'
=> str_replace(
'525C69'
,
'fff'
, $icon),
49
],
// todo
50
]));
51
}
52
53
protected
function
getDefaultTemplateFilter
():
ConditionTree
54
{
55
return
(
56
\
Bitrix
\Main\ORM\
Query
\Query::filter()
57
->where(
'ACTIVE'
,
'Y'
)
58
->where(
'AUTO_EXECUTE'
, \CBPDocumentEventType::Automation)
59
);
60
}
61
}
Bitrix\Bizproc\Integration\UI\EntitySelector\AutomationTemplateProvider
Definition
automationtemplateprovider.php:11
Bitrix\Bizproc\Integration\UI\EntitySelector\AutomationTemplateProvider\__construct
__construct(array $options=[])
Definition
automationtemplateprovider.php:15
Bitrix\Bizproc\Integration\UI\EntitySelector\AutomationTemplateProvider\ENTITY_ID
const ENTITY_ID
Definition
automationtemplateprovider.php:12
Bitrix\Bizproc\Integration\UI\EntitySelector\AutomationTemplateProvider\getDefaultTemplateFilter
getDefaultTemplateFilter()
Definition
automationtemplateprovider.php:53
Bitrix\Bizproc\Integration\UI\EntitySelector\AutomationTemplateProvider\TAB_ID
const TAB_ID
Definition
automationtemplateprovider.php:13
Bitrix\Bizproc\Integration\UI\EntitySelector\AutomationTemplateProvider\addTemplatesTab
addTemplatesTab(Dialog $dialog)
Definition
automationtemplateprovider.php:21
Bitrix\Bizproc\Integration\UI\EntitySelector\TemplateProvider
Definition
templateprovider.php:18
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Query\Filter\ConditionTree
Definition
conditiontree.php:28
Bitrix\Main\ORM\Query\Query
Definition
query.php:118
Bitrix\UI\EntitySelector\BaseProvider\$options
$options
Definition
baseprovider.php:6
Bitrix\UI\EntitySelector\Dialog
Definition
dialog.php:10
Bitrix\UI\EntitySelector\Dialog\addTab
addTab(Tab $tab)
Definition
dialog.php:235
Bitrix\UI\EntitySelector\Tab
Definition
tab.php:5
Bitrix\Bizproc\Integration\UI\EntitySelector
Definition
automationtemplateprovider.php:3
Bitrix
modules
bizproc
lib
integration
ui
entityselector
automationtemplateprovider.php
Создано системой
1.10.0