Skip to content

Commit

Permalink
Translate
Browse files Browse the repository at this point in the history
  • Loading branch information
DitriXNew committed Aug 1, 2024
1 parent 2f0bc05 commit 4c04e54
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 10 deletions.
62 changes: 62 additions & 0 deletions IRP/src/CommonForms/EditUserSettings/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,68 @@ Function GetAdditionalSettings(RowOwner, TableOfSettings)

RowOwner.Rows.Add(NewRow_PointOfSales);

/////////////////////////
// Additional settings for Attached files to documents control
FullName = "DataProcessor.AttachedFilesToDocumentsControl.AdditionalSettings";

NewRow_AttachedFilesToDocumentsControl = New Structure();
NewRow_AttachedFilesToDocumentsControl.Insert("FullName" , FullName);
NewRow_AttachedFilesToDocumentsControl.Insert("Name" , "AttachedFilesToDocumentsControl");
NewRow_AttachedFilesToDocumentsControl.Insert("Synonym" , R().Add_Settings_013);
NewRow_AttachedFilesToDocumentsControl.Insert("PictureIndex" , 11);
NewRow_AttachedFilesToDocumentsControl.Insert("Rows" , New Array());

// change filters
NewSetting = New Structure();
NewSetting.Insert("Name", "EnableChangeFilters");
NewSetting.Insert("FullName", FullName + ".EnableChangeFilters");
NewSetting.Insert("Synonym" , R().Add_Settings_014);
NewSetting.Insert("KindOfAttribute", Enums.KindsOfAttributes.AdditionalSetting);
NewSetting.Insert("TypeRestriction", New TypeDescription("Boolean"));
NewSetting.Insert("SettingID" , New UUID());
NewSetting.Insert("PictureIndex" , 12);
NewRow_AttachedFilesToDocumentsControl.Rows.Add(NewSetting);
AddRowToTableOfSettings(TableOfSettings, NewSetting.FullName, NewSetting.Name, NewSetting.SettingID);

// check mode
NewSetting = New Structure();
NewSetting.Insert("Name", "EnableCheckMode");
NewSetting.Insert("FullName", FullName + ".EnableCheckMode");
NewSetting.Insert("Synonym" , R().Add_Settings_015);
NewSetting.Insert("KindOfAttribute", Enums.KindsOfAttributes.AdditionalSetting);
NewSetting.Insert("TypeRestriction", New TypeDescription("Boolean"));
NewSetting.Insert("SettingID" , New UUID());
NewSetting.Insert("PictureIndex" , 12);
NewRow_AttachedFilesToDocumentsControl.Rows.Add(NewSetting);
AddRowToTableOfSettings(TableOfSettings, NewSetting.FullName, NewSetting.Name, NewSetting.SettingID);

//Company
NewSetting = New Structure();
NewSetting.Insert("Name", "Company");
NewSetting.Insert("FullName", FullName + ".Company");
NewSetting.Insert("Synonym" , R().Add_Settings_016);
NewSetting.Insert("KindOfAttribute", Enums.KindsOfAttributes.AdditionalSetting);
NewSetting.Insert("TypeRestriction", New TypeDescription("CatalogRef.Companies"));
NewSetting.Insert("SettingID" , New UUID());
NewSetting.Insert("PictureIndex" , 3);
NewRow_AttachedFilesToDocumentsControl.Rows.Add(NewSetting);
AddRowToTableOfSettings(TableOfSettings, NewSetting.FullName, NewSetting.Name, NewSetting.SettingID);

//Branch
NewSetting = New Structure();
NewSetting.Insert("Name", "Branch");
NewSetting.Insert("FullName", FullName + ".Branch");
NewSetting.Insert("Synonym" , R().Add_Settings_017);
NewSetting.Insert("KindOfAttribute", Enums.KindsOfAttributes.AdditionalSetting);
NewSetting.Insert("TypeRestriction", New TypeDescription("CatalogRef.BusinessUnits"));
NewSetting.Insert("SettingID" , New UUID());
NewSetting.Insert("PictureIndex" , 3);
NewRow_AttachedFilesToDocumentsControl.Rows.Add(NewSetting);
AddRowToTableOfSettings(TableOfSettings, NewSetting.FullName, NewSetting.Name, NewSetting.SettingID);

RowOwner.Rows.Add(NewRow_AttachedFilesToDocumentsControl);
//

// Additional settings for all documents
FullName = "Documents.AllDocuments.AdditionalSettings";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Function GetQuery(DocName) Export

If MetaDoc.TabularSections.Find("AddAttributes") = Undefined Then
Result.Tables.Insert("AddAttributes", TmplDoc.AddAttributes.Unload());
Result.AddParameres.Insert("AddAttributesRef", Catalogs.AddAttributeAndPropertySets.EmptyRef());
Result.AddParameres.Insert("AddAttributesSetRef", Catalogs.AddAttributeAndPropertySets.EmptyRef());
Else
Result.Tables.Insert("AddAttributes", Undefined);
ErrorsArray.Add(ErrorWithAddAttributes());
Expand Down
15 changes: 15 additions & 0 deletions IRP/src/CommonModules/Localization/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -2657,6 +2657,21 @@ Function Strings(Lang) Export
Strings.Insert("Add_Setiings_012", NStr("en='Enable - Change price type';
|ru='Включить - Изменить тип цены';
|tr='Etkinleştir - Fiyat tipi değiştir'", Lang));
Strings.Insert("Add_Settings_013", NStr("en='Attached files to documents control';
|ru='Прикрепленные файлы для контроля документов';
|tr='Evrek denetimi için eklenen dosyalar'", Lang));
Strings.Insert("Add_Settings_014", NStr("en='Enable - Change filters';
|ru='Включить - Изменить фильтры';
|tr='Enable - Change filters'", Lang));
Strings.Insert("Add_Settings_015", NStr("en='Enable - Check-mode';
|ru='Включить - Режим проверки';
|tr='Enable - Check-mode'", Lang));
Strings.Insert("Add_Settings_016", NStr("en='Company';
|ru='Организация';
|tr='Şirket'", Lang));
Strings.Insert("Add_Settings_017", NStr("en='Branch';
|ru='Структурное подразделение';
|tr='Şube'", Lang));
#EndRegion

#Region Mobile
Expand Down
36 changes: 36 additions & 0 deletions IRP/src/CommonModules/UserSettingsServer/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,42 @@ Function LinkedDocumets_Settings_UseReverseTree(val User = Undefined) Export
Return False;
EndFunction

Function AttachedFilesToDocumentsControl_AdditionalSettings_EnableChangeFilters(val User) Export
Value = GetUserSettings(User, New Structure("MetadataObject",
"DataProcessor.AttachedFilesToDocumentsControl.AdditionalSettings.EnableChangeFilters"));
If Value.Count() Then
Return Value[0].Value;
EndIf;
Return False;
EndFunction

Function AttachedFilesToDocumentsControl_AdditionalSettings_EnableCheckMode(val User) Export
Value = GetUserSettings(User, New Structure("MetadataObject",
"DataProcessor.AttachedFilesToDocumentsControl.AdditionalSettings.EnableCheckMode"));
If Value.Count() Then
Return Value[0].Value;
EndIf;
Return False;
EndFunction

Function AttachedFilesToDocumentsControl_AdditionalSettings_CompanyFilter(val User) Export
Value = GetUserSettings(User, New Structure("MetadataObject",
"DataProcessor.AttachedFilesToDocumentsControl.AdditionalSettings.Company"));
If Value.Count() Then
Return Value[0].Value;
EndIf;
Return Catalogs.Companies.EmptyRef();
EndFunction

Function AttachedFilesToDocumentsControl_AdditionalSettings_BranchFilter(val User) Export
Value = GetUserSettings(User, New Structure("MetadataObject",
"DataProcessor.AttachedFilesToDocumentsControl.AdditionalSettings.Branch"));
If Value.Count() Then
Return Value[0].Value;
EndIf;
Return Catalogs.BusinessUnits.EmptyRef();
EndFunction

#EndRegion

Function GetPredefinedUserSettingNames() Export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)

Object.Period.StartDate = BegOfYear(CurrentSessionDate());
Object.Period.EndDate = EndOfYear(CurrentSessionDate());

FillDefaultSettings();
SetVisibilityAvailability();
FillDocumentsToControl();

EndProcedure
Expand Down Expand Up @@ -802,7 +801,7 @@ Procedure UpdateAttachedFiles(DocRef, RowID)
EndDo;
EndProcedure

&AtClıent
&AtClient
Function GetSelectedDocs()

DocsArray = New Array; // Array of DocumentRef
Expand Down Expand Up @@ -999,5 +998,35 @@ Procedure CurrentFilesTableSelection(Item, SelectedRow, Field, StandardProcessin

EndProcedure

&AtServer
Procedure FillDefaultSettings()
CurrentUser = SessionParameters.CurrentUser;

Object.Period.StartDate = BegOfYear(CurrentSessionDate());
Object.Period.EndDate = EndOfYear(CurrentSessionDate());
Company = UserSettingsServer.AttachedFilesToDocumentsControl_AdditionalSettings_CompanyFilter(CurrentUser);
//@skip-check typed-value-adding-to-untyped-collection
Branch.Add(UserSettingsServer.AttachedFilesToDocumentsControl_AdditionalSettings_BranchFilter(CurrentUser));
EndProcedure

&AtServer
Procedure SetVisibilityAvailability()
CurrentUser = SessionParameters.CurrentUser;

EnableChangeFilters = UserSettingsServer.AttachedFilesToDocumentsControl_AdditionalSettings_EnableChangeFilters(CurrentUser);
EnableCheckMode = UserSettingsServer.AttachedFilesToDocumentsControl_AdditionalSettings_EnableCheckMode(CurrentUser);

ArrayFilterItems = New Array; //Array of String
ArrayFilterItems.Add("Company");
ArrayFilterItems.Add("Branch");

For Each ArrayItem In ArrayFilterItems Do
Items[ArrayItem].ReadOnly = Not EnableChangeFilters;
EndDo;

Items.CheckMode.Enabled = EnableCheckMode;

EndProcedure

#EndRegion

Original file line number Diff line number Diff line change
Expand Up @@ -8573,7 +8573,7 @@
</title>
<title>
<key>tr</key>
<value>Show vendor price</value>
<value>Tedarikçi fiyatı göster</value>
</title>
<id>20</id>
<toolTip>
Expand All @@ -8586,7 +8586,7 @@
</toolTip>
<toolTip>
<key>tr</key>
<value>Show vendor price</value>
<value>Tedarikçi fiyatı göster</value>
</toolTip>
<use>
<common>true</common>
Expand Down
6 changes: 3 additions & 3 deletions IRP/src/Documents/PurchaseOrder/Forms/DocumentForm/Form.form
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,7 @@
</title>
<title>
<key>tr</key>
<value>Show vendor price</value>
<value>Tedarikçi fiyatı göster</value>
</title>
<visible>true</visible>
<enabled>true</enabled>
Expand Down Expand Up @@ -7924,7 +7924,7 @@
</title>
<title>
<key>tr</key>
<value>Show vendor price</value>
<value>Tedarikçi fiyatı göster</value>
</title>
<id>13</id>
<toolTip>
Expand All @@ -7937,7 +7937,7 @@
</toolTip>
<toolTip>
<key>tr</key>
<value>Show vendor price</value>
<value>Tedarikçi fiyatı göster</value>
</toolTip>
<use>
<common>true</common>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ Scenario: _4001701 preparation (Attach Files Control)
And I select current line in "List" table
And I click "Save and close" button
And Delay 3
* User settings
Given I open hyperlink "e1cib/list/Catalog.Users"
And I go to line in "List" table
| 'Login' |
| 'CI' |
And I click "Settings" button
And I go to line in "MetadataTree" table
| "Group name" | "Use" |
| "Enable - Change filters" | "No" |
And I activate "Value" field in "MetadataTree" table
And I select current line in "MetadataTree" table
And I select "Yes" exact value from "Value" drop-down list in "MetadataTree" table
And I finish line editing in "MetadataTree" table
And I go to line in "MetadataTree" table
| "Group name" | "Use" |
| "Enable - Check-mode" | "No" |
And I select current line in "MetadataTree" table
And I select current line in "MetadataTree" table
And I select "Yes" exact value from "Value" drop-down list in "MetadataTree" table
And I finish line editing in "MetadataTree" table
And I go to line in "MetadataTree" table
| "Group name" | "Use" |
| "Company" | "No" |
And I select current line in "MetadataTree" table
And I select "Main Company" from "Value" drop-down list by string in "MetadataTree" table
And I finish line editing in "MetadataTree" table
And I click "Ok" button
And I close TestClient session
Given I open new TestClient session or connect the existing one

Expand Down Expand Up @@ -169,6 +196,7 @@ Scenario: _4001711 check mandatory documents for RRR (jpg)
And I close all client application windows
* Open AttachedFilesToDocumentsControl
And I open hyperlink "e1cib/app/DataProcessor.AttachedFilesToDocumentsControl"
And I click Clear button of the field named "Branch"
And I click Choice button of the field named "Period"
And I click "Clear period" button
And I input "01.01.2023" text in the field named "DateBegin"
Expand Down Expand Up @@ -210,6 +238,7 @@ Scenario: _4001713 check optional documents for RRR (pdf)
And I close all client application windows
* Open AttachedFilesToDocumentsControl
And I open hyperlink "e1cib/app/DataProcessor.AttachedFilesToDocumentsControl"
And I click Clear button of the field named "Branch"
And I click Choice button of the field named "Period"
And I click "Clear period" button
And I input "01.01.2023" text in the field named "DateBegin"
Expand Down Expand Up @@ -244,6 +273,7 @@ Scenario: _4001715 check Date, Company and Branch filters
And I close all client application windows
* Open AttachedFilesToDocumentsControl
And I open hyperlink "e1cib/app/DataProcessor.AttachedFilesToDocumentsControl"
And I click Clear button of the field named "Branch"
And I click Choice button of the field named "Period"
And I click "Clear period" button
And I input "01.01.2023" text in the field named "DateBegin"
Expand Down Expand Up @@ -313,6 +343,7 @@ Scenario: _4001720 check audit lock from AttachedFilesToDocumentsControl data pr
And I close all client application windows
* Open AttachedFilesToDocumentsControl
And I open hyperlink "e1cib/app/DataProcessor.AttachedFilesToDocumentsControl"
And I click Clear button of the field named "Branch"
And I click Choice button of the field named "Period"
And I click "Clear period" button
And I input "01.01.2023" text in the field named "DateBegin"
Expand Down

0 comments on commit 4c04e54

Please sign in to comment.