From ec55e3b6bb9168856d59b6125f85ee405a05a135 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 14 Sep 2020 18:30:08 +0000 Subject: [PATCH] --- server/AyaNova/generator/CoreJobNotify.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/AyaNova/generator/CoreJobNotify.cs b/server/AyaNova/generator/CoreJobNotify.cs index b0149d95..4878531a 100644 --- a/server/AyaNova/generator/CoreJobNotify.cs +++ b/server/AyaNova/generator/CoreJobNotify.cs @@ -103,6 +103,7 @@ namespace AyaNova.Biz //this is just to let people know there is a problem //todo: create message here if not already set? //todo: Link to open report in here + //CLIENT EXPECTS: open report links to have a query string [CLIENTAPPURL]/viewreport?oid=[objectid]&rid=[reportid] //All items have an event date, for non time delayed events it's just the moment it was created @@ -327,6 +328,21 @@ namespace AyaNova.Biz return $"{ServerUrl}/open/{(int)otype}/{id}"; } + + //Used to directly open a report at client + private static string OpenReportUrlBuilder(long objectId, long reportId) + { + //CLIENT EXPECTS: open report links to have a query string [CLIENTAPPURL]/viewreport?oid=[objectid]&rid=[reportid] + var ServerUrl = ServerGlobalOpsSettingsCache.Notify.AyaNovaServerURL; + if (string.IsNullOrWhiteSpace(ServerUrl)) + { + NotifyEventProcessor.AddOpsProblemEvent("Notification system: The OPS Notification setting is empty for AyaNova Server URL. This prevents Notification system from linking events to openable objects.").Wait(); + return "OPS ERROR NO SERVER URL CONFIGURED"; + } + ServerUrl = ServerUrl.Trim().TrimEnd('/'); + return $"{ServerUrl}/viewreport?oid={objectId}&rid={reportId}"; + } + ///////////////////////////////////////////////////////////////////// }//eoc