Bugzilla – Attachment 174274 Details for
Bug 38411
When adding multiple items on receive, mandatory fields are not checked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38411: Check mandatory item fields when creating several items ordering or receiving.
Bug-38411-Check-mandatory-item-fields-when-creatin.patch (text/plain), 2.15 KB, created by
Adolfo RodrÃguez Taboada
on 2024-11-08 15:24:15 UTC
(
hide
)
Description:
Bug 38411: Check mandatory item fields when creating several items ordering or receiving.
Filename:
MIME Type:
Creator:
Adolfo RodrÃguez Taboada
Created:
2024-11-08 15:24:15 UTC
Size:
2.15 KB
patch
obsolete
>From 15e9036fef623f0408c870fa6afde8597642e7c0 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= <adolfo.rodriguez@xercode.es> >Date: Fri, 8 Nov 2024 16:22:46 +0100 >Subject: [PATCH] Bug 38411: Check mandatory item fields when creating several > items ordering or receiving. > >This patch adds a check of mandatory item fields when adding several items > >Test plan: >1 We need mandatory subfields for items in the ACQ framework and an open basket configured to create items on order or a closed basket configured to create items on receiving an order >2 In both cases, in the form to create items check that there are mandatory fields. >3 Click the Add multiple items button, write a number and then add. >4 Check that the items have been added. >5 Apply patch, restart services >6 Repeat step 3 Now it doesn't add the items and shows an alert regarding the empty mandatory fields >--- > koha-tmpl/intranet-tmpl/prog/js/additem.js | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/additem.js b/koha-tmpl/intranet-tmpl/prog/js/additem.js >index 4f8c0aa7e5..57960e0f27 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/additem.js >@@ -45,7 +45,21 @@ function addItem( node, unique_item_fields ) { > } > > function addMulti( count, node, unique_item_fields){ >- var index = $(node).closest("div").attr('id'); >+ var item_form = $(node).closest("div"); >+ var index = item_form.attr("id"); >+ >+ //We need to verify the item form before saving >+ var empty_item_mandatory = CheckMandatorySubfields(item_form); >+ if (empty_item_mandatory > 0) { >+ var _alertString= _("Form not submitted because of the following problem(s)")+"\n"; >+ >+ _alertString +="-------------------------------------------------------------------\n\n"; >+ _alertString += >+ "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory); >+ alert(_alertString); >+ return false; >+ } >+ > var countItemsBefore = $("#items_list tbody tr").length; > var current_qty = parseInt( $('#quantity').val(), 10 ); > $("#procModal").modal('show'); >-- >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 38411
: 174274