From c106d489c5adfabd69367ec17ed11fb518560230 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Wed, 25 Jul 2018 15:50:41 +0800 Subject: [PATCH 1/2] MDL-62342 privacy: Use singular/plural form in labels --- admin/tool/policy/classes/form/accept_policy.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/tool/policy/classes/form/accept_policy.php b/admin/tool/policy/classes/form/accept_policy.php index f53af7aadff..3ff0daf6edd 100644 --- a/admin/tool/policy/classes/form/accept_policy.php +++ b/admin/tool/policy/classes/form/accept_policy.php @@ -71,10 +71,12 @@ class accept_policy extends \moodleform { $mform->addElement('hidden', 'returnurl'); $mform->setType('returnurl', PARAM_LOCALURL); - - $mform->addElement('static', 'user', get_string('acceptanceusers', 'tool_policy'), join(', ', $usernames)); - $mform->addElement('static', 'policy', get_string('acceptancepolicies', 'tool_policy'), - join(', ', $versionnames)); + $useracceptancelabel = (count($usernames) > 1) ? get_string('acceptanceusers', 'tool_policy') : + get_string('user'); + $mform->addElement('static', 'user', $useracceptancelabel, join(', ', $usernames)); + $policyacceptancelabel = (count($versionnames) > 1) ? get_string('acceptancepolicies', 'tool_policy') : + get_string('policydochdrpolicy', 'tool_policy'); + $mform->addElement('static', 'policy', $policyacceptancelabel, join(', ', $versionnames)); if ($revoke) { $mform->addElement('static', 'ack', '', get_string('revokeacknowledgement', 'tool_policy')); From 2e72392bbf782881ff5da3cb4b62418698525e39 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Wed, 29 Aug 2018 11:48:55 +0800 Subject: [PATCH 2/2] MDL-62342 privacy: Fix strings used in the consent on behalf modal --- admin/tool/policy/lang/en/tool_policy.php | 8 ++--- .../policy/tests/behat/acceptances.feature | 30 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/admin/tool/policy/lang/en/tool_policy.php b/admin/tool/policy/lang/en/tool_policy.php index 8f2a1d5658d..3ede09b9590 100644 --- a/admin/tool/policy/lang/en/tool_policy.php +++ b/admin/tool/policy/lang/en/tool_policy.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$string['acceptanceacknowledgement'] = 'I acknowledge that I have received a request to give consent on behalf of user(s).'; +$string['acceptanceacknowledgement'] = 'I acknowledge that I have received a request to give consent on behalf of the above user(s).'; $string['acceptancecount'] = '{$a->agreedcount} of {$a->policiescount}'; $string['acceptancenote'] = 'Remarks'; $string['acceptancepolicies'] = 'Policies'; @@ -53,7 +53,7 @@ $string['agreepolicies'] = 'Please agree to the following policies'; $string['backtoprevious'] = 'Go back to previous page'; $string['backtotop'] = 'Back to top'; $string['consentbulk'] = 'Consent'; -$string['consentdetails'] = 'Give consent on behalf of user'; +$string['consentdetails'] = 'Give consent on behalf of user(s)'; $string['consentpagetitle'] = 'Consent'; $string['contactdpo'] = 'For any questions about the policies please contact the privacy officer.'; $string['dataproc'] = 'Personal data processing'; @@ -78,7 +78,7 @@ $string['filterpolicy'] = 'Policy: {$a}'; $string['guestconsent:continue'] = 'Continue'; $string['guestconsentmessage'] = 'If you continue browsing this website, you agree to our policies:'; $string['iagree'] = 'I agree to the {$a}'; -$string['iagreetothepolicy'] = 'Give consent on behalf of user'; +$string['iagreetothepolicy'] = 'Give consent'; $string['inactivate'] = 'Set status to "Inactive"'; $string['inactivating'] = 'Inactivating a policy'; $string['inactivatingconfirm'] = '

You are about to inactivate policy \'{$a->name}\' version \'{$a->revision}\'.

'; @@ -159,7 +159,7 @@ $string['privacy:metadata:versions:contentformat'] = 'The format of the content $string['privacysettings'] = 'Privacy settings'; $string['readpolicy'] = 'Please read our {$a}'; $string['refertofullpolicytext'] = 'Please refer to the full {$a} if you would like to review the text.'; -$string['revokeacknowledgement'] = 'I acknowledge that I have received a request to withdraw consent on behalf of user(s).'; +$string['revokeacknowledgement'] = 'I acknowledge that I have received a request to withdraw consent on behalf of the above user(s).'; $string['revokedetails'] = 'Withdraw user consent'; $string['save'] = 'Save'; $string['saveasdraft'] = 'Save as draft'; diff --git a/admin/tool/policy/tests/behat/acceptances.feature b/admin/tool/policy/tests/behat/acceptances.feature index b8c6d6e8066..3d436d441ca 100644 --- a/admin/tool/policy/tests/behat/acceptances.feature +++ b/admin/tool/policy/tests/behat/acceptances.feature @@ -58,12 +58,12 @@ Feature: Viewing acceptances reports and accepting on behalf of other users And I navigate to "Users > Privacy and policies > Manage policies" in site administration And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row" And I click on "Consent not given" "link" in the "User One" "table_row" - Then I should see "Give consent on behalf of user" + Then I should see "Give consent" And I should see "User One" And I should see "This site policy" - And I should see "I acknowledge that I have received a request to give consent on behalf of user(s)." + And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)." And I set the field "Remarks" to "Consent received from a parent" - And I press "Give consent on behalf of user" + And I press "Give consent" And "Consent given on behalf of user" "icon" should exist in the "User One" "table_row" And "Max Manager" "link" should exist in the "User One" "table_row" And "Consent received from a parent" "text" should exist in the "User One" "table_row" @@ -84,12 +84,12 @@ Feature: Viewing acceptances reports and accepting on behalf of other users And I navigate to "Users > Privacy and policies > Manage policies" in site administration And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row" And I click on "Consent not given" "link" in the "User One" "table_row" - Then I should see "Give consent on behalf of user" + Then I should see "Give consent" And I should see "User One" And I should see "This site policy" - And I should see "I acknowledge that I have received a request to give consent on behalf of user(s)." + And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)." And I set the field "Remarks" to "Consent received from a parent" - And I press "Give consent on behalf of user" + And I press "Give consent" And "Consent given on behalf of user" "icon" should exist in the "User One" "table_row" And "Max Manager" "link" should exist in the "User One" "table_row" And "Consent received from a parent" "text" should exist in the "User One" "table_row" @@ -151,12 +151,12 @@ Feature: Viewing acceptances reports and accepting on behalf of other users And I press "Next" And I navigate to "Users > Privacy and policies > User agreements" in site administration And I click on "Consent not given; click to give consent on behalf of user for This site policy" "link" in the "User One" "table_row" - Then I should see "Give consent on behalf of user" + Then I should see "Give consent" And I should see "User One" And I should see "This site policy" - And I should see "I acknowledge that I have received a request to give consent on behalf of user(s)." + And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)." And I set the field "Remarks" to "Consent received from a parent" - And I press "Give consent on behalf of user" + And I press "Give consent" And "Consent given on behalf of user" "icon" should exist in the "User One" "table_row" And "Consent not given; click to give consent on behalf of user for This privacy policy" "icon" should exist in the "User One" "table_row" And I click on "1 of 2" "link" in the "User One" "table_row" @@ -184,12 +184,12 @@ Feature: Viewing acceptances reports and accepting on behalf of other users And I press "Next" And I navigate to "Users > Privacy and policies > User agreements" in site administration And I click on "Consent not given; click to give consent on behalf of user for This site policy" "link" in the "User One" "table_row" - Then I should see "Give consent on behalf of user" + Then I should see "Give consent" And I should see "User One" And I should see "This site policy" - And I should see "I acknowledge that I have received a request to give consent on behalf of user(s)." + And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)." And I set the field "Remarks" to "Consent received from a parent" - And I press "Give consent on behalf of user" + And I press "Give consent" And "Consent given on behalf of user" "icon" should exist in the "User One" "table_row" And "Consent not given; click to give consent on behalf of user for This privacy policy" "icon" should exist in the "User One" "table_row" And I click on "1 of 2" "link" in the "User One" "table_row" @@ -249,12 +249,12 @@ Feature: Viewing acceptances reports and accepting on behalf of other users And I navigate to "Users > Privacy and policies > Manage policies" in site administration And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row" And I click on "Consent not given" "link" in the "User One" "table_row" - Then I should see "Give consent on behalf of user" + Then I should see "Give consent" And I should see "User One" And I should see "This site policy" - And I should see "I acknowledge that I have received a request to give consent on behalf of user(s)." + And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)." And I set the field "Remarks" to "Consent received from a parent" - And I press "Give consent on behalf of user" + And I press "Give consent" And "Consent given on behalf of user" "icon" should exist in the "User One" "table_row" And "Max Manager" "link" should not exist in the "User One" "table_row" And "Admin User" "link" should exist in the "User One" "table_row"