Browse Source

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 <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
16.11.x
Jonathan Druart 8 years ago
committed by Kyle M Hall
parent
commit
71ea7e2ba5
  1. 12
      circ/add_message.pl
  2. 1
      circ/circulation.pl
  3. 1
      koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
  4. 6
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt

12
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 .= "&amp;batch=1" if $batch;
}
} else {
$url = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber";
}
print $input->redirect($url);

1
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"),

1
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc

@ -248,6 +248,7 @@ function searchToHold(){
</li>
</ol>
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
<input type="hidden" name="batch" value="[% batch %]" />
<input type="hidden" name="branchcode" value="[% LoginBranchcode %]" />
</fieldset>
</div>

6
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt

@ -79,7 +79,7 @@ $(document).ready(function() {
[% END %]
</div>
[% ELSIF borrower and not checkout_infos %]
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&batch=1">
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
<fieldset id="circ_circulation_issue">
<label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
<fieldset class="rows">
@ -110,9 +110,9 @@ $(document).ready(function() {
[% ELSIF borrower %]
[% IF confirmation_needed && CAN_user_circulate_force_checkout %]
<h3>Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
<form method="post" action="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]" id="mainform" name="mainform" autocomplete="off">
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
[% ELSE %]
<h3>Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
<h3>Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] |[% batch %]|[% END %]</h3>
[% END %]
<table id="checkout_infos">
<thead>

Loading…
Cancel
Save