Bugzilla – Attachment 52642 Details for
Bug 3669
Create a template for circ/add_message.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3669: Remove parameters passed to action of form
Bug-3669-Remove-parameters-passed-to-action-of-for.patch (text/plain), 4.64 KB, created by
Jonathan Druart
on 2016-06-21 11:40:20 UTC
(
hide
)
Description:
Bug 3669: Remove parameters passed to action of form
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-06-21 11:40:20 UTC
Size:
4.64 KB
patch
obsolete
>From ab279924efe87eec7cb26c90a3d2f977727ec2f4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 <jonathan.druart@bugs.koha-community.org> >--- > 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 b4d454d..2fda806 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 75cb6bc..7f7fe5c 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(){ > </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> >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 %] > </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> >-- >2.8.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 3669
:
49497
|
49610
|
49714
|
49716
|
49833
|
50044
|
50047
|
50100
|
50976
|
51353
|
51374
|
52277
|
52641
| 52642 |
52796