Browse Source

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 <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>
18.05.x
Mark Tompsett 3 years ago
committed by Jonathan Druart
parent
commit
32a2528d53
  1. 31
      C4/Reports/Guided.pm
  2. 25
      koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
  3. 16
      reports/guided_reports.pl

31
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)

25
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt

@ -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>

16
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 ();

Loading…
Cancel
Save