public static string CreateVerifySelectedModalUrlHtml(string gridName, BulkTagModalDialogForm bulkTagModalDialogForm) { if (bulkTagModalDialogForm == null) { return(string.Empty); } var tagIconHtml = $"<span style=\"margin-right:5px\">{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-ok")}</span>"; var getProjectIDFunctionString = $"function() {{ return Sitka.{gridName}.getValuesFromCheckedGridRows({bulkTagModalDialogForm.CheckboxColumnIndex}, '{bulkTagModalDialogForm.ValueColumnName}', '{bulkTagModalDialogForm.ReturnListName}'); }}"; return (ModalDialogFormHelper.ModalDialogFormLink($"{tagIconHtml}{bulkTagModalDialogForm.DialogLinkText}", bulkTagModalDialogForm.DialogUrl, bulkTagModalDialogForm.DialogTitle, ModalDialogFormHelper.DefaultDialogWidth, "Verify", "Cancel", new List <string> { "btn", "btn-neptune" }, null, getProjectIDFunctionString).ToString()); }
public static HtmlString SortOrderModalLink(string url, bool hasPermission) { return(ModalDialogFormHelper.ModalDialogFormLink("Edit Sort Order", url, "Edit sort order", new List <string> { "btn", "btn-firma" }, hasPermission)); }
/// <summary> /// For making a delete icon on the grid with a delete jquery ui dialog confirm. /// Will make a grey trash can icon if delete is not possible. /// </summary> /// <param name="deleteDialogUrl"></param> /// <param name="userHasDeletePermission">Does the given user have permission to perform a delete?</param> /// <param name="deletePossibleForObject">Is a delete possible for the given object?</param> /// <returns></returns> public static HtmlString MakeDeleteIconAndLinkBootstrap(string deleteDialogUrl, bool userHasDeletePermission, bool deletePossibleForObject) { var deleteIcon = deletePossibleForObject ? $"{DeleteIconBootstrap}<span style=\"display:none\">Delete</span>" : BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-trash gi-1x disabled").ToString(); return(ModalDialogFormHelper.MakeDeleteLink(deleteIcon, deleteDialogUrl, new List <string>(), userHasDeletePermission)); }
private void MakeFirmaMenu(Person currentPerson) { TopLevelLtInfoMenuItems = new List <LtInfoMenuItem> { BuildAboutMenu(currentPerson), BuildProjectsMenu(currentPerson), BuildFinancialsMenuItem(currentPerson), BuildProgramInfoMenu(currentPerson) }; TopLevelLtInfoMenuItems.Add(BuildManageMenu(currentPerson)); TopLevelLtInfoMenuItems.ForEach(x => x.ExtraTopLevelMenuCssClasses = new List <string> { "navigation-root-item" }); TopLevelLtInfoMenuItems.SelectMany(x => x.ChildMenus).ToList().ForEach(x => x.ExtraTopLevelMenuCssClasses = new List <string> { "navigation-dropdown-item" }); HelpMenu = new LtInfoMenuItem("Help"); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem("Request Support", ModalDialogFormHelper.ModalDialogFormLink("Request Support", RequestSupportUrl, "Request Support", 800, "Submit Request", "Cancel", new List <string>(), null, null).ToString(), "ToolHelp")); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem(new SitkaRoute <HomeController>(c => c.Training()), currentPerson, "Training", "ToolHelp")); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem("About ProjectFirma", @"<a href='http://www.sitkatech.com/products/ProjectFirma/projectfirma-faqs/' target='_blank'>About ProjectFirma <span class='glyphicon glyphicon-new-window'></span></a>", "ExternalHelp")); }
public EditOrganizationsViewData(IProject iProject, FirmaSession currentFirmaSession, IEnumerable <ProjectFirmaModels.Models.Organization> organizations, IEnumerable <Person> allPeople, List <OrganizationRelationshipType> allOrganizationRelationshipTypes) { AllPeople = allPeople.Select(x => new PersonSimple(x)).ToList(); AllOrganizations = organizations.Where(x => x.OrganizationType.OrganizationTypeOrganizationRelationshipTypes.Any()).Select(x => new OrganizationSimple(x)).ToList(); var userCanViewPrivateLocations = currentFirmaSession.UserCanViewPrivateLocations(iProject.GetProject()); OrganizationContainingProjectSimpleLocation = allOrganizationRelationshipTypes.ToDictionary( x => x.OrganizationRelationshipTypeID, x => { var organization = x.GetOrganizationContainingProjectSimpleLocation(iProject, userCanViewPrivateLocations); return(organization == null ? null : new OrganizationSimple(organization)); }); var primaryContactRelationshipType = MultiTenantHelpers.GetIsPrimaryContactOrganizationRelationship(); PrimaryContactRelationshipTypeSimple = primaryContactRelationshipType != null ? new OrganizationRelationshipTypeSimple(primaryContactRelationshipType) : null; AllOrganizationRelationshipTypes = allOrganizationRelationshipTypes.Except(new[] { primaryContactRelationshipType }).Select(x => new OrganizationRelationshipTypeSimple(x)).ToList(); RequestSupportUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(c => c.Support()); RequestSupportLink = ModalDialogFormHelper.ModalDialogFormLink("Request Support", RequestSupportUrl, "Request Support", 800, "Submit Request", "Cancel", new List <string>(), null, null).ToString(); }
public DetailViewData(Person currentPerson, StormwaterJurisdiction stormwaterJurisdiction) : base(currentPerson, NeptuneArea.OCStormwaterTools) { StormwaterJurisdiction = stormwaterJurisdiction; PageTitle = stormwaterJurisdiction.GetOrganizationDisplayName(); EntityName = $"{FieldDefinitionType.Jurisdiction.GetFieldDefinitionLabelPluralized()}"; EntityUrl = SitkaRoute <JurisdictionController> .BuildUrlFromExpression(x => x.Index()); TreatmentBMPGridSpec = new TreatmentBMPGridSpec(currentPerson, false, false) { ObjectNameSingular = "Treatment BMP", ObjectNamePlural = $"Treatment BMPs for {stormwaterJurisdiction.GetOrganizationDisplayName()}", SaveFiltersInCookie = true }; TreatmentBMPGridName = "jurisdictionTreatmentBMPGrid"; TreatmentBMPGridDataUrl = SitkaRoute <JurisdictionController> .BuildUrlFromExpression(x => x.JurisdictionTreatmentBMPGridJsonData(stormwaterJurisdiction)); UsersAssignedToJurisdiction = StormwaterJurisdiction.PeopleWhoCanManageStormwaterJurisdictionExceptSitka().ToList(); UserHasJurisdictionEditPermissions = new NeptuneAdminFeature().HasPermissionByPerson(CurrentPerson); EditStormwaterJurisdictionLink = UserHasJurisdictionEditPermissions ? ModalDialogFormHelper.MakeEditIconLink(SitkaRoute <JurisdictionController> .BuildUrlFromExpression(c => c.Edit(stormwaterJurisdiction)), $"Edit Jurisdiction - {StormwaterJurisdiction.GetOrganizationDisplayName()}", true) : new HtmlString(string.Empty); }
public static HtmlString GisProjectBulkUploadButton() { return(ModalDialogFormHelper.ModalDialogFormLink(GetGisBulkUploadButtonText, GisProjectBulkUploadUrl, GetGisBulkUploadButtonText, 700, GisProjectBulkUploadContinueButtonText, "Cancel", new List <string> { "btn", "btn-firma", "addSomePadding" }, null, null)); }
/// <summary> /// For making an edit icon on the grid with an editor in a jquery ui dialog /// If insufficient permissions, returns empty string /// </summary> public static HtmlString MakeModalDialogLink(string linkHtml, string dialogContentUrl, int dialogWidth, string dialogTitle, bool hasPermission, string saveButtonText, string cancelButtonText, List <string> extraCssClasses, string onJavascriptReadyFunction, string postData) { if (hasPermission) { return(ModalDialogFormHelper.ModalDialogFormLink(linkHtml, dialogContentUrl, dialogTitle, dialogWidth, saveButtonText, cancelButtonText, extraCssClasses, onJavascriptReadyFunction, postData)); } return(new HtmlString(String.Empty)); }
public static HtmlString AddProjectButton() { return(ModalDialogFormHelper.ModalDialogFormLink(GetAddNewProjectButtonText(), ProjectTypeSelectionUrl, $"Add a {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}", 700, ProjectTypeSelectionContinueButtonText, "Cancel", new List <string> { "btn", "btn-firma" }, null, null)); }
public ObligationRequestDetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.ObligationRequest obligationRequest, bool userCanInteractWithSubmissionNotes, EntityNotesViewData obligationRequestNotesViewData) : base(currentFirmaSession) { PageTitle = $"Obligation Request: {obligationRequest.GetObligationRequestNumber()}"; EntityName = "Obligation Request Detail"; ObligationRequest = obligationRequest; IndexUrl = SitkaRoute <ObligationRequestController> .BuildUrlFromExpression(c => c.ObligationRequestIndex()); EditObligationRequestBasicsUrl = SitkaRoute <ObligationRequestController> .BuildUrlFromExpression(c => c.Edit(obligationRequest)); EditRequisitionInformationUrl = SitkaRoute <ObligationRequestController> .BuildUrlFromExpression(c => c.EditRequisitionInformation(obligationRequest)); UserCanEditObligationRequest = new ObligationRequestCreateFeature().HasPermissionByFirmaSession(currentFirmaSession); UserCanEditRequisitionInformation = new ObligationRequestCreateFeature().HasPermissionByFirmaSession(currentFirmaSession); UserCanInteractWithSubmissionNotes = userCanInteractWithSubmissionNotes; ObligationRequestNotesViewData = obligationRequestNotesViewData; // Potential Matches PotentialMatches = obligationRequest.CostAuthorityObligationRequests .SelectMany(x => x.CostAuthorityObligationRequestPotentialObligationNumberMatches).ToList(); PotentialMatchesGridName = "potentialMatchesGrid"; PotentialMatchesGridSpec = new CostAuthorityObligationRequestPotentialObligationNumberMatchGridSpec(currentFirmaSession); PotentialMatchesGridDataUrl = SitkaRoute <ObligationRequestController> .BuildUrlFromExpression(cac => cac.PotentialObligationRequestMatchesJsonData(obligationRequest)); ShowPotentialMatches = obligationRequest.ObligationNumber == null && obligationRequest.Agreement == null && PotentialMatches.Any(); var costAuthorityIDList = obligationRequest.Agreement != null ? obligationRequest.Agreement.AgreementCostAuthorities .Select(x => x.CostAuthorityID).ToList() : new List <int>(); // Match Status MatchStatus = GetMatchStatus(obligationRequest, PotentialMatches); // Unmatch Dialog string unmatchUrl = SitkaRoute <ObligationRequestController> .BuildUrlFromExpression(x => x.ConfirmObligationRequestUnmatch(obligationRequest)); var extraCssClassesForAButton = new List <string>() { "btn", "btn-sm", "btn-firma" }; UnmatchObligationRequestButtonHtml = ModalDialogFormHelper.MakeConfirmDialogLink("Unmatch", unmatchUrl, "Unmatch Obligation Request", "Unmatch", extraCssClassesForAButton, true); CostAuthorityObligationRequestGridName = "costAuthorityObligationRequestGrid"; CostAuthorityObligationRequestGridSpec = new CostAuthorityObligationRequestGridSpec(CurrentFirmaSession, obligationRequest.ObligationRequestStatus == ObligationRequestStatus.Draft, costAuthorityIDList) { ObjectNameSingular = $"{FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabel()} associated with {FieldDefinitionEnum.ObligationRequest.ToType().GetFieldDefinitionLabel()} {obligationRequest.ObligationRequestID.ToString("D4")}", ObjectNamePlural = $"{FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().GetFieldDefinitionLabelPluralized()} associated with {FieldDefinitionEnum.ObligationRequest.ToType().GetFieldDefinitionLabel()} {obligationRequest.ObligationRequestID.ToString("D4")}", SaveFiltersInCookie = true }; CostAuthorityObligationRequestGridDataUrl = SitkaRoute <ObligationRequestController> .BuildUrlFromExpression(cac => cac.CostAuthorityObligationRequestsJsonData(obligationRequest)); }
public DetailViewData(FirmaSession currentFirmaSession, Person personToView, Project.UserProjectGridSpec userProjectGridSpec, string basicProjectInfoGridName, string basicProjectInfoGridDataUrl, UserNotificationGridSpec userNotificationGridSpec, string userNotificationGridName, string userNotificationGridDataUrl, string activateInactivateUrl, ActionItemsUserGridSpec actionItemsUserGridSpec, string actionItemsGridName, string actionItemsGridDataUrl) : base(currentFirmaSession) { Person = personToView; PageTitle = personToView.GetFullNameFirstLast() + (!personToView.IsActive ? " (inactive)" : string.Empty); EntityName = "User"; EditPersonOrganizationPrimaryContactUrl = SitkaRoute <PersonOrganizationController> .BuildUrlFromExpression(c => c.EditPersonOrganizationPrimaryContacts(personToView)); IndexUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.Index()); if (FirmaWebConfiguration.AuthenticationType == AuthenticationType.LocalAuth) { EditDetailBasicsUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.EditUser(personToView.PrimaryKey)); ChangePasswordUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.ChangePassword(personToView.PrimaryKey)); } // And again, here we should take Current FirmaSession, not the person. -- SLG & SG UserHasPersonViewPermissions = new UserViewFeature().HasPermission(currentFirmaSession, personToView).HasPermission; UserHasPersonManagePermissions = new UserEditFeature().HasPermissionByFirmaSession(currentFirmaSession); UserHasAdminPermissions = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession); CurrentPersonCanBeImpersonatedByCurrentUser = new FirmaImpersonateUserFeature().HasPermission(currentFirmaSession, personToView).HasPermission; IsViewingSelf = !currentFirmaSession.IsAnonymousUser() && currentFirmaSession.PersonID == personToView.PersonID; EditRolesLink = UserHasAdminPermissions ? ModalDialogFormHelper.MakeEditIconLink(SitkaRoute <UserController> .BuildUrlFromExpression(c => c.EditRoles(personToView)), $"Edit Roles for User - {personToView.GetFullNameFirstLast()}", true) : new HtmlString(string.Empty); UserProjectGridSpec = userProjectGridSpec; BasicProjectInfoGridName = basicProjectInfoGridName; BasicProjectInfoGridDataUrl = basicProjectInfoGridDataUrl; UserNotificationGridSpec = userNotificationGridSpec; UserNotificationGridName = userNotificationGridName; UserNotificationGridDataUrl = userNotificationGridDataUrl; ActivateInactivateUrl = activateInactivateUrl; TenantHasStewardshipAreas = MultiTenantHelpers.GetProjectStewardshipAreaType() != null; ActionItemsUserGridSpec = actionItemsUserGridSpec; ActionItemsGridName = actionItemsGridName; ActionItemsGridDataUrl = actionItemsGridDataUrl; }
public HtmlString GetRequestOrgAddedToKeystoneModalDialogLink(string linkText) { string requestOrganizationAddedToKeystoneUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(x => x.RequestOrganizationAddedToKeystone()); HtmlString requestOrgAddedToKeystoneModalDialogLink = ModalDialogFormHelper.ModalDialogFormLink(linkText, requestOrganizationAddedToKeystoneUrl, "Request Support", 800, "Submit Request", "Cancel", new List <string>(), null, null); return(requestOrgAddedToKeystoneModalDialogLink); }
public static HtmlString AddObligationRequestButton() { return(ModalDialogFormHelper.ModalDialogFormLink(GetAddNewObligationRequestText(), NewObligationRequestUrl, $"Add a {FieldDefinitionEnum.ObligationRequest.ToType().GetFieldDefinitionLabel()}", 900, "Save", "Cancel", new List <string> { "btn", "btn-firma" }, null, null)); }
public ManageViewData(Person currentPerson, Models.FirmaPage firmaPage, string customNotificationUrl, ProjectUpdateStatusGridSpec projectsRequiringUpdateGridSpec, string projectsRequiringUpdateGridDataUrl, PeopleReceivingReminderGridSpec peopleReceivingReminderGridSpec, string peopleReceivingReminderGridDataUrl, int projectsWithNoContactCount, ProjectUpdateConfiguration projectUpdateConfiguration) : base(currentPerson, firmaPage) { var reportingYear = FirmaDateUtilities.CalculateCurrentYearToUseForRequiredReporting(); PageTitle = $"Manage {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Updates"; ReportingYear = reportingYear; ProjectsRequiringUpdateGridDataUrl = projectsRequiringUpdateGridDataUrl; ProjectsRequiringUpdateGridSpec = projectsRequiringUpdateGridSpec; ProjectsRequiringUpdateGridName = "projectsRequiringAnUpdateGrid"; PeopleReceivingReminderGridDataUrl = peopleReceivingReminderGridDataUrl; ProjectsWithNoContactCount = projectsWithNoContactCount; ProjectUpdateConfiguration = projectUpdateConfiguration ?? ProjectUpdateConfiguration.CreateNewBlank(); PeopleReceivingReminderGridSpec = peopleReceivingReminderGridSpec; PeopleReceivingReminderGridName = "peopleReceivingAnReminderGrid"; KickOffIntroPreviewUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.KickOffIntroPreview()); ReminderIntroPreviewUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.ReminderIntroPreview()); CloseOutIntroPreviewUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.CloseOutIntroPreview()); var getPersonIDFunctionString = $"function() {{ return Sitka.{PeopleReceivingReminderGridName}.getValuesFromCheckedGridRows({0}, \'PersonID\', \'PersonIDList\'); }}"; var modalDialogFormLink = ModalDialogFormHelper.ModalDialogFormLink( "<span class=\"glyphicon glyphicon-envelope\" style=\"margin-right:5px\"></span>Send Notification to Selected People", customNotificationUrl, "Send Notification to Selected People", 700, "Send", "Cancel", new List <string>(), null, getPersonIDFunctionString); PeopleReceivingReminderGridSpec.ArbitraryHtml = new List <string> { modalDialogFormLink.ToString() }; EditProjectUpdateConfigurationUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.EditProjectUpdateConfiguration()); }
public CostAuthorityObligationRequestPotentialObligationNumberMatchGridSpec(FirmaSession currentFirmaSession) { Add(string.Empty, x => ModalDialogFormHelper.MakeInfoIconLink(x.GetPotentialMatchDetailUrl(), "View Details of Potential Match", true), 30, DhtmlxGridColumnFilterType.None); Add(FieldDefinitionEnum.Obligation.ToType().ToGridHeaderString(), pm => UrlTemplate.MakeHrefString(pm.ObligationNumber.GetDetailUrl(), pm.ObligationNumber.ObligationNumberKey), 100, DhtmlxGridColumnFilterType.Text); Add("Total of All Obligation Item Budgets", pm => pm.ObligationNumber.GetWbsElementObligationItemBudgets().Sum(y => y.UnexpendedBalance).ToStringCurrency(), 100, DhtmlxGridColumnFilterType.Numeric); Add("Obligation Item Budget Count", pm => pm.ObligationNumber.GetWbsElementObligationItemBudgets().Count.ToString(), 60, DhtmlxGridColumnFilterType.Numeric); Add(FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().ToGridHeaderString(), a => a.CostAuthorityObligationRequest.CostAuthority.GetDetailLinkUsingCostAuthorityWorkBreakdownStructure(), 200, DhtmlxGridColumnFilterType.Text); Add("Confirm Match", x => ModalDialogFormHelper.MakeConfirmDialogLink("Confirm this match", x.GetPotentialMatchConfirmUrl(), "Confirm Match", null, true), 120, DhtmlxGridColumnFilterType.None); }
/// <summary> /// For making a delete icon on the grid with a delete jquery ui dialog confirm. /// Will make a grey trash can icon if delete is not possible. /// </summary> /// <param name="deleteDialogUrl"></param> /// <param name="userHasDeletePermission">Does the given user have permission to perform a delete?</param> /// <param name="deletePossibleForObject">Is a delete possible for the given object?</param> /// <param name="addDeleteSpan">Is a delete possible for the given object?</param> /// <returns></returns> public static HtmlString MakeDeleteIconAndLinkBootstrap(string deleteDialogUrl, bool userHasDeletePermission, bool deletePossibleForObject, bool addDeleteSpan) { var deleteSpan = addDeleteSpan ? "<span style=\"display:none\">Delete</span>" : string.Empty; var deleteIconToUse = addDeleteSpan ? DeleteIconBootstrap : BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-trash gi-1x blue", "Delete"); var deleteIcon = deletePossibleForObject ? $"{deleteIconToUse}{deleteSpan}" : BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-trash gi-1x disabled").ToString(); return(ModalDialogFormHelper.MakeDeleteLink(deleteIcon, deleteDialogUrl, new List <string>(), userHasDeletePermission)); }
public static void AddTechnicalAssistanceParametersMenuItem(LtInfoMenuItem manageMenu, FirmaSession currentFirmaSession, string menuGroupName) { if (UsesTechnicalAssistanceParameters() && new FirmaAdminFeature().HasPermission(currentFirmaSession).HasPermission) { manageMenu.AddMenuItem(LtInfoMenuItem.MakeItem("Technical Assistance Parameters", ModalDialogFormHelper.ModalDialogFormLink("Technical Assistance Parameters", SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.TechnicalAssistanceParameters()), "Technical Assistance Parameters", 800, "Save", "Cancel", new List <string>(), null, null).ToString(), menuGroupName)); } }
public ProjectTimelineDisplayViewData(ProjectFirmaModels.Models.Project project, Models.ProjectTimeline projectTimeline, bool userHasProjectStatusUpdatePermissions, ProjectStatusLegendDisplayViewData projectStatusLegendDisplayViewData) { ProjectTimeline = projectTimeline; UserHasProjectStatusUpdatePermissions = userHasProjectStatusUpdatePermissions; var updateStatusUrl = SitkaRoute <ProjectProjectStatusController> .BuildUrlFromExpression(tc => tc.New(project)); AddProjectProjectStatusButton = ModalDialogFormHelper.MakeNewIconButton(updateStatusUrl, "Update Status", true); ProjectStatusLegendDisplayViewData = projectStatusLegendDisplayViewData; CurrentProjectStatus = project.GetCurrentProjectStatus(); }
public static HtmlString MakeProjectStatusDetailsLinkButton(ProjectProjectStatus projectProjectStatus) { var detailsLink = ModalDialogFormHelper.ModalDialogFormLinkHiddenSave( null, "Show Details", projectProjectStatus.GetProjectProjectStatusDetailsUrl() , $"{FieldDefinitionEnum.StatusUpdate.ToType().GetFieldDefinitionLabel()} Details" , 900 , "Close" , new List <string>()); return(detailsLink); }
public static HtmlString EditCostAuthorityObligationRequestsButton(this ProjectFirmaModels.Models.ObligationRequest obligationRequest) { var disabledState = obligationRequest.ObligationRequestStatus != ObligationRequestStatus.Draft ? ModalDialogFormHelper.DisabledState.Disabled : ModalDialogFormHelper.DisabledState.NotDisabled; var disabledHoverText = disabledState == ModalDialogFormHelper.DisabledState.Disabled ? "You cannot Add Obligation Item Budget Projections because this Obligation Request is not in a Draft state." : null; return(ModalDialogFormHelper.ModalDialogFormLink(MakeProjectNewObligationsText(), EditCostAuthorityObligationRequestsUrl(obligationRequest), $"Create new Obligation Item Budget Projections", 1100, "Save", "Cancel", new List <string> { "btn", "btn-firma" }, null, null, disabledState, disabledHoverText)); }
public static HtmlString MakeProjectStatusDeleteLinkButton(ProjectProjectStatus projectProjectStatus, bool canEditProjectStatus, bool canEditFinalStatusReport) { var deleteIconAsModalDialogLinkBootstrap = new HtmlString(string.Empty); if ((canEditProjectStatus && !projectProjectStatus.IsFinalStatusUpdate) || (canEditFinalStatusReport && projectProjectStatus.IsFinalStatusUpdate)) { deleteIconAsModalDialogLinkBootstrap = ModalDialogFormHelper.MakeDeleteLink( BootstrapHtmlHelpers.MakeGlyphIconWithScreenReaderOnlyText("glyphicon-trash", "Delete status report").ToString(), projectProjectStatus.GetDeleteProjectProjectStatusUrl(), new List <string> { }, true); } return(deleteIconAsModalDialogLinkBootstrap); }
public GeospatialAreaPerformanceMeasureTargetGridSpec(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.PerformanceMeasure performanceMeasure) { var userHasManagePermissions = new GeospatialAreaPerformanceMeasureTargetManageFeature().HasPermissionByFirmaSession(currentFirmaSession); if (userHasManagePermissions) { Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteGeospatialAreaPerformanceMeasureTargetUrl(performanceMeasure), true), 30, DhtmlxGridColumnFilterType.None); Add(string.Empty, x => ModalDialogFormHelper.MakeEditIconLink(x.GetEditGeospatialAreaPerformanceMeasureTargetUrl(performanceMeasure), $"Edit {FieldDefinitionEnum.PerformanceMeasure.ToType().GetFieldDefinitionLabelPluralized()} Target for {x.GeospatialAreaShortName}", 1000, true, null), 30, DhtmlxGridColumnFilterType.None); } Add("Geospatial Layer", x => x.GeospatialAreaType.GeospatialAreaTypeName, 200, DhtmlxGridColumnFilterType.SelectFilterStrict); Add(FieldDefinitionEnum.GeospatialArea.ToType().ToGridHeaderString(), a => a.GetDisplayNameAsUrl(), 400, DhtmlxGridColumnFilterType.SelectFilterHtmlStrict); Add("Target Value", a => a.GetTargetValueDisplayForGrid(performanceMeasure), 350, DhtmlxGridColumnFilterType.SelectFilterStrict); }
public static HtmlString MakeProjectUpdateDetailsLinkButton(ProjectUpdateBatch projectUpdateBatch) { var url = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(c => c.ProjectUpdateBatchDiff(projectUpdateBatch)); var detailsLink = ModalDialogFormHelper.ModalDialogFormLinkHiddenSave( "diff-link-id", "Show Details", url , $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} Update Change Log" , 1000 , "Close" , new List <string>()); return(detailsLink); }
public DetailViewData(Person currentPerson, Person personToView, UserNotificationGridSpec userNotificationGridSpec, string userNotificationGridName, string userNotificationGridDataUrl, string activateInactivateUrl) : base(currentPerson, NeptuneArea.OCStormwaterTools) { Person = personToView; PageTitle = personToView.GetFullNameFirstLast() + (!personToView.IsActive ? " (inactive)" : string.Empty); EntityName = "Users"; //TODO: This gets pulled up to root EditPersonOrganizationPrimaryContactUrl = SitkaRoute <PersonOrganizationController> .BuildUrlFromExpression(c => c.EditPersonOrganizationPrimaryContacts(personToView)); IndexUrl = SitkaRoute <UserController> .BuildUrlFromExpression(x => x.Index()); JurisdictionIndexUrl = SitkaRoute <JurisdictionController> .BuildUrlFromExpression(x => x.Index()); UserHasPersonViewPermissions = new UserViewFeature().HasPermission(currentPerson, personToView).HasPermission; UserCanManageThisPersonPermissions = new UserEditRoleFeature().HasPermission(currentPerson, personToView).HasPermission; UserCanManagePeople = new UserEditFeature().HasPermissionByPerson(currentPerson); UserIsAdmin = new NeptuneAdminFeature().HasPermissionByPerson(currentPerson); UserHasViewEverythingPermissions = new NeptuneAdminFeature().HasPermissionByPerson(currentPerson); if (UserCanManagePeople) { EntityUrl = IndexUrl; } IsViewingSelf = currentPerson != null && currentPerson.PersonID == personToView.PersonID; EditRolesLink = UserCanManageThisPersonPermissions ? ModalDialogFormHelper.MakeEditIconLink(SitkaRoute <UserController> .BuildUrlFromExpression(c => c.EditRoles(personToView)), $"Edit Roles for User - {personToView.GetFullNameFirstLast()}", true) : new HtmlString(string.Empty); EditJurisdictionsLink = UserCanManageThisPersonPermissions ? ModalDialogFormHelper.MakeEditIconLink(SitkaRoute <UserController> .BuildUrlFromExpression(c => c.EditJurisdiction(personToView)), $"Edit Assigned Jurisdictions for User - {personToView.GetFullNameFirstLast()}", true) : new HtmlString(string.Empty); UserNotificationGridSpec = userNotificationGridSpec; UserNotificationGridName = userNotificationGridName; UserNotificationGridDataUrl = userNotificationGridDataUrl; ActivateInactivateUrl = activateInactivateUrl; }
public CostAuthorityObligationRequestGridSpec(FirmaSession currentFirmaSession, bool isInDraft, List <int> costAuthorityIDListOnObligation) { Add(string.Empty , x => !isInDraft ? new HtmlString("<span style='cursor: not-allowed;' class='glyphicon glyphicon-trash blue disabled' title='You cannot delete this because it is in draft'><span class='sr-only'>You cannot delete this because it is in draft</span></span>") : costAuthorityIDListOnObligation.Contains(x.CostAuthorityID) ? new HtmlString("<span style='cursor: not-allowed;' class='glyphicon glyphicon-trash blue disabled' title='You cannot delete this because it is on the Obligation'><span class='sr-only'>You cannot delete this because it is on the Obligation</span></span>") : ModalDialogFormHelper.MakeDeleteIconLink(x.GetDeleteUrl(), "Delete This Projected Obligation", true) , 30 , DhtmlxGridColumnFilterType.None); Add(string.Empty, x => ModalDialogFormHelper.MakeEditIconLink(x.GetEditUrl(), "Edit Projected Obligation", true), 30, DhtmlxGridColumnFilterType.None); Add(FieldDefinitionEnum.CostAuthorityWorkBreakdownStructure.ToType().ToGridHeaderString("CAWBS"), x => x.CostAuthority.CostAuthorityWorkBreakdownStructure, 300, DhtmlxGridColumnFilterType.Html); Add(FieldDefinitionEnum.AccountStructureDescription.ToType().ToGridHeaderString(), x => x.CostAuthority.AccountStructureDescription, 300, DhtmlxGridColumnFilterType.Html); Add(FieldDefinitionEnum.ProjectedObligation.ToType().ToGridHeaderString(), x => x.ProjectedObligation, 300, DhtmlxGridColumnFormatType.Currency, DhtmlxGridColumnAggregationType.Total); Add(FieldDefinitionEnum.BudgetObjectCode.ToType().ToGridHeaderString(), a => a.BudgetObjectCode?.GetDisplayName(), 120, DhtmlxGridColumnFilterType.Text); Add(FieldDefinitionEnum.RecipientOrganization.ToType().ToGridHeaderString(), a => a.RecipientOrganization?.GetDisplayName(), 120, DhtmlxGridColumnFilterType.Text); Add(FieldDefinitionEnum.TechnicalRepresentative.ToType().ToGridHeaderString(), a => a.TechnicalRepresentativePerson?.GetFullNameFirstLast(), 120, DhtmlxGridColumnFilterType.Text); Add(FieldDefinitionEnum.CostAuthorityObligationRequestNote.ToType().ToGridHeaderString("Notes"), x => x.CostAuthorityObligationRequestNote, 300, DhtmlxGridColumnFilterType.Text); }
public static string CreateGenerateReportUrlHtml(string gridName, SelectProjectsModalDialogForm modalDialogForm) { var tagIconHtml = $"<span style=\"margin-right:5px\">{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-file")}</span>"; var getProjectIDFunctionString = $"function() {{ return Sitka.{gridName}.getValuesFromCheckedGridRows({modalDialogForm.CheckboxColumnIndex}, '{modalDialogForm.ValueColumnName}', '{modalDialogForm.ReturnListName}'); }}"; return(ModalDialogFormHelper.ModalDialogFormLink($"{tagIconHtml} Generate Reports", modalDialogForm.DialogUrl, modalDialogForm.DialogTitle, ModalDialogFormHelper.DefaultDialogWidth, "Generate", "Close", new List <string>(), null, getProjectIDFunctionString, true).ToString()); }
/// <summary> /// For making an edit icon on the grid with an editor in a jquery ui dialog /// </summary> public static HtmlString MakeLtInfoEditIconAsModalDialogLinkBootstrap(ModalDialogForm modalDialogForm) { string linkText = $"{EditIconBootstrap}<span style=\"display:none\">Edit</span>"; List <string> extraCssClasses = new List <string>(); return(ModalDialogFormHelper.ModalDialogFormLink(null, linkText, modalDialogForm.ContentUrl, modalDialogForm.DialogTitle, modalDialogForm.DialogWidth, ModalDialogFormHelper.SaveButtonID, "Save", "Cancel", extraCssClasses, modalDialogForm.OnJavascriptReadyFunction, null, null)); }
private void AddEditAndOrViewColumn() { Add(String.Empty, x => { var latestUpdateState = x.GetLatestUpdateState(); if (!x.IsUpdateMandatory && (latestUpdateState == null || latestUpdateState == ProjectUpdateState.Approved)) { return (ModalDialogFormHelper.ModalDialogFormLink("Begin", SitkaRoute <ProjectController> .BuildUrlFromExpression(y => y.ConfirmNonMandatoryUpdate(x.PrimaryKey)), $"Update this {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}?", 400, "Continue", "Cancel", new List <string> { "btn", "btn-xs", "btn-firma" }, null, null)); } var linkText = "Begin"; if (latestUpdateState == ProjectUpdateState.Created) { linkText = "Edit"; } else if (latestUpdateState == ProjectUpdateState.Returned) { linkText = "Re-Edit"; } else if (latestUpdateState == ProjectUpdateState.Submitted) { linkText = _canStewardProjects ? "Review" : "View"; } return(UrlTemplate.MakeHrefString(x.GetProjectUpdateUrl(), linkText, new Dictionary <string, string> { { "class", "btn btn-xs btn-firma" } })); }, 60); }
public ProjectTimelineProjectStatusChangeEvent(ProjectProjectStatus projectProjectStatus, bool canEditProjectProjectStatus, bool canEditFinalStatusReport) { Date = projectProjectStatus.ProjectProjectStatusUpdateDate; DateDisplay = Date.ToString("MMM dd, yyyy"); FiscalYear = FirmaDateUtilities.CalculateFiscalYearForTenant(Date); Quarter = (Quarter)FirmaDateUtilities.CalculateQuarterForTenant(Date); ProjectTimelineEventType = ProjectTimelineEventType.ProjectStatusChange; TimelineEventTypeDisplayName = projectProjectStatus.IsFinalStatusUpdate ? "Final Status Update" : "Status Updated"; TimelineEventPersonDisplayName = projectProjectStatus.ProjectProjectStatusCreatePerson.GetPersonDisplayNameWithContactTypesListForProject(projectProjectStatus.Project); ProjectTimelineSide = ProjectTimelineSide.Right; EditButton = ProjectTimeline.MakeProjectStatusEditLinkButton(projectProjectStatus, canEditProjectProjectStatus, canEditFinalStatusReport); DeleteButton = ProjectTimeline.MakeProjectStatusDeleteLinkButton(projectProjectStatus, canEditProjectProjectStatus, canEditFinalStatusReport); Color = projectProjectStatus.ProjectStatus.ProjectStatusColor; ShowDetailsLinkHtmlString = ProjectTimeline.MakeProjectStatusDetailsLinkButton(projectProjectStatus); ProjectProjectStatus = projectProjectStatus; ActionItems = projectProjectStatus.ActionItems.ToList(); AddActionItemLinkHtmlString = ModalDialogFormHelper.ModalDialogFormLink(string.Format("<span class='glyphicon glyphicon-plus' style='margin-right: 3px'></span>Add {0}", FieldDefinitionEnum.ActionItem.ToType().GetFieldDefinitionLabel()), SitkaRoute <ActionItemController> .BuildUrlFromExpression(c => c.NewForProjectStatus(projectProjectStatus.Project, projectProjectStatus)), string.Format("Add New {0}", FieldDefinitionEnum.ActionItem.ToType().GetFieldDefinitionLabel()), 700, "Add", "Cancel", new List <string> { }, null, null); }
private void MakeFirmaMenu(FirmaSession currentFirmaSession) { TopLevelLtInfoMenuItems = new List <LtInfoMenuItem> { BuildAboutMenu(currentFirmaSession), BuildProjectsMenu(currentFirmaSession), // WARNING: This has been deleted multiple times. We are manually re-adding it. If a conflict occurs here, lets talk - SMG & SLG BuildAgreementsMenu(currentFirmaSession), //BuildObligationsMenu(currentFirmaSession), BuildProgramInfoMenu(currentFirmaSession) }; if (MultiTenantHelpers.DisplayAccomplishmentDashboard() || MultiTenantHelpers.UsesCustomResultsPages(currentFirmaSession)) { TopLevelLtInfoMenuItems.Add(BuildResultsMenu(currentFirmaSession)); } if (MultiTenantHelpers.DisplayReportsLink()) { TopLevelLtInfoMenuItems.Add(BuildReportsMenu(currentFirmaSession)); } TopLevelLtInfoMenuItems.Add(BuildManageMenu(currentFirmaSession)); TopLevelLtInfoMenuItems.Add(BuildConfigureMenu(currentFirmaSession)); TopLevelLtInfoMenuItems.ForEach(x => x.ExtraTopLevelMenuCssClasses = new List <string> { "navigation-root-item" }); TopLevelLtInfoMenuItems.SelectMany(x => x.ChildMenus).ToList().ForEach(x => x.ExtraTopLevelMenuCssClasses = new List <string> { "navigation-dropdown-item" }); HelpMenu = new LtInfoMenuItem("Help"); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem("Request Support", ModalDialogFormHelper.ModalDialogFormLink("Request Support", RequestSupportUrl, "Request Support", 800, "Submit Request", "Cancel", new List <string>(), null, null).ToString(), "ToolHelp")); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem(new SitkaRoute <HomeController>(c => c.Training()), currentFirmaSession, "Training", "ToolHelp")); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem(new SitkaRoute <HomeController>(c => c.InternalSetupNotes()), currentFirmaSession, "Internal Setup Notes", "ToolHelp")); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem(new SitkaRoute <HomeController>(c => c.ReleaseNotes()), currentFirmaSession, "Release Notes", "ToolHelp")); AddCustomPagesToMenu(currentFirmaSession, FirmaMenuItem.Help, HelpMenu, "CustomHelp"); HelpMenu.AddMenuItem(LtInfoMenuItem.MakeItem("About ProjectFirma", @"<a href='http://www.sitkatech.com/products/ProjectFirma/projectfirma-faqs/' target='_blank'>About ProjectFirma <span class='glyphicon glyphicon-new-window'></span></a>", "ExternalHelp")); }