Bug 10543 - add mandatory subfield check to addorderiso2709.pl

When adding orders from staged file, you can create one order per
record using item form in the bottom of addorderiso2709.pl.  The
form was missing checks of mandatory item fields; this patch
adds those checks.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

All 3 patches pass tests and QA script.

Some additional notes on the test plan from the first patch:
It took me a while to figure out a combination of subfields
that would trigger the bug. I am not sure about the condition
that transforms the input field into a textbox as it does
not seem to happen for every field.

What worked in the end was (MARC21):
- $g cost, normal purchase price = mandatory
- $h serial enumeration/chronolgy = optional, filled with
  text over 100 characters

Checked for:
- Adding items in cataloguing
  Was able to reproduce the problem, mandatory check works
  as expected.
- Adding items from staged file in acq
  Was not able to trigger the problem, because we don't edit
  the item here, but mandatory check works as expected.
- Addings items for serial subscriptions
  Was not able to trigger the problem, because we don't edit
  the items here, but mandatory check works better as before
  as missing mandatory fields are now highlighted and weren't
  before.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Fridolyn SOMERS 2013-07-11 16:33:33 +02:00 committed by Galen Charlton
parent 0d4724e81b
commit 2c7e1390b4

View file

@ -13,6 +13,7 @@
[% INCLUDE 'datatables-strings.inc' %]
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
<script type="text/JavaScript">
//<![CDATA[
[% IF (dateformat == 'metric') %]
@ -25,6 +26,18 @@
],
"sPaginationType": "four_button"
} ) );
$("form#Aform").submit(function() {
var total_errors = CheckMandatorySubfields(this);
if (total_errors > 0) {
var alertString = _("Form not submitted because of the following problem(s)");
alertString += "\n------------------------------------------------------------------------------------\n";
alertString += "\n- "+ total_errors + _(" mandatory fields empty (highlighted)");
alert(alertString);
return false;
}
return true;
});
});
//]]>
</script>