From: Frédéric Demians Date: Fri, 17 Dec 2010 11:16:52 +0000 (+0000) Subject: Bug 5446 Fix a bug introduces by previous patch X-Git-Tag: html_template_pro~571^2 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=9a048e2b12e2004fad51b5b0db3187a8eb6c2a04;p=koha-ffzg.git Bug 5446 Fix a bug introduces by previous patch When AcqCreateItem was set to 'cataloguing' there was no items fields in the acq web form to validate in JS... Alert commented. Signed-off-by: Marcel de Rooy Signed-off-by: Chris Cormack --- diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl index 85ccb6feb7..a76cb5c234 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl @@ -40,16 +40,19 @@ function Check(ff) { _(") exceeds budget available (") + actTotal+")"; } - var empty_item_mandatory = 0; - for (i = 0; i < ff.field_value.length; i++) { - if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) { - empty_item_mandatory++; + if ( ff.field_value ) { + var empty_item_mandatory = 0; + for (i = 0; i < ff.field_value.length; i++) { + //alert("i = " + i + " => " + ff.kohafield[i] ); + if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) { + empty_item_mandatory++; + } + } + if (empty_item_mandatory > 0) { + ok = 1; + _alertString += + "\n- " + empty_item_mandatory + _(" item mandatory fields empty"); } - } - if (empty_item_mandatory > 0) { - ok = 1; - _alertString += - "\n- " + empty_item_mandatory + _(" item mandatory fields empty"); } if (ok) {