Bugzilla – Attachment 118426 Details for
Bug 27967
Modals on the borrower account page don't validate minimum values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27967: Add min attribute to borraccount modals
Bug-27967-Add-min-attribute-to-borraccount-modals.patch (text/plain), 2.24 KB, created by
Owen Leonard
on 2021-03-17 17:27:26 UTC
(
hide
)
Description:
Bug 27967: Add min attribute to borraccount modals
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-03-17 17:27:26 UTC
Size:
2.24 KB
patch
obsolete
>From 3137c7fe9fe3d7f4a9164fe7f60606cb11863d5b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 16 Mar 2021 16:39:13 +0000 >Subject: [PATCH] Bug 27967: Add min attribute to borraccount modals > >This patch adds a min attribute to the form fields of the borrower >account page modals to prevent negative values being entered >inappropriately. > >Test plan >1/ Trigger the refund modal from the borrower account page. >2/ Attempt to enter a negative value for the amount to refund and note >with the patch applied you face a validation error (without the patch, >upon submission of a negative value you will be faced with a server side >error) >3/ Trigger the discount modal from the borrower account page. >4/ Attempt to enter a negative value for the amount to discount and note >with the patch applied you face a validation error (without the patch, >upon submission of a negative value you will be faced with a server side >error) >5/ Signoff > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index a742d0ddbb..971ff4f41c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -387,7 +387,7 @@ > var amountoutstanding = button.data('amountoutstanding'); > var paid = amount - amountoutstanding; > $("#paid + span").replaceWith(paid); >- $("#returned").attr({ "value": paid, "max": paid }); >+ $("#returned").attr({ "value": paid, "max": paid, "min": 0 }); > $("#returned, #refund_transaction_type").focus(); > }); > >@@ -399,7 +399,7 @@ > $('#discountline').val(accountline); > var amount = button.data('amount'); > $("#charged + span").replaceWith(amount); >- $("#discount").attr({ "max": amount }); >+ $("#discount").attr({ "max": amount, "min": 0 }); > $("#discount").focus(); > }); > }); >-- >2.11.0
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 27967
:
118339
|
118426
|
118428