public bool AddDocumentWithMetaData(long targetFolder, string docName, byte[] fileByteArray, EntityMetadata emd)
        {
            EntityAttachment eaj = null;

            try
            {
                if (fileByteArray != null && targetFolder > 0)
                {
                    eaj = new EntityAttachment
                    {
                        Contents     = fileByteArray,
                        CreatedDate  = DateTime.Now,
                        FileName     = docName,
                        ModifiedDate = DateTime.Now,
                        FileSize     = fileByteArray.Length
                    };
                }

                var ida = VariableHelper.Dmo.AddDocumentWithMetadata(OtCredentialsEnum.ConvertString(OtCredentialsEnum.OtAdminCredentials.User), VariableHelper.Token, targetFolder, emd, eaj, "");
                if (ida == 0)
                {
                    StreamHelper.MoveUnUploadedDocumentsToBackUpFolder(docName);
                }

                return(ida > 0);
            }
            catch (Exception ex)
            {
                Logger.Trace(ex, "File named" + docName + "is not exist in this address");
                StreamHelper.MoveUnUploadedDocumentsToBackUpFolder(docName);
                return(false);
            }
        }
        public bool AddDocumentOrVersion(string docName, byte[] fileByteArray, long targetFolder)
        {
            try
            {
                if (fileByteArray != null && targetFolder > 0)
                {
                    var eaj = new EntityAttachment
                    {
                        Contents     = fileByteArray,
                        CreatedDate  = DateTime.Now,
                        FileName     = docName,
                        ModifiedDate = DateTime.Now,
                        FileSize     = fileByteArray.Length
                    };

                    var idj = VariableHelper.Dmo.AddDocumentOrVersion(OtCredentialsEnum.ConvertString(OtCredentialsEnum.OtAdminCredentials.User), VariableHelper.Token, eaj, targetFolder, "", true);
                    return(idj > 0);
                }
            }
            catch (Exception ex)
            {
                Logger.Warn(ex, "File named " + docName + "   could not be found.");
            }
            return(false);
        }
        public async Task <bool> AddDocumentWithMetaDataAsync(long targetFolder, string docName, byte[] fileByteArray, EntityMetadata emd)
        {
            EntityAttachment eaj = null;

            try
            {
                if (fileByteArray != null && targetFolder > 0)
                {
                    eaj = new EntityAttachment
                    {
                        Contents     = fileByteArray,
                        CreatedDate  = DateTime.Now,
                        FileName     = docName,
                        ModifiedDate = DateTime.Now,
                        FileSize     = fileByteArray.Length
                    };
                }

                await Task.Run(() => VariableHelper.Dmo.AddDocumentWithMetadataAsync(OtCredentialsEnum.ConvertString(OtCredentialsEnum.OtAdminCredentials.User), VariableHelper.Token, targetFolder, emd, eaj, ""));

                eaj = null;
                return(true);
            }
            catch (Exception ex)
            {
                Logger.Trace(ex, "File named" + docName + "is not exist in this address");
                return(false);
            }
        }
示例#4
0
        protected void btnDownload_OnClick(object sender, EventArgs e)
        {
            RequiresAuthorization(AuthorizationStrings.AttachmentAdd);
            var control    = sender as Control;
            var attachment = new EntityAttachment();

            if (control != null)
            {
                var gvRow   = (GridViewRow)control.Parent.Parent;
                var dataKey = gvAttachments.DataKeys[gvRow.RowIndex];
                if (dataKey != null)
                {
                    attachment = Call.AttachmentApi.Get(Convert.ToInt32(dataKey.Value));
                }
            }

            Response.Clear();
            var ms = new MemoryStream(Call.AttachmentApi.GetAttachment(attachment.Id));

            Response.ContentType = "application/octet-stream";
            Response.AddHeader("content-disposition", "attachment;filename=" + "\"" + attachment.Name + "\"");

            Response.Buffer = true;
            ms.WriteTo(Response.OutputStream);
            Response.End();
        }
示例#5
0
        public DtoActionResult Add(EntityAttachment attachment)
        {
            var actionResult = new DtoActionResult();


            _uow.AttachmentRepository.Insert(attachment);
            _uow.Save();
            actionResult.Success = true;
            actionResult.Id      = attachment.Id;


            return(actionResult);
        }
        public AttachmentsAndNotesViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, string diffUrl) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), ProjectUpdateSection.AttachmentsAndNotes.ProjectUpdateSectionDisplayName)
        {
            EntityNotesViewData = new EntityNotesViewData(EntityNote.CreateFromEntityNote(projectUpdateBatch.ProjectNoteUpdates),
                                                          SitkaRoute <ProjectNoteUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch)),
                                                          projectUpdateBatch.Project.GetDisplayName(),
                                                          IsEditable);
            ProjectAttachmentsViewData = new ProjectAttachmentsDetailViewData(
                EntityAttachment.CreateFromProjectAttachment(projectUpdateBatch.ProjectAttachmentUpdates),
                SitkaRoute <ProjectAttachmentUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch)),
                projectUpdateBatch.Project.GetDisplayName(),
                IsEditable,
                projectUpdateBatch.GetAllAttachmentTypes().ToList(),
                currentFirmaSession);
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshNotesAndAttachments(projectUpdateBatch.Project));

            DiffUrl = diffUrl;

            var applicableWizardSections = projectUpdateBatch.GetApplicableWizardSections(currentFirmaSession, true, projectUpdateBatch.Project.HasEditableCustomAttributes(CurrentFirmaSession));
            var currentSection           = applicableWizardSections.Single(x => x.SectionDisplayName.Equals(ProjectUpdateSection.AttachmentsAndNotes.ProjectUpdateSectionDisplayName, StringComparison.InvariantCultureIgnoreCase));
            var nextProjectUpdateSection = applicableWizardSections.Where(x => x.SortOrder > currentSection.SortOrder).OrderBy(x => x.SortOrder).FirstOrDefault();

            NextSectionUrl = nextProjectUpdateSection?.SectionUrl;
        }
示例#7
0
        public void AttachmentChunkingComplete()
        {
            var fileName = Request["qqfilename"];

            if (string.IsNullOrEmpty(fileName) || fileName == Path.DirectorySeparatorChar.ToString())
            {
                throw new HttpException();
            }
            var attachmentGuid = Request["attachmentGuid"];

            if (string.IsNullOrEmpty(attachmentGuid))
            {
                throw new HttpException();
            }

            var computerId = Request["computerId"];
            var assetId    = Request["assetId"];

            if (assetId == null && computerId == null)
            {
                throw new HttpException();
            }

            var userId = Convert.ToInt32(((ClaimsIdentity)User.Identity).Claims.Where(c => c.Type == "user_id")
                                         .Select(c => c.Value).SingleOrDefault());
            var userName = new ServiceUser().GetUserName(userId);

            var attachment = new EntityAttachment();

            attachment.AttachmentTime = DateTime.Now;
            attachment.DirectoryGuid  = attachmentGuid;
            attachment.Name           = fileName;
            attachment.UserName       = userName;
            var result = new ServiceAttachment().Add(attachment);

            if (!result.Success)
            {
                throw new HttpException();
            }

            if (assetId != null)
            {
                var asset = new EntityAssetAttachment();
                asset.AssetId      = Convert.ToInt32(assetId);
                asset.AttachmentId = attachment.Id;
                result             = new ServiceAssetAttachment().Add(asset);
                if (!result.Success)
                {
                    throw new HttpException();
                }
            }

            if (computerId != null)
            {
                var computer = new EntityComputerAttachment();
                computer.ComputerId   = Convert.ToInt32(computerId);
                computer.AttachmentId = attachment.Id;
                result = new ServiceComputerAttachment().Add(computer);
                if (!result.Success)
                {
                    throw new HttpException();
                }
            }
        }
示例#8
0
        private string SaveAs(string type)
        {
            var filePath = Path.Combine(_upload.DestinationDirectory, _upload.Filename);

            using (var unc = new UncServices())
            {
                if (unc.NetUseWithCredentials() || unc.LastError == 1219)
                {
                    try
                    {
                        using (var file = new FileStream(filePath, FileMode.Create))
                            _upload.InputStream.CopyTo(file);
                    }
                    catch (Exception ex)
                    {
                        return(ex.Message);
                    }

                    if (type.Equals("module"))
                    {
                        var uploadedFile = new EntityUploadedFile();
                        uploadedFile.Name = _upload.Filename;
                        uploadedFile.Guid = _upload.ModuleGuid;
                        uploadedFile.Hash = Utility.GetFileHash(filePath);

                        var result = new ServiceUploadedFile().AddFile(uploadedFile);
                        if (!result.Success)
                        {
                            try
                            {
                                File.Delete(filePath);
                            }
                            catch
                            {
                                //ignored
                            }

                            return("Could Not Update Database");
                        }
                    }
                    else if (type.Equals("attachment"))
                    {
                        var attachment = new EntityAttachment();
                        attachment.AttachmentTime = DateTime.Now;
                        attachment.DirectoryGuid  = _upload.AttachmentGuid;
                        attachment.Name           = _upload.Filename;
                        attachment.UserName       = _upload.Username;
                        var result = new ServiceAttachment().Add(attachment);
                        if (!result.Success)
                        {
                            throw new HttpException();
                        }

                        if (_upload.AssetId != null)
                        {
                            var asset = new EntityAssetAttachment();
                            asset.AssetId      = Convert.ToInt32(_upload.AssetId);
                            asset.AttachmentId = attachment.Id;
                            result             = new ServiceAssetAttachment().Add(asset);
                            if (!result.Success)
                            {
                                throw new HttpException();
                            }
                        }

                        if (_upload.ComputerId != null)
                        {
                            var computer = new EntityComputerAttachment();
                            computer.ComputerId   = Convert.ToInt32(_upload.ComputerId);
                            computer.AttachmentId = attachment.Id;
                            result = new ServiceComputerAttachment().Add(computer);
                            if (!result.Success)
                            {
                                throw new HttpException();
                            }
                        }
                    }
                }
                else
                {
                    return("Could Not Reach Storage Path");
                }
            }
            return(null);
        }
示例#9
0
        public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Project project,
                              List <ProjectStage> projectStages,
                              ProjectBasicsViewData projectBasicsViewData, ProjectLocationSummaryViewData projectLocationSummaryViewData,
                              ProjectBudgetSummaryViewData projectBudgetSummaryViewData,
                              ProjectBudgetsAnnualViewData projectBudgetsAnnualViewData,
                              ProjectBudgetsAnnualByCostTypeViewData projectBudgetsAnnualByCostTypeViewData,
                              TechnicalAssistanceRequestsDetailViewData technicalAssistanceRequestDetailViewData,
                              PerformanceMeasureExpectedSummaryViewData performanceMeasureExpectedSummaryViewData,
                              PerformanceMeasureReportedValuesGroupedViewData performanceMeasureReportedValuesGroupedViewData,
                              ProjectExpendituresDetailViewData projectExpendituresDetailViewData,
                              ProjectExpendituresByCostTypeDetailViewData projectExpendituresByCostTypeDetailViewData,
                              ImageGalleryViewData imageGalleryViewData, EntityNotesViewData projectNotesViewData,
                              EntityNotesViewData internalNotesViewData,
                              EntityExternalLinksViewData entityExternalLinksViewData,
                              ProjectBasicsTagsViewData projectBasicsTagsViewData, bool userHasProjectAdminPermissions,
                              bool userHasEditProjectPermissions, bool userHasProjectUpdatePermissions,
                              bool userHasPerformanceMeasureActualManagePermissions, string mapFormID,
                              string editProjectCustomAttributesUrl,
                              string editSimpleProjectLocationUrl, string editDetailedProjectLocationUrl,
                              string editProjectOrganizationsUrl, string editPerformanceMeasureExpectedsUrl,
                              string editPerformanceMeasureActualsUrl, string editReportedExpendituresUrl,
                              bool reportFinancialsByCostType, AuditLogsGridSpec auditLogsGridSpec, string auditLogsGridDataUrl,
                              string editExternalLinksUrl, ProjectNotificationGridSpec projectNotificationGridSpec,
                              string projectNotificationGridName, string projectNotificationGridDataUrl, bool userCanEditProposal,
                              ProjectOrganizationsDetailViewData projectOrganizationsDetailViewData,
                              ProjectPotentialPartnerDetailViewData projectPotentialPartnerDetailViewData,
                              List <ProjectFirmaModels.Models.ClassificationSystem> classificationSystems,
                              string editProjectBoundingBoxFormID, List <GeospatialAreaType> geospatialAreaTypes,
                              DisplayProjectCustomAttributesViewData displayProjectCustomAttributeTypesViewData,
                              ProjectContactsDetailViewData projectContactsDetailViewData, string editProjectContactsUrl,
                              string editExpectedFundingUrl, ProjectTimelineDisplayViewData projectTimelineDisplayViewData,
                              bool userHasProjectTimelinePermissions, List <ProjectEvaluation> projectEvaluationsUserHasAccessTo,
                              bool userHasStartUpdateWorkflowPermission)
            : base(currentFirmaSession, project)
        {
            PageTitle       = project.GetDisplayName();
            BreadCrumbTitle = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} Detail";
            ProjectStages   = projectStages;

            EditProjectUrl = project.GetEditUrl();
            UserHasProjectAdminPermissions = userHasProjectAdminPermissions;
            UserHasEditProjectPermissions  = userHasEditProjectPermissions;
            UserHasPerformanceMeasureActualManagePermissions = userHasPerformanceMeasureActualManagePermissions;
            UserHasProjectTimelinePermissions = userHasProjectTimelinePermissions;
            CanLaunchProjectOrProposalWizard  = userHasStartUpdateWorkflowPermission;
            WithdrawUrl = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(c => c.Withdraw(project));

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

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

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

            var currentPerson = currentFirmaSession.Person;

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

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

                if (userHasProjectAdminPermissions || currentPerson.CanStewardProject(project))
                {
                    projectAlerts.Add(
                        $"This {FieldDefinitionEnum.Project.ToType().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 Proposal"
                        : "Review Proposal";
                ProjectWizardUrl = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.EditBasics(project.ProjectID));

                ProjectListUrl     = proposedProjectListUrl;
                BackToProjectsText = backToAllProposalsText;
                if ((projectApprovalStatus == ProjectApprovalStatus.Draft || projectApprovalStatus == ProjectApprovalStatus.Returned) && (userHasProjectAdminPermissions || userHasStartUpdateWorkflowPermission))
                {
                    projectAlerts.Add(
                        $"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} is in the Proposal stage. Any edits to this {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} must be made using the Add New {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} workflow.");
                }
                else if (projectApprovalStatus == ProjectApprovalStatus.PendingApproval)
                {
                    if (userHasProjectAdminPermissions || currentPerson.IsPersonAProjectOwnerWhoCanStewardProjects() && currentPerson.CanStewardProject(project))
                    {
                        projectAlerts.Add($"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} has been submitted and is awaiting review.");
                    }
                    else if (userHasStartUpdateWorkflowPermission)
                    {
                        projectAlerts.Add($"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} has been submitted, no change can be made.");
                        CanLaunchProjectOrProposalWizard = false;
                        ShowWithdrawProjectButton        = true;
                    }
                }
            }
            else if (project.IsPendingProject())
            {
                var projectApprovalStatus = project.ProjectApprovalStatus;
                ProjectUpdateButtonText =
                    projectApprovalStatus == ProjectApprovalStatus.Draft ||
                    projectApprovalStatus == ProjectApprovalStatus.Returned
                        ? $"Edit Pending {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}"
                        : $"Review Pending {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}";
                ProjectWizardUrl = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.EditBasics(project.ProjectID));

                ProjectListUrl     = pendingProjectsListUrl;
                BackToProjectsText = backToAllPendingProjectsText;
                if ((projectApprovalStatus == ProjectApprovalStatus.Draft || projectApprovalStatus == ProjectApprovalStatus.Returned) && (userHasProjectAdminPermissions || userHasStartUpdateWorkflowPermission))
                {
                    projectAlerts.Add(
                        $"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} is pending. Any edits to this {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} must be made using the Add New {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} workflow.");
                }
                else if (projectApprovalStatus == ProjectApprovalStatus.PendingApproval)
                {
                    if (userHasProjectAdminPermissions || currentPerson.IsPersonAProjectOwnerWhoCanStewardProjects() && currentPerson.CanStewardProject(project))
                    {
                        projectAlerts.Add($"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} has been submitted and is awaiting review.");
                    }
                    else if (userHasStartUpdateWorkflowPermission)
                    {
                        projectAlerts.Add($"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} is pending, no change can be made.");
                        CanLaunchProjectOrProposalWizard = false;
                        ShowWithdrawProjectButton        = true;
                    }
                }
            }
            else
            {
                var latestUpdateState = project.GetLatestUpdateStateResilientToDuplicateUpdateBatches();
                ProjectUpdateButtonText =
                    latestUpdateState == ProjectUpdateState.Submitted ||
                    latestUpdateState == ProjectUpdateState.Returned
                        ? "Review Update"
                        : $"Update {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}";
                ProjectWizardUrl   = project.GetProjectUpdateUrl();
                ProjectListUrl     = FullProjectListUrl;
                BackToProjectsText = $"Back to all {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}";


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

            if (ProjectModelExtensions.GetLatestNotApprovedUpdateBatch(project) != null)
            {
                if (userHasEditProjectPermissions)
                {
                    projectAlerts.Add($"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} has an Update in progress. Changes made through this page will be overwritten when the Update is approved.");
                }
                else
                {
                    projectAlerts.Add($"This {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} has an Update in progress.");
                }
            }

            ProjectAlerts = projectAlerts;

            ProjectBasicsViewData     = projectBasicsViewData;
            ProjectBasicsTagsViewData = projectBasicsTagsViewData;

            EditProjectCustomAttributesUrl = editProjectCustomAttributesUrl;

            ProjectLocationSummaryViewData = projectLocationSummaryViewData;
            MapFormID = mapFormID;
            EditSimpleProjectLocationUrl   = editSimpleProjectLocationUrl;
            EditDetailedProjectLocationUrl = editDetailedProjectLocationUrl;

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

            EditProjectBoundingBoxFormID = editProjectBoundingBoxFormID;

            EditProjectOrganizationsUrl = editProjectOrganizationsUrl;

            PerformanceMeasureExpectedSummaryViewData = performanceMeasureExpectedSummaryViewData;
            EditPerformanceMeasureExpectedsUrl        = editPerformanceMeasureExpectedsUrl;

            PerformanceMeasureReportedValuesGroupedViewData = performanceMeasureReportedValuesGroupedViewData;
            EditPerformanceMeasureActualsUrl = editPerformanceMeasureActualsUrl;

            ProjectBudgetSummaryViewData           = projectBudgetSummaryViewData;
            ProjectBudgetsAnnualViewData           = projectBudgetsAnnualViewData;
            ProjectBudgetsAnnualByCostTypeViewData = projectBudgetsAnnualByCostTypeViewData;
            EditTechnicalAssistanceRequestsUrl     = SitkaRoute <TechnicalAssistanceRequestController> .BuildUrlFromExpression(c => c.EditTechnicalAssistanceRequestsForProject(project));

            TechnicalAssistanceRequestDetailViewData = technicalAssistanceRequestDetailViewData;
            EditExpectedFundingUrl = editExpectedFundingUrl;

            ProjectExpendituresDetailViewData           = projectExpendituresDetailViewData;
            ProjectExpendituresByCostTypeDetailViewData = projectExpendituresByCostTypeDetailViewData;
            EditReportedExpendituresUrl = editReportedExpendituresUrl;
            GeospatialAreaTypes         = geospatialAreaTypes;
            DisplayProjectCustomAttributeTypesViewData = displayProjectCustomAttributeTypesViewData;
            EditExternalLinksUrl = editExternalLinksUrl;
            ImageGalleryViewData = imageGalleryViewData;

            ProjectNotesViewData  = projectNotesViewData;
            InternalNotesViewData = internalNotesViewData;

            EntityExternalLinksViewData = entityExternalLinksViewData;

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

            ReportFinancialsByCostType = reportFinancialsByCostType;

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

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

            // Potential Partner panel
            ProjectPotentialPartnerDetailViewData = projectPotentialPartnerDetailViewData;

            ProjectContactsDetailViewData = projectContactsDetailViewData;
            EditProjectContactsUrl        = editProjectContactsUrl;

            EditProjectGeospatialAreaFormID = ProjectGeospatialAreaController.GetEditProjectGeospatialAreasFormID();

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

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

            ClassificationSystems = classificationSystems;

            ProjectAttachmentsDetailViewData = new ProjectAttachmentsDetailViewData(
                EntityAttachment.CreateFromProjectAttachment(project.ProjectAttachments),
                SitkaRoute <ProjectAttachmentController> .BuildUrlFromExpression(x => x.New(project)),
                project.ProjectName,
                new ProjectEditAsAdminFeature().HasPermission(currentFirmaSession, project).HasPermission,
                project.GetAllAttachmentTypes().ToList(),
                currentFirmaSession);

            ProjectTimelineDisplayViewData = projectTimelineDisplayViewData;

            ProjectEvaluationsUserHasAccessTo = projectEvaluationsUserHasAccessTo;

            ShowFactSheetButton = OfferProjectFactSheetLinkFeature.OfferProjectFactSheetLink(currentFirmaSession, project);
        }