Skip to content

Commit

Permalink
Merge pull request #1638 from vkislitsin/develop
Browse files Browse the repository at this point in the history
ПодготовкаИЗагрузкаДанных: выбор по ссылкам объектов расширений
  • Loading branch information
Pr-Mex committed Jun 7, 2022
2 parents a8bd792 + 7143a8e commit 2f8ec24
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
Expand Up @@ -864,11 +864,7 @@
<v8:content>Объект</v8:content>
</v8:item>
</Title>
<Type>
<v8:TypeSet>cfg:DocumentRef</v8:TypeSet>
<v8:TypeSet>cfg:ChartOfCharacteristicTypesRef</v8:TypeSet>
<v8:TypeSet>cfg:CatalogRef</v8:TypeSet>
</Type>
<Type/>
</Column>
<Column name="IncludeDownstreamDependencies" id="2">
<Title>
Expand Down
Expand Up @@ -54,6 +54,38 @@ Function ПолучитьМакетОбработки(Val TemplateName) Export
Return GetTemplateAtServer(TemplateName);
EndFunction

&AtServer
Procedure SetAttributTypes()

TypesArray = New Array;

MetadataTypeMap = GetMetadataTypeMap();

For Each MetadataTypeItem In MetadataTypeMap Do
For Each MetadataObj In Metadata[MetadataTypeItem.Key] Do
TypesArray.add(StrTemplate("%1.%2", MetadataTypeItem.Value, MetadataObj.Name));
EndDo;
EndDo;

DataRefsTypeRestriction = New TypeDescription(StrConcat(TypesArray, ","));

Items.DataRefsRef.TypeRestriction = DataRefsTypeRestriction;

EndProcedure

&AtServer
Function GetMetadataTypeMap()

MetadataTypeMap = New Map;

MetadataTypeMap.Insert("Catalogs", "CatalogRef");
MetadataTypeMap.Insert("Documents", "DocumentRef");
MetadataTypeMap.Insert("ChartsOfCharacteristicTypes", "ChartOfCharacteristicTypesRef");

Return MetadataTypeMap;

EndFunction

#EndRegion

#Region WorkWithScenarious
Expand Down Expand Up @@ -805,6 +837,7 @@ EndProcedure
Procedure OnCreateAtServer(Cancel, StandardProcessing)

MaxDownstreamDependenciesHierarchyLevel = 1;
SetAttributTypes();

EndProcedure

Expand Down

0 comments on commit 2f8ec24

Please sign in to comment.