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 @@ ?> - - - - - - - +
+ +
+ + +
+ +
+
+ + + + + + +
diff --git a/app/plugins/OrcidSource/templates/element/preview.php b/app/plugins/OrcidSource/templates/element/preview.php index c5ad8ab0b..f2efffd99 100644 --- a/app/plugins/OrcidSource/templates/element/preview.php +++ b/app/plugins/OrcidSource/templates/element/preview.php @@ -33,18 +33,25 @@ ?> - - - - - - + + + + + + - - - - - - + + + + + +
+
+ +
+
+
+
+
diff --git a/app/plugins/TermsAgreer/resources/locales/en_US/terms_agreer.po b/app/plugins/TermsAgreer/resources/locales/en_US/terms_agreer.po index b2c8b8cda..0cb592900 100644 --- a/app/plugins/TermsAgreer/resources/locales/en_US/terms_agreer.po +++ b/app/plugins/TermsAgreer/resources/locales/en_US/terms_agreer.po @@ -37,21 +37,9 @@ msgstr "Ignore" msgid "enumeration.TAndCEnrollmentModeEnum.IC" msgstr "Implied Consent" -msgid "error.TAndCAgreement.missing" -msgstr "Did not receive agreement for \"{0}\" (T&C {1})" - msgid "field.AgreementCollectors.t_and_c_mode" msgstr "Terms and Conditions Mode" -msgid "information.AgreementCollectors.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 "information.AgreementCollectors.review" -msgstr "You must review and agree to these Terms and Conditions before continuing." - -msgid "information.AgreementCollectors.review.tc" -msgstr "Review Terms & Conditions" - msgid "result.AgreementCollectors.ignored" msgstr "Terms and Conditions collection disabled" diff --git a/app/plugins/TermsAgreer/src/Controller/AgreementCollectorsController.php b/app/plugins/TermsAgreer/src/Controller/AgreementCollectorsController.php index 80f4cd977..df5c0f902 100644 --- a/app/plugins/TermsAgreer/src/Controller/AgreementCollectorsController.php +++ b/app/plugins/TermsAgreer/src/Controller/AgreementCollectorsController.php @@ -31,8 +31,8 @@ use App\Controller\StandardEnrollerController; use App\Lib\Enum\SuspendableStatusEnum; +use App\Lib\Enum\TAndCAgreementModeEnum; use Cake\ORM\TableRegistry; -use TermsAgreer\Lib\Enum\TAndCEnrollmentModeEnum; class AgreementCollectorsController extends StandardEnrollerController { protected array $paginate = [ @@ -58,7 +58,7 @@ public function dispatch(string $id) { $cfg = $this->AgreementCollectors->get($id); - if($cfg->t_and_c_mode == TAndCEnrollmentModeEnum::Ignore) { + if($cfg->t_and_c_mode == TAndCAgreementModeEnum::Ignore) { // If the Plugin is set to Ignore, we simply skip this step and move on. return $this->finishStep( @@ -119,7 +119,7 @@ public function dispatch(string $id) { if(!isset($data[$key]) || $data[$key] != "1") { $ok = false; - $this->Flash->error(__d('terms_agreer','error.TAndCAgreement.missing', [$tc->description, $tc->id])); + $this->Flash->error(__d('error','TermsAndConditions.agreement.missing', [$tc->description, $tc->id])); } } diff --git a/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc b/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc index 11026edd3..1e8cf7b2d 100644 --- a/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc +++ b/app/plugins/TermsAgreer/templates/AgreementCollectors/dispatch.inc @@ -1,6 +1,6 @@ element('flash', []); - -// Make the Form fields editable -$this->Field->enableFormEditMode(); -?> - -

- -Form->create(null, [ - 'id' => 'agreement-form', - 'type' => 'post' -]); - - -?> - - - - - - - - - - - - - - - - -
- - - - url)): // We have a URL based T&C ?> - - - element('TermsAgreer.agreeDialog', ['vv_tc' => $tc]); ?> - - -
- 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'] - ) - ?> -
-
- - - \ 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/error.po b/app/resources/locales/en_US/error.po index 2ed785f12..781a22c44 100644 --- a/app/resources/locales/en_US/error.po +++ b/app/resources/locales/en_US/error.po @@ -451,6 +451,12 @@ msgstr "No outgoing SMTP Server configuration found" msgid "TermsAndConditions.document.one" msgstr "Exactly one of Mostly Static Page or URL must be specified" +msgid "TermsAndConditions.agreement.missing" +msgstr "Did not receive agreement for \"{0}\" (T&C {1})" + +msgid "TermsAndConditions.agreement.failed" +msgstr "Failed to record agreement. Please try again or check with your administrator." + msgid "TermsAndConditions.revoke.none" msgstr "No Agreements available to revoke" diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po index c64a13ef7..d77f9d14b 100644 --- a/app/resources/locales/en_US/information.po +++ b/app/resources/locales/en_US/information.po @@ -235,7 +235,16 @@ msgid "table.list" msgstr "{0} List" msgid "TermsAndConditions.desc.old" -msgstr "{0} (Agreement is to an older definition)" +msgstr "Agreement is to an older definition" + +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/src/Controller/ApiV2Controller.php b/app/src/Controller/ApiV2Controller.php index 4407814bd..260121298 100644 --- a/app/src/Controller/ApiV2Controller.php +++ b/app/src/Controller/ApiV2Controller.php @@ -131,21 +131,6 @@ public function add() { $this->render('/Standard/api/v2/json/add-edit'); } - /** - * beforeFilter callback. - * - * @param \Cake\Event\EventInterface $event Event. - * @return \Cake\Http\Response|null|void - */ - public function beforeFilter(\Cake\Event\EventInterface $event) - { - parent::beforeFilter($event); - - if ($this->request->is('ajax') && $this->request->is(['post', 'put'])) { - $this->FormProtection->setConfig('validate', false); - } - } - /** * Callback run prior to the request rendering. * @@ -446,20 +431,27 @@ public function recordTAndC(string $id) { } $TAndCAgreements = TableRegistry::getTableLocator()->get('TAndCAgreements'); + $TAndCs = TableRegistry::getTableLocator()->get('TermsAndConditions'); $agreement = $TAndCAgreements->record( termsAndConditionsId: (int)$id, - personId: $json['personId'], - actorPersonId: $json['actorPersonId'], + personId: (int)$json['personId'], + actorPersonId: (int)$json['actorPersonId'], identifier: $json['identifier'] ); $TAndCAgreements->People->requestProvisioning( - id: $json['personId'], + id: (int)$json['personId'], context: ProvisioningContextEnum::Automatic ); $this->set('vv_results', ['id' => $agreement->id]); + + // Only this action uses a Flash message. If more restful actions need it in the future, + // move the loadComponent('Flash') out of the !restful test in AppController. + $this->loadComponent('Flash'); + $tandc = $TAndCs->get($agreement->terms_and_conditions_id); + $this->Flash->success(__d('result', 'TermsAndConditions.agreed', [$tandc->description])); // Let the view render $this->viewBuilder()->setLayout('rest'); diff --git a/app/src/Controller/AppController.php b/app/src/Controller/AppController.php index 25f4d16f2..bb8f0f4f9 100644 --- a/app/src/Controller/AppController.php +++ b/app/src/Controller/AppController.php @@ -207,6 +207,7 @@ public function beforeFilter(\Cake\Event\EventInterface $event) { $this->RegistryAuth->isAuthenticatedUser() && !$this->RegistryAuth->isApiUser() && $this->getCOID() !== null + && !$this->request->is('ajax') ) { $this->set('vv_person_id', $this->RegistryAuth->getPersonId($this->getCOID())); diff --git a/app/src/Controller/TermsAndConditionsController.php b/app/src/Controller/TermsAndConditionsController.php index d30814b4d..13a72356a 100644 --- a/app/src/Controller/TermsAndConditionsController.php +++ b/app/src/Controller/TermsAndConditionsController.php @@ -34,6 +34,7 @@ use Cake\ORM\TableRegistry; use Cake\Utility\Hash; use \App\Lib\Enum\ProvisioningContextEnum; +use \App\Lib\Enum\TAndCAgreementModeEnum; use \App\Lib\Enum\TAndCStatusEnum; class TermsAndConditionsController extends StandardController { @@ -145,34 +146,7 @@ public function proxy(string $id) { */ public function review() { - // Before we get started, see if a return parameter was requested, and if so if it is permitted. - // If so, we'll override any current return URL. We check the return URL here rather than when - // we're done because URLs stored by AppController are not subject to the allow list check. - - $returnUrl = $this->request->getQuery('return'); - - if(!empty($returnUrl)) { - $returnUrl = base64_decode($returnUrl); - - $CoSettings = TableRegistry::getTableLocator()->get('CoSettings'); - $settings = $CoSettings->find()->where(['co_id' => $this->getCOID()])->firstOrFail(); - - if(!empty($settings->tc_return_url_allowlist)) { - foreach(preg_split('/\R/', $settings->tc_return_url_allowlist) as $u) { - if(preg_match($u, $returnUrl)) { - // The requested URL is permitted, so store it in the session, potentially overriding - // the original return URL - $this->request->getSession()->write('TAndC.return', $returnUrl); - break; - } - } - } else { - // No allowed URLs, so ignore redirect - } - } - // We get the current user from RegistryAuthComponent and then pass their T&C status to the view. - $personId = $this->RegistryAuth->getPersonID($this->getCOID()); if(empty($personId)) { @@ -183,23 +157,12 @@ public function review() { $status = $this->TermsAndConditions->status((int)$personId); - // If there is nothing left to do, redirect to the original request - $done = true; - - foreach($status as $s) { - if($s['status'] != TAndCStatusEnum::Agreed) { - $done = false; - break; - } - } - - if($done) { - return $this->redirect($this->request->getSession()->read('TAndC.return')); - } - $this->set('vv_tandc_statuses', $status); $this->set('vv_person_id', (int)$personId); + // The default mode for CO and platform wide T&Cs is "Explicit Consent" ('EC'). + $this->set('vv_tandc_mode', TAndCAgreementModeEnum::ExplicitConsent); + $this->set('vv_title', __d('controller', 'TermsAndConditions', 99)); } diff --git a/app/plugins/TermsAgreer/src/Lib/Enum/TAndCEnrollmentModeEnum.php b/app/src/Lib/Enum/TAndCAgreementModeEnum.php similarity index 86% rename from app/plugins/TermsAgreer/src/Lib/Enum/TAndCEnrollmentModeEnum.php rename to app/src/Lib/Enum/TAndCAgreementModeEnum.php index 9ed765b5e..8b15ff42f 100644 --- a/app/plugins/TermsAgreer/src/Lib/Enum/TAndCEnrollmentModeEnum.php +++ b/app/src/Lib/Enum/TAndCAgreementModeEnum.php @@ -1,6 +1,6 @@ ['coAdmin'], // 'recordTAndC' is used by ApiV2Controller - 'recordTAndC' => ['platformAdmin', 'coAdmin'], + 'recordTAndC' => ['platformAdmin', 'coAdmin', 'coMember'], 'revoke' => ['platformAdmin', 'coAdmin'], 'view' => ['platformAdmin', 'coAdmin'] ], @@ -194,25 +194,26 @@ public function status(int $personId): array { // Pull active T&C for the CO/COU $copersonid is a member of. This will NOT include // any outdated T&C, we'll pull those separately, below. - + $whereClause = [ - 'co_id' => $person->co_id, - 'status' => SuspendableStatusEnum::Active + 'TermsAndConditions.co_id' => $person->co_id, + 'TermsAndConditions.status' => SuspendableStatusEnum::Active ]; if(!empty($couIds)) { $whereClause['OR'] = [ - 'cou_id IS NULL', - 'cou_id IN' => array_values($couIds) + 'TermsAndConditions.cou_id IS NULL', + 'TermsAndConditions.cou_id IN' => array_values($couIds) ]; } else { - $whereClause[] = 'cou_id IS NULL'; + $whereClause[] = 'TermsAndConditions.cou_id IS NULL'; } $tandc = $this->find() - ->where($whereClause) - ->order('ordr ASC') - ->all(); + ->contain('MostlyStaticPages') + ->where($whereClause) + ->orderBy(['TermsAndConditions.ordr' => 'ASC']) + ->all(); if(!empty($tandc)) { // Pull all the Agreements for $personId at once, we'll walk through them as needed. diff --git a/app/templates/Error/error400.php b/app/templates/Error/error400.php index 809690169..5de690ef4 100644 --- a/app/templates/Error/error400.php +++ b/app/templates/Error/error400.php @@ -31,7 +31,7 @@ $this->end(); endif; ?> -

+

: '{$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; ?> -

+

: 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): ?> +

Html->link( // Cast to string in case we have a numeric source key (string)$source_key, @@ -149,10 +150,32 @@ 'class' => 'row-link row-link-retrieve' ] ); ?> +
+ + +
+ +
+
+ +
+ + +
+ +
+
+ +
+ + +
+ +
+
+ +
- - - diff --git a/app/templates/Petitions/resume.php b/app/templates/Petitions/resume.php index 9c4f9557c..8fc08f9d7 100644 --- a/app/templates/Petitions/resume.php +++ b/app/templates/Petitions/resume.php @@ -76,39 +76,75 @@
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
ordr ?? "" ?>description ?>petition_step_results[0]->comment ?? "" ?>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; - } - } - ?>
+
+ description ?> +
+
+
+ +
+
+ ordr ?? "" ?> +
+
+
+ +
+
+ petition_step_results[0]->comment ?? "" ?> +
+
+
+ +
+
+ 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; + } + } + ?> +
+
diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index dfaff9d5e..50b77a8c8 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -272,7 +272,7 @@ - + > '; } + if(!$isFirstLink) { + $label = !empty($cfg['label']) ? $cfg['label'] : \App\Lib\Util\StringUtilities::columnKey($modelsName, $col, $vv_tz); + print '
' . $label . '
'; + print '
'; + } else { + print '
'; + } + switch($cfg['type']) { case 'boolean': if(!empty($entity->$col) && $entity->$col) { @@ -663,6 +671,7 @@ } break; } + print "
"; // cell-content (or cell-first-content) if($isFirstLink && !empty($rowActions)) { print '
'; // field-actions-container @@ -674,7 +683,9 @@ - + + + diff --git a/app/templates/TermsAndConditions/columns.inc b/app/templates/TermsAndConditions/columns.inc index f1248e8fd..e769c39b9 100644 --- a/app/templates/TermsAndConditions/columns.inc +++ b/app/templates/TermsAndConditions/columns.inc @@ -49,6 +49,13 @@ $rowActions = [ [ 'icon' => 'arrow_outward', 'label' => __d('operation', 'visit.tandc'), - 'callbackUrl' => static fn($entity) => $entity->url + 'callbackUrl' => function($entity) use ($vv_base_url) { + // There should always be either a Mostly Static Page or a URL to reference. + if(!empty($entity->mostly_static_page->name)) { + // The T&C is a mostly static page. Provide a link to it. + return $vv_base_url . '/pages/' . $entity->mostly_static_page->name; + } + return $entity->url; + } ] ]; diff --git a/app/templates/TermsAndConditions/review.php b/app/templates/TermsAndConditions/review.php index 49e5c255d..a694dd6d2 100644 --- a/app/templates/TermsAndConditions/review.php +++ b/app/templates/TermsAndConditions/review.php @@ -1,32 +1,33 @@
@@ -35,68 +36,104 @@
-element('flash') // Flash messages ?> - - +element('flash') // Flash messages ?> + + + +Form->create(null); // We don't need an object for this form ?>
- - - - - - - - - + + + +
+ +
+Form->end(); ?> - - - - + + + - - - diff --git a/app/templates/TermsAndConditions/tandcs.inc b/app/templates/TermsAndConditions/tandcs.inc new file mode 100644 index 000000000..00cf2f585 --- /dev/null +++ b/app/templates/TermsAndConditions/tandcs.inc @@ -0,0 +1,247 @@ +element('flash', []); + + // Make the Form fields editable + $this->Field->enableFormEditMode(); +?> + +

+ +Form->create(null, [ + 'id' => 'agreement-form', + 'type' => 'post' + ]); + + +?> +
+
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 + ] + ); + } + ?> +
- Html->link( - // There might be a more elegant way to render this than appending - // it to the URL label... - __d('information', 'TermsAndConditions.desc.old', [$t['oldtandc']->description]), - [ - 'controller' => 'terms_and_conditions', - // We can only view archive records, not edit - 'action' => 'view', - $t['oldtandc']->id - ] - ); - } else { - print $this->Html->link( - $t['tandc']->description, - [ - 'controller' => 'terms_and_conditions', - 'action' => 'edit', - $t['tandc']->id - ] - ); - } +
+
+ +
+
+ +
+
+
+ +
+
+ identifier ?? "" ?> +
+
+
+ getName()]); ?> +
+
+ created) + ? $this->Time->nice($t['agreement']->created, $vv_tz) + : ""; ?> -
+
identifier ?? "" ?>created) - ? $this->Time->nice($t['agreement']->created, $vv_tz) - : ""; - ?>
+ + + + + + + + + + + + + + $tc): ?> + + + + + + + + + + + + +
getName()]); ?>
+
+ +
+
+
+
+ +
+
+
+
+ identifier ?? "" ?> +
+
+
getName()]); ?>
+
+ 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, + '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' + ] + ) + ?> +
+
+
+
+ + diff --git a/app/templates/element/form/nameDiv.php b/app/templates/element/form/nameDiv.php index 375436646..fd005759d 100644 --- a/app/templates/element/form/nameDiv.php +++ b/app/templates/element/form/nameDiv.php @@ -90,9 +90,9 @@ ): ?> Form->label($fn, $label) ?> - - + el.clientWidth); + } + + checkOverflow(); + // Attach a resize observer to the div. + new ResizeObserver(checkOverflow).observe(el); + }); + // Define default text for confirm dialog var defaultConfirmOk = ""; var defaultConfirmCancel = ""; diff --git a/app/templates/element/menuAction.php b/app/templates/element/menuAction.php index 1120dcca7..14a5cf091 100644 --- a/app/templates/element/menuAction.php +++ b/app/templates/element/menuAction.php @@ -134,7 +134,7 @@ class=""> - +