Bug 20663: Remove dead code related to compound reports
authorMark Tompsett <mtompset@hotmail.com>
Thu, 26 Apr 2018 04:17:51 +0000 (04:17 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 4 May 2018 12:19:26 +0000 (09:19 -0300)
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 <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

C4/Reports/Guided.pm
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
reports/guided_reports.pl

index d61b282..e03dc1f 100644 (file)
@@ -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)
 
index 5a443aa..86c17e8 100644 (file)
@@ -794,31 +794,6 @@ $(document).ready(function() {
 </form>
 [% END %]
 
-[% IF ( compound ) %]
-<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
-Master: <select name="master">
-[% FOREACH savedreport IN savedreports %]
-<option value="[% savedreport.id %]">[% savedreport.report_name %]</option>
-[% END %]
-</select>
-&nbsp;
-Sub report:<select name="subreport">
-[% FOREACH savedreport IN savedreports %]
-<option value="[% savedreport.id %]">[% savedreport.report_name %]</option>
-[% END %]
-</select>
-<br />
-<input type="hidden" name="phase" value="Save Compound" />
-<input type="submit" name="submit" value="Save compound" />
-</form>
-[% END %]
-
-[% IF ( save_compound ) %]
-[% master %] <br />
-[% subsql %]
-[% END %]
-
-
 [% IF saved_results %]
 <h1>Saved report results</h1>
 <h2>[% name %]</h2>
index b5aa1d3..2273f1c 100755 (executable)
@@ -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 ();