This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -53,7 +53,7 @@
|
|||||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||||
"AYANOVA_SERVER_TEST_MODE": "true",
|
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace AyaNova.DataList
|
|||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "ayatype";
|
cm.fld = "ayatype";
|
||||||
|
dlistView.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "ayatypeex";
|
||||||
dlistView.Add(cm);
|
dlistView.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
@@ -76,6 +80,19 @@ namespace AyaNova.DataList
|
|||||||
SqlValueColumnName = "afileattachment.AttachToObjectType"
|
SqlValueColumnName = "afileattachment.AttachToObjectType"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "AyaType",
|
||||||
|
FieldKey = "ayatypeex",
|
||||||
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
|
// EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
|
||||||
|
SqlIdColumnName = "afileattachment.AttachToObjectid",
|
||||||
|
SqlValueColumnName = "AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtoobjecttype)",
|
||||||
|
SqlAyTypeColumnName = "afileattachment.attachtoobjecttype"
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "FileSize",
|
TKey = "FileSize",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace AyaNova.DataList
|
|||||||
//CLIENT / SERVER - client display server validation purposes
|
//CLIENT / SERVER - client display server validation purposes
|
||||||
public bool IsSortable { get; set; }
|
public bool IsSortable { get; set; }
|
||||||
|
|
||||||
//CLIENT / SERVER - indicates internal only meta column, don't show to user for filter settings etc
|
//CLIENT / SERVER - indicates internal only meta column, don't show to user for filter settings etc
|
||||||
public bool IsMeta { get; set; }
|
public bool IsMeta { get; set; }
|
||||||
|
|
||||||
//CLIENT Use only for display
|
//CLIENT Use only for display
|
||||||
@@ -46,8 +46,8 @@ namespace AyaNova.DataList
|
|||||||
public string SqlIdColumnName { get; set; }
|
public string SqlIdColumnName { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string SqlValueColumnName { get; set; }
|
public string SqlValueColumnName { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public string SqlAyTypeColumnName { get; set; }//column to fetch the AyaType for this field to set it dynamically instead of preset
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -59,9 +59,10 @@ namespace AyaNova.DataList
|
|||||||
IsFilterable = true;
|
IsFilterable = true;
|
||||||
IsSortable = true;
|
IsSortable = true;
|
||||||
IsRowId = false;
|
IsRowId = false;
|
||||||
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=string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace AyaNova.DataList
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
TODO: have to figure out how to include name and openable link to object in reminder
|
// TODO: have to figure out how to include name and openable link to object in reminder
|
||||||
//or do I?... outstanding for sure
|
//or do I?... outstanding for sure
|
||||||
//The only efficient way to do this would be a Function that is outer joined to fetch the names
|
//The only efficient way to do this would be a Function that is outer joined to fetch the names
|
||||||
//maybe that's an option, look into a query that joins tables to Function
|
//maybe that's an option, look into a query that joins tables to Function
|
||||||
|
|||||||
@@ -315,6 +315,134 @@ END;
|
|||||||
$BODY$;
|
$BODY$;
|
||||||
");
|
");
|
||||||
|
|
||||||
|
//Name fetcher function
|
||||||
|
await ExecQueryAsync(@"
|
||||||
|
CREATE OR REPLACE FUNCTION PUBLIC.AYGETNAME(IN AYOBJECTID bigint, IN AYOBJECTTYPE integer) RETURNS text AS $BODY$
|
||||||
|
DECLARE
|
||||||
|
aytable TEXT DEFAULT '';
|
||||||
|
aynamecolumn TEXT DEFAULT 'name';
|
||||||
|
returnstr TEXT DEFAULT '';
|
||||||
|
BEGIN
|
||||||
|
-- Object type to table name
|
||||||
|
case ayobjecttype
|
||||||
|
when 2 then aytable = 'awidget';
|
||||||
|
when 3 then aytable = 'auser';
|
||||||
|
when 8 then aytable = 'acustomer';
|
||||||
|
when 25 then aytable = 'aproject';
|
||||||
|
when 33 then aytable = 'avendor';
|
||||||
|
else
|
||||||
|
RETURN '-';-- unknown or not supported just return default string
|
||||||
|
end case;
|
||||||
|
EXECUTE format('SELECT %I FROM %I WHERE id = %L', aynamecolumn, aytable, ayobjectid) INTO returnstr;
|
||||||
|
RETURN returnstr;
|
||||||
|
END;
|
||||||
|
$BODY$ LANGUAGE PLPGSQL STABLE /*
|
||||||
|
NoType = 0,
|
||||||
|
Global = 1,
|
||||||
|
[CoreBizObject]
|
||||||
|
Widget = 2,
|
||||||
|
[CoreBizObject]
|
||||||
|
User = 3,
|
||||||
|
ServerState = 4,
|
||||||
|
License = 5,
|
||||||
|
LogFile = 6,
|
||||||
|
PickListTemplate = 7,
|
||||||
|
[CoreBizObject]
|
||||||
|
Customer = 8,
|
||||||
|
ServerJob = 9,
|
||||||
|
[CoreBizObject]
|
||||||
|
Contract = 10,
|
||||||
|
TrialSeeder = 11,
|
||||||
|
ServerMetrics = 12,
|
||||||
|
Translation = 13,
|
||||||
|
UserOptions = 14,
|
||||||
|
[CoreBizObject]
|
||||||
|
HeadOffice = 15,
|
||||||
|
[CoreBizObject]
|
||||||
|
LoanUnit = 16,
|
||||||
|
FileAttachment = 17,
|
||||||
|
DataListView = 18,
|
||||||
|
FormCustom = 19,
|
||||||
|
[CoreBizObject]
|
||||||
|
Part = 20,
|
||||||
|
[CoreBizObject]
|
||||||
|
PM = 21,
|
||||||
|
[CoreBizObject]
|
||||||
|
PMItem = 22,
|
||||||
|
[CoreBizObject]
|
||||||
|
PMTemplate = 23,
|
||||||
|
[CoreBizObject]
|
||||||
|
PMTemplateItem = 24,
|
||||||
|
[CoreBizObject]
|
||||||
|
Project = 25,
|
||||||
|
[CoreBizObject]
|
||||||
|
PurchaseOrder = 26,
|
||||||
|
[CoreBizObject]
|
||||||
|
Quote = 27,
|
||||||
|
[CoreBizObject]
|
||||||
|
QuoteItem = 28,
|
||||||
|
[CoreBizObject]
|
||||||
|
QuoteTemplate = 29,
|
||||||
|
[CoreBizObject]
|
||||||
|
QuoteTemplateItem = 30,
|
||||||
|
[CoreBizObject]
|
||||||
|
Unit = 31,
|
||||||
|
[CoreBizObject]
|
||||||
|
UnitModel = 32,
|
||||||
|
[CoreBizObject]
|
||||||
|
Vendor = 33,
|
||||||
|
//--- WorkOrder
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrder = 34,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItem = 35,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemExpense = 36,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemLabor = 37,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemLoan = 38,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemPart = 39,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemPartRequest = 40,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemScheduledUser = 41,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemTask = 42,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemTravel = 43,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderItemUnit = 44,
|
||||||
|
//---
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderTemplate = 45,
|
||||||
|
[CoreBizObject]
|
||||||
|
WorkOrderTemplateItem = 46,
|
||||||
|
GlobalOps = 47,//really only used for rights, not an object type of any kind
|
||||||
|
BizMetrics = 48,//deprecate? Not used for anything as of nov 2020
|
||||||
|
Backup = 49,
|
||||||
|
Notification = 50,
|
||||||
|
NotifySubscription = 51,
|
||||||
|
[CoreBizObject]
|
||||||
|
Reminder = 52,
|
||||||
|
UnitMeterReading = 53,
|
||||||
|
CustomerServiceRequest = 54,
|
||||||
|
ServiceBank = 55,
|
||||||
|
OpsNotificationSettings = 56,
|
||||||
|
Report = 57,
|
||||||
|
DashboardView = 58,
|
||||||
|
[CoreBizObject]
|
||||||
|
CustomerNote = 59,
|
||||||
|
[CoreBizObject]
|
||||||
|
Memo = 60,
|
||||||
|
[CoreBizObject]
|
||||||
|
Review = 61
|
||||||
|
*/");
|
||||||
|
|
||||||
|
//Usage: select created, textra, AYGETNAME(aevent.ayid, aevent.ayatype) as name from aevent order by created
|
||||||
|
|
||||||
|
|
||||||
//create translation text tables
|
//create translation text tables
|
||||||
await ExecQueryAsync("CREATE TABLE atranslation (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null, stock bool, cjkindex bool default false)");
|
await ExecQueryAsync("CREATE TABLE atranslation (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null, stock bool, cjkindex bool default false)");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user