diff --git a/app/controllers/admin/archivematica_accessions_controller.rb b/app/controllers/admin/archivematica_accessions_controller.rb
index 559b7940..ee8795e4 100644
--- a/app/controllers/admin/archivematica_accessions_controller.rb
+++ b/app/controllers/admin/archivematica_accessions_controller.rb
@@ -8,6 +8,13 @@ class ArchivematicaAccessionsController < Admin::ApplicationController
# send_foo_updated_email(requested_resource)
# end
+ def new
+ resource = ArchivematicaAccession.new(degree_period_id: params[:degree_period_id])
+ render locals: {
+ page: Administrate::Page::Form.new(dashboard, resource)
+ }
+ end
+
# Override this method to specify custom lookup behavior.
# This will be used to set the resource for the `show`, `edit`, and `update`
# actions.
diff --git a/app/models/thesis.rb b/app/models/thesis.rb
index 18826619..ecd64ea7 100644
--- a/app/models/thesis.rb
+++ b/app/models/thesis.rb
@@ -146,6 +146,19 @@ class Thesis < ApplicationRecord
enum proquest_exported: ['Not exported', 'Full harvest', 'Partial harvest']
+ # Looks up the thesis' accession number based on its degree period.
+ def accession_number
+ degree_period = look_up_degree_period
+ return if degree_period.nil?
+ return if degree_period.archivematica_accession.nil?
+
+ degree_period.archivematica_accession.accession_number
+ end
+
+ def look_up_degree_period
+ DegreePeriod.find_by(grad_year: graduation_year, grad_month: graduation_month)
+ end
+
# Returns a true/false value (rendered as "yes" or "no") if there are any
# holds with a status of either 'active' or 'expired'. A false/"No" is
# only returned if all holds are 'released'.
@@ -189,7 +202,8 @@ def evaluate_status
no_active_holds?,
authors_graduated?,
departments_have_dspace_name?,
- degrees_have_types?
+ degrees_have_types?,
+ accession_number.present?
].all?
end
diff --git a/app/views/thesis/process_theses.html.erb b/app/views/thesis/process_theses.html.erb
index 5dc33e59..d4cc6482 100644
--- a/app/views/thesis/process_theses.html.erb
+++ b/app/views/thesis/process_theses.html.erb
@@ -47,6 +47,14 @@
hint_html: { style: 'display: block' },
hint: link_to('See details in admin interface', admin_thesis_path(f.object), target: :_blank) %>
+