Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/bizproc/lib/workflow/type/ |
Upload File : |
<?php namespace Bitrix\Bizproc\Workflow\Type; class GlobalVar extends GlobalsManager { protected static function getTableEntity(): string { return \Bitrix\Bizproc\Workflow\Type\Entity\GlobalVarTable::class; } protected static function getCacheId(): string { return 'variable'; } public static function getObjectNameForExpressions(): string { return 'GlobalVar'; } public static function getVisibilityFullNames(array $parameterDocumentType): array { $runtime = \CBPRuntime::GetRuntime(); $runtime->StartRuntime(); $documentService = $runtime->GetService("DocumentService"); [$moduleId, $entity, $documentType] = \CBPHelper::ParseDocumentId($parameterDocumentType); $documentCaption = $documentService->getDocumentTypeCaption($parameterDocumentType); $names = []; $names['GLOBAL'] = \Bitrix\Main\Localization\Loc::getMessage( 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_GLOBAL' ); switch (mb_strtoupper($moduleId)) { case 'RPA': $moduleVisibility = \Bitrix\Main\Localization\Loc::getMessage( 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE', ['#MODULE#' => mb_strtoupper($moduleId)] ); $documentVisibility = \Bitrix\Main\Localization\Loc::getMessage( 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_DOCUMENT_PROCESS', ['#PROCESS#' => $documentCaption] ); break; case 'CRM': $moduleVisibility = \Bitrix\Main\Localization\Loc::getMessage( 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_MODULE', ['#MODULE#' => mb_strtoupper($moduleId)] ); $documentVisibility = \Bitrix\Main\Localization\Loc::getMessage( 'BIZPROC_LIB_WF_TYPE_GLOBAL_VAR_VISIBILITY_FULL_DOCUMENT_SECTION', ['#SECTION#' => $documentCaption] ); break; default: $moduleVisibility = ''; $documentVisibility = ''; } if (!$moduleVisibility) { return $names; } $names[mb_strtoupper($moduleId)] = $moduleVisibility; $names[mb_strtoupper($moduleId) . '_' . mb_strtoupper($documentType)] = $documentVisibility; return $names; } /** * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\ObjectPropertyException * @throws \Bitrix\Main\SystemException * @throws \Exception */ public static function saveAll(array $all): bool { $diff = array_diff(array_keys(static::getAll()), array_keys($all)); foreach ($all as $id => $property) { if (!isset($property['Changed']) || \CBPHelper::getBool($property['Changed']) === true) { static::upsert($id, $property); } } if ($diff) { foreach ($diff as $toDelete) { static::delete($toDelete); } } static::clearStaticCache(self::getCacheId()); return true; } }