Modify aygetname postgres function to handle translation of items that do not have a name, also code to back it at server
This commit is contained in:
@@ -41,7 +41,7 @@ namespace AyaNova.DataList
|
||||
FieldKey = "object",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "afileattachment.AttachToObjectid",
|
||||
SqlValueColumnName = "AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtoatype)",
|
||||
SqlValueColumnName = $"AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtoatype,{CurrentUserTranslationId})",
|
||||
SqlATypeColumnName = "afileattachment.attachtoatype",
|
||||
Translate=true
|
||||
});
|
||||
|
||||
@@ -9,10 +9,12 @@ namespace AyaNova.DataList
|
||||
//Instantiate list object specified
|
||||
//this is safe as it's only attempting to load assemblies in the AyaNova.DataList namespace so can't attempt to instantiate some random object or nefarious object
|
||||
//returns null if doesn't exist
|
||||
internal static IDataListProcessing GetAyaDataList(string ListKey)
|
||||
internal static IDataListProcessing GetAyaDataList(string ListKey, long translationId)
|
||||
{
|
||||
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
|
||||
return ass.CreateInstance($"AyaNova.DataList.{ListKey}") as IDataListProcessing;
|
||||
var v= ass.CreateInstance($"AyaNova.DataList.{ListKey}") as IDataListProcessing;
|
||||
v.CurrentUserTranslationId=translationId;
|
||||
return v;
|
||||
}
|
||||
|
||||
//List all the datalist types available
|
||||
|
||||
@@ -30,7 +30,8 @@ namespace AyaNova.DataList
|
||||
public List<DataListFieldDefinition> FieldDefinitions { get; set; }
|
||||
public AuthorizationRoles AllowedRoles { get; set; }
|
||||
public AyaType DefaultListAType { get; set; }
|
||||
public long CurrentUserId { get; set; }
|
||||
//public long CurrentUserId { get; set; }
|
||||
public long CurrentUserTranslationId { get; set; }
|
||||
public List<string> DefaultColumns { get; set; }
|
||||
public Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
|
||||
@@ -133,7 +134,7 @@ namespace AyaNova.DataList
|
||||
//Not Sortable?
|
||||
if (!o.IsSortable)
|
||||
sb.Append($",\"ns\":1");
|
||||
|
||||
|
||||
//Not Filterable?
|
||||
if (!o.IsFilterable)
|
||||
sb.Append($",\"nf\":1");
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace AyaNova.DataList
|
||||
FieldKey = "object",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aevent.ayid",
|
||||
SqlValueColumnName = "AYGETNAME(aevent.ayid, aevent.ayatype)",
|
||||
SqlValueColumnName = $"AYGETNAME(aevent.ayid, aevent.ayatype,{CurrentUserTranslationId})",
|
||||
SqlATypeColumnName = "aevent.ayatype"
|
||||
});
|
||||
|
||||
|
||||
@@ -17,5 +17,7 @@ namespace AyaNova.DataList
|
||||
Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
void SetListOptionDefaultsIfNecessary(Models.DataListProcessingBase listOptions);
|
||||
Newtonsoft.Json.Linq.JArray GenerateReturnListColumns(List<string> columns);
|
||||
|
||||
long CurrentUserTranslationId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace AyaNova.DataList
|
||||
FieldKey = "PartInventoryTransactionSource",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apartinventory.sourceid",
|
||||
SqlValueColumnName = "AYGETNAME(apartinventory.sourceid, apartinventory.sourcetype)",
|
||||
SqlValueColumnName = $"AYGETNAME(apartinventory.sourceid, apartinventory.sourcetype,{CurrentUserTranslationId})",
|
||||
SqlATypeColumnName = "apartinventory.sourcetype",
|
||||
Translate=true
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace AyaNova.DataList
|
||||
FieldKey = "Object",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "areview.objectid",
|
||||
SqlValueColumnName = "AYGETNAME(areview.objectid, areview.aType)",
|
||||
SqlValueColumnName = $"AYGETNAME(areview.objectid, areview.aType,{CurrentUserTranslationId})",
|
||||
SqlATypeColumnName = "areview.aType",
|
||||
Translate=true
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
// FieldKey = "ServiceBankSourceRootAType",
|
||||
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
// SqlIdColumnName = "aservicebank.sourceid",
|
||||
// SqlValueColumnName = "AYGETNAME(aservicebank.sourceid, aservicebank.sourcetype)",
|
||||
// SqlValueColumnName = $"AYGETNAME(aservicebank.sourceid, aservicebank.sourcetype,{CurrentUserTranslationId})",
|
||||
// SqlATypeColumnName = "aservicebank.sourcetype"
|
||||
// });
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
// FieldKey = "Object",
|
||||
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
// SqlIdColumnName = "aservicebank.objectid",
|
||||
// SqlValueColumnName = "AYGETNAME(aservicebank.objectid, aservicebank.aType)",
|
||||
// SqlValueColumnName = $"AYGETNAME(aservicebank.objectid, aservicebank.aType,{CurrentUserTranslationId})",
|
||||
// SqlATypeColumnName = "aservicebank.aType"
|
||||
// });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user