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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-14 / +7 lines)
Lines 18-34 Link Here
18
                }
18
                }
19
            });
19
            });
20
20
21
            var alertString;
21
            if (total_errors != 0) {
22
            if (total_errors==0) {
22
                var alertString = _("Form not submitted because of the following problem(s)");
23
                return true;
24
            } else {
25
                alertString  = _("Form not submitted because of the following problem(s)");
26
                alertString += "\n------------------------------------------------------------------------------------\n";
23
                alertString += "\n------------------------------------------------------------------------------------\n";
27
                alertString += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)");
24
                alertString += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)");
28
                alert(alertString);
25
                alert(alertString);
29
                return false;
26
                return false;
30
            }
27
            }
31
28
29
            if(check_additem('[% UniqueItemFields %]') == false){
30
                alert(_('Duplicate values detected. Please correct the errors and resubmit.') );
31
                return false;
32
            };
33
32
            // Remove last itemblock if it is not in items_list
34
            // Remove last itemblock if it is not in items_list
33
            var lastitemblock = $("#outeritemblock > div:last");
35
            var lastitemblock = $("#outeritemblock > div:last");
34
            var tobedeleted = true;
36
            var tobedeleted = true;
Lines 41-54 Link Here
41
            if(tobedeleted){
43
            if(tobedeleted){
42
                $(lastitemblock).remove();
44
                $(lastitemblock).remove();
43
            }
45
            }
44
45
            if(check_additem('[% UniqueItemFields %]') == false){
46
                alert(_('Duplicate values detected. Please correct the errors and resubmit.') );
47
                if(tobedeleted) {
48
                    $(lastitemblock).appendTo("#outeritemblock");
49
                }
50
                return false;
51
            };
52
        [% END %]
46
        [% END %]
53
47
54
        return true;
48
        return true;
55
- 

Return to bug 9126