public GrantDetailViewData(Person currentPerson,
                                   Models.Grant grant,
                                   EntityNotesViewData grantNotesViewData,
                                   EntityNotesViewData internalNotesViewData)
            : base(currentPerson, grant)
        {
            PageTitle                  = grant.GrantTitle.ToEllipsifiedStringClean(110);
            BreadCrumbTitle            = $"{Models.FieldDefinition.Grant.GetFieldDefinitionLabel()} Detail";
            NewGrantNoteUrl            = grant.GetNewNoteUrl();
            GrantNotesViewData         = grantNotesViewData;
            InternalGrantNotesViewData = internalNotesViewData;

            GrantModificationGridSpec    = new GrantModificationGridSpec(currentPerson, grant);
            GrantModificationGridName    = "grantModificationsGridName";
            GrantModificationGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantModificationGridJsonDataByGrant(grant.PrimaryKey));

            //GrantAllocationGridSpec = new GrantAllocationGridSpec(currentPerson, GrantAllocationGridSpec.GrantAllocationGridCreateButtonType.Shown, grant);
            //GrantAllocationGridName = "grantAllocationsGridName";
            //GrantAllocationGridDataUrlTemplate = SitkaRoute<GrantController>.BuildUrlFromExpression(tc => tc.GrantAllocationGridJsonDataByGrantModification(UrlTemplate.Parameter1Int));

            GrantAllocationBudgetLineItemGridSpec    = new GrantAllocationBudgetLineItemGridSpec();
            GrantAllocationBudgetLineItemGridName    = "grantAllocationBudgetLineItemsGridName";
            GrantAllocationBudgetLineItemGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantAllocationBudgetLineItemGridJsonDataByGrant(grant));

            GrantAgreementGridSpec    = new GrantAgreementGridSpec();
            GrantAgreementGridName    = "grantAgreementGridName";
            GrantAgreementGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantAgreementGridJsonData(grant));

            GrantDetailsFileDetailsViewData = new FileDetailsViewData(
                EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(grant.GrantFileResources)),
                SitkaRoute <GrantController> .BuildUrlFromExpression(x => x.NewGrantFiles(grant.PrimaryKey)),
                new GrantEditAsAdminFeature().HasPermission(currentPerson, grant).HasPermission,
                Models.FieldDefinition.Grant
                );
        }
        public InteractionEventDetailViewData(Person currentPerson, Models.InteractionEvent interactionEvent, string locationMapFormID, MapInitJson interactionEventLocationSummaryMapInitJson) : base(currentPerson)
        {
            IndexUrl = SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x => x.Index());

            EditInteractionEventBasicsUrl = SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x => x.EditInteractionEvent(interactionEvent.PrimaryKey));

            EditInteractionEventLocationSimpleUrl =
                SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x =>
                                                                                x.EditInteractionEventLocation(interactionEvent.PrimaryKey));

            UserHasInteractionEventManagePermissions = new InteractionEventManageFeature().HasPermissionByPerson(currentPerson);
            InteractionEvent         = interactionEvent;
            InteractionEventContacts = interactionEvent.InteractionEventContacts.ToList();
            InteractionEventProjects = interactionEvent.InteractionEventProjects.ToList();
            LocationMapFormID        = locationMapFormID;
            InteractionEventLocationSummaryMapInitJson = interactionEventLocationSummaryMapInitJson;
            PageTitle = interactionEvent.InteractionEventTitle;

            var canEditDocuments = new InteractionEventManageFeature().HasPermissionByPerson(CurrentPerson);

            InteractionEventDetailFileDetailsViewData = new FileDetailsViewData(
                EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(interactionEvent.InteractionEventFileResources)),
                SitkaRoute <InteractionEventController> .BuildUrlFromExpression(x => x.NewInteractionEventFiles(interactionEvent.PrimaryKey)),
                canEditDocuments,
                Models.FieldDefinition.InteractionEvent
                );
        }
Esempio n. 3
0
        public DetailViewData(Person currentPerson, Models.PriorityLandscape priorityLandscape, MapInitJson mapInitJson, ViewGoogleChartViewData viewGoogleChartViewData, List <Models.PerformanceMeasure> performanceMeasures) : base(currentPerson)
        {
            PriorityLandscape       = priorityLandscape;
            MapInitJson             = mapInitJson;
            ViewGoogleChartViewData = viewGoogleChartViewData;
            PageTitle  = priorityLandscape.PriorityLandscapeName;
            EntityName = "PriorityLandscape";
            UserHasPriorityLandscapeManagePermissions = new PriorityLandscapeManageFeature().HasPermissionByPerson(currentPerson);
            IndexUrl = SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(x => x.Index());

            BasicProjectInfoGridName = "priorityLandscapeProjectListGrid";
            BasicProjectInfoGridSpec = new ProjectIndexGridSpec(CurrentPerson, false, false, new Dictionary <int, vTotalTreatedAcresByProject>())
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} in this {Models.FieldDefinition.PriorityLandscape.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} in this {Models.FieldDefinition.PriorityLandscape.GetFieldDefinitionLabel()}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(priorityLandscape));

            PerformanceMeasureChartViewDatas = performanceMeasures.Select(x => priorityLandscape.GetPerformanceMeasureChartViewData(x, CurrentPerson)).ToList();

            EditPriorityLandscapeBasicsUrl = SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(plc => plc.EditPriorityLandscape(priorityLandscape));

            PriorityLandscapeFileDetailsViewData = new FileDetailsViewData(
                EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(priorityLandscape.PriorityLandscapeFileResources)),
                SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(x => x.NewPriorityLandscapeFiles(priorityLandscape.PrimaryKey)),
                UserHasPriorityLandscapeManagePermissions,
                Models.FieldDefinition.PriorityLandscape
                );
        }
        public GrantModificationDetailViewData(Person currentPerson,
                                               Models.GrantModification grantModification,
                                               EntityNotesViewData internalGrantModificationNotesViewData) : base(currentPerson)
        {
            Check.EnsureNotNull(currentPerson);
            Check.EnsureNotNull(grantModification);

            GrantModification = grantModification;
            PageTitle         = grantModification.GrantModificationName;
            BreadCrumbTitle   = $"{Models.FieldDefinition.GrantModification.GetFieldDefinitionLabel()} Detail";
            InternalGrantModificationNotesViewData = internalGrantModificationNotesViewData;
            ParentGrantUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(gc => gc.GrantDetail(grantModification.GrantID));

            BackToParentGrantUrlText       = $"Back to {Models.FieldDefinition.Grant.GetFieldDefinitionLabel()}: {grantModification.Grant.GrantName}";
            EditGrantModificationBasicsUrl = SitkaRoute <GrantModificationController> .BuildUrlFromExpression(gmc => gmc.EditGrantModification(grantModification.PrimaryKey));

            UserHasEditGrantModificationPermissions = new GrantModificationEditAsAdminFeature().HasPermissionByPerson(currentPerson);

            var canEditDocuments = new GrantModificationEditAsAdminFeature().HasPermission(currentPerson, grantModification).HasPermission;

            GrantModificationDetailFileDetailsViewData = new FileDetailsViewData(
                EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(grantModification.GrantModificationFileResources)),
                SitkaRoute <GrantModificationController> .BuildUrlFromExpression(x => x.NewGrantModificationFiles(grantModification.PrimaryKey)),
                canEditDocuments,
                Models.FieldDefinition.GrantModification
                );

            var relevantGrant = grantModification.Grant;

            GrantAllocationGridSpec    = new GrantAllocationGridSpec(currentPerson, GrantAllocationGridSpec.GrantAllocationGridCreateButtonType.Shown, relevantGrant);
            GrantAllocationGridName    = "grantAllocationsGridName";
            GrantAllocationGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantAllocationGridJsonDataByGrantModification(grantModification));
        }
Esempio n. 5
0
        public DetailViewData(Person currentPerson, Models.GrantAllocation grantAllocation
                              , GrantAllocationBasicsViewData grantAllocationBasicsViewData
                              , EntityNotesViewData grantAllocationNotesViewData
                              , EntityNotesViewData grantAllocationNoteInternalsViewData
                              , ViewGoogleChartViewData viewGoogleChartViewData
                              , GridSpec <Models.ProjectGrantAllocationRequest> projectGrantAllocationRequestsGridSpec
                              , GrantAllocationExpendituresGridSpec grantAllocationExpendituresGridSpec)
            : base(currentPerson, grantAllocation)
        {
            PageTitle       = grantAllocation.GrantAllocationName.ToEllipsifiedStringClean(110);
            BreadCrumbTitle = $"{Models.FieldDefinition.GrantAllocation.GetFieldDefinitionLabel()} Detail";

            GrantAllocationBasicsViewData = grantAllocationBasicsViewData;
            GrantAllocationNotesViewData  = grantAllocationNotesViewData;

            NewGrantAllocationNoteUrl            = grantAllocation.GetNewNoteUrl();
            GrantAllocationNoteInternalsViewData = grantAllocationNoteInternalsViewData;

            ViewGoogleChartViewData = viewGoogleChartViewData;

            var projectGrantAllocationExpenditures = GrantAllocation.ProjectGrantAllocationExpenditures.ToList();

            CalendarYearsForProjectExpenditures = projectGrantAllocationExpenditures.CalculateCalendarYearRangeForExpenditures(grantAllocation);

            ProjectCalendarYearExpendituresGridSpec = new ProjectCalendarYearExpendituresGridSpec(CalendarYearsForProjectExpenditures)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            ProjectCalendarYearExpendituresGridName    = "projectsCalendarYearExpendituresFromGrantAllocationGrid";
            ProjectCalendarYearExpendituresGridDataUrl = SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(tc => tc.ProjectCalendarYearExpendituresGridJsonData(grantAllocation));

            ProjectGrantAllocationRequestsGridSpec    = projectGrantAllocationRequestsGridSpec;
            ProjectGrantAllocationRequestsGridName    = "projectsGrantAllocationRequestsFromGrantAllocationGrid";
            ProjectGrantAllocationRequestsGridDataUrl = SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(tc => tc.ProjectGrantAllocationRequestsGridJsonData(grantAllocation));

            GrantAllocationExpendituresGridSpec    = grantAllocationExpendituresGridSpec;
            GrantAllocationExpendituresGridName    = "grantAllocationExpendituresGrid";
            GrantAllocationExpendituresGridDataUrl = SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(gac => gac.GrantAllocationExpendituresGridJsonData(grantAllocation));

            GrantAllocationBudgetLineItemsViewData = new GrantAllocationBudgetLineItemsViewData(currentPerson, grantAllocation, grantAllocation.GrantAllocationBudgetLineItems.ToList());
            GrantAllocationBudgetVsActualsViewData = new GrantAllocationBudgetVsActualsViewData(currentPerson, grantAllocation);

            var canEditDocuments = new GrantAllocationEditAsAdminFeature().HasPermission(currentPerson, grantAllocation).HasPermission;

            GrantAllocationDetailsFileDetailsViewData = new FileDetailsViewData(
                EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(grantAllocation.GrantAllocationFileResources)),
                SitkaRoute <GrantAllocationController> .BuildUrlFromExpression(x => x.NewGrantAllocationFiles(grantAllocation.PrimaryKey)),
                canEditDocuments,
                Models.FieldDefinition.GrantAllocation
                );
        }
        public DocumentsAndNotesViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, UpdateStatus updateStatus, string diffUrl) : base(currentPerson, projectUpdateBatch, updateStatus, new List <string>(), ProjectUpdateSection.NotesAndDocuments.ProjectUpdateSectionDisplayName)
        {
            EntityNotesViewData = new EntityNotesViewData(EntityNote.CreateFromEntityNote(new List <IEntityNote>(projectUpdateBatch.ProjectNoteUpdates)),
                                                          SitkaRoute <ProjectNoteUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch)),
                                                          projectUpdateBatch.Project.DisplayName,
                                                          IsEditable);
            ProjectDocumentsViewData = new ProjectDocumentsDetailViewData(EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(projectUpdateBatch.ProjectDocumentUpdates)),
                                                                          SitkaRoute <ProjectDocumentUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch)),
                                                                          projectUpdateBatch.Project.DisplayName,
                                                                          IsEditable);
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshNotesAndDocuments(projectUpdateBatch.Project));

            DiffUrl = diffUrl;
        }
        public DetailViewData(Person currentPerson, Models.Project project, List <ProjectStage> projectStages,
                              ProjectBasicsViewData projectBasicsViewData, ProjectAttributesViewData projectAttributesViewData,
                              ProjectLocationSummaryViewData projectLocationSummaryViewData,
                              ProjectFundingDetailViewData projectFundingDetailViewData,
                              PerformanceMeasureExpectedSummaryViewData performanceMeasureExpectedSummaryViewData,
                              PerformanceMeasureReportedValuesGroupedViewData performanceMeasureReportedValuesGroupedViewData,
                              ProjectExpendituresDetailViewData projectExpendituresDetailViewData,
                              ImageGalleryViewData imageGalleryViewData, EntityNotesViewData projectNotesViewData,
                              EntityNotesViewData internalNotesViewData,
                              EntityExternalLinksViewData entityExternalLinksViewData,
                              ProjectBasicsTagsViewData projectBasicsTagsViewData, bool userHasProjectAdminPermissions,
                              bool userHasEditProjectPermissions, bool userHasProjectUpdatePermissions,
                              bool userHasPerformanceMeasureActualManagePermissions, string mapFormID,
                              string editSimpleProjectLocationUrl, string editDetailedProjectLocationUrl,
                              string editProjectOrganizationsUrl, string editPerformanceMeasureExpectedsUrl,
                              string editPerformanceMeasureActualsUrl, string editReportedExpendituresUrl,
                              AuditLogsGridSpec auditLogsGridSpec, string auditLogsGridDataUrl,
                              string editExternalLinksUrl, ProjectNotificationGridSpec projectNotificationGridSpec,
                              string projectNotificationGridName, string projectNotificationGridDataUrl, bool userCanEditProposal,
                              ProjectOrganizationsDetailViewData projectOrganizationsDetailViewData,
                              List <Models.ClassificationSystem> classificationSystems,
                              string editProjectBoundingBoxFormID, ProjectPeopleDetailViewData projectPeopleDetailViewData,
                              TreatmentAreaGridSpec treatmentAreaGridSpec,
                              string treatmentAreaGridDataUrl
                              , TreatmentGridSpec treatmentGridSpec
                              , string treatmentGridDataUrl
                              , string editProjectRegionUrl
                              , string editProjectPriorityLandscapeUrl,
                              InteractionEventGridSpec projectInteractionEventsGridSpec, string projectInteractionEventsGridDataUrl)
            : base(currentPerson, project)
        {
            PageTitle       = project.DisplayName.ToEllipsifiedStringClean(110);
            BreadCrumbTitle = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Detail";

            ProjectStages = projectStages;

            EditProjectUrl = project.GetEditUrl();

            EditProjectAttributesUrl = project.GetEditProjectAttributesUrl();

            CanViewProjectFactSheet = ProjectController.FactSheetIsAvailable(project);

            UserHasProjectAdminPermissions = userHasProjectAdminPermissions;
            UserHasEditProjectPermissions  = userHasEditProjectPermissions;
            UserHasPerformanceMeasureActualManagePermissions = userHasPerformanceMeasureActualManagePermissions;

            var projectAlerts          = new List <string>();
            var proposedProjectListUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Proposed());

            var backToAllProposalsText = "Back to all Applications";
            var pendingProjectsListUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Pending());

            var backToAllPendingProjectsText = $"Back to all Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}";

            if (project.IsRejected())
            {
                var projectApprovalStatus = project.ProjectApprovalStatus;
                ProjectUpdateButtonText =
                    projectApprovalStatus == ProjectApprovalStatus.Draft ||
                    projectApprovalStatus == ProjectApprovalStatus.Returned
                        ? $"Edit Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}"
                        : $"Review Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}";
                ProjectWizardUrl =
                    SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.EditBasics(project.ProjectID));

                CanLaunchProjectOrProposalWizard = userCanEditProposal;
                if (project.IsProposal())
                {
                    ProjectListUrl     = proposedProjectListUrl;
                    BackToProjectsText = backToAllProposalsText;
                }
                else if (project.IsPendingProject())
                {
                    ProjectListUrl     = pendingProjectsListUrl;
                    BackToProjectsText = backToAllPendingProjectsText;
                }

                if (userHasProjectAdminPermissions || currentPerson.CanStewardProject(project))
                {
                    projectAlerts.Add(
                        $"This {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} was rejected and can no longer be edited. It can be deleted, or preserved for archival purposes.");
                }
            }
            else if (project.IsProposal())
            {
                var projectApprovalStatus = project.ProjectApprovalStatus;
                ProjectUpdateButtonText =
                    projectApprovalStatus == ProjectApprovalStatus.Draft ||
                    projectApprovalStatus == ProjectApprovalStatus.Returned
                        ? "Edit Application"
                        : "Review Application";
                ProjectWizardUrl =
                    SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.EditBasics(project.ProjectID));

                CanLaunchProjectOrProposalWizard = userCanEditProposal;
                ProjectListUrl     = proposedProjectListUrl;
                BackToProjectsText = backToAllProposalsText;
                if (userHasProjectAdminPermissions || currentPerson.CanStewardProject(project))
                {
                    projectAlerts.Add(
                        $"This {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} is in the {Models.FieldDefinition.Application.GetFieldDefinitionLabel()} stage. Any edits to this {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} must be made using the Add New {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} workflow.");
                }
            }
            else if (project.IsPendingProject())
            {
                var projectApprovalStatus = project.ProjectApprovalStatus;
                ProjectUpdateButtonText =
                    projectApprovalStatus == ProjectApprovalStatus.Draft ||
                    projectApprovalStatus == ProjectApprovalStatus.Returned
                        ? $"Edit Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}"
                        : $"Review Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}";
                ProjectWizardUrl =
                    SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.EditBasics(project.ProjectID));

                CanLaunchProjectOrProposalWizard = userCanEditProposal;
                ProjectListUrl     = pendingProjectsListUrl;
                BackToProjectsText = backToAllPendingProjectsText;
                if (userHasProjectAdminPermissions || currentPerson.CanStewardProject(project))
                {
                    projectAlerts.Add(
                        $"This {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} is pending. Any edits to this {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} must be made using the Add New {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} workflow.");
                }
            }
            else
            {
                var latestUpdateState = project.GetLatestUpdateState();
                ProjectUpdateButtonText =
                    latestUpdateState == ProjectUpdateState.Submitted ||
                    latestUpdateState == ProjectUpdateState.Returned
                        ? "Review Update"
                        : $"Update {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}";
                ProjectWizardUrl = project.GetProjectUpdateUrl();
                CanLaunchProjectOrProposalWizard = userHasProjectUpdatePermissions;
                ProjectListUrl     = FullProjectListUrl;
                BackToProjectsText = $"Back to all {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}";


                if (currentPerson.PersonIsProjectOwnerWhoCanStewardProjects)
                {
                    if (currentPerson.CanStewardProject(project))
                    {
                        projectAlerts.Add(
                            $"You are a {Models.FieldDefinition.ProjectSteward.GetFieldDefinitionLabel()} for this {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}. You may edit this {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} by using the <i class=\"glyphicon glyphicon-edit\"></i> icon on each panel.<br/>");
                    }
                    else
                    {
                        projectAlerts.Add(
                            $"You are a {Models.FieldDefinition.ProjectSteward.GetFieldDefinitionLabel()}, but not for this {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}. You may only edit {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} that are associated with your {Models.FieldDefinition.ProjectStewardshipArea.GetFieldDefinitionLabel()}.");
                    }
                }
            }


            if (project.GetLatestNotApprovedUpdateBatch() != null)
            {
                if (userHasProjectAdminPermissions || currentPerson.CanStewardProject(project))
                {
                    projectAlerts.Add($"This {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} has an Update in progress. Changes made through this page will be overwritten when the Update is approved.");
                }
                else
                {
                    projectAlerts.Add($"This {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} has an Update in progress.");
                }
            }

            ProjectAlerts = projectAlerts;

            ProjectBasicsViewData     = projectBasicsViewData;
            ProjectBasicsTagsViewData = projectBasicsTagsViewData;

            ProjectLocationSummaryViewData = projectLocationSummaryViewData;
            MapFormID = mapFormID;
            EditSimpleProjectLocationUrl    = editSimpleProjectLocationUrl;
            EditDetailedProjectLocationUrl  = editDetailedProjectLocationUrl;
            EditProjectRegionUrl            = editProjectRegionUrl;
            EditProjectPriorityLandscapeUrl = editProjectPriorityLandscapeUrl;

            EditProjectBoundingBoxUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(c => c.EditProjectBoundingBox(project));

            EditProjectBoundingBoxFormID = editProjectBoundingBoxFormID;
            ProjectAttributesViewData    = projectAttributesViewData;

            EditProjectOrganizationsUrl = editProjectOrganizationsUrl;

            PerformanceMeasureExpectedSummaryViewData = performanceMeasureExpectedSummaryViewData;
            EditPerformanceMeasureExpectedsUrl        = editPerformanceMeasureExpectedsUrl;

            PerformanceMeasureReportedValuesGroupedViewData = performanceMeasureReportedValuesGroupedViewData;
            EditPerformanceMeasureActualsUrl = editPerformanceMeasureActualsUrl;

            ProjectFundingDetailViewData = projectFundingDetailViewData;
            EditExpectedFundingUrl       =
                SitkaRoute <ProjectGrantAllocationRequestController> .BuildUrlFromExpression(c =>
                                                                                             c.EditProjectGrantAllocationRequestsForProject(project));

            ProjectExpendituresDetailViewData = projectExpendituresDetailViewData;
            EditReportedExpendituresUrl       = editReportedExpendituresUrl;
            ProjectPeopleDetailViewData       = projectPeopleDetailViewData;
            EditExternalLinksUrl = editExternalLinksUrl;
            ImageGalleryViewData = imageGalleryViewData;

            ProjectNotesViewData  = projectNotesViewData;
            InternalNotesViewData = internalNotesViewData;

            EntityExternalLinksViewData = entityExternalLinksViewData;

            ProjectUpdateBatchGridSpec = new ProjectUpdateBatchGridSpec
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Update",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Updates",
                SaveFiltersInCookie = true
            };
            ProjectUpdateBatchGridName    = "projectUpdateBatch";
            ProjectUpdateBatchGridDataUrl =
                SitkaRoute <ProjectController> .BuildUrlFromExpression(x =>
                                                                       x.ProjectUpdateBatchGridJsonData(project.ProjectID));

            AuditLogsGridSpec    = auditLogsGridSpec;
            AuditLogsGridName    = "projectAuditLogsGrid";
            AuditLogsGridDataUrl = auditLogsGridDataUrl;

            ProjectNotificationGridSpec        = projectNotificationGridSpec;
            ProjectNotificationGridName        = projectNotificationGridName;
            ProjectNotificationGridDataUrl     = projectNotificationGridDataUrl;
            ProjectOrganizationsDetailViewData = projectOrganizationsDetailViewData;

            EditProjectPriorityLandscapeFormID = ProjectPriorityLandscapeController.GetEditProjectPriorityLandscapesFormID();
            EditProjectRegionFormID            = ProjectRegionController.GetEditProjectRegionsFormID();

            ProjectStewardCannotEditUrl =
                SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.ProjectStewardCannotEdit());

            ProjectStewardCannotEditPendingApprovalUrl =
                SitkaRoute <ProjectController> .BuildUrlFromExpression(c =>
                                                                       c.ProjectStewardCannotEditPendingApproval(project));

            ClassificationSystems = classificationSystems;

            ProjectCostShareViewData = new ProjectCostShareViewData(project, currentPerson);

            ProjectDocumentsDetailViewData = new ProjectDocumentsDetailViewData(
                EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(project.ProjectDocuments)),
                SitkaRoute <ProjectDocumentController> .BuildUrlFromExpression(x => x.New(project)), project.ProjectName,
                new ProjectEditAsAdminFeature().HasPermission(currentPerson, project).HasPermission);

            EditProjectPeopleUrl =
                SitkaRoute <ProjectPersonController> .BuildUrlFromExpression(x => x.EditPeople(project));

            TreatmentAreaGridSpec    = treatmentAreaGridSpec;
            TreatmentAreaGrid        = "treatmentAreaGrid";
            TreatmentAreaGridDataUrl = treatmentAreaGridDataUrl;


            TreatmentGridSpec    = treatmentGridSpec;
            TreatmentGrid        = "treatmentGrid";
            TreatmentGridDataUrl = treatmentGridDataUrl;

            ProjectInteractionEventsGridSpec    = projectInteractionEventsGridSpec;
            ProjectInteractionEventsGridName    = "projectInteractionEventsGrid";
            ProjectInteractionEventsGridDataUrl = projectInteractionEventsGridDataUrl;

            ProjectAgreementByGrantAllocations = ProjectAgreementByGrantAllocation.MakeAgreementProjectsByGrantAllocation(Project.ProjectGrantAllocationRequests.ToList());
        }