Bugzilla – Attachment 153568 Details for
Bug 34169
Add validation for monetary input fields in acquisition module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34169: Use jQuery validator plugin to validate amounts
Bug-34169-Use-jQuery-validator-plugin-to-validate-.patch (text/plain), 2.17 KB, created by
Katrin Fischer
on 2023-07-17 16:23:59 UTC
(
hide
)
Description:
Bug 34169: Use jQuery validator plugin to validate amounts
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-17 16:23:59 UTC
Size:
2.17 KB
patch
obsolete
>From 6304a82a9a969812f45918d6fd8582b1c72ea6d4 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 14 Jul 2023 15:42:46 +0000 >Subject: [PATCH] Bug 34169: Use jQuery validator plugin to validate amounts > >This is a first step towards more consistency and possibly supporting >multiple input formats as well in the future. It allows us to mark all >input fields for monetary values, such as prices, replacement prices, >fees etc. with a class that is linked to a check for the 'number' format >in the jQuery Validator plugin. > >This is the base patch that does nothing by itself, please see >test plan in second patch. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc | 1 + > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 3 +++ > 2 files changed, 4 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc >index 0600f0a672..87dde3e610 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc >@@ -11,6 +11,7 @@ > number: _("Please enter a valid number."), > digits: _("Please enter only digits."), > equalTo: _("Please enter the same value again."), >+ number: _("Please add amount in valid format: 0.00"), > maxlength: $.validator.format(_("Please enter no more than {0} characters.")), > minlength: $.validator.format(_("Please enter at least {0} characters.")), > rangelength: $.validator.format(_("Please enter a value between {0} and {1} characters long.")), >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index 74af1ad89a..ca909eb861 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -110,6 +110,9 @@ $(document).ready(function() { > $(".validated").each(function() { > $(this).validate(); > }); >+ jQuery.validator.addClassRules("decimal", { >+ number: true >+ }); > > $("#logout").on("click",function(){ > logOut(); >-- >2.30.2
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 34169
:
153568
|
153569
|
153577
|
153578
|
153580
|
153581
|
153582
|
153583
|
153801
|
153802
|
153803