From c8b4c4eabf919085e9038dc48fb9744bb43000b2 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. --- .../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 daabf1eef1a..783cd17d679 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 82246054410..27aab7ad8da 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 c44c4964881..fe23d3be8a1 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 cafc9940886..d033ab30d84 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.34.1