From a6664bcf8be97d6839f749d32ff87731c4c4e3f6 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Fri, 27 Sep 2024 10:44:44 +0300 Subject: [PATCH] Fix dispatch View to use the new FieldHelper.php --- app/templates/Standard/dispatch.php | 25 ++++++-------------- app/templates/element/form/unorderedList.php | 4 +++- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/app/templates/Standard/dispatch.php b/app/templates/Standard/dispatch.php index 924fb12a7..5df393ceb 100644 --- a/app/templates/Standard/dispatch.php +++ b/app/templates/Standard/dispatch.php @@ -33,7 +33,7 @@ $tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name)); // $vv_template_path will be set for plugins -$templatePath = $vv_template_path ?? ROOT . DS . "templates" . DS . $modelsName; +$templatePath = $vv_template_path ?? ROOT . DS . 'templates' . DS . $modelsName; $action_args['vv_actions'][] = [ 'order' => $this->Menu->getMenuOrder('Default'), @@ -75,34 +75,23 @@ set('vv_fields_inc', 'dispatch.inc'); +$this->set('vv_submit_button_label', __d('operation', 'continue')); // By default, the form will POST to the current controller // Note we need to open the form for view so Cake will autopopulate values print $this->Form->create(); - -print $this->Field->startControlSet( - modelName: $this->name, - action: $vv_action, - editable: true, - reqFields: [], - pluginName: $this->getPlugin() -); +// Form body +print $this->element('form/unorderedList'); // Inject the Petition ID into the form, though it will most likely // still be available in the URL. print $this->Form->hidden('petition_id', ['value' => $vv_petition->id]); - // Inject the token, if indicated. if(isset($vv_token_ok) && $vv_token_ok && !empty($vv_petition->token)) { print $this->Form->hidden('token', ['value' => $vv_petition->token]); } -if(file_exists($templatePath . DS . "dispatch.inc")) { - include($templatePath . DS . "dispatch.inc"); -} - -print $this->Field->submit(__d('operation', 'continue')); - print $this->Form->end(); - -print $this->Field->endControlSet(); diff --git a/app/templates/element/form/unorderedList.php b/app/templates/element/form/unorderedList.php index 9012de827..a5ee224a3 100644 --- a/app/templates/element/form/unorderedList.php +++ b/app/templates/element/form/unorderedList.php @@ -35,6 +35,7 @@ // $vv_fields_inc // $vv_template_path // $vv_field_types +// $vv_submit_button_label ?>