From c48f58d49b76c2e69d61de8aea6f835e6410f951 Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 17 Sep 2018 17:21:31 +0100 Subject: [PATCH] Added block plugin for report form, to show on reporting page. --- .../opencase_reporting.links.action.yml | 2 +- .../src/Plugin/Block/ReportForm.php | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 modules/opencase_reporting/src/Plugin/Block/ReportForm.php diff --git a/modules/opencase_reporting/opencase_reporting.links.action.yml b/modules/opencase_reporting/opencase_reporting.links.action.yml index b1f264e..c4c66cd 100644 --- a/modules/opencase_reporting/opencase_reporting.links.action.yml +++ b/modules/opencase_reporting/opencase_reporting.links.action.yml @@ -1,5 +1,5 @@ entity.opencase_report.add_form: - route_name: entity.opencase_report.add_form + route_name: view.reporting_actors.page_1 title: 'New Report' appears_on: - entity.opencase_report.collection diff --git a/modules/opencase_reporting/src/Plugin/Block/ReportForm.php b/modules/opencase_reporting/src/Plugin/Block/ReportForm.php new file mode 100644 index 0000000..677e095 --- /dev/null +++ b/modules/opencase_reporting/src/Plugin/Block/ReportForm.php @@ -0,0 +1,26 @@ +getStorage('opencase_report')->create(); + $form = \Drupal::service('entity.form_builder')->getForm($report, 'add'); + return $form; + } + +}