/// <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));
        }
        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 OnlandVisualTrashAssessmentAreaIndexGridSpec(Person currentPerson)
        {
            if (currentPerson.IsManagerOrAdmin())
            {
                Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(), true, true), 25, DhtmlxGridColumnFilterType.None);
            }

            if (currentPerson.IsJurisdictionEditorOrManagerOrAdmin())
            {
                Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeModalDialogLink(
                        BootstrapHtmlHelpers.MakeGlyphIconWithHiddenText("glyphicon-plus", "Reassess this OVTA Area")
                        .ToString(),
                        x.GetBeginOVTAUrl(), 500, "Begin OVTA", true, "Begin", "Cancel",
                        new List <string>(), null, null), 30, DhtmlxGridColumnFilterType.None);
            }

            Add("Assessment Area Name",
                x => x.GetDisplayNameAsDetailUrl(currentPerson) ?? new HtmlString("Not Set"), 170,
                DhtmlxGridColumnFilterType.Html);

            Add(FieldDefinitionType.BaselineScore.ToGridHeaderString(), x => x.GetBaselineScoreAsHtmlString(), 150,
                DhtmlxGridColumnFilterType.SelectFilterHtmlStrict);
            Add(FieldDefinitionType.ProgressScore.ToGridHeaderString(), x => x.GetProgressScoreAsHtmlString(), 150,
                DhtmlxGridColumnFilterType.SelectFilterHtmlStrict);
            Add("Number of Assessments Completed", x => x.OnlandVisualTrashAssessments.Count, 170,
                DhtmlxGridColumnAggregationType.Total);
            Add("Last Assessment Date", x => x.GetLastAssessmentDate(), 120, DhtmlxGridColumnFormatType.Date);
            Add(FieldDefinitionType.Jurisdiction.ToGridHeaderString("Jurisdiction"), x => x.StormwaterJurisdiction?.GetDisplayNameAsDetailUrl() ?? new HtmlString("Not Set"), 170);
        }
示例#4
0
        /// <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));
        }
示例#5
0
        private static HtmlString MakeAlertButton(string alertDialogTitle, string alertDialogText, string alertDialogButtonText, string gridButtonHtml)
        {
            var cssClasses = new List <string> {
                "btn", "btn-xs", "btn-firma"
            };

            return(BootstrapHtmlHelpers.MakeModalDialogAlertButton(alertDialogText, alertDialogTitle, alertDialogButtonText, gridButtonHtml, cssClasses));
        }
示例#6
0
 public static HtmlString MakeDisabledSectionLink(string sectionLabel)
 {
     return(BootstrapHtmlHelpers.MakeModalDialogAlertLink(string.Format("Unable to edit {0} until Basics are complete", sectionLabel),
                                                          string.Format("Unable to Edit {0}", sectionLabel),
                                                          "Close",
                                                          sectionLabel,
                                                          new List <string> {
         "disabledSection"
     }));
 }
示例#7
0
 public static HtmlString MakeDisabledSectionLinkForApprovedAndRejectedProjects(string sectionLabel)
 {
     return(BootstrapHtmlHelpers.MakeModalDialogAlertLink($"Unable to edit {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} through this wizard.",
                                                          string.Format("Unable to Edit {0}", sectionLabel),
                                                          "Close",
                                                          sectionLabel,
                                                          new List <string> {
         "disabledSection"
     }));
 }
        /// <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));
        }
示例#9
0
        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);
        }
示例#10
0
        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 OnlandVisualTrashAssessmentIndexGridSpec(Person currentPerson, bool showName)
        {
            Add(string.Empty, x => x.GetDetailUrlForGrid(currentPerson), 40, DhtmlxGridColumnFilterType.None);

            if (currentPerson.IsManagerOrAdmin())
            {
                Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(), true, true), 25, DhtmlxGridColumnFilterType.None);
            }

            if (currentPerson.IsJurisdictionEditorOrManagerOrAdmin())
            {
                Add(string.Empty, x => x.GetEditUrlForGrid(currentPerson), 80, DhtmlxGridColumnFilterType.None);
                Add(string.Empty, x => x.OnlandVisualTrashAssessmentArea != null
                    ? DhtmlxGridHtmlHelpers.MakeModalDialogLink(
                        BootstrapHtmlHelpers.MakeGlyphIconWithHiddenText("glyphicon-plus", "Reassess this OVTA Area")
                        .ToString(),
                        x.OnlandVisualTrashAssessmentArea.GetBeginOVTAUrl(), 500, "Begin OVTA", true, "Begin", "Cancel",
                        new List <string>(), null, null)
                    : new HtmlString(""), 30, DhtmlxGridColumnFilterType.None);
            }

            if (showName)
            {
                Add("Assessment Area Name",
                    x => x.OnlandVisualTrashAssessmentArea?.GetDisplayNameAsDetailUrl(currentPerson) ?? new HtmlString("Not Set"), 170,
                    DhtmlxGridColumnFilterType.Html);
            }

            Add(FieldDefinitionType.AssessmentScore.ToGridHeaderString(), x => x.OnlandVisualTrashAssessmentScore?.OnlandVisualTrashAssessmentScoreDisplayName, 100,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Assessment Type", x => x.ToBaselineProgress(), 75,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Last Assessment Date", x => x.CompletedDate, 120, DhtmlxGridColumnFormatType.Date);
            Add("Status", x => x.OnlandVisualTrashAssessmentStatus.OnlandVisualTrashAssessmentStatusDisplayName, 120, DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add(FieldDefinitionType.Jurisdiction.ToGridHeaderString("Jurisdiction"), x => x.StormwaterJurisdiction?.GetDisplayNameAsDetailUrl() ?? new HtmlString("Not Set"), 170);

            Add("Created By", x => x.CreatedByPerson.GetFullNameFirstLastAsUrl(), 115,
                DhtmlxGridColumnFilterType.SelectFilterHtmlStrict);
            Add("Created On", x => x.CreatedDate, 120, DhtmlxGridColumnFormatType.Date);
        }
示例#12
0
 /// <summary>
 ///  Magnifying glass
 /// </summary>
 public static HtmlString MakeInfoIconLink(string dialogUrl, string dialogTitle, int width, bool hasPermission)
 {
     return(hasPermission ? ModalDialogFormLink(null, BootstrapHtmlHelpers.MakeGlyphIconWithScreenReaderOnlyText("glyphicon-search gi-1x blue", dialogTitle).ToString(), dialogUrl, dialogTitle, width, HiddenSaveButtonID, "NotARealSaveButton", "Close", new List <string>(), null, null, null) : new HtmlString(string.Empty));
 }
示例#13
0
 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));
 }
示例#14
0
 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));
 }
示例#15
0
 public static HtmlString MakeEditIconLink(string dialogUrl, string dialogTitle, int width, bool hasPermission, string optionalDialogFormID)
 {
     return(hasPermission ? ModalDialogFormLink(null, BootstrapHtmlHelpers.MakeGlyphIconWithScreenReaderOnlyText("glyphicon-edit blue", dialogTitle).ToString(), dialogUrl, dialogTitle, width, SaveButtonID, "Save", "Cancel", new List <string>(), null, null, optionalDialogFormID) : new HtmlString(string.Empty));
 }
示例#16
0
 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));
 }
示例#17
0
 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));
 }
示例#18
0
        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 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 static HtmlString ToCheckboxImageOrEmpty(this bool value)
 {
     return(new HtmlString(value ? $" {BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-ok-circle", "Yes")} " : String.Empty));
 }
示例#21
0
 private static string GetAddNewObligationRequestText() =>
 $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Create a new {FieldDefinitionEnum.ObligationRequest.ToType().GetFieldDefinitionLabel()}";
示例#22
0
 private static string MakeProjectNewObligationsText() =>
 $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Create New Obligation Item Budget Projections";
示例#23
0
        public WaterQualityManagementPlanIndexGridSpec(Person currentPerson)
        {
            var fieldDefinitionWaterQualityManagementPlan = FieldDefinitionType.WaterQualityManagementPlan;
            var waterQualityManagementPlanLabelSingular   =
                fieldDefinitionWaterQualityManagementPlan.GetFieldDefinitionLabel();

            ObjectNameSingular  = waterQualityManagementPlanLabelSingular;
            ObjectNamePlural    = fieldDefinitionWaterQualityManagementPlan.GetFieldDefinitionLabelPluralized();
            SaveFiltersInCookie = true;

            var waterQualityManagementPlanDeleteFeature = new WaterQualityManagementPlanDeleteFeature();
            var qualityManagementPlanManageFeature      = new WaterQualityManagementPlanManageFeature();
            var isAnonymousOrUnassigned = currentPerson.IsAnonymousOrUnassigned();

            Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(),
                                                                                        waterQualityManagementPlanDeleteFeature.HasPermission(currentPerson, x).HasPermission), 26,
                DhtmlxGridColumnFilterType.None);
            Add(string.Empty,
                x => DhtmlxGridHtmlHelpers.MakeEditIconAsModalDialogLinkBootstrap(new ModalDialogForm(x.GetEditUrl(),
                                                                                                      ModalDialogFormHelper.DefaultDialogWidth,
                                                                                                      $"Edit {waterQualityManagementPlanLabelSingular}"),
                                                                                  qualityManagementPlanManageFeature.HasPermission(currentPerson, x).HasPermission),
                26, DhtmlxGridColumnFilterType.None);
            Add("Name", x => x.GetDisplayNameAsUrl(), 300, DhtmlxGridColumnFilterType.Text);
            Add("Jurisdiction", x => isAnonymousOrUnassigned ? new HtmlString(x.StormwaterJurisdiction.GetOrganizationDisplayName()) : x.StormwaterJurisdiction.GetDisplayNameAsDetailUrl(), 150);
            Add("Priority", x => x.WaterQualityManagementPlanPriority?.WaterQualityManagementPlanPriorityDisplayName,
                100, DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Status", x => x.WaterQualityManagementPlanStatus?.WaterQualityManagementPlanStatusDisplayName, 100,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Development Type",
                x => x.WaterQualityManagementPlanDevelopmentType?.WaterQualityManagementPlanDevelopmentTypeDisplayName,
                100, DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Land Use", x => x.WaterQualityManagementPlanLandUse?.WaterQualityManagementPlanLandUseDisplayName, 100,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Permit Term",
                x => x.WaterQualityManagementPlanPermitTerm?.WaterQualityManagementPlanPermitTermDisplayName, 100,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Approval Date", x => x.ApprovalDate, 120);
            Add("Date of Construction", x => x.DateOfContruction, 120);
            Add(FieldDefinitionType.HydromodificationApplies.ToGridHeaderString(), x => x.HydromodificationAppliesType?.HydromodificationAppliesTypeDisplayName, 130,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Hydrologic Subarea", x => x.HydrologicSubarea?.HydrologicSubareaName, 120,
                DhtmlxGridColumnFilterType.SelectFilterStrict);

            if (!currentPerson.IsAnonymousOrUnassigned())
            {
                Add("Maintenance Contact Organization", x => x.MaintenanceContactOrganization, 120);
                Add("Maintenance Contact Name", x => x.MaintenanceContactName, 100);
                Add("Maintenance Contact Address", x => x.MaintenanceContactAddressToString(), 200);
                Add("Maintenance Contact Phone", x => x.MaintenanceContactPhone, 70);
            }

            Add("# of Inventoried BMPs", x => currentPerson.GetInventoriedBMPsForWQMP(x).Count(), 100);
            Add("# of Simplified BMPs", x => x.QuickBMPs.Count, 100);
            Add("Modeling Approach", x => x.WaterQualityManagementPlanModelingApproach.WaterQualityManagementPlanModelingApproachDisplayName,
                100, DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add(FieldDefinitionType.FullyParameterized.ToGridHeaderString("Fully Parameterized?"), x => x.IsFullyParameterized() ? new HtmlString("Yes") : new HtmlString("No"), 120);
            Add("# of Documents", x => x.WaterQualityManagementPlanDocuments.Count, 100);
            Add(FieldDefinitionType.HasAllRequiredDocuments.ToGridHeaderString(),
                x => x.HasAllRequiredDocuments()
                    ? BootstrapHtmlHelpers.MakeGlyphIconWithHiddenText("glyphicon-ok-circle", "Yes")
                    : new HtmlString("<span style='display:none;'>No</span>")
                , 100, DhtmlxGridColumnFilterType.SelectFilterHtmlStrict, DhtmlxGridColumnAlignType.Center);
            Add("Record Number", x => x.RecordNumber, 150);
            Add("Recorded Parcel Acreage", x => x.RecordedWQMPAreaInAcres, 100);
            Add("Calculated Parcel Acreage", x => Math.Round(x.CalculateParcelAcreageTotal(), 1), 100);
            Add("Latest O&M Verification",
                x => currentPerson.IsAnonymousOrUnassigned() ? new HtmlString(x.GetLatestOandMVerificationDate().IsNullOrWhiteSpace()
                    ? "N/A" : x.GetLatestOandMVerificationDate()) :new HtmlString(!x.GetLatestOandMVerificationDate().IsNullOrWhiteSpace()
                    ? $"<a href=\"{x.GetLatestOandMVerificationUrl()}\" alt=\"{x.GetLatestOandMVerificationDate()}\" title=\"{x.GetLatestOandMVerificationDate()}\" >{x.GetLatestOandMVerificationDate()}</a>"
                    : "N/A"), 100);
            Add(FieldDefinitionType.TrashCaptureStatus.ToGridHeaderString(),
                x => x.TrashCaptureStatusType.TrashCaptureStatusTypeDisplayName, 130,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
        }
 private static string GetAddNewProjectButtonText() =>
 $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Add {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}";