This commit is contained in:
@@ -37,9 +37,10 @@ namespace AyaNova.DataList
|
|||||||
ret.Add(cm["fld"].Value<string>());
|
ret.Add(cm["fld"].Value<string>());
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Newtonsoft.Json.Linq.JArray GenerateListColumnsJSONFromListView(JArray listViewArray)
|
public Newtonsoft.Json.Linq.JArray GenerateListColumnsJSONFromListView(JArray listViewArray)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace AyaNova.DataList
|
|||||||
|
|
||||||
sb.Append(" AS df");
|
sb.Append(" AS df");
|
||||||
|
|
||||||
|
bool CustomFieldIncluded = false;
|
||||||
foreach (string ColumnName in listViewFieldList)
|
foreach (string ColumnName in listViewFieldList)
|
||||||
{
|
{
|
||||||
//skip the df column, it's already been processed above
|
//skip the df column, it's already been processed above
|
||||||
@@ -53,15 +54,25 @@ namespace AyaNova.DataList
|
|||||||
if (o != null)
|
if (o != null)
|
||||||
{//Ignore missing fields in production
|
{//Ignore missing fields in production
|
||||||
|
|
||||||
sb.Append(", ");
|
|
||||||
sb.Append(o.GetSqlValueColumnName());
|
if (o.IsCustomField && !CustomFieldIncluded)
|
||||||
|
{ //if any are custom field then add custom fields column to query
|
||||||
|
CustomFieldIncluded=true;
|
||||||
|
|
||||||
//does it also have an ID column?
|
}
|
||||||
if (!string.IsNullOrWhiteSpace(o.SqlIdColumnName))
|
else
|
||||||
{
|
{
|
||||||
sb.Append(", ");
|
sb.Append(", ");
|
||||||
sb.Append(o.SqlIdColumnName);
|
sb.Append(o.GetSqlValueColumnName());
|
||||||
|
|
||||||
|
//does it also have an ID column?
|
||||||
|
if (!string.IsNullOrWhiteSpace(o.SqlIdColumnName))
|
||||||
|
{
|
||||||
|
sb.Append(", ");
|
||||||
|
sb.Append(o.SqlIdColumnName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace AyaNova.DataList
|
|||||||
{
|
{
|
||||||
internal interface IAyaDataList
|
internal interface IAyaDataList
|
||||||
{
|
{
|
||||||
|
|
||||||
//sql query from fragment with table joins et
|
//sql query from fragment with table joins et
|
||||||
string SQLFrom { get; set; }
|
string SQLFrom { get; set; }
|
||||||
|
|
||||||
@@ -14,18 +14,16 @@ namespace AyaNova.DataList
|
|||||||
|
|
||||||
//allowed roles to access this list
|
//allowed roles to access this list
|
||||||
AuthorizationRoles AllowedRoles { get; set; }
|
AuthorizationRoles AllowedRoles { get; set; }
|
||||||
|
|
||||||
//Default object type to open for rows of this list (use no object if no)
|
//Default object type to open for rows of this list (use no object if no)
|
||||||
AyaType DefaultListObjectType { get; set; }
|
AyaType DefaultListObjectType { get; set; }
|
||||||
|
|
||||||
//Default / STOCK DataListView when none is specified
|
//Default / STOCK DataListView when none is specified
|
||||||
string DefaultListView { get; set; }
|
string DefaultListView { get; set; }
|
||||||
|
|
||||||
Newtonsoft.Json.Linq.JArray GenerateListColumnsJSONFromListView(JArray listViewArray);
|
Newtonsoft.Json.Linq.JArray GenerateListColumnsJSONFromListView(JArray listViewArray);
|
||||||
List<string> GetFieldListFromListView(JArray listViewArray);
|
List<string> GetFieldListFromListView(JArray listViewArray);
|
||||||
|
|
||||||
// bool ValidateTemplate(string template);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,22 +146,22 @@ namespace AyaNova.DataList
|
|||||||
SqlValueColumnName = "awidget.tags"
|
SqlValueColumnName = "awidget.tags"
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom1", FieldKey = "widgetcustom1", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom1", FieldKey = "widgetcustom1", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom2", FieldKey = "widgetcustom2", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom2", FieldKey = "widgetcustom2", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom3", FieldKey = "widgetcustom3", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom3", FieldKey = "widgetcustom3", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom4", FieldKey = "widgetcustom4", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom4", FieldKey = "widgetcustom4", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom5", FieldKey = "widgetcustom5", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom5", FieldKey = "widgetcustom5", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom6", FieldKey = "widgetcustom6", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom6", FieldKey = "widgetcustom6", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom7", FieldKey = "widgetcustom7", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom7", FieldKey = "widgetcustom7", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom8", FieldKey = "widgetcustom8", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom8", FieldKey = "widgetcustom8", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom9", FieldKey = "widgetcustom9", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom9", FieldKey = "widgetcustom9", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom10", FieldKey = "widgetcustom10", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom10", FieldKey = "widgetcustom10", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom11", FieldKey = "widgetcustom11", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom11", FieldKey = "widgetcustom11", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom12", FieldKey = "widgetcustom12", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom12", FieldKey = "widgetcustom12", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom13", FieldKey = "widgetcustom13", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom13", FieldKey = "widgetcustom13", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom14", FieldKey = "widgetcustom14", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom14", FieldKey = "widgetcustom14", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom15", FieldKey = "widgetcustom15", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom15", FieldKey = "widgetcustom15", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom16", FieldKey = "widgetcustom16", IsCustomField = true });
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { LtKey = "WidgetCustom16", FieldKey = "widgetcustom16", IsCustomField = true, SqlValueColumnName = "awidget.customfields" });
|
||||||
}
|
}
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
Reference in New Issue
Block a user