From ab3f9bcab7d3cc0b0b335cf0306f9531b3df0b72 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 7 Feb 2020 13:14:19 +0100 Subject: [PATCH] Admin: Add configuration setting 'gdpr_terms_public' to enable the public availability of GDPR terms used on the platform - refs BT#16553 --- main/install/configuration.dist.php | 15 +++++-- main/template/default/user_portal/terms.tpl | 10 +++++ terms.php | 50 +++++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 main/template/default/user_portal/terms.tpl create mode 100644 terms.php diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index b68a2e3846..e9df83ff93 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -947,12 +947,15 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1, // $_configuration['show_pending_survey_in_menu'] = false; // GDPR: European's General Data Protection Rules activation option -// Set to true to disable the new personal data page inside the social network menu +// Set to true to disable the new personal data page inside the social network +// menu // $_configuration['disable_gdpr'] = true; -// GDPR requires users to be informed of the Data Protection Officer name and contact point -// These can only be defined here for now, but will be moved to web settings in the future. -// Name of the person or organization that is responsible for the treatment of personal info +// GDPR requires users to be informed of the Data Protection Officer name and +// contact point. These can only be defined here for now, but will be moved to +// web settings in the future. +// Name of the person or organization that is responsible for the treatment of +// personal info //$_configuration['data_protection_officer_name'] = ''; // A description of the role of the DP Officer in this context //$_configuration['data_protection_officer_role'] = ''; @@ -976,6 +979,10 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1, ], ];*/ +// Make GDPR terms public (useful when using the platform for anonymous survey +// invitations where users can leave personal info). +// $_configuration['gdpr_terms_public'] = false; + // Hide LP item prerequisite label in the LP view //$_configuration['hide_accessibility_label_on_lp_item'] = true; diff --git a/main/template/default/user_portal/terms.tpl b/main/template/default/user_portal/terms.tpl new file mode 100644 index 0000000000..1a2b432556 --- /dev/null +++ b/main/template/default/user_portal/terms.tpl @@ -0,0 +1,10 @@ +{% extends 'layout/layout_1_col.tpl'|get_template %} +{% import 'default/macro/macro.tpl' as display %} + +{% block content %} +
+ {% if term %} + {{ display.panel('TermsAndConditions'|get_lang, term.content, term.date_text ) }} + {% endif %} +
+{% endblock %} diff --git a/terms.php b/terms.php new file mode 100644 index 0000000000..691d488aa8 --- /dev/null +++ b/terms.php @@ -0,0 +1,50 @@ +getAllValuesByItem($term['id']); +foreach ($values as $value) { + if (!empty($value['value'])) { + $term['content'] .= '

'.get_lang($value['display_text']).'


'.$value['value'].'
'; + } +} + +$term['date_text'] = get_lang('PublicationDate').': '. + api_get_local_time( + $term['date'], + null, + null, + false, + true, + true + ); + +$tpl = new Template(null); + +$tpl->assign('term', $term); + +$socialLayout = $tpl->get_template('user_portal/terms.tpl'); +$tpl->display($socialLayout);