1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
globalvar.php
См. документацию.
1<?php
2
3namespace Bitrix\Bizproc\Workflow\Type;
4
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 = [];
33 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_GLOBAL'
34 );
35
36 switch (mb_strtoupper($moduleId))
37 {
38 case 'RPA':
40 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE',
41 ['#MODULE#' => mb_strtoupper($moduleId)]
42 );
44 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_DOCUMENT_PROCESS',
45 ['#PROCESS#' => $documentCaption]
46 );
47 break;
48 case 'CRM':
50 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE',
51 ['#MODULE#' => mb_strtoupper($moduleId)]
52 );
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}
static getTableEntity()
Определения globalvar.php:7
static getObjectNameForExpressions()
Определения globalvar.php:17
static saveAll(array $all)
Определения globalvar.php:80
static getVisibilityFullNames(array $parameterDocumentType)
Определения globalvar.php:22
static getMessage($code, $replace=null, $language=null)
Определения loc.php:30
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$entity
$moduleId