diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index 1f692b430..c6799bd55 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -171,7 +171,7 @@ class OrganisationsController < ApplicationController signed_at: Time.zone.now, data_protection_officer: current_user, organisation_name: @organisation.name, - organisation_address: @organisation.address_string, + organisation_address: @organisation.address_row, organisation_phone_number: @organisation.phone, dpo_email: current_user.email, dpo_name: current_user.name, diff --git a/app/helpers/data_sharing_agreement_helper.rb b/app/helpers/data_sharing_agreement_helper.rb index 8664dd15b..d8949de4f 100644 --- a/app/helpers/data_sharing_agreement_helper.rb +++ b/app/helpers/data_sharing_agreement_helper.rb @@ -34,12 +34,36 @@ module DataSharingAgreementHelper def org_name_for_data_sharing_agreement(data_sharing_agreement, user) if data_sharing_agreement.present? data_sharing_agreement.organisation_name - elsif user.is_dpo? + else user.organisation.name + end + end + + # rubocop:disable Rails/HelperInstanceVariable + def section_12_2(data_sharing_agreement:, user:, organisation:) + if data_sharing_agreement + @org_address = data_sharing_agreement.organisation_address + @org_name = data_sharing_agreement.organisation_name + @org_phone = data_sharing_agreement.organisation_phone_number + @dpo_name = data_sharing_agreement.dpo_name + @dpo_email = data_sharing_agreement.dpo_email else - "[Data provider organisation]" + @org_name = organisation.name + @org_address = organisation.address_row + @org_phone = organisation.phone + + if user.is_dpo? + @dpo_name = user.name + @dpo_email = user.email + else + @dpo_name = "[DPO name]" + @dpo_email = "[DPO email]" + end end + + "12.2. For #{@org_name}: Name: #{@dpo_name}, Postal Address: #{@org_address}, E-mail address: #{@dpo_email}, Telephone number: #{@org_phone}" end +# rubocop:enable Rails/HelperInstanceVariable private diff --git a/app/models/organisation.rb b/app/models/organisation.rb index e87854120..cd2fd8c38 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -75,6 +75,10 @@ class Organisation < ApplicationRecord %i[address_line1 address_line2 postcode].map { |field| public_send(field) }.join("\n") end + def address_row + %i[address_line1 address_line2 postcode].map { |field| public_send(field) }.join(", ") + end + def rent_periods organisation_rent_periods.pluck(:rent_period) end diff --git a/app/views/organisations/data_sharing_agreement.html.erb b/app/views/organisations/data_sharing_agreement.html.erb index 2d17a3c27..9e1c020d7 100644 --- a/app/views/organisations/data_sharing_agreement.html.erb +++ b/app/views/organisations/data_sharing_agreement.html.erb @@ -18,7 +18,7 @@ <% if @data_sharing_agreement %>
1) <%= @data_sharing_agreement.organisation_name %> of <%= @data_sharing_agreement.organisation_address %> (“CORE Data Provider”)
<% else %> -1) [Data provider organisation] of [full address] (“CORE Data Provider”)
+1) <%= @organisation.name %> of <%= @organisation.address_row %> (“CORE Data Provider”)
<% end %>and
2) The Department for Levelling Up, Housing and Communities of 2 Marsham Street, London, SW1P 4DF (“DLUHC”)
@@ -105,13 +105,11 @@11.2. CORE data providers and DLUHC acknowledge that any loss or unauthorised release of the Data can be treated as valid grounds for immediately terminating this agreement by DLUHC.
12.1. CORE data providers and DLUHC will each appoint an Authorised Representative to be the primary point of contact in all day-to-day matters relating to this Agreement:
- <% if @data_sharing_agreement %> -12.2. For <%= @data_sharing_agreement.organisation_name %>: Name: <%= @data_sharing_agreement.dpo_name %>, Postal Address: <%= @data_sharing_agreement.organisation_address %>, E-mail address: <%= @data_sharing_agreement.dpo_email %>, Telephone number: <%= @data_sharing_agreement.organisation_phone_number %>
- <% else %> -12.2. For [Organisation name]: Name: [DPO name], Postal Address: [Organisation address], E-mail address: [DPO email], Telephone number: [Organisation telephone number]
- <% end %> -12.3. For DLUHC: Name: Rachel Worledge - Postal Address: South-west section, 4th Floor, Fry Building, 2 Marsham Street, London, SW1P 4DF +
+ <%= section_12_2(data_sharing_agreement: @data_sharing_agreement, user: current_user, organisation: @organisation) %> +
+12.3. For DLUHC: Name: Rachel Worledge, + Postal Address: South-west section, 4th Floor, Fry Building, 2 Marsham Street, London, SW1P 4DF, E-mail address: Rachel.Worledge@levellingup.gov.uk
13.1. The Data potentially allows for persons to be identified, although the risk of this happening should be minimised by the steps taken in clause 9. CORE data providers should agree to carry out a thorough check of the Data and ensure that all steps are taken within its powers to minimise the risk that any outputs lead to identification of a person by a third party.
@@ -125,7 +123,7 @@16.1. The Parties shall comply with all relevant legislation, regulations, orders, statutory instruments and any amendments or re-enactments thereof from the commencement of this agreement.
As witness of which the parties have set their hands on the day and year first above written - signed for and on behalf of [job title of an officer with appropriate delegated authority] for <%= org_name_for_data_sharing_agreement(@data_sharing_agreement, current_user) %>, by:
+ signed for and on behalf of the Data Protection Officer for <%= org_name_for_data_sharing_agreement(@data_sharing_agreement, current_user) %>, by: