From 7d89db96b59dbad877b2d4b960e10bd7ccc479ea Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 26 Apr 2018 04:17:51 +0000 Subject: [PATCH] Bug 20663: Remove dead code related to compound reports TEST PLAN --------- git grep "Create Compound Report" -- only one file git grep compound | grep 1 -- this is the only setting of the compound tt variable less koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt -- There is an TT IF statement for compound. -- In that statement it would trigger 'Save Compound' git grep save_compound -- only the template and the guided report perl git grep create_compound -- only triggered by the save code in the guided report perl -- in the export for the C4/Reports/Guided.pm git grep run_compound -- left over in export apply the patch look around and see the pieces are cleaned up. run koha qa test tools Signed-off-by: Katrin Fischer --- C4/Reports/Guided.pm | 31 +--------------------- .../en/modules/reports/guided_reports_start.tt | 25 ----------------- reports/guided_reports.pl | 16 ----------- 3 files changed, 1 insertion(+), 71 deletions(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index d61b282cc2..e03dc1fe34 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -39,7 +39,7 @@ BEGIN { @ISA = qw(Exporter); @EXPORT = qw( get_report_types get_report_areas get_report_groups get_columns build_query get_criteria - save_report get_saved_reports execute_query get_saved_report create_compound run_compound + save_report get_saved_reports execute_query get_saved_report get_column_type get_distinct_values save_dictionary get_from_dictionary delete_definition delete_report format_results get_sql nb_rows update_sql @@ -718,35 +718,6 @@ sub get_saved_report { return $dbh->selectrow_hashref($query, undef, $report_arg); } -=head2 create_compound($masterID,$subreportID) - -This will take 2 reports and create a compound report using both of them - -=cut - -sub create_compound { - my ( $masterID, $subreportID ) = @_; - my $dbh = C4::Context->dbh(); - - # get the reports - my $master = get_saved_report($masterID); - my $mastersql = $master->{savedsql}; - my $mastertype = $master->{type}; - my $sub = get_saved_report($subreportID); - my $subsql = $master->{savedsql}; - my $subtype = $master->{type}; - - # now we have to do some checking to see how these two will fit together - # or if they will - my ( $mastertables, $subtables ); - if ( $mastersql =~ / from (.*) where /i ) { - $mastertables = $1; - } - if ( $subsql =~ / from (.*) where /i ) { - $subtables = $1; - } - return ( $mastertables, $subtables ); -} =head2 get_column_type($column) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 5a443aac18..86c17e8893 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -794,31 +794,6 @@ $(document).ready(function() { [% END %] -[% IF ( compound ) %] -
-Master: -  -Sub report: -
- - -
-[% END %] - -[% IF ( save_compound ) %] -[% master %]
-[% subsql %] -[% END %] - - [% IF saved_results %]

Saved report results

[% name %]

diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index b5aa1d3d77..2273f1cc62 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -974,22 +974,6 @@ elsif ( $phase eq 'Create report from SQL' ) { ); } -elsif ($phase eq 'Create Compound Report'){ - $template->param( 'savedreports' => get_saved_reports(), - 'compound' => 1, - ); -} - -elsif ($phase eq 'Save Compound'){ - my $master = $input->param('master'); - my $subreport = $input->param('subreport'); - my ($mastertables,$subtables) = create_compound($master,$subreport); - $template->param( 'save_compound' => 1, - master=>$mastertables, - subsql=>$subtables - ); -} - # pass $sth, get back an array of names for the column headers sub header_cell_values { my $sth = shift or return (); -- 2.14.1