24 $runtime = \CBPRuntime::GetRuntime();
25 $runtime->StartRuntime();
26 $documentService = $runtime->GetService(
"DocumentService");
28 [$moduleId, $entity, $documentType] = \CBPHelper::ParseDocumentId($parameterDocumentType);
29 $documentCaption = $documentService->getDocumentTypeCaption($parameterDocumentType);
32 $names[
'GLOBAL'] = \Bitrix\Main\Localization\Loc::getMessage(
33 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_GLOBAL'
36 switch (mb_strtoupper($moduleId))
39 $moduleVisibility = \Bitrix\Main\Localization\Loc::getMessage(
40 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE',
41 [
'#MODULE#' => mb_strtoupper($moduleId)]
43 $documentVisibility = \Bitrix\Main\Localization\Loc::getMessage(
44 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_DOCUMENT_PROCESS',
45 [
'#PROCESS#' => $documentCaption]
49 $moduleVisibility = \Bitrix\Main\Localization\Loc::getMessage(
50 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE',
51 [
'#MODULE#' => mb_strtoupper($moduleId)]
53 $documentVisibility = \Bitrix\Main\Localization\Loc::getMessage(
54 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_DOCUMENT_SECTION',
55 [
'#SECTION#' => $documentCaption]
59 $moduleVisibility =
'';
60 $documentVisibility =
'';
63 if (!$moduleVisibility)
68 $names[mb_strtoupper($moduleId)] = $moduleVisibility;
69 $names[mb_strtoupper($moduleId) .
'_' . mb_strtoupper($documentType)] = $documentVisibility;
80 public static function saveAll(array $all): bool
82 $diff = array_diff(array_keys(static::getAll()), array_keys($all));
84 foreach ($all as $id => $property)
86 if (!isset($property[
'Changed']) || \CBPHelper::getBool($property[
'Changed']) ===
true)
88 static::upsert($id, $property);
94 foreach ($diff as $toDelete)
96 static::delete($toDelete);
100 static::clearStaticCache(self::getCacheId());