From 8504c2e230493d60466244d53482c9af9a8fbc94 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Mon, 15 Jun 2026 18:40:23 -0400 Subject: [PATCH 1/2] Improve UI/UX for Terms and Conditions Review (CFM-501) --- .../AgreementCollectors/dispatch.inc | 30 +++- .../templates/element/agreeDialog.php | 4 +- .../TermsAndConditionsController.php | 69 +++++++-- .../Model/Table/TermsAndConditionsTable.php | 12 +- app/templates/TermsAndConditions/review.php | 132 ++++++------------ app/templates/element/javascript.php | 4 +- app/webroot/css/co-base.css | 12 ++ 7 files changed, 148 insertions(+), 115 deletions(-) diff --git a/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc b/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc index 159fe00ee..b6c97e09d 100644 --- a/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc +++ b/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc @@ -1,6 +1,7 @@ Form->create(null, [ + + + + + - + $tc): ?> + + + + +
getName()]); ?>
identifier ?? "" ?>created) + ? $this->Time->nice($vv_tandc_statuses[$i]['agreement']->created, $vv_tz) + : ""; + ?>
- \ No newline at end of file +// This dispatch uses the same user interface as the core TermsAndConditions/tandcs.inc template. +include ROOT . DS . 'templates' . DS . 'TermsAndConditions' . DS . 'tandcs.inc'; \ No newline at end of file diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po index 6f75d1a43..f9350f928 100644 --- a/app/resources/locales/en_US/information.po +++ b/app/resources/locales/en_US/information.po @@ -183,6 +183,15 @@ msgstr "Report for " msgid "table.list" msgstr "{0} List" +msgid "tandc.review" +msgstr "You must review and agree to these Terms and Conditions before continuing." + +msgid "tandc.review.dialog.title" +msgstr "Review Terms & Conditions" + +msgid "tandc.review.external" +msgstr "These Terms and Conditions will be loaded in an external browser window. After review, you must return to this window and click \"Agree\" to continue." + msgid "ug.tasks.post" msgstr "Executing post-database tasks for version {0}" diff --git a/app/templates/TermsAndConditions/review.php b/app/templates/TermsAndConditions/review.php index 1fa254c15..4ec9296a0 100644 --- a/app/templates/TermsAndConditions/review.php +++ b/app/templates/TermsAndConditions/review.php @@ -41,12 +41,13 @@ Form->create(null); // We don't need an object for this form ?>
diff --git a/app/templates/TermsAndConditions/tandcs.inc b/app/templates/TermsAndConditions/tandcs.inc new file mode 100644 index 000000000..ed9bc8dfc --- /dev/null +++ b/app/templates/TermsAndConditions/tandcs.inc @@ -0,0 +1,210 @@ +element('flash', []); + + // Make the Form fields editable + $this->Field->enableFormEditMode(); +?> + +

+ +Form->create(null, [ + 'id' => 'agreement-form', + 'type' => 'post' + ]); + + +?> + + + + + + + + + + + + + + $tc): ?> + + + + + + + + + + + + +
getName()]); ?>
+ + identifier ?? "" ?>created) + ? $this->Time->nice($vv_tandc_statuses[$i]['agreement']->created, $vv_tz) + : ""; + ?> + + url)): // We have a URL based T&C ?> + + + element('tandcAgreeDialog', ['vv_tc' => $tc]); ?> + + +
+ Form->checkbox( + 'tc'.$tc['id'], + [ + 'id' => 'tc'.$tc['id'], + 'class' => 'form-check-input tc-agree-checkbox', + 'checked' => !empty($vv_tandc_statuses) && $vv_tandc_statuses[$i]['status'] == 'Y' ? true : false, + ] + ) . + $this->Form->label( + 'tc'.$tc['id'], + __d('operation','agree'), + [ + 'class' => 'form-check-label' + ] + ) + ?> +
+
+ + \ No newline at end of file diff --git a/app/plugins/TermsAgreer/templates/element/agreeDialog.php b/app/templates/element/tandcAgreeDialog.php similarity index 97% rename from app/plugins/TermsAgreer/templates/element/agreeDialog.php rename to app/templates/element/tandcAgreeDialog.php index 49b25c244..63e384a90 100644 --- a/app/plugins/TermsAgreer/templates/element/agreeDialog.php +++ b/app/templates/element/tandcAgreeDialog.php @@ -52,7 +52,7 @@