From c5d5dea7e82fae85f9d86065c19c798e910ecea8 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 18 Nov 2021 19:59:13 +0000 Subject: [PATCH] --- server/AyaNova/biz/UserBiz.cs | 45 ++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index 582c348a..94df4a79 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -173,18 +173,57 @@ namespace AyaNova.Biz } } + //WO REPORT //determine effective wo report if not default, there are 5 slots, any could be used or not so just iterate from bottom to top, last one wins in case of ties //this prioritizes the lowest numbered slot automatically, i.e. first choice + //SLOT 5 if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport5Id != null && AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport5Tags.Count > 0) { if (CustomerWorkOrderReportByTagTags.Intersect(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport5Tags).Any()) ThisWOEffectiveWorkOrderReportId = AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport5Id; - + } + //SLOT 4 + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport4Id != null && AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport4Tags.Count > 0) + { + if (CustomerWorkOrderReportByTagTags.Intersect(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport4Tags).Any()) + ThisWOEffectiveWorkOrderReportId = AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport4Id; + } + //SLOT 3 + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport3Id != null && AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport3Tags.Count > 0) + { + if (CustomerWorkOrderReportByTagTags.Intersect(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport3Tags).Any()) + ThisWOEffectiveWorkOrderReportId = AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport3Id; + } + //SLOT 2 + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport2Id != null && AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport2Tags.Count > 0) + { + if (CustomerWorkOrderReportByTagTags.Intersect(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport2Tags).Any()) + ThisWOEffectiveWorkOrderReportId = AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport2Id; + } + //SLOT 1 + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport1Id != null && AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport1Tags.Count > 0) + { + if (CustomerWorkOrderReportByTagTags.Intersect(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerWorkOrderReport1Tags).Any()) + ThisWOEffectiveWorkOrderReportId = AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerTagWorkOrderReport1Id; } + //WO WIKI + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOWiki) + { + ThisWOCanWiki = true; + //Tag override? + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOWikiInTags.Count > 0) + ThisWOCanWiki = CustomerWorkOrderWikiAttachmentTags.Intersect(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOWikiInTags).Any(); + } - - + //WO ATTACHMENTS + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOAttachments) + { + ThisWOCanAttachments = true; + //Tag override? + if (AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOAttachmentsInTags.Count > 0) + ThisWOCanAttachments = CustomerWorkOrderWikiAttachmentTags.Intersect(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOAttachmentsInTags).Any(); + } }