View | Details | Raw Unified | Return to bug 26165
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc (-1 / +1 lines)
Lines 23-29 Link Here
23
                </div>
23
                </div>
24
            [% END %]
24
            [% END %]
25
            <div class="btn-group">
25
            <div class="btn-group">
26
                <a class="btn btn-default" title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&amp;sql=[% original_sql || sql |uri %]&amp;reportname=[% reportname |uri %]&amp;notes=[% notes |uri %]">
26
                <a class="btn btn-default" title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from existing&amp;report_id=[% id | uri %]">
27
                    <i class="fa fa-copy"></i> Duplicate
27
                    <i class="fa fa-copy"></i> Duplicate
28
                </a>
28
                </a>
29
            </div>
29
            </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-1 / +1 lines)
Lines 332-338 Link Here
332
                                                                <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&amp;phase=Show%20SQL"><i class="fa fa-search"></i> Show</a></li>
332
                                                                <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&amp;phase=Show%20SQL"><i class="fa fa-search"></i> Show</a></li>
333
                                                                [% IF ( CAN_user_reports_create_reports ) %]
333
                                                                [% IF ( CAN_user_reports_create_reports ) %]
334
                                                                    <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&amp;phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li>
334
                                                                    <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id | uri %]&amp;phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li>
335
                                                                    <li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&amp;sql=[% savedreport.savedsql |uri %]&amp;reportname=[% savedreport.report_name |uri %]&amp;notes=[% savedreport.notes |uri %]"><i class="fa fa-copy"></i> Duplicate</a></li>
335
                                                                    <li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from existing&amp;report_id=[% savedreport.id | uri %]"><i class="fa fa-copy"></i> Duplicate</a></li>
336
                                                                [% END %]
336
                                                                [% END %]
337
                                                                [% IF (Koha.Preference('Mana') == 1) %]
337
                                                                [% IF (Koha.Preference('Mana') == 1) %]
338
                                                                    <li><a class="ShareButton" data-toggle="modal" href="#mana_share_report" title="Share your report with Mana Knowledge Base"><i class="fa fa-share-alt"></i> Share</a></li>
338
                                                                    <li><a class="ShareButton" data-toggle="modal" href="#mana_share_report" title="Share your report with Mana Knowledge Base"><i class="fa fa-share-alt"></i> Share</a></li>
(-)a/reports/guided_reports.pl (-12 / +22 lines)
Lines 55-61 my $usecache = Koha::Caches->get_instance->memcached_cache; Link Here
55
55
56
my $phase = $input->param('phase') // '';
56
my $phase = $input->param('phase') // '';
57
my $flagsrequired;
57
my $flagsrequired;
58
if ( ( $phase eq 'Build new' ) || ( $phase eq 'Create report from SQL' ) || ( $phase eq 'Edit SQL' ) ){
58
if ( ( $phase eq 'Build new' ) || ( $phase eq 'Create report from SQL' ) || ( $phase eq 'Edit SQL' )
59
   || ( $phase eq 'Build new from existing' ) ) {
59
    $flagsrequired = 'create_reports';
60
    $flagsrequired = 'create_reports';
60
}
61
}
61
elsif ( $phase eq 'Use saved' ) {
62
elsif ( $phase eq 'Use saved' ) {
Lines 973-997 elsif ($phase eq 'Export'){ Link Here
973
    );
974
    );
974
}
975
}
975
976
976
elsif ( $phase eq 'Create report from SQL' ) {
977
elsif ( $phase eq 'Create report from SQL' || $phase eq 'Create report from existing' ) {
977
978
978
    my ($group, $subgroup);
979
    my ($group, $subgroup, $sql, $reportname, $notes);
979
    # allow the user to paste in sql
980
    if ( $input->param('sql') ) {
980
    if ( $input->param('sql') ) {
981
        $group = $input->param('report_group');
981
        $group      = $input->param('report_group');
982
        $subgroup  = $input->param('report_subgroup');
982
        $subgroup   = $input->param('report_subgroup');
983
        $template->param(
983
        $sql        = $input->param('sql') // '';
984
            'sql'           => scalar $input->param('sql') // '',
984
        $reportname = $input->param('reportname') // '';
985
            'reportname'    => scalar $input->param('reportname') // '',
985
        $notes      = $input->param('notes') // '';
986
            'notes'         => scalar $input->param('notes') // '',
986
    }
987
        );
987
    elsif ( my $report_id = $input->param('report_id') ) {
988
        my $report = Koha::Reports->find($report_id);
989
        $group      = $report->report_group;
990
        $subgroup   = $report->report_subgroup;
991
        $sql        = $report->savedsql // '';
992
        $reportname = $report->report_name // '';
993
        $notes      = $report->notes // '';
988
    }
994
    }
995
989
    $template->param(
996
    $template->param(
997
        sql        => $sql,
998
        reportname => $reportname,
999
        notes      => $notes,
990
        'create' => 1,
1000
        'create' => 1,
991
        'groups_with_subgroups' => groups_with_subgroups($group, $subgroup),
1001
        'groups_with_subgroups' => groups_with_subgroups($group, $subgroup),
992
        'public' => '0',
1002
        'public' => '0',
993
        'cache_expiry' => 300,
1003
        'cache_expiry' => 300,
994
        'usecache' => $usecache,
1004
        'usecache' => $usecache,
1005
995
    );
1006
    );
996
}
1007
}
997
1008
998
- 

Return to bug 26165