If a report is duplicated from the report list, the new report will
contain the tag (<<YEAR>> for instance), but from the reports results
page it copies the values used for the results.
Test plan:
Create a new sql report with tags
Duplicate it from the report list: no expected changes
Run it and duplicate it: the tags must not have been replaced
Signed-off-by: Andreas Roussos <arouss1980@gmail.com>
Ran and duplicated a report, the tags remained intact.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
</div>
[% END %]
<div class="btn-group">
- <a class="btn btn-small" title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% sql |uri %]&reportname=[% reportname |uri %]&notes=[% notes |uri %]">
+ <a class="btn btn-small" title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% original_sql || sql |uri %]&reportname=[% reportname |uri %]&notes=[% notes |uri %]">
<i class="fa fa-copy"></i> Duplicate
</a>
</div>
'report_id' => $report_id,
);
- my ( $sql, $type, $name, $notes );
+ my ( $sql, $original_sql, $type, $name, $notes );
if (my $report = get_saved_report($report_id)) {
- $sql = $report->{savedsql};
+ $sql = $original_sql = $report->{savedsql};
$name = $report->{report_name};
$notes = $report->{notes};
$template->param(
'results' => \@rows,
'sql' => $sql,
+ original_sql => $original_sql,
'id' => $report_id,
'execute' => 1,
'name' => $name,