From 8e668646a4999e3d88f943e51f433dbcffb7b115 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Fri, 21 Apr 2017 16:39:18 +0000 Subject: [PATCH] Bug 17047: minor corrections on report share --- .../prog/en/modules/reports/guided_reports_start.tt | 5 +++++ svc/mana/use | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) 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 aa67657..d990b20 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 @@ -285,6 +285,11 @@ function mana_use( mana_id ){ data: {id:mana_id, resource: 'report', saveinbase: 1}, dataType: "json", }) + .done( function (result){ + window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); + }) + .fail( function ( foo, msg, longmsg){ + }); } function mana_search( textquery ){ diff --git a/svc/mana/use b/svc/mana/use index 2ba15d0..efb5bf3 100755 --- a/svc/mana/use +++ b/svc/mana/use @@ -42,12 +42,12 @@ if ( $auth_status ne "ok" ) { my $result = Koha::SharedContent::manaGetRequestWithId($input->param('resource'), $input->param('id') ); my $package = "Koha::".ucfirst($input->param('resource')); +my $resource; if ( $input->param( 'saveinbase' )) { - $package->new_from_mana($result->{data}); + $resource = { id => $package->new_from_mana($result->{data})->id }; } - -my $subscription; -$subscription = $result->{data}; - -print(to_json($subscription)); +else{ + $resource = $result->{data}; +} +print(to_json($resource)); -- 2.7.4