Subversion Repositories oidplus

Rev

Rev 1292 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1292 Rev 1447
Line 76... Line 76...
76
                        success:function(data) {
76
                        success:function(data) {
77
                                // TODO XXX: (Future feature) If the user decides that existing OIDs shall be overwritten, then we may not print "Ignored OIDs because they are already existing"
77
                                // TODO XXX: (Future feature) If the user decides that existing OIDs shall be overwritten, then we may not print "Ignored OIDs because they are already existing"
78
                                // TODO: Use oidplus_ajax_success(), since this checks the existance of "error" in data, and checks if status>=0
78
                                // TODO: Use oidplus_ajax_success(), since this checks the existance of "error" in data, and checks if status>=0
79
                                if (typeof data === "object" && "error" in data) {
79
                                if (typeof data === "object" && "error" in data) {
80
                                        if (typeof data === "object" && "count_imported_oids" in data) {
80
                                        if (typeof data === "object" && "count_imported_oids" in data) {
81
                                                // TODO: Device if alertSuccess, alertWarning oder alertError is shown
81
                                                // TODO: Decide if alertSuccess, alertWarning oder alertError is shown
82
                                                alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
82
                                                alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
83
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
83
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
84
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
84
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
85
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
85
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
86
                                                          "\n"+
86
                                                          "\n"+
87
                                                          _L("Warnings / Error messages:")+"\n"+
87
                                                          _L("Warnings / Error messages:")+"\n"+
88
                                                          "\n"+
88
                                                          "\n"+
89
                                                          data.error);
89
                                                          data.error);
90
                                        } else {
90
                                        } else {
-
 
91
                                                console.error(data.error);
91
                                                alertError(_L("Error: %1",data.error));
92
                                                alertError(_L("Error: %1",data.error));
92
                                        }
93
                                        }
93
                                } else if (typeof data === "object" && data.status >= 0) {
94
                                } else if (typeof data === "object" && "status" in data && data.status >= 0) {
94
                                        // TODO: Device if alertSuccess, alertWarning oder alertError is shown
95
                                        // TODO: Decide if alertSuccess, alertWarning oder alertError is shown
95
                                        alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
96
                                        alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
96
                                                  _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
97
                                                  _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
97
                                                  _L("Not imported because of errors: %1",data.count_errors)+"\n"+
98
                                                  _L("Not imported because of errors: %1",data.count_errors)+"\n"+
98
                                                  _L("Warnings: %1",data.count_warnings));
99
                                                  _L("Warnings: %1",data.count_warnings));
99
                                        $('#userfile').val('');
100
                                        $('#userfile').val('');
100
                                } else {
101
                                } else {
101
                                        if (typeof data === "object" && "count_imported_oids" in data) {
102
                                        if (typeof data === "object" && "count_imported_oids" in data) {
102
                                                // TODO: Device if alertSuccess, alertWarning oder alertError is shown
103
                                                // TODO: Decide if alertSuccess, alertWarning oder alertError is shown
103
                                                alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
104
                                                alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
104
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
105
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
105
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
106
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
106
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
107
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
107
                                                          "\n"+
108
                                                          "\n"+
108
                                                          _L("Warnings / Error messages:")+"\n"+
109
                                                          _L("Warnings / Error messages:")+"\n"+
109
                                                          "\n"+
110
                                                          "\n"+
110
                                                          data/*sic*/);
111
                                                          data/*sic*/);
111
                                        } else {
112
                                        } else {
-
 
113
                                                console.error(data);
112
                                                alertError(_L("Error: %1",data));
114
                                                alertError(_L("Error: %1",data));
113
                                        }
115
                                        }
114
                                }
116
                                }
115
                        }
117
                        }
116
                });
118
                });