diff --git a/Shared/Core/EnumTranslations.cs b/Shared/Core/EnumTranslations.cs index ac920a697..1e9edb2da 100644 --- a/Shared/Core/EnumTranslations.cs +++ b/Shared/Core/EnumTranslations.cs @@ -630,15 +630,17 @@ namespace BS.Shared.Core dict.Add(UserRightType.AccountingTransactionView_Delete, Translator.Translate("Finanzen löschen")); dict.Add(UserRightType.AccountingTransactionView_Edit, Translator.Translate("Finanzen ändern")); dict.Add(UserRightType.AccountingTransactionView_View, Translator.Translate("Finanzen ansehen (alle)")); + dict.Add(UserRightType.AdministrationView_Create, Translator.Translate("Verwaltung anlegen")); dict.Add(UserRightType.AdministrationView_Delete, Translator.Translate("Verwaltung löschen")); dict.Add(UserRightType.AdministrationView_Edit, Translator.Translate("Verwaltung ändern")); dict.Add(UserRightType.AdministrationView_View, Translator.Translate("Verwaltung ansehen")); + dict.Add(UserRightType.CustomerView_Create, Translator.Translate("Klienten") + " anlegen"); dict.Add(UserRightType.CustomerView_Delete, Translator.Translate("Klienten") + " löschen"); - dict.Add(UserRightType.Customer_AllowArchiving, Translator.Translate("Klienten") + " archivieren"); dict.Add(UserRightType.CustomerView_Edit, Translator.Translate("Klienten") + " ändern"); dict.Add(UserRightType.CustomerView_View, Translator.Translate("Klienten") + " ansehen (alle)"); + dict.Add(UserRightType.Customer_AllowArchiving, Translator.Translate("Klienten") + " archivieren"); dict.Add(UserRightType.Customer_ViewMyCustomers, Translator.Translate("Klienten") + " ansehen (von " + Translator.Translate("MitarbeiterSingular") + " betreut)"); dict.Add(UserRightType.Customer_ViewMyTeams, Translator.Translate("Klienten") + " ansehen (von Teams betreut)"); dict.Add(UserRightType.Customer_ViewMedication, Translator.Translate("Klienten") + " Medikation ansehen"); @@ -647,26 +649,10 @@ namespace BS.Shared.Core dict.Add(UserRightType.Customer_ViewNotizen, Translator.Translate("Klienten") + " Notizen ansehen"); dict.Add(UserRightType.Customer_EditNotizen, Translator.Translate("Klienten") + " Notizen bearbeiten"); dict.Add(UserRightType.Customer_DeleteNotizen, Translator.Translate("Klienten") + " Notizen löschen"); + dict.Add(UserRightType.DeleteAll, Translator.Translate("Alles löschen")); dict.Add(UserRightType.EmployeeView_Create, Translator.Translate("MitarbeiterSingular") + " anlegen"); dict.Add(UserRightType.EmployeeView_Delete, Translator.Translate("MitarbeiterSingular") + " löschen"); - - dict.Add(UserRightType.WohnheimView_Create, Translator.Translate("Wohnprojekte anlegen")); - dict.Add(UserRightType.WohnheimView_Delete, Translator.Translate("Wohnprojekte löschen")); - dict.Add(UserRightType.WohnheimView_Edit, Translator.Translate("Wohnprojekte bearbeiten")); - dict.Add(UserRightType.WohnheimView_View, Translator.Translate("Wohnprojekte ansehen")); - dict.Add(UserRightType.Wohnheim_AllowArchiving, Translator.Translate("Wohnprojekte archivieren")); - - dict.Add(UserRightType.WohnheimView_Wohneinheit_View, Translator.Translate("Wohnprojekte-> Wohneinheit ansehen")); - dict.Add(UserRightType.WohnheimView_Wohneinheit_Create, Translator.Translate("Wohnprojekte-> Wohneinheit anlegen")); - dict.Add(UserRightType.WohnheimView_Wohneinheit_Edit, Translator.Translate("Wohnprojekte-> Wohneinheit bearbeiten")); - dict.Add(UserRightType.WohnheimView_Wohneinheit_Delete, Translator.Translate("Wohnprojekte-> Wohneinheit löschen")); - - dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_View, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung ansehen")); - dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Create, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung anlegen")); - dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Edit, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung bearbeiten")); - dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Delete, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung löschen")); - dict.Add(UserRightType.EmployeeView_Edit, Translator.Translate("MitarbeiterSingular") + " ändern (alle)"); dict.Add(UserRightType.EmployeeView_View, Translator.Translate("MitarbeiterSingular") + " ansehen (alle)"); dict.Add(UserRightType.Employee_ShowFinance, Translator.Translate("MitarbeiterSingular") + " alle Daten bearbeiten"); @@ -678,12 +664,28 @@ namespace BS.Shared.Core dict.Add(UserRightType.Employee_ViewNotizen, Translator.Translate("MitarbeiterSingular") + " Notizen ansehen"); dict.Add(UserRightType.Employee_EditNotizen, Translator.Translate("MitarbeiterSingular") + " Notizen bearbeiten"); dict.Add(UserRightType.Employee_DeleteNotizen, Translator.Translate("MitarbeiterSingular") + " Notizen löschen"); + dict.Add(UserRightType.OrganisationView_Create, Translator.Translate("Organisationen anlegen")); dict.Add(UserRightType.OrganisationView_Delete, Translator.Translate("Organisationen löschen")); dict.Add(UserRightType.OrganisationView_Edit, Translator.Translate("Organisationen ändern")); dict.Add(UserRightType.OrganisationView_View, Translator.Translate("Organisationen ansehen")); dict.Add(UserRightType.Organisation_AllowArchiving, Translator.Translate("Organisationen archivieren")); dict.Add(UserRightType.OrganisationView_AllowEditCostBearer, Translator.Translate("Organisationen Kostenträgerdetails bearbeiten")); + + dict.Add(UserRightType.WohnheimView_Create, Translator.Translate("Wohnprojekte anlegen")); + dict.Add(UserRightType.WohnheimView_Delete, Translator.Translate("Wohnprojekte löschen")); + dict.Add(UserRightType.WohnheimView_Edit, Translator.Translate("Wohnprojekte bearbeiten")); + dict.Add(UserRightType.WohnheimView_View, Translator.Translate("Wohnprojekte ansehen")); + dict.Add(UserRightType.Wohnheim_AllowArchiving, Translator.Translate("Wohnprojekte archivieren")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_View, Translator.Translate("Wohnprojekte-> Wohneinheit ansehen")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_Create, Translator.Translate("Wohnprojekte-> Wohneinheit anlegen")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_Edit, Translator.Translate("Wohnprojekte-> Wohneinheit bearbeiten")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_Delete, Translator.Translate("Wohnprojekte-> Wohneinheit löschen")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_View, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung ansehen")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Create, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung anlegen")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Edit, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung bearbeiten")); + dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Delete, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung löschen")); + dict.Add(UserRightType.PersonView_Create, Translator.Translate("Personen anlegen")); dict.Add(UserRightType.PersonView_Delete, Translator.Translate("Personen löschen")); dict.Add(UserRightType.Person_AllowArchiving, Translator.Translate("Personen archivieren")); diff --git a/TranslationUnitTest/EnumTranslation.cs b/TranslationUnitTest/EnumTranslation.cs deleted file mode 100644 index a7cc93483..000000000 --- a/TranslationUnitTest/EnumTranslation.cs +++ /dev/null @@ -1,28 +0,0 @@ -using BS.Shared; -using BS.Shared.Core; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; - -namespace TranslationUnitTest -{ - [TestClass] - public class EnumTranslation - { - [TestInitialize] - public void Init() - { - - } - - [TestMethod] - public void UserRightType2TranslationsComplete() - { - var dict = EnumTranslations.UserRightType2Translations; - foreach (UserRightType item in Enum.GetValues(typeof(UserRightType))) - { - if (item != UserRightType.None && !dict.ContainsKey(item)) - Assert.Fail($"UserRight \"{item}\" hat keine Übersetzung in {nameof(EnumTranslations.UserRightType2Translations)}"); - } - } - } -} diff --git a/TranslationUnitTest/EnumTranslationTest.cs b/TranslationUnitTest/EnumTranslationTest.cs new file mode 100644 index 000000000..d3295c82c --- /dev/null +++ b/TranslationUnitTest/EnumTranslationTest.cs @@ -0,0 +1,41 @@ +using BS.Shared; +using BS.Shared.Core; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; + +namespace TranslationUnitTest +{ + [TestClass] + public class EnumTranslationTest + { + public Dictionary Dict { get; set; } + + [TestInitialize] + public void UserRightTypeCreation() + { + Dict = EnumTranslations.UserRightType2Translations; + + var values = new Dictionary(); + foreach (UserRightType item in Enum.GetValues(typeof(UserRightType))) + { + var value = (long)item; + + if (values.ContainsKey(value)) + Assert.Fail($"\"{item}\" und \"{values[value]}\" haben den gleichen Wert \"{value}\""); + + values.Add(value, item); + } + } + + [TestMethod] + public void UserRightType2TranslationsComplete() + { + foreach (UserRightType item in Enum.GetValues(typeof(UserRightType))) + { + if (item != UserRightType.None && !Dict.ContainsKey(item)) + Assert.Fail($"UserRight \"{item}\" hat keine Übersetzung in {nameof(EnumTranslations.UserRightType2Translations)}"); + } + } + } +} diff --git a/TranslationUnitTest/TranslationUnitTest.csproj b/TranslationUnitTest/TranslationUnitTest.csproj index fbe387df2..cd2306083 100644 --- a/TranslationUnitTest/TranslationUnitTest.csproj +++ b/TranslationUnitTest/TranslationUnitTest.csproj @@ -49,7 +49,7 @@ - +