Subversion Repositories oidplus

Rev

Rev 642 | Rev 1036 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 642 Rev 833
Line 40... Line 40...
40
                                action: "import_oidinfo_oid",
40
                                action: "import_oidinfo_oid",
41
                                oid: oid
41
                                oid: oid
42
                        },
42
                        },
43
                        error:function(jqXHR, textStatus, errorThrown) {
43
                        error:function(jqXHR, textStatus, errorThrown) {
44
                                if (errorThrown == "abort") return;
44
                                if (errorThrown == "abort") return;
45
                                alert(_L("Error: %1",errorThrown));
45
                                alertError(_L("Error: %1",errorThrown));
46
                        },
46
                        },
47
                        success:function(data) {
47
                        success:function(data) {
48
                                if ("error" in data) {
48
                                if ("error" in data) {
49
                                        alert(_L("Error: %1",data.error));
49
                                        alertError(_L("Error: %1",data.error));
50
                                } else if (data.status >= 0) {
50
                                } else if (data.status >= 0) {
51
                                        console.log(_L("Imported OID %1",oid));
51
                                        console.log(_L("Imported OID %1",oid));
52
                                        OIDplusPageAdminOIDInfoExport.removeMissingOid(oid);
52
                                        OIDplusPageAdminOIDInfoExport.removeMissingOid(oid);
53
                                } else {
53
                                } else {
54
                                        alert(_L("Error: %1",data));
54
                                        alertError(_L("Error: %1",data));
55
                                }
55
                                }
56
                        }
56
                        }
57
                });
57
                });
58
        },
58
        },
59
 
59
 
Line 79... Line 79...
79
                                $.xhrPool.remove(jqXHR);
79
                                $.xhrPool.remove(jqXHR);
80
                        },
80
                        },
81
                        data: form_data,
81
                        data: form_data,
82
                        error:function(jqXHR, textStatus, errorThrown) {
82
                        error:function(jqXHR, textStatus, errorThrown) {
83
                                if (errorThrown == "abort") return;
83
                                if (errorThrown == "abort") return;
84
                                alert(_L("Error: %1",errorThrown));
84
                                alertError(_L("Error: %1",errorThrown));
85
                        },
85
                        },
86
                        success:function(data) {
86
                        success:function(data) {
87
                                // 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"
87
                                // 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"
88
                                if ("error" in data) {
88
                                if ("error" in data) {
89
                                        if ("count_imported_oids" in data) {
89
                                        if ("count_imported_oids" in data) {
-
 
90
                                                // TODO: Device if alertSuccess, alertWarning oder alertError is shown
90
                                                alert(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
91
                                                alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
91
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
92
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
92
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
93
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
93
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
94
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
94
                                                          "\n"+
95
                                                          "\n"+
95
                                                          _L("Warnings / Error messages:")+"\n"+
96
                                                          _L("Warnings / Error messages:")+"\n"+
96
                                                          "\n"+
97
                                                          "\n"+
97
                                                          data.error);
98
                                                          data.error);
98
                                        } else {
99
                                        } else {
99
                                                alert(_L("Error: %1",data.error));
100
                                                alertError(_L("Error: %1",data.error));
100
                                        }
101
                                        }
101
                                } else if (data.status >= 0) {
102
                                } else if (data.status >= 0) {
-
 
103
                                        // TODO: Device if alertSuccess, alertWarning oder alertError is shown
102
                                        alert(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
104
                                        alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
103
                                                  _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"+
104
                                                  _L("Not imported because of errors: %1",data.count_errors)+"\n"+
106
                                                  _L("Not imported because of errors: %1",data.count_errors)+"\n"+
105
                                                  _L("Warnings: %1",data.count_warnings));
107
                                                  _L("Warnings: %1",data.count_warnings));
106
                                        $('#userfile').val('');
108
                                        $('#userfile').val('');
107
                                } else {
109
                                } else {
108
                                        if ("count_imported_oids" in data) {
110
                                        if ("count_imported_oids" in data) {
-
 
111
                                                // TODO: Device if alertSuccess, alertWarning oder alertError is shown
109
                                                alert(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
112
                                                alertSuccess(_L("Successfully imported OIDs: %1",data.count_imported_oids)+"\n"+
110
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
113
                                                          _L("Ignored OIDs because they are already existing: %1",data.count_already_existing)+"\n"+
111
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
114
                                                          _L("Not imported because of errors: %1",data.count_errors)+"\n"+
112
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
115
                                                          _L("Warnings: %1",data.count_warnings)+"\n"+
113
                                                          "\n"+
116
                                                          "\n"+
114
                                                          _L("Warnings / Error messages:")+"\n"+
117
                                                          _L("Warnings / Error messages:")+"\n"+
115
                                                          "\n"+
118
                                                          "\n"+
116
                                                          data/*sic*/);
119
                                                          data/*sic*/);
117
                                        } else {
120
                                        } else {
118
                                                alert(_L("Error: %1",data));
121
                                                alertError(_L("Error: %1",data));
119
                                        }
122
                                        }
120
                                }
123
                                }
121
                        }
124
                        }
122
                });
125
                });
123
        },
126
        },