From e573d8405c569f90227329402c9eac437057f2c1 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. --- circ/add_message.pl | 12 +++++++++++- circ/circulation.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc | 1 + .../prog/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 aee65a1..4233e90 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 d11f188..62ab242 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 7144a4f..07f338e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -245,6 +245,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 e36dfc0..7ef4436 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.8.1