From e632e763e51ac13470783cd83d4f71c3fccb2cd6 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 11 Mar 2022 00:54:07 +0000 Subject: [PATCH] case 4141 --- server/AyaNova/DataList/AttachmentDataList.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/server/AyaNova/DataList/AttachmentDataList.cs b/server/AyaNova/DataList/AttachmentDataList.cs index 793c4c8d..b334aea4 100644 --- a/server/AyaNova/DataList/AttachmentDataList.cs +++ b/server/AyaNova/DataList/AttachmentDataList.cs @@ -7,10 +7,10 @@ namespace AyaNova.DataList public AttachmentDataList(long translationId) { DefaultListAType = AyaType.FileAttachment; - SQLFrom = "from afileattachment"; + SQLFrom = "from afileattachment left join auser on (afileattachment.attachedByUserId=auser.id)"; var RoleSet = BizRoles.GetRoleSet(DefaultListAType); AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; - DefaultColumns = new List() { "displayfilename", "object", "size", "notes", "exists" }; + DefaultColumns = new List() { "displayfilename", "object", "size", "username", "notes", "exists" }; DefaultSortBy = new Dictionary() { { "displayfilename", "+" }, { "size", "-" } }; @@ -27,6 +27,17 @@ namespace AyaNova.DataList IsRowId = true }); + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "User", + FieldKey = "username", + AType = (int)AyaType.User, + UiFieldDataType = (int)UiFieldDataType.Text, + SqlIdColumnName = "auser.id", + SqlValueColumnName = "auser.name", + IsRowId = false + }); + FieldDefinitions.Add(new DataListFieldDefinition { TKey = "AttachmentExists", @@ -43,7 +54,7 @@ namespace AyaNova.DataList SqlIdColumnName = "afileattachment.AttachToObjectid", SqlValueColumnName = $"AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtoatype,{translationId})", SqlATypeColumnName = "afileattachment.attachtoatype", - Translate=true + Translate = true }); FieldDefinitions.Add(new DataListFieldDefinition