diff --git a/app/config/routes.php b/app/config/routes.php index 0ff3028af..ea53d618c 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -138,6 +138,11 @@ function (RouteBuilder $builder) { ['controller' => 'ApiV2', 'action' => 'generateApiKey', 'model' => 'api_users']) ->setPass(['id']) ->setPatterns(['id' => '[0-9]+']); + $builder->post( + '/terms_and_conditions/record/{id}', + ['controller' => 'ApiV2', 'action' => 'recordTAndC', 'model' => 'terms_and_conditions']) + ->setPass(['id']) + ->setPatterns(['id' => '[0-9]+']); $builder->get( '/people/pick', ['controller' => 'ApiV2', 'action' => 'pick', 'model' => 'people']); diff --git a/app/plugins/CoreEnroller/templates/element/emailVerifiers/list.php b/app/plugins/CoreEnroller/templates/element/emailVerifiers/list.php index f4a44b24b..5bdc3ae5a 100644 --- a/app/plugins/CoreEnroller/templates/element/emailVerifiers/list.php +++ b/app/plugins/CoreEnroller/templates/element/emailVerifiers/list.php @@ -101,14 +101,23 @@ ?>
| = __d('field', 'identifier') ?> | -= __d('field', 'value') ?> | -
|---|---|
| = __d('field', 'identifier') ?> | += __d('field', 'value') ?> | +
| = __d('orcid_source', 'information.orcid_source.identifier') ?> | -= $vv_orcid ?> | -
|
+
+ = __d('orcid_source', 'information.orcid_source.identifier') ?>
+
+ |
+
+ = __d('field', 'value') ?>
+ = $vv_orcid ?>
+ |
+
= __d('terms_agreer', 'information.AgreementCollectors.review') ?>
- -Form->create(null, [ - 'id' => 'agreement-form', - 'type' => 'post' -]); - - -?> - -| = __d('controller','TermsAndConditions',[99]) ?> | -= __d('operation','review') ?> | -= __d('operation','agreement') ?> | -
|---|---|---|
| - = $tc['description'] ?> - | -- - url)): // We have a URL based T&C ?> - - - = $this->element('TermsAgreer.agreeDialog', ['vv_tc' => $tc]); ?> - - | -
-
- =
- $this->Form->checkbox(
- 'tc'.$tc['id'],
- ['id' => 'tc'.$tc['id'], 'class' => 'form-check-input tc-agree-checkbox']
- ) .
- $this->Form->label(
- 'tc'.$tc['id'],
- __d('operation','agree'),
- ['class' => 'form-check-label']
- )
- ?>
-
- |
-
= __d('cake', 'Error') ?>: = __d('cake', 'The requested address {0} was not found on this server.', "'{$url}'") ?> diff --git a/app/templates/Error/error500.php b/app/templates/Error/error500.php index 4ade4dd94..b3971e69a 100644 --- a/app/templates/Error/error500.php +++ b/app/templates/Error/error500.php @@ -35,7 +35,7 @@ $this->end(); endif; ?> -
= __d('cake', 'Error') ?>: = h($message) ?> diff --git a/app/templates/ExternalIdentitySources/search.php b/app/templates/ExternalIdentitySources/search.php index 79858177c..279a034b2 100644 --- a/app/templates/ExternalIdentitySources/search.php +++ b/app/templates/ExternalIdentitySources/search.php @@ -137,6 +137,7 @@ $r): ?>
| = __d('field', 'ordr') ?> | -= __d('controller', 'EnrollmentFlowSteps', [1]) ?> | -= __d('result', 'result') ?> | -= __d('field', 'EnrollmentFlows.authz_type') ?> | -= __d('field', 'action') ?> | -
|---|---|---|---|---|
| = $step->ordr ?? "" ?> | -= $step->description ?> | - -= $step->petition_step_results[0]->comment ?? "" ?> | -= __d('enumeration', 'EnrollmentActorEnum.'.$step->actor_type) ?> | -id ])) { - print $this->Html->link( - ($step->id == $vv_next_step_id) ? - __d('operation', 'continue') . ' arrow_forward' : - __d('operation', 'Petitions.rerun') . ' restart_alt', - $vv_dispatch_urls[ $step->id ], - [ - 'class' => 'btn btn-sm ' . (($step->id == $vv_next_step_id) ? 'btn-tertiary ef-continue-step' : 'btn-default ef-rerun-step'), - 'escape' => false - ] - ); - - if($step->id == $vv_next_step_id) { - $seenNextStep = true; - } - } - ?> | -
| = __d('controller', 'EnrollmentFlowSteps', [1]) ?> | += __d('field', 'ordr') ?> | += __d('result', 'result') ?> | += __d('field', 'EnrollmentFlows.authz_type') ?> | += __d('field', 'action') ?> | +
|
+
+ = $step->description ?>
+
+ |
+
+
+ = __d('field', 'ordr') ?>
+
+
+ = $step->ordr ?? "" ?>
+
+ |
+
+
+
+ = __d('result', 'result') ?>
+
+
+ = $step->petition_step_results[0]->comment ?? "" ?>
+
+ |
+
+
+ = __d('field', 'EnrollmentFlows.authz_type') ?>
+
+
+ = __d('enumeration', 'EnrollmentActorEnum.'.$step->actor_type) ?>
+
+ |
+
+
+ = __d('field', 'action') ?>
+
+
+ id ])) {
+ print $this->Html->link(
+ ($step->id == $vv_next_step_id) ?
+ __d('operation', 'continue') . ' arrow_forward' :
+ __d('operation', 'Petitions.rerun') . ' restart_alt',
+ $vv_dispatch_urls[ $step->id ],
+ [
+ 'class' => 'btn btn-sm ' . (($step->id == $vv_next_step_id) ? 'btn-tertiary ef-continue-step' : 'btn-default ef-rerun-step'),
+ 'escape' => false
+ ]
+ );
+
+ if($step->id == $vv_next_step_id) {
+ $seenNextStep = true;
+ }
+ }
+ ?>
+
+ |
+
| = __d('controller', 'TermsAndConditions', [1]); ?> | -= __d('field', 'status'); ?> | -= __d('field', 'changelog.actor_identifier'); ?> | -= __d('field', 'timestamp.tz', [$vv_tz->getName()]); ?> | -||||
|---|---|---|---|---|---|---|---|
|
-
-
- id;
- $action_args['vv_actions'] = [];
+Url->build([
+ 'plugin' => null,
+ 'controller' => 'Dashboards',
+ 'action' => 'dashboard',
+ '?' => ['co_id' => $vv_cur_co->id]],
+ ['escape' => false]
+ );
- if($t['status'] != TAndCStatusEnum::Agreed) {
- // T&C that are not current can be agreed to
+ // Get the CSRF Token in JavaScript
+ $token = $this->request->getAttribute('csrfToken');
+?>
- $action_args['vv_actions'][] = [
- 'order' => $this->Menu->getMenuOrder('Default'),
- 'icon' => 'signature',
- 'url' => [
- 'controller' => 'terms_and_conditions',
- 'action' => 'agree',
- $t['tandc']->id
- ],
- 'label' => __d('operation', 'agree'),
- 'confirm' => [
- 'dg_body_txt' => __d('operation', 'TermsAndConditions.agree.confirm'),
- 'dg_confirm_btn' => __d('operation', 'confirm')
- ]
- ];
- }
+
diff --git a/app/templates/TermsAndConditions/status.php b/app/templates/TermsAndConditions/status.php
index 5d166a1ff..e3bf45040 100644
--- a/app/templates/TermsAndConditions/status.php
+++ b/app/templates/TermsAndConditions/status.php
@@ -55,97 +55,124 @@
|
+
- id;
- $action_args['vv_actions'] = [];
-
- if($t['status'] != TAndCStatusEnum::Agreed) {
- // T&C that are not current can be agreed to on behalf by an admin
-
- $action_args['vv_actions'][] = [
- 'order' => $this->Menu->getMenuOrder('Default'),
- 'icon' => 'signature',
- 'url' => [
- 'controller' => 'terms_and_conditions',
- 'action' => 'proxy',
- $t['tandc']->id,
- '?' => [
- 'person_id' => $vv_person_id
- ]
- ],
- 'label' => __d('operation', 'TermsAndConditions.proxy'),
- 'confirm' => [
- 'dg_body_txt' => __d('operation', 'TermsAndConditions.proxy.confirm'),
- 'dg_confirm_btn' => __d('operation', 'confirm')
- ]
- ];
- }
-
- if($t['status'] != TAndCStatusEnum::NotAgreed) {
- // T&C that are Agreed, Expired, or Outdated can be revoked
-
- $action_args['vv_actions'][] = [
- 'order' => $this->Menu->getMenuOrder('Default'),
- 'icon' => 'contract_delete',
- 'url' => [
- 'controller' => 'terms_and_conditions',
- 'action' => 'revoke',
- $t['tandc']->id,
- '?' => [
- 'person_id' => $vv_person_id
- ]
- ],
- 'label' => __d('operation', 'TermsAndConditions.revoke'),
- 'confirm' => [
- 'dg_body_txt' => __d('operation', 'TermsAndConditions.revoke.confirm'),
- 'dg_confirm_btn' => __d('operation', 'confirm')
- ]
- ];
- }
-
- if(!empty($action_args['vv_actions'])) {
- print $this->element('menuAction', $action_args);
- }
- ?>
+ id;
+ $action_args['vv_actions'] = [];
+
+ if($t['status'] != TAndCStatusEnum::Agreed) {
+ // T&C that are not current can be agreed to on behalf by an admin
+
+ $action_args['vv_actions'][] = [
+ 'order' => $this->Menu->getMenuOrder('Default'),
+ 'icon' => 'signature',
+ 'url' => [
+ 'controller' => 'terms_and_conditions',
+ 'action' => 'proxy',
+ $t['tandc']->id,
+ '?' => [
+ 'person_id' => $vv_person_id
+ ]
+ ],
+ 'label' => __d('operation', 'TermsAndConditions.proxy'),
+ 'confirm' => [
+ 'dg_body_txt' => __d('operation', 'TermsAndConditions.proxy.confirm'),
+ 'dg_confirm_btn' => __d('operation', 'confirm')
+ ]
+ ];
+ }
+
+ if($t['status'] != TAndCStatusEnum::NotAgreed) {
+ // T&C that are Agreed, Expired, or Outdated can be revoked
+
+ $action_args['vv_actions'][] = [
+ 'order' => $this->Menu->getMenuOrder('Default'),
+ 'icon' => 'contract_delete',
+ 'url' => [
+ 'controller' => 'terms_and_conditions',
+ 'action' => 'revoke',
+ $t['tandc']->id,
+ '?' => [
+ 'person_id' => $vv_person_id
+ ]
+ ],
+ 'label' => __d('operation', 'TermsAndConditions.revoke'),
+ 'confirm' => [
+ 'dg_body_txt' => __d('operation', 'TermsAndConditions.revoke.confirm'),
+ 'dg_confirm_btn' => __d('operation', 'confirm')
+ ]
+ ];
+ }
+
+ if(!empty($action_args['vv_actions'])) {
+ print $this->element('menuAction', $action_args);
+ }
+ ?>
+
+
+ ';
+ print $this->Html->link(
+ // There might be a more elegant way to render this than appending
+ // it to the URL label...
+ $t['oldtandc']->description,
+ [
+ 'controller' => 'terms_and_conditions',
+ // We can only view archive records, not edit
+ 'action' => 'view',
+ $t['oldtandc']->id
+ ]
+ );
+ print $this->element('notify/alert', [
+ 'message' => __d('information', 'TermsAndConditions.desc.old')
+ ]);
+ print ' ';
+ } else {
+ print $this->Html->link(
+ $t['tandc']->description,
+ [
+ 'controller' => 'terms_and_conditions',
+ 'action' => 'edit',
+ $t['tandc']->id
+ ]
+ );
+ }
+ ?>
+
+ |
+
+ = __d('field', 'status'); ?>
+
+
+ = __d('enumeration', 'TAndCStatusEnum.'.$t['status']); ?>
+
+
+ |
+
+ = __d('field', 'changelog.actor_identifier'); ?>
+
+
+ = $t['agreement']->identifier ?? "" ?>
+
+
+ |
-
+ = __d('field', 'timestamp.tz', [$vv_tz->getName()]); ?>
+
+
+ =
+ !empty($t['agreement']->created)
+ ? $this->Time->nice($t['agreement']->created, $vv_tz)
+ : "";
?>
-
+
= __d('enumeration', 'TAndCStatusEnum.'.$t['status']); ?> |
- = $t['agreement']->identifier ?? "" ?> |
- =
- !empty($t['agreement']->created)
- ? $this->Time->nice($t['agreement']->created, $vv_tz)
- : "";
- ?> |
|
| = __d('controller','TermsAndConditions',[99]) ?> | + += __d('field', 'status'); ?> | += __d('field', 'changelog.actor_identifier'); ?> | += __d('field', 'timestamp.tz', [$vv_tz->getName()]); ?> | + += __d('operation','review') ?> | += __d('operation','agreement') ?> | +
|---|---|---|---|---|---|
|
+
+ = $tc['description'] ?>
+
+ |
+
+
+ = __d('field', 'status'); ?>
+
+ = __d('enumeration', 'TAndCStatusEnum.'.$vv_tandc_statuses[$i]['status']); ?>
+
+ |
+
+ = __d('field', 'changelog.actor_identifier'); ?>
+
+ = $vv_tandc_statuses[$i]['agreement']->identifier ?? "" ?>
+
+ |
+
+ = __d('field', 'timestamp.tz', [$vv_tz->getName()]); ?>
+
+ =
+ !empty($vv_tandc_statuses[$i]['agreement']->created)
+ ? $this->Time->nice($vv_tandc_statuses[$i]['agreement']->created, $vv_tz)
+ : "";
+ ?>
+
+ |
+
+
+ = __d('operation','review') ?>
+
+
+ url)): // We have a URL based T&C ?>
+
+
+ = $this->element('tandcAgreeDialog', ['vv_tc' => $tc]); ?>
+
+
+ |
+
+ = __d('operation','agreement') ?>
+
+
+
+ =
+ $this->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,
+ 'data-id' => $tc['id'],
+ 'data-status' => !empty($vv_tandc_statuses) && $vv_tandc_statuses[$i]['status'] === 'Y' ? 'Y' : 'N',
+ 'data-coid' => !empty($vv_cur_co) ? $vv_cur_co?->id : -1
+ ]
+ ) .
+ $this->Form->label(
+ 'tc'.$tc['id'],
+ __d('operation','agree'),
+ [
+ 'class' => 'form-check-label'
+ ]
+ )
+ ?>
+
+ |
+