1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
globalconst.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Bizproc\Workflow\Type;
4
5
class
GlobalConst
extends
GlobalsManager
6
{
7
const
CONF_NAME
=
'global_const'
;
8
9
protected
static
function
getTableEntity
(): string
10
{
11
return \Bitrix\Bizproc\Workflow\Type\Entity\GlobalConstTable::class;
12
}
13
14
protected
static
function
getCacheId
(): string
15
{
16
return
'constant'
;
17
}
18
19
public
static
function
getObjectNameForExpressions
(): string
20
{
21
return
'GlobalConst'
;
22
}
23
24
public
static
function
getVisibilityFullNames
(
array
$parameterDocumentType):
array
25
{
26
$runtime = \CBPRuntime::GetRuntime();
27
$runtime->StartRuntime();
28
$documentService = $runtime->GetService(
"DocumentService"
);
29
30
[
$moduleId
,
$entity
, $documentType] = \CBPHelper::ParseDocumentId($parameterDocumentType);
31
$documentCaption = $documentService->getDocumentTypeCaption($parameterDocumentType);
32
33
$names = [];
34
$names[
'GLOBAL'
] =
\Bitrix\Main\Localization\Loc::getMessage
(
35
'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_GLOBAL'
36
);
37
38
switch
(mb_strtoupper(
$moduleId
))
39
{
40
case
'CRM'
:
41
$moduleVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
42
'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_MODULE'
,
43
[
'#MODULE#'
=> mb_strtoupper(
$moduleId
)]
44
);
45
$documentVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
46
'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_DOCUMENT_SECTION'
,
47
[
'#SECTION#'
=> $documentCaption]
48
);
49
break
;
50
case
'RPA'
:
51
$moduleVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
52
'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_MODULE'
,
53
[
'#MODULE#'
=> mb_strtoupper(
$moduleId
)]
54
);
55
$documentVisibility =
\Bitrix\Main\Localization\Loc::getMessage
(
56
'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_DOCUMENT_PROCESS'
,
57
[
'#PROCESS#'
=> $documentCaption]
58
);
59
break
;
60
default
:
61
$moduleVisibility =
''
;
62
$documentVisibility =
''
;
63
}
64
65
if
(!$moduleVisibility)
66
{
67
return
$names;
68
}
69
70
$names[mb_strtoupper(
$moduleId
)] = $moduleVisibility;
71
$names[mb_strtoupper(
$moduleId
) .
'_'
. mb_strtoupper($documentType)] = $documentVisibility;
72
73
return
$names;
74
}
75
76
public
static
function
saveAll
(
array
$all,
int
$userId
=
null
)
77
{
78
$diff = array_diff(array_keys(static::getAll()), array_keys($all));
79
80
foreach
($all as $id => $property)
81
{
82
Entity\GlobalConstTable::upsertByProperty
($id, $property,
$userId
);
83
}
84
85
if
($diff)
86
{
87
foreach
($diff as $toDelete)
88
{
89
Entity\GlobalConstTable::delete
($toDelete);
90
}
91
}
92
93
//clear cache
94
static::clearStaticCache(self::getCacheId());
95
96
return
true
;
97
}
98
}
$userId
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения
check_mail.php:18
Bitrix\Bizproc\Workflow\Type\Entity\GlobalConstTable\upsertByProperty
static upsertByProperty($constId, array $property, int $userId=null)
Определения
globalconst.php:127
Bitrix\Bizproc\Workflow\Type\GlobalConst
Определения
globalconst.php:6
Bitrix\Bizproc\Workflow\Type\GlobalConst\getTableEntity
static getTableEntity()
Определения
globalconst.php:9
Bitrix\Bizproc\Workflow\Type\GlobalConst\saveAll
static saveAll(array $all, int $userId=null)
Определения
globalconst.php:76
Bitrix\Bizproc\Workflow\Type\GlobalConst\getObjectNameForExpressions
static getObjectNameForExpressions()
Определения
globalconst.php:19
Bitrix\Bizproc\Workflow\Type\GlobalConst\getVisibilityFullNames
static getVisibilityFullNames(array $parameterDocumentType)
Определения
globalconst.php:24
Bitrix\Bizproc\Workflow\Type\GlobalConst\getCacheId
static getCacheId()
Определения
globalconst.php:14
Bitrix\Bizproc\Workflow\Type\GlobalConst\CONF_NAME
const CONF_NAME
Определения
globalconst.php:7
Bitrix\Bizproc\Workflow\Type\GlobalsManager
Определения
globalsmanager.php:10
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Определения
loc.php:30
Bitrix\Main\ORM\Data\DataManager\delete
static delete($primary)
Определения
datamanager.php:1644
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
globalconst.php
Создано системой
1.14.0