This commit is contained in:
@@ -48,6 +48,8 @@ namespace AyaNova.DataList
|
|||||||
public string SqlValueColumnName { get; set; }
|
public string SqlValueColumnName { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string SqlAyTypeColumnName { get; set; }//column to fetch the AyaType openabel for this field to set it dynamically instead of preset
|
public string SqlAyTypeColumnName { get; set; }//column to fetch the AyaType openabel for this field to set it dynamically instead of preset
|
||||||
|
[JsonIgnore]
|
||||||
|
public string SqlColorColumnName { get; set; }//column to fetch the color if applicable to this field
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +64,8 @@ namespace AyaNova.DataList
|
|||||||
IsMeta = false;
|
IsMeta = false;
|
||||||
//Set openable object type to no type which is the default and means it's not a link to another object
|
//Set openable object type to no type which is the default and means it's not a link to another object
|
||||||
AyaObjectType = (int)AyaType.NoType;
|
AyaObjectType = (int)AyaType.NoType;
|
||||||
SqlAyTypeColumnName=null;//must be null as that is checked against specifically
|
SqlAyTypeColumnName = null;//must be null as that is checked against specifically
|
||||||
|
SqlColorColumnName = null;//must be null to be ignored properly
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
193
server/AyaNova/DataList/ReminderDataList.cs
Normal file
193
server/AyaNova/DataList/ReminderDataList.cs
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
namespace AyaNova.DataList
|
||||||
|
{
|
||||||
|
internal class ReminderDataList : AyaDataList, IAyaDataListViewServerCriteria
|
||||||
|
{
|
||||||
|
public ReminderDataList()
|
||||||
|
{
|
||||||
|
|
||||||
|
DefaultListObjectType = AyaType.Reminder;
|
||||||
|
SQLFrom = "from areminder";
|
||||||
|
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
||||||
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||||
|
|
||||||
|
|
||||||
|
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
|
||||||
|
//Default ListView
|
||||||
|
dynamic dlistView = new JArray();
|
||||||
|
|
||||||
|
|
||||||
|
dynamic cm = new JObject();
|
||||||
|
cm.fld = "ReminderName";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "ReminderStopDate";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "ReminderStartDate";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "Object";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "AyaType";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "ReminderNotes";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "ReminderUserId";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
|
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
|
||||||
|
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "Object",
|
||||||
|
FieldKey = "Object",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "areminder.ayid",
|
||||||
|
SqlValueColumnName = "AYGETNAME(areminder.objectid, areminder.objecttype)",
|
||||||
|
SqlAyTypeColumnName = "areminder.ayatype"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "AyaType",
|
||||||
|
FieldKey = "AyaType",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||||
|
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
|
||||||
|
SqlValueColumnName = "areminder.ayatype"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderName",
|
||||||
|
FieldKey = "ReminderName",
|
||||||
|
AyaObjectType = (int)AyaType.Reminder,
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "areminder.id",
|
||||||
|
SqlValueColumnName = "areminder.name",
|
||||||
|
IsRowId = true
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderNotes",
|
||||||
|
FieldKey = "ReminderNotes",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlValueColumnName = "areminder.notes"
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderStartDate",
|
||||||
|
FieldKey = "ReminderStartDate",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||||
|
SqlValueColumnName = "areminder.startdate"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderStopDate",
|
||||||
|
FieldKey = "ReminderStopDate",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||||
|
SqlValueColumnName = "areminder.stopdate"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderColor",
|
||||||
|
FieldKey = "ReminderColor",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Color,
|
||||||
|
SqlValueColumnName = "areminder.color"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderCompletionNotes",
|
||||||
|
FieldKey = "ReminderCompletionNotes",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlValueColumnName = "areminder.completionnotes"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderUserId",
|
||||||
|
FieldKey = "ReminderUserId",
|
||||||
|
AyaObjectType = (int)AyaType.User,
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "uassto.id",
|
||||||
|
SqlValueColumnName = "uassto.name"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "ReminderAssignedByUserId",
|
||||||
|
FieldKey = "ReminderAssignedByUserId",
|
||||||
|
AyaObjectType = (int)AyaType.User,
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "uassby.id",
|
||||||
|
SqlValueColumnName = "uassby.name"
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "Tags",
|
||||||
|
FieldKey = "ReminderTags",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||||
|
SqlValueColumnName = "areminder.tags"
|
||||||
|
});
|
||||||
|
|
||||||
|
//META column
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
FieldKey = "metareminderuser",
|
||||||
|
SqlIdColumnName = "areminder.userid",
|
||||||
|
SqlValueColumnName = "areminder.userid",
|
||||||
|
IsMeta = true
|
||||||
|
});
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom1", FieldKey = "ReminderCustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom2", FieldKey = "ReminderCustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom3", FieldKey = "ReminderCustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom4", FieldKey = "ReminderCustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom5", FieldKey = "ReminderCustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom6", FieldKey = "ReminderCustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom7", FieldKey = "ReminderCustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom8", FieldKey = "ReminderCustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom9", FieldKey = "ReminderCustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom10", FieldKey = "ReminderCustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom11", FieldKey = "ReminderCustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom12", FieldKey = "ReminderCustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom13", FieldKey = "ReminderCustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom14", FieldKey = "ReminderCustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom15", FieldKey = "ReminderCustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "ReminderCustom16", FieldKey = "ReminderCustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "areminder.customfields" });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string IAyaDataListViewServerCriteria.ListViewServerCriteria(long userId)
|
||||||
|
{
|
||||||
|
return "[{\"fld\":\"metareminderto\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":" + userId.ToString() + "}]}}]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}//eoc
|
||||||
|
}//eons
|
||||||
Reference in New Issue
Block a user