26 $runtime = \CBPRuntime::GetRuntime();
27 $runtime->StartRuntime();
28 $documentService = $runtime->GetService(
"DocumentService");
30 [$moduleId, $entity, $documentType] = \CBPHelper::ParseDocumentId($parameterDocumentType);
31 $documentCaption = $documentService->getDocumentTypeCaption($parameterDocumentType);
34 $names[
'GLOBAL'] = \Bitrix\Main\Localization\Loc::getMessage(
35 'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_GLOBAL'
38 switch (mb_strtoupper($moduleId))
41 $moduleVisibility = \Bitrix\Main\Localization\Loc::getMessage(
42 'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_MODULE',
43 [
'#MODULE#' => mb_strtoupper($moduleId)]
45 $documentVisibility = \Bitrix\Main\Localization\Loc::getMessage(
46 'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_DOCUMENT_SECTION',
47 [
'#SECTION#' => $documentCaption]
51 $moduleVisibility = \Bitrix\Main\Localization\Loc::getMessage(
52 'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_MODULE',
53 [
'#MODULE#' => mb_strtoupper($moduleId)]
55 $documentVisibility = \Bitrix\Main\Localization\Loc::getMessage(
56 'BIZPROC_LIB_WF_TYPE_GLOBAL_CONST_VISIBILITY_FULL_DOCUMENT_PROCESS',
57 [
'#PROCESS#' => $documentCaption]
61 $moduleVisibility =
'';
62 $documentVisibility =
'';
65 if (!$moduleVisibility)
70 $names[mb_strtoupper($moduleId)] = $moduleVisibility;
71 $names[mb_strtoupper($moduleId) .
'_' . mb_strtoupper($documentType)] = $documentVisibility;
76 public static function saveAll(array $all,
int $userId =
null)
78 $diff = array_diff(array_keys(static::getAll()), array_keys($all));
80 foreach ($all as $id => $property)
82 Entity\GlobalConstTable::upsertByProperty($id, $property, $userId);
87 foreach ($diff as $toDelete)
89 Entity\GlobalConstTable::delete($toDelete);
94 static::clearStaticCache(self::getCacheId());