case 4141

This commit is contained in:
2022-03-11 00:54:07 +00:00
parent f11c06cf19
commit e632e763e5

View File

@@ -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<string>() { "displayfilename", "object", "size", "notes", "exists" };
DefaultColumns = new List<string>() { "displayfilename", "object", "size", "username", "notes", "exists" };
DefaultSortBy = new Dictionary<string, string>() { { "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