View | Details | Raw Unified | Return to bug 10543
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-7 / +2 lines)
Lines 6-11 Link Here
6
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
6
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
7
[% INCLUDE 'additem.js.inc' %]
7
[% INCLUDE 'additem.js.inc' %]
8
<script type="text/javascript" src="[% themelang %]/js/additem.js"></script>
8
<script type="text/javascript" src="[% themelang %]/js/additem.js"></script>
9
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
9
<script type="text/javascript" src="[% themelang %]/js/prevent_submit.js"></script>
10
<script type="text/javascript" src="[% themelang %]/js/prevent_submit.js"></script>
10
<script type="text/javascript">
11
<script type="text/javascript">
11
//<![CDATA[
12
//<![CDATA[
Lines 64-76 function Check(ff) { Link Here
64
    }
65
    }
65
66
66
    if ( ff.field_value ) {
67
    if ( ff.field_value ) {
67
        var empty_item_mandatory = 0;
68
        var empty_item_mandatory = CheckMandatorySubfields(ff);
68
        for (i = 0; i < ff.field_value.length; i++) {
69
            //alert("i = " + i + " => " + ff.kohafield[i] );
70
            if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) {
71
                empty_item_mandatory++;
72
            }
73
        }
74
        if (empty_item_mandatory > 0) {
69
        if (empty_item_mandatory > 0) {
75
            ok = 1;
70
            ok = 1;
76
            _alertString +=
71
            _alertString +=
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-12 / +3 lines)
Lines 2-24 Link Here
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'additem.js.inc' %]
4
[% INCLUDE 'additem.js.inc' %]
5
<script type="text/javascript" src="[% themelang %]/js/additem.js"> </script>
5
<script type="text/javascript" src="[% themelang %]/js/additem.js"></script>
6
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
6
<script type="text/javascript" src="[% themelang %]/js/prevent_submit.js"></script>
7
<script type="text/javascript" src="[% themelang %]/js/prevent_submit.js"></script>
7
<script type="text/javascript">
8
<script type="text/javascript">
8
//<![CDATA[
9
//<![CDATA[
9
    function Check(form) {
10
    function Check(form) {
10
        [% IF (AcqCreateItemReceiving) %]
11
        [% IF (AcqCreateItemReceiving) %]
11
            var total_errors=0;
12
            var total_errors = CheckMandatorySubfields(form);
12
            $("input[name='mandatory'],select[name='mandatory']").each(function(i){
13
                if($(this).val() == 1){
14
                    var mandatory_field = $("input[name='field_value'],select[name='field_value']").eq(i);
15
                    if(mandatory_field.val() == ''){
16
                        mandatory_field.addClass("missing");
17
                        total_errors++;
18
                    }
19
                }
20
            });
21
22
            if (total_errors != 0) {
13
            if (total_errors != 0) {
23
                var alertString = _("Form not submitted because of the following problem(s)");
14
                var alertString = _("Form not submitted because of the following problem(s)");
24
                alertString += "\n------------------------------------------------------------------------------------\n";
15
                alertString += "\n------------------------------------------------------------------------------------\n";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (-9 / +6 lines)
Lines 78-98 function changeDate2(adate) { Link Here
78
}
78
}
79
79
80
$(document).ready(function() {
80
$(document).ready(function() {
81
	$("form#serials_edit").submit(function() {
81
    $("form#serials_edit").submit(function() {
82
	    var total_errors = 0;
82
        var total_errors = 0;
83
        $(".subfield_line:visible", this).each(function() {
83
        $(this).find(".cataloguing_additem_itemlist:visible").each(function(){
84
            if ($("*[name=field_value]", this).val().length == 0 &&
84
            total_errors = total_errors + CheckMandatorySubfields(this);
85
                $("*[name=mandatory]", this).val() == 1) {
86
                total_errors++;
87
            }
88
        });
85
        });
89
        if ( total_errors > 0 ) {
86
        if ( total_errors > 0 ) {
90
            var mes  = _("Form not submitted because of the following problem(s)");
87
            var mes  = _("Form not submitted because of the following problem(s)");
91
            mes += "\n------------------------------------------------------------------------------------\n";
88
            mes += "\n------------------------------------------------------------------------------------\n";
92
            mes += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
89
            mes += "\n- " + total_errors + _(" mandatory fields empty (highlighted)");
93
            alert(mes);
90
            alert(mes);
94
            return false;
91
            return false;
95
        }
92
        }
93
        return true;
96
    });
94
    });
97
});
95
});
98
//]]>
96
//]]>
99
- 

Return to bug 10543