Bugzilla – Attachment 162668 Details for
Bug 36195
CSRF - testing reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36195: serials/routing-preview.pl - Fix save and preview
Bug-36195-serialsrouting-previewpl---Fix-save-and-.patch (text/plain), 4.61 KB, created by
Jonathan Druart
on 2024-03-01 14:11:57 UTC
(
hide
)
Description:
Bug 36195: serials/routing-preview.pl - Fix save and preview
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-03-01 14:11:57 UTC
Size:
4.61 KB
patch
obsolete
>From c8b4c4eabf919085e9038dc48fb9744bb43000b2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 @@ > </div> <!-- /.row --> > > [% MACRO jsinclude BLOCK %] >- <script> >- $(document).ready(function(){ >- $("#save_and_preview").on("click",function(e){ >- e.preventDefault(); >- print_slip( $("#subscriptionid").val(), $("#issue_escaped").val() ); >- }); >- }); >- function print_slip(subscriptionid,issue){ >- var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue; >- window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes'); >- window.location.href='subscription-detail.pl?subscriptionid=' + subscriptionid; >- } >- </script> > [% 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36195
:
162668
|
162960
|
163049
|
163050