Bugzilla – Attachment 187409 Details for
Bug 40948
Transport cost matrix needs form validation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40948: Add form validation to transport cost matrix
Bug-40948-Add-form-validation-to-transport-cost-ma.patch (text/plain), 2.26 KB, created by
Brendan Lawlor
on 2025-10-03 15:28:44 UTC
(
hide
)
Description:
Bug 40948: Add form validation to transport cost matrix
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2025-10-03 15:28:44 UTC
Size:
2.26 KB
patch
obsolete
>From 42409a344fa0810c73ad09dacb52d4a9af5d44d6 Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Fri, 3 Oct 2025 15:27:14 +0000 >Subject: [PATCH] Bug 40948: Add form validation to transport cost matrix > >--- > .../prog/en/modules/admin/transport-cost-matrix.tt | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt >index 0b1c848393..5255e6cef3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt >@@ -106,13 +106,6 @@ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] > <script> >- function check_transport_cost(e) { >- var val = e.value; >- if (val && val != "" && !isNaN(parseFloat(val)) && val >= 0.0) { >- return; >- } >- alert(_("Cost must be expressed as a decimal number >= 0")); >- } > function disable_transport_cost_chg(e) { > var input_name = e.name; > var cost_id = input_name.replace(/disable_/, ""); // Parse the code_id out of the input name >@@ -138,11 +131,11 @@ > $(cell).removeClass("disabled-transfer"); > > $("#celldiv_" + cost_id).html( >- '<input type="text" name="cost_' + >+ '<input type="text" inputmode="numeric" pattern="^((0|[1-9]\\d*)(\\.\\d{1,2})?|\\.\\d{1,2})$" name="cost_' + > cost_id + > '" class="cost_input" size="4" value="' + > $.trim(cost) + >- '" />' + >+ '" required/>' + > "<br/>" + > _("Disable ") + > '<input name="disable_' + >@@ -163,9 +156,6 @@ > var cost_id = $(this).data("cost-id"); > enable_cost_input(cost_id); > }); >- $("body").on("blur", ".cost_input", function () { >- check_transport_cost(this); >- }); > $("body").on("change", ".disable_transport_cost", function () { > disable_transport_cost_chg(this); > }); >-- >2.39.5
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 40948
: 187409