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