From 4e5a4a1ca4f7ef15d2359f41abfb1bfc5f38f2e4 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 23 Jun 2020 23:18:50 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- .../AyaNova/DataList/TranslationDataList.cs | 71 +++++++++++++++++++ server/AyaNova/resource/de.json | 3 +- server/AyaNova/resource/en.json | 5 +- server/AyaNova/resource/es.json | 3 +- server/AyaNova/resource/fr.json | 3 +- 6 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 server/AyaNova/DataList/TranslationDataList.cs diff --git a/.vscode/launch.json b/.vscode/launch.json index 396abc9b..33155498 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -45,7 +45,7 @@ //"AYANOVA_LOG_LEVEL": "Debug", "AYANOVA_DEFAULT_TRANSLATION": "en", //TRANSLATION MUST BE en for Integration TESTING - //"AYANOVA_PERMANENTLY_ERASE_DATABASE": "true", + "AYANOVA_PERMANENTLY_ERASE_DATABASE": "true", "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;", "AYANOVA_USE_URLS": "http://*:7575;", "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", diff --git a/server/AyaNova/DataList/TranslationDataList.cs b/server/AyaNova/DataList/TranslationDataList.cs new file mode 100644 index 00000000..fa5e7715 --- /dev/null +++ b/server/AyaNova/DataList/TranslationDataList.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; +using Newtonsoft.Json.Linq; +using AyaNova.Biz; +namespace AyaNova.DataList +{ + internal class TranslationDataList : AyaDataList + { + + public TranslationDataList() + { + DefaultListObjectType = AyaType.Translation; + SQLFrom = "from atranslation"; + var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType); + AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; + + //Default ListView + dynamic dlistView = new JArray(); + + dynamic cm = new JObject(); + cm.fld = "name"; + dlistView.Add(cm); + + cm = new JObject(); + cm.fld = "stock"; + dlistView.Add(cm); + + cm = new JObject(); + cm.fld = "cjkindex"; + dlistView.Add(cm); + + DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + + + + //NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely + FieldDefinitions = new List(); + //DPRECATED FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.User, SqlIdColumnName = "auser.id" }); + FieldDefinitions.Add(new AyaDataListFieldDefinition + { + TKey = "Translation", + FieldKey = "name", + AyaObjectType = (int)AyaType.Translation, + UiFieldDataType = (int)UiFieldDataType.Text, + SqlIdColumnName = "atranslation.id", + SqlValueColumnName = "atranslation.name", + IsRowId = true + }); + + FieldDefinitions.Add(new AyaDataListFieldDefinition + { + TKey = "GlobalCJKIndex", + FieldKey = "cjkindex", + UiFieldDataType = (int)UiFieldDataType.Bool, + SqlValueColumnName = "atranslation.cjkindex" + }); + + + + FieldDefinitions.Add(new AyaDataListFieldDefinition + { + TKey = "ReadOnly", + FieldKey = "stock", + UiFieldDataType = (int)UiFieldDataType.Bool, + SqlValueColumnName = "atranslation.stock" + }); + + + + } + }//eoc +}//eons \ No newline at end of file diff --git a/server/AyaNova/resource/de.json b/server/AyaNova/resource/de.json index b12e59e1..78b52178 100644 --- a/server/AyaNova/resource/de.json +++ b/server/AyaNova/resource/de.json @@ -1837,5 +1837,6 @@ "CopyDbId":"Datenbank-ID kopieren", "LastLogin":"Letzte Anmeldezeit", "Import":"Importieren", - "Export":"Exportieren" + "Export":"Exportieren", + "ReadOnly":"Schreibgeschützt" } \ No newline at end of file diff --git a/server/AyaNova/resource/en.json b/server/AyaNova/resource/en.json index 288e4377..a61f6098 100644 --- a/server/AyaNova/resource/en.json +++ b/server/AyaNova/resource/en.json @@ -234,7 +234,7 @@ "UiFieldDataTypesInteger": "Integer", "GlobalAllowScheduleConflicts": "Allow Schedule Conflicts", "GlobalAllowScheduleConflictsDescription": "If the user assigning schedules wants to be notified that a scheduled user overlaps, they should set this to FALSE. If it is common to overlap schedules, it is suggested to set to TRUE", - "GlobalCJKIndex": "Use CJK Index", + "GlobalCJKIndex": "CJK Index", "GlobalCJKIndexDescription": "Only set to TRUE if entry of Chinese, Japanese or Korean characters into fields and labels", "GlobalCoordinateStyle": "Coordinate display style", "GlobalCoordinateStyleDescription": "Determines how geographic co-ordinates are displayed", @@ -1837,7 +1837,8 @@ "CopyDbId":"Copy database id", "LastLogin":"Last login", "Import":"Import", - "Export":"Export" + "Export":"Export", + "ReadOnly":"Read only" } \ No newline at end of file diff --git a/server/AyaNova/resource/es.json b/server/AyaNova/resource/es.json index 39bb1ffe..ca63d487 100644 --- a/server/AyaNova/resource/es.json +++ b/server/AyaNova/resource/es.json @@ -1837,5 +1837,6 @@ "CopyDbId":"Copiar ID de base de datos", "LastLogin":"Última hora de inicio de sesión", "Import":"Importar", - "Export":"Exportar" + "Export":"Exportar", + "ReadOnly":"Sólo lectura" } \ No newline at end of file diff --git a/server/AyaNova/resource/fr.json b/server/AyaNova/resource/fr.json index 130c76d5..000dde0d 100644 --- a/server/AyaNova/resource/fr.json +++ b/server/AyaNova/resource/fr.json @@ -1837,5 +1837,6 @@ "CopyDbId":"Copier l'ID de la base de données", "LastLogin":"Dernière connexion", "Import":"Importer", - "Export":"Exporter" + "Export":"Exporter", + "ReadOnly":"Lecture seule" } \ No newline at end of file