From d2c0902f65fe48d5b19573615fe3d739a8085234 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 26 May 2021 12:02:08 +0000 Subject: [PATCH] Bug 28454: Add Koha version number to database schema link in reports This patch modifies the guided reports script, adding a verion check so that a version string can be added to the database schema link if the user is using a non-development version. To test, apply the patch and go to reports -> Saved reports. - In the left-hand sidebar menu you should see a "Koha database schema" link. Depending on which version you're using, it may or may not have a version string included, e.g. "http://schema.koha-community.org/20_05" - In master, there is no version string added because there is no schema available for development versions. - If you apply the patch on a previously released version, e.g. 'tags/v20.11.08' you will see a link directly to that schema page. Signed-off-by: Lucas Gass --- .../intranet-tmpl/prog/en/includes/guided-reports-view.inc | 2 +- reports/guided_reports.pl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc index 752ecf22c3..14f0aa40eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc @@ -12,7 +12,7 @@
Useful resources
diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 4c926b3c0a..09889ac660 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -92,6 +92,12 @@ elsif ($session and not $input->param('clear_filters')) { my $op = $input->param('op') || q||; my @errors = (); + +my $version_string = Koha::version(); +my ( $major, $minor, $maintenance, $development ) = split( '\.', $version_string ); +my $schema_version = ( $development ne '000' ) ? "" : $major . "_" . $minor; +$template->param( 'schema_version' => $schema_version ); + if ( !$phase ) { $template->param( 'start' => 1 ); # show welcome page -- 2.20.1