/// <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)); }
/// <summary> /// For making an edit icon on the grid with an edit jquery ui dialog confirm. /// Will make a grey edit icon if edit is not possible. *** WILL NOT PREVENT AN EDIT FROM HAPPENING! YOU MUST ENFORCE AT THE CONTROLLER LEVEL *** /// </summary> /// <param name="editDialogUrl"></param> /// <param name="formTitle"></param> /// <param name="editPossibleForObject">Is an edit possible for the given object?</param> /// <returns></returns> public static HtmlString MakeEditIconAsModalDialogLinkBootstrap(string editDialogUrl, string formTitle, bool editPossibleForObject) { var editIcon = editPossibleForObject ? $"{EditIconBootstrap}<span style=\"display:none\">Edit</span>" : BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-edit gi-1x disabled").ToString(); return(MakeModalDialogLink(editIcon, editDialogUrl, ModalDialogFormHelper.DefaultDialogWidth, formTitle, null)); }
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()); }
/// <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 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()); }
public static HtmlString MakeEditIconLink(string dialogUrl, string dialogTitle, int width, bool hasPermission) { return(hasPermission ? ModalDialogFormLink(null, BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-edit").ToString(), dialogUrl, dialogTitle, width, SaveButtonID, "Save", "Cancel", new List <string>(), null, null, null) : new HtmlString(string.Empty)); }
public ProjectAttachmentGridSpec(bool hasManagePermissions) { var projectFieldDefinitionLabel = FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel(); var attachmentTypeFieldDefinitionLabel = FieldDefinitionEnum.AttachmentType.ToType().GetFieldDefinitionLabel(); if (hasManagePermissions) { Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(), true, true), 30, DhtmlxGridColumnFilterType.None); Add(string.Empty, a => DhtmlxGridHtmlHelpers.MakeLtInfoEditIconAsModalDialogLinkBootstrap(new ModalDialogForm(a.GetEditUrl(), $"Edit Attachment \"{a.ProjectAttachmentDisplayName}\"")), 30, DhtmlxGridColumnFilterType.None); } Add($"Attachment Name", a => UrlTemplate.MakeHrefString(a.GetFileResourceUrl(), a.ProjectAttachmentDisplayName + " " + BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-download"), new Dictionary <string, string> { { "target", "_blank" } }), 240); Add($"Attachment Description", a => a.ProjectAttachmentDescription, 240); Add($"{projectFieldDefinitionLabel} Name", a => UrlTemplate.MakeHrefString(a.GetProjectDetailUrl(), a.ProjectName), 240, DhtmlxGridColumnFilterType.Text); Add($"{attachmentTypeFieldDefinitionLabel}", a => a.AttachmentTypeName, 240, DhtmlxGridColumnFilterType.SelectFilterStrict); Add($"File Type", a => FileResourceMimeType.AllLookupDictionary[a.FileResourceMimeTypeID].FileResourceMimeTypeName, 240, DhtmlxGridColumnFilterType.SelectFilterStrict); }
public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.PerformanceMeasure performanceMeasure, PerformanceMeasureChartViewData performanceMeasureChartViewData, EntityNotesViewData entityNotesViewData, bool userHasPerformanceMeasureManagePermissions, bool isAdmin) : base(currentFirmaSession) { PageTitle = performanceMeasure.PerformanceMeasureDisplayName; EntityName = "PerformanceMeasure Detail"; PerformanceMeasure = performanceMeasure; PerformanceMeasureChartViewData = performanceMeasureChartViewData; EntityNotesViewData = entityNotesViewData; UserHasPerformanceMeasureOverviewManagePermissions = userHasPerformanceMeasureManagePermissions; IsAdmin = isAdmin; EditPerformanceMeasureUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.Edit(performanceMeasure)); EditSubcategoriesAndOptionsUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditSubcategoriesAndOptions(performanceMeasure)); var performanceMeasuresExternallySourced = HttpRequestStorage.Tenant.ArePerformanceMeasuresExternallySourced; CanEditImportanceAndAdditionalInformation = !performanceMeasuresExternallySourced; EditImportanceUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.Importance)); EditAdditionalInformationUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.AdditionalInformation)); EditCriticalDefinitionsUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.CriticalDefinitions)); EditProjectReportingUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.ProjectReporting)); IndexUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.Index()); var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel(); TaxonomyTierDisplayNamePluralized = associatePerformanceMeasureTaxonomyLevel.GetFieldDefinition().GetFieldDefinitionLabelPluralized(); UserHasTaxonomyTierPerformanceMeasureManagePermissions = new TaxonomyTierPerformanceMeasureManageFeature().HasPermission(currentFirmaSession, performanceMeasure).HasPermission; EditTaxonomyTiersUrl = SitkaRoute <TaxonomyTierPerformanceMeasureController> .BuildUrlFromExpression(c => c.Edit(performanceMeasure)); RelatedTaxonomyTiersViewData = new RelatedTaxonomyTiersViewData(performanceMeasure, associatePerformanceMeasureTaxonomyLevel, true); // Hide GeoSpatialArea panel on tenants where performance measures are externally sourced ShowGeoSpatialAreaPanel = !performanceMeasuresExternallySourced; CanAddGeospatialArea = new GeospatialAreaPerformanceMeasureTargetManageFeature().HasPermissionByFirmaSession(currentFirmaSession); PerformanceMeasureReportedValuesGridSpec = new PerformanceMeasureReportedValuesGridSpec(performanceMeasure) { ObjectNameSingular = $"{FieldDefinitionEnum.ReportedValue.ToType().GetFieldDefinitionLabel()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.ReportedValue.ToType().GetFieldDefinitionLabelPluralized()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true }; PerformanceMeasureReportedValuesGridName = "performanceMeasuresReportedValuesFromPerformanceMeasureGrid"; PerformanceMeasureReportedValuesGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.PerformanceMeasureReportedValuesGridJsonData(performanceMeasure)); PerformanceMeasureExpectedGridSpec = new PerformanceMeasureExpectedGridSpec(performanceMeasure) { ObjectNameSingular = $"{FieldDefinitionEnum.ExpectedValue.ToType().GetFieldDefinitionLabel()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.ExpectedValue.ToType().GetFieldDefinitionLabelPluralized()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true }; PerformanceMeasureExpectedsGridName = "performanceMeasuresExpectedValuesFromPerformanceMeasureGrid"; PerformanceMeasureExpectedsGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.PerformanceMeasureExpectedsGridJsonData(performanceMeasure)); GeospatialAreaPerformanceMeasureTargetGridSpec = new GeospatialAreaPerformanceMeasureTargetGridSpec(currentFirmaSession, performanceMeasure) { ObjectNameSingular = $"{FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabel()} Target for {performanceMeasure.GetDisplayName()}", ObjectNamePlural = $"{FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabel()} Targets for {performanceMeasure.GetDisplayName()}", SaveFiltersInCookie = true }; GeospatialAreaPerformanceMeasureTargetGridName = "geospatialAreaPerformanceMeasuresTargetsGrid"; GeospatialAreaPerformanceMeasureTargetGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.GeospatialAreaPerformanceMeasureTargetsGridJsonData(performanceMeasure)); AddGeospatialAreaPerformanceMeasureTargetDialogTitle = $"Add {FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabelPluralized()} to {performanceMeasure.GetDisplayName()}"; AddGeospatialAreaPerformanceMeasureTargetText = $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Add {FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabel()}"; AddGeospatialAreaPerformanceMeasureTargetUrl = SitkaRoute <GeospatialAreaPerformanceMeasureTargetController> .BuildUrlFromExpression(x => x.AddGeospatialAreaToPerformanceMeasure(performanceMeasure)); EditPerformanceMeasureTargetUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(pmc => pmc.EditPerformanceMeasureReportedValues(performanceMeasure)); FieldDefinitionForPerformanceMeasure = FieldDefinitionEnum.PerformanceMeasure.ToType(); FieldDefinitionForPerformanceMeasureType = FieldDefinitionEnum.PerformanceMeasureType.ToType(); FieldDefinitionForPerformanceMeasureSubcategory = FieldDefinitionEnum.PerformanceMeasureSubcategory.ToType(); FieldDefinitionForPerformanceMeasureSubcategoryOption = FieldDefinitionEnum.PerformanceMeasureSubcategoryOption.ToType(); FieldDefinitionForProject = FieldDefinitionEnum.Project.ToType(); }
public static HtmlString ToCheckboxImageOrEmpty(this bool value) { return(new HtmlString(value ? $" {BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-ok-circle", "Yes")} " : String.Empty)); }
private static string GetAddNewProjectButtonText() => $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Add {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}";
private static string MakeProjectNewObligationsText() => $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Create New Obligation Item Budget Projections";
private static string GetAddNewObligationRequestText() => $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Create a new {FieldDefinitionEnum.ObligationRequest.ToType().GetFieldDefinitionLabel()}";
public static HtmlString MakeEditIconButton(string dialogUrl, string linkText, string dialogTitle, bool hasPermission) { return(hasPermission ? ModalDialogFormLink($"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-edit")} {linkText}", dialogUrl, dialogTitle, DefaultDialogWidth, "Save", "Cancel", new List <string> { "btn", "btn-firma" }, null, null) : new HtmlString(string.Empty)); }
public static HtmlString MakeNewIconButton(string dialogUrl, string dialogTitle, int width, bool hasPermission) { return(hasPermission ? ModalDialogFormLink($"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} {dialogTitle}", dialogUrl, dialogTitle, width, "Save", "Cancel", new List <string> { "btn", "btn-firma" }, null, null) : new HtmlString(string.Empty)); }
public static HtmlString MakeDeleteIconLink(string deleteDialogUrl, bool userHasDeletePermission) { return(userHasDeletePermission ? ModalDialogFormLink(BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-trash gi-1x blue").ToString(), deleteDialogUrl, "Confirm Delete", 500, "Delete", "Cancel", new List <string>(), null, null) : new HtmlString(string.Empty)); }