/// <summary> /// This goes on a bit of a different path to get a project url than normal. For some reason /// using the project extension method GetDetailAbsoluteUrl() was returning absolute urls for the wrong /// tenant when generating reports in QA (and likely PROD) /// </summary> /// <param name="project"></param> private string GetProjectUrlForReport(Project project) { var tenant = MultiTenantHelpers.GetAllTenantSimples().First(x => x.TenantID == project.TenantID); var tenantCanonicalUrlUriBuilder = tenant.GetCanonicalUrlUriBuilderForCurrentEnvironment(); tenantCanonicalUrlUriBuilder.Path = Project.GetDetailUrl(); tenantCanonicalUrlUriBuilder.Port = -1; return(tenantCanonicalUrlUriBuilder.ToString()); }
/// <summary> /// Call for page with associated FirmaPage /// </summary> protected FirmaViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) { FirmaPage = firmaPage; //CurrentPerson = currentPerson; CurrentFirmaSession = currentFirmaSession; FirmaHomeUrl = SitkaRoute <HomeController> .BuildUrlFromExpression(c => c.Index()); LogInUrl = FirmaHelpers.GenerateLogInUrl(); LogOutUrl = FirmaHelpers.GenerateLogOutUrlWithReturnUrl(); CurrentUrl = HttpContext.Current.Request.Url; ForgotPasswordUrl = FirmaHelpers.GenerateForgotPasswordUrlWithReturnUrl(CurrentUrl.AbsoluteUri); RegisterAccountUrl = FirmaHelpers.GenerateCreateAccountWithReturnUrl(CurrentUrl.AbsoluteUri); QaUrl = MultiTenantHelpers.GetRelativeUrlForEnvironment(CurrentUrl, FirmaEnvironmentType.Qa); LocalUrl = MultiTenantHelpers.GetRelativeUrlForEnvironment(CurrentUrl, FirmaEnvironmentType.Local); ProdUrl = MultiTenantHelpers.GetRelativeUrlForEnvironment(CurrentUrl, FirmaEnvironmentType.Prod); TenantSimples = MultiTenantHelpers.GetAllTenantSimples().Where(ts => ts.ShowTenantInSwitcherDropdown).ToList(); RequestSupportUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(c => c.Support()); MakeFirmaMenu(currentFirmaSession); FullProjectListUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Index()); ProjectSearchUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Search(UrlTemplate.Parameter1String)); ProjectFindUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Find(string.Empty)); var currentPersonCanManage = new FirmaPageManageFeature().HasPermission(currentFirmaSession, firmaPage).HasPermission; ViewPageContentViewData = firmaPage != null ? new ViewPageContentViewData(firmaPage, currentPersonCanManage) : null; CustomFooterViewData = new CustomFooterViewData(FirmaPageTypeEnum.CustomFooter.GetFirmaPage(), currentPersonCanManage, this.CurrentFirmaSession); TenantName = MultiTenantHelpers.GetTenantName(); TenantShortDisplayName = MultiTenantHelpers.GetTenantShortDisplayName(); TenantBannerLogoUrl = MultiTenantHelpers.GetTenantBannerLogoUrl(); TenantToolDisplayName = MultiTenantHelpers.GetToolDisplayName(); ShowTenantDropdown = // Tenant dropdown can be globally disabled if necessary. (Reclamation needs this, and so might other hard-ish forks.) FirmaWebConfiguration.TenantDropdownEnabled && (FirmaWebConfiguration.FirmaEnvironment.FirmaEnvironmentType == FirmaEnvironmentType.Local || CurrentFirmaSession.IsSitkaAdministrator()); ShowEnvironmentLabel = FirmaWebConfiguration.FirmaEnvironment.FirmaEnvironmentType != FirmaEnvironmentType.Prod; ShowEnvironmentDropdown = FirmaWebConfiguration.FirmaEnvironment.FirmaEnvironmentType == FirmaEnvironmentType.Local || CurrentFirmaSession.IsSitkaAdministrator(); FirmaIncludesViewData = new FirmaIncludesViewData(); }