From adbd1fcacae5ebb27bb022c7977bc3699b13fdb8 Mon Sep 17 00:00:00 2001 From: Jesper Schulz-Wedde Date: Tue, 10 Dec 2024 10:04:43 +0100 Subject: [PATCH] Bug 560051: New "Allowed Languages" page is missing permissions and some fit and finish (#2481) #### Summary - Adds missing permission. Everyone should be able to read "Allowed Languages" - Add a notification to the Languages page, if the view is filtered - Updates a few strings - Adds action to reach the Allowed Languages from the UI (Languages page) #### Work Item(s) Fixes [AB#560051](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/560051) --- .../App/Language/src/AllowedLanguage.Table.al | 4 ++-- .../App/Language/src/AllowedLanguages.Page.al | 9 +++---- .../App/Language/src/LanguageImpl.Codeunit.al | 24 +++++++++++++++++++ .../App/Language/src/Languages.Page.al | 17 ++++++++++--- .../App/Language/src/WindowsLanguages.Page.al | 8 +++++-- 5 files changed, 51 insertions(+), 11 deletions(-) diff --git a/src/System Application/App/Language/src/AllowedLanguage.Table.al b/src/System Application/App/Language/src/AllowedLanguage.Table.al index 3535acb412..3d691f855c 100644 --- a/src/System Application/App/Language/src/AllowedLanguage.Table.al +++ b/src/System Application/App/Language/src/AllowedLanguage.Table.al @@ -13,8 +13,8 @@ table 3563 "Allowed Language" Caption = 'Allowed Language'; DataClassification = SystemMetadata; DataPerCompany = false; - InherentEntitlements = X; - InherentPermissions = X; + InherentEntitlements = RX; + InherentPermissions = RX; fields { diff --git a/src/System Application/App/Language/src/AllowedLanguages.Page.al b/src/System Application/App/Language/src/AllowedLanguages.Page.al index be15edce17..fb2c90d505 100644 --- a/src/System Application/App/Language/src/AllowedLanguages.Page.al +++ b/src/System Application/App/Language/src/AllowedLanguages.Page.al @@ -18,8 +18,7 @@ page 3563 "Allowed Languages" HelpLink = 'https://go.microsoft.com/fwlink/?linkid=2149387'; AdditionalSearchTerms = 'company,role center,role,language'; AboutTitle = 'About allowed languages.'; - AboutText = 'Define a list of allowed languages which is enabled for this environment. If nothing is specified, then the user will be able to use all available languages.'; - Permissions = tabledata "Allowed Language" = r; + AboutText = 'Define a list of allowed languages which are enabled in this environment. If nothing is specified, the user will be able to select from all languages.'; layout { @@ -28,9 +27,11 @@ page 3563 "Allowed Languages" repeater(AllowedLanguages) { field("Language Id"; Rec."Language Id") - { } + { + } field(Language; Rec.Language) - { } + { + } } } } diff --git a/src/System Application/App/Language/src/LanguageImpl.Codeunit.al b/src/System Application/App/Language/src/LanguageImpl.Codeunit.al index bbba4693bd..d9573a50f9 100644 --- a/src/System Application/App/Language/src/LanguageImpl.Codeunit.al +++ b/src/System Application/App/Language/src/LanguageImpl.Codeunit.al @@ -29,6 +29,9 @@ codeunit 54 "Language Impl." LanguageIdOverrideMsg: Label 'LanguageIdOverride has been applied in GetLanguageIdOrDefault. The new Language Id is %1.', Comment = '%1 - Language ID'; FormatRegionOverrideMsg: Label 'FormatRegionOverride has been applied in GetFormatRegionOrDefault. The new FormatRegion is %1.', Comment = '%1 - Format Region'; LanguageCategoryTxt: Label 'Language'; + NotificationAllowedLanguagesLbl: Label '2c2bd28b-926c-47a7-bbc4-cf76f8173549', Locked = true; + NotificationAllowedLanguagesMessageLbl: Label 'This list of languages has been filtered by your administrator.'; + ReadMoreLbl: Label 'Read more'; procedure GetUserLanguageCode() UserLanguageCode: Code[10] var @@ -349,6 +352,27 @@ codeunit 54 "Language Impl." exit(CultureInfo.CurrentCulture.Name); end; + procedure ShowAllowedLanguagesNotification() + var + AllowedLanguage: Record "Allowed Language"; + Notification: Notification; + NotificationGuid: Guid; + begin + if AllowedLanguage.IsEmpty() then + exit; + + NotificationGuid := NotificationAllowedLanguagesLbl; + Notification.Id(NotificationGuid); + Notification.Message(NotificationAllowedLanguagesMessageLbl); + Notification.AddAction(ReadMoreLbl, Codeunit::"Language Impl.", 'OpenReadMore'); + Notification.Send(); + end; + + procedure OpenReadMore(Notification: Notification) + begin + Hyperlink('https://go.microsoft.com/fwlink/?linkid=2299275'); + end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"UI Helper Triggers", GetApplicationLanguage, '', false, false)] local procedure SetApplicationLanguageId(var language: Integer) begin diff --git a/src/System Application/App/Language/src/Languages.Page.al b/src/System Application/App/Language/src/Languages.Page.al index 6f673b8dc0..f2ecc03462 100644 --- a/src/System Application/App/Language/src/Languages.Page.al +++ b/src/System Application/App/Language/src/Languages.Page.al @@ -50,7 +50,18 @@ page 9 Languages } } } - + actions + { + area(Navigation) + { + action(ShowAllowedLanguagesNotification) + { + ApplicationArea = All; + Caption = 'Allowed Languages'; + ToolTip = 'Shows the list of allowed languages for this environment.'; + RunObject = Page "Allowed Languages"; + Image = Language; + } + } + } } - - diff --git a/src/System Application/App/Language/src/WindowsLanguages.Page.al b/src/System Application/App/Language/src/WindowsLanguages.Page.al index 7f4a3fb957..0543808ce0 100644 --- a/src/System Application/App/Language/src/WindowsLanguages.Page.al +++ b/src/System Application/App/Language/src/WindowsLanguages.Page.al @@ -45,6 +45,10 @@ page 535 "Windows Languages" } } + trigger OnOpenPage() + var + LanguageImpl: Codeunit "Language Impl."; + begin + LanguageImpl.ShowAllowedLanguagesNotification(); + end; } - -