Bug 30268: Check mandatory fields in addorderiso2709.pl

Test plan:
1. Make sure you have mandatory item subfields in the MARC bibliographic
   framework used in acquisitions ("ACQ" if it exists, the default framework
   otherwise).
2. Use the "Stage MARC records for import" tool to upload a file. Do not import
   the bibliographic records.
3. Create a new acquisition basket ("Create items when:" must be set to
   "placing an order") and add a new order from a staged file
4. Select the file you just uploaded
5. In the "Items information" tab, make sure at least one mandatory subfield is
   empty
6. Try to submit the form. If there are errors about other mandatory fields
   (like the fund for instance), fix those errors and resubmit. There should be
   an error message about mandatory item subfields.
7. Enter a value for the mandatory item subfields and resubmit the form. Verify
   that the order and the item have been correctly created.

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e37359cae9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Julian Maurice 2022-03-09 16:42:50 +01:00 committed by Lucas Gass
parent 1256907319
commit 7faeaf4aef
2 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Batch list
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/acq.js") | $raw %]
[% Asset.js("js/funds_sorts.js") | $raw %]
[% Asset.js("js/cataloging.js") | $raw %]
[% Asset.js("js/addorderiso2709.js") | $raw %]
</head>

View File

@ -71,6 +71,14 @@ $(document).ready(function() {
return false;
}
if (0 < CheckMandatorySubfields(this.form)) {
// Open the item tab
$('#tabs').tabs('option', 'active', 1);
alert(__('Some required item subfields are not set'));
return false;
}
disableUnchecked($(this.form));
$(this.form).submit();