1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
globalvar.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Bizproc\Workflow\Type;
4
5
class
GlobalVar
extends
GlobalsManager
6
{
7
protected
static
function
getTableEntity
(): string
8
{
9
return \Bitrix\Bizproc\Workflow\Type\Entity\GlobalVarTable::class;
10
}
11
12
protected
static
function
getCacheId
(): string
13
{
14
return
'variable'
;
15
}
16
17
public
static
function
getObjectNameForExpressions
(): string
18
{
19
return
'GlobalVar'
;
20
}
21
22
public
static
function
getVisibilityFullNames
(
array
$parameterDocumentType):
array
23
{
24
$runtime = \CBPRuntime::GetRuntime();
25
$runtime->StartRuntime();
26
$documentService = $runtime->GetService(
"DocumentService"
);
27
28
[
$moduleId
,
$entity
, $documentType] = \CBPHelper::ParseDocumentId($parameterDocumentType);
29
$documentCaption = $documentService->getDocumentTypeCaption($parameterDocumentType);
30
31
$names = [];
32
$names[
'GLOBAL'
] =
\Bitrix\Main\Localization\Loc::getMessage
(
33
'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_GLOBAL'
34
);
35
36
switch
(mb_strtoupper(
$moduleId
))
37
{
38
case
'RPA'
:
39
$moduleVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
40
'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE'
,
41
[
'#MODULE#'
=> mb_strtoupper(
$moduleId
)]
42
);
43
$documentVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
44
'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_DOCUMENT_PROCESS'
,
45
[
'#PROCESS#'
=> $documentCaption]
46
);
47
break
;
48
case
'CRM'
:
49
$moduleVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
50
'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE'
,
51
[
'#MODULE#'
=> mb_strtoupper(
$moduleId
)]
52
);
53
$documentVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
54
'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_DOCUMENT_SECTION'
,
55
[
'#SECTION#'
=> $documentCaption]
56
);
57
break
;
58
default
:
59
$moduleVisibility =
''
;
60
$documentVisibility =
''
;
61
}
62
63
if
(!$moduleVisibility)
64
{
65
return
$names;
66
}
67
68
$names[mb_strtoupper(
$moduleId
)] = $moduleVisibility;
69
$names[mb_strtoupper(
$moduleId
) .
'_'
. mb_strtoupper($documentType)] = $documentVisibility;
70
71
return
$names;
72
}
73
80
public
static
function
saveAll
(
array
$all): bool
81
{
82
$diff = array_diff(array_keys(static::getAll()), array_keys($all));
83
84
foreach
($all as $id => $property)
85
{
86
if
(!isset($property[
'Changed'
]) || \CBPHelper::getBool($property[
'Changed'
]) ===
true
)
87
{
88
static::upsert($id, $property);
89
}
90
}
91
92
if
($diff)
93
{
94
foreach
($diff as $toDelete)
95
{
96
static::delete($toDelete);
97
}
98
}
99
100
static::clearStaticCache(self::getCacheId());
101
102
return
true
;
103
}
104
}
Bitrix\Bizproc\Workflow\Type\GlobalVar
Определения
globalvar.php:6
Bitrix\Bizproc\Workflow\Type\GlobalVar\getTableEntity
static getTableEntity()
Определения
globalvar.php:7
Bitrix\Bizproc\Workflow\Type\GlobalVar\getObjectNameForExpressions
static getObjectNameForExpressions()
Определения
globalvar.php:17
Bitrix\Bizproc\Workflow\Type\GlobalVar\saveAll
static saveAll(array $all)
Определения
globalvar.php:80
Bitrix\Bizproc\Workflow\Type\GlobalVar\getVisibilityFullNames
static getVisibilityFullNames(array $parameterDocumentType)
Определения
globalvar.php:22
Bitrix\Bizproc\Workflow\Type\GlobalVar\getCacheId
static getCacheId()
Определения
globalvar.php:12
Bitrix\Bizproc\Workflow\Type\GlobalsManager
Определения
globalsmanager.php:10
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Определения
loc.php:30
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
$moduleId
$moduleId
Определения
group_bizproc_workflow_delete.php:16
bitrix
modules
bizproc
lib
workflow
type
globalvar.php
Создано системой
1.14.0