From 71ea7e2ba5b8a44f1a8fb292b66f9ed3a6a0eb45 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sun, 12 Jun 2016 11:08:44 +0100 Subject: [PATCH] Bug 3669: Remove parameters passed to action of form Sounds weird to pass parameters to the action of a POST form. This patch adds a workaround. Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- circ/add_message.pl | 12 +++++++++++- circ/circulation.pl | 1 + .../prog/en/includes/members-toolbar.inc | 1 + .../en/modules/circ/circulation_batch_checkouts.tt | 6 +++--- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/circ/add_message.pl b/circ/add_message.pl index aee65a1b91..4233e9077e 100755 --- a/circ/add_message.pl +++ b/circ/add_message.pl @@ -41,6 +41,7 @@ my $borrowernumber = $input->param('borrowernumber'); my $branchcode = $input->param('branchcode'); my $message_type = $input->param('message_type'); my $borrower_message = $input->param('borrower_message'); +my $batch = $input->param('batch'); Koha::Patron::Message->new( { @@ -51,5 +52,14 @@ Koha::Patron::Message->new( } )->store; -my $url = $input->referer() // "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"; +my $url = $input->referer; +if ( $url ) { + if ( $url =~ m|circulation\.pl$| ) { + # Trick for POST form from batch checkouts + $url .= "?borrowernumber=$borrowernumber"; + $url .= "&batch=1" if $batch; + } +} else { + $url = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"; +} print $input->redirect($url); diff --git a/circ/circulation.pl b/circ/circulation.pl index ef743bedc5..24c8110cb3 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -644,6 +644,7 @@ $template->param( is_child => ($borrowernumber && $borrower->{'category_type'} eq 'C'), $view => 1, batch_allowed => $batch_allowed, + batch => $batch, AudioAlerts => C4::Context->preference("AudioAlerts"), fast_cataloging => $fast_cataloging, CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 75cb6bc893..7f7fe5c4ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -248,6 +248,7 @@ function searchToHold(){ + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt index e36dfc0de7..7ef4436ed9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt @@ -79,7 +79,7 @@ $(document).ready(function() { [% END %] [% ELSIF borrower and not checkout_infos %] -
+
@@ -110,9 +110,9 @@ $(document).ready(function() { [% ELSIF borrower %] [% IF confirmation_needed && CAN_user_circulate_force_checkout %]

Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]

- + [% ELSE %] -

Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]

+

Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] |[% batch %]|[% END %]

[% END %] -- 2.39.5