From 649eeb63790a69f3668c6a45661dd6f9f09a74aa Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 29 Apr 2020 00:34:53 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 39 ++++++++++++++++++++++++ source/Plugins/AyaNova.Plugin.V8/util.cs | 17 +++++++++++ 2 files changed, 56 insertions(+) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 37d1ee9..2a2050f 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -745,6 +745,11 @@ namespace AyaNova.PlugIn.V8 if (ocf.Count == 0) return ret; + + dynamic d = new JObject(); + d.formkey = RavenCustomTranslationKeyObjectName; + dynamic dtemplate = new JArray(); + bool bAtLeastOneFieldIsVisible = false; foreach (ObjectCustomField f in ocf) { @@ -755,6 +760,40 @@ namespace AyaNova.PlugIn.V8 int n=Convert.ToInt32(f.FieldName.Replace("Custom", ""))+1;//raven custom fields are 1 based, v7 are zero based CustomFieldLocaleKeys.Add(RavenCustomTranslationKeyObjectName + n.ToString(), util.LocaleText.GetLocalizedText(objectName + ".Label." + f.FieldName)); + dynamic dt = new JObject(); + dt.fld = RavenCustomTranslationKeyObjectName+"Custom"+n.ToString(); + dt.hide = false; + dt.required = true; + switch (f.FieldType) + { + case FormFieldDataTypes.Currency: + dt.type = util.AyaUiFieldDataType.Currency; + break; + case FormFieldDataTypes.DateOnly: + dt.type = util.AyaUiFieldDataType.Date; + break; + case FormFieldDataTypes.DateTime: + dt.type = util.AyaUiFieldDataType.DateTime; + break; + case FormFieldDataTypes.Number: + dt.type = util.AyaUiFieldDataType.Decimal; + break; + case FormFieldDataTypes.Text: + dt.type = util.AyaUiFieldDataType.Text; + break; + case FormFieldDataTypes.TimeOnly: + dt.type = util.AyaUiFieldDataType.Time; + break; + case FormFieldDataTypes.TrueFalse: + dt.type = util.AyaUiFieldDataType.Bool; + break; + default: + dt.type = util.AyaUiFieldDataType.Text; + + + } + dt.type = AyaUiFieldDataType.Text; + dtemplate.Add(dt); } } diff --git a/source/Plugins/AyaNova.Plugin.V8/util.cs b/source/Plugins/AyaNova.Plugin.V8/util.cs index efd97f1..09ddf76 100644 --- a/source/Plugins/AyaNova.Plugin.V8/util.cs +++ b/source/Plugins/AyaNova.Plugin.V8/util.cs @@ -287,6 +287,23 @@ namespace AyaNova.PlugIn.V8 return s; } + public enum AyaUiFieldDataType : int + { + NoType = 0, + DateTime = 1, + Date = 2, + Time = 3, + Text = 4, + Integer = 5, + Bool = 6, + Decimal = 7, + Currency = 8, + Tags = 9, + Enum = 10, + EmailAddress = 11 + + } + #endregion }//eoc