private static XsltArgumentList GetXslParameters(this Report report, ReportViewType view, int templateID) { var parameters = new XsltArgumentList(); var columns = report.GetColumns(view, templateID); var logo = string.IsNullOrEmpty(SetupInfo.MainLogoMailTmplURL) ? CommonLinkUtility.GetFullAbsolutePath(TenantLogoManager.GetLogoLight(true)) : SetupInfo.MainLogoMailTmplURL; for (var i = 0; i < columns.Count; i++) { parameters.AddParam("p" + i, string.Empty, columns[i]); } parameters.AddParam("p" + columns.Count, string.Empty, Global.ReportCsvDelimiter.Value); parameters.AddParam("logo", string.Empty, logo); return(parameters); }
private static void BeforeTransferRequest(NotifyEngine sender, NotifyRequest request) { var aid = Guid.Empty; var aname = string.Empty; if (SecurityContext.IsAuthenticated) { aid = SecurityContext.CurrentAccount.ID; if (CoreContext.UserManager.UserExists(aid)) { aname = CoreContext.UserManager.GetUsers(aid).DisplayUserName(false) .Replace(">", ">") .Replace("<", "<"); } } IProduct product; IModule module; CommonLinkUtility.GetLocationByRequest(out product, out module); if (product == null && CallContext.GetData("asc.web.product_id") != null) { product = WebItemManager.Instance[(Guid)CallContext.GetData("asc.web.product_id")] as IProduct; } request.Arguments.Add(new TagValue(CommonTags.AuthorID, aid)); request.Arguments.Add(new TagValue(CommonTags.AuthorName, aname)); request.Arguments.Add(new TagValue(CommonTags.AuthorUrl, CommonLinkUtility.GetFullAbsolutePath(CommonLinkUtility.GetUserProfile(aid)))); request.Arguments.Add(new TagValue(CommonTags.VirtualRootPath, CommonLinkUtility.GetFullAbsolutePath("~").TrimEnd('/'))); request.Arguments.Add(new TagValue(CommonTags.ProductID, product != null ? product.ID : Guid.Empty)); request.Arguments.Add(new TagValue(CommonTags.ModuleID, module != null ? module.ID : Guid.Empty)); request.Arguments.Add(new TagValue(CommonTags.ProductUrl, CommonLinkUtility.GetFullAbsolutePath(product != null ? product.StartURL : "~"))); request.Arguments.Add(new TagValue(CommonTags.DateTime, TenantUtil.DateTimeNow())); request.Arguments.Add(new TagValue(CommonTags.Helper, new PatternHelper())); request.Arguments.Add(new TagValue(CommonTags.RecipientID, Context.SYS_RECIPIENT_ID)); request.Arguments.Add(new TagValue(CommonTags.RecipientSubscriptionConfigURL, CommonLinkUtility.GetMyStaff())); request.Arguments.Add(new TagValue("Partner", GetPartnerInfo())); request.Arguments.Add(new TagValue(Constants.LetterLogo, CommonLinkUtility.GetFullAbsolutePath(TenantLogoManager.GetLogoLight(true)))); if (!request.Arguments.Any(x => CommonTags.SendFrom.Equals(x.Tag))) { request.Arguments.Add(new TagValue(CommonTags.SendFrom, CoreContext.TenantManager.GetCurrentTenant().Name)); } }