From 68a615f6ee17bd28a565e1aa08083564f2a76888 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 1 Mar 2024 15:07:38 +0100 Subject: [PATCH] Bug 36195: serials/routing-preview.pl - Fix save and preview No idea why we are passing issue_escaped instead of the id, but this patch fixes the regression. Signed-off-by: Katrin Fischer --- .../en/modules/serials/routing-preview.tt | 13 -------- .../en/modules/serials/subscription-detail.tt | 6 ++++ serials/routing-preview.pl | 32 +++++++++++-------- serials/subscription-detail.pl | 1 + 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt index daabf1eef1..783cd17d67 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview.tt @@ -82,19 +82,6 @@ [% MACRO jsinclude BLOCK %] - [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index 8224605441..27aab7ad8d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -488,6 +488,12 @@ table.fnFilter( '', 4 ); // Not filter, display all columns }); $("#show_all_orders").click(); + + [% IF print_routing_list_issue %] + var myurl = '/cgi-bin/koha/serials/routing-preview.pl?op=print&subscriptionid=[% subscriptionid | uri %]&issue=[% print_routing_list_issue | uri %]'; + window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes'); + [% END %] + }); function mana_comment_close(){ diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index c44c496488..fe23d3be8a 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -104,20 +104,26 @@ if($op eq 'cud-save_and_preview'){ } } } - - ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "serials/routing-preview-slip.tt", - query => $query, - type => "intranet", - flagsrequired => {serials => '*'}, - }); + print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid&print_routing_list_issue=" . $query->param('issue_escaped')); + exit; +} elsif ( $op eq 'print' ) { + ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "serials/routing-preview-slip.tt", + query => $query, + type => "intranet", + flagsrequired => { serials => '*' }, + } + ); } else { - ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "serials/routing-preview.tt", - query => $query, - type => "intranet", - flagsrequired => {serials => '*'}, - }); + ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "serials/routing-preview.tt", + query => $query, + type => "intranet", + flagsrequired => { serials => '*' }, + } + ); } $template->param( libraryname => $library->branchname ) if $library; diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index cafc994088..d033ab30d8 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -166,6 +166,7 @@ $template->param( orders_grouped => $orders_grouped, (uc(C4::Context->preference("marcflavour"))) => 1, mana_comments => $subs->{comments}, + print_routing_list_issue => scalar $query->param('print_routing_list_issue'), ); output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5