Rev 320 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 320 | Rev 360 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | confidential:(document.getElementById('hide') ? document.getElementById('hide').checked : null), |
30 | confidential:(document.getElementById('hide') ? document.getElementById('hide').checked : null), |
31 | weid:(document.getElementById('weid') ? document.getElementById('weid').checked : null), |
31 | weid:(document.getElementById('weid') ? document.getElementById('weid').checked : null), |
32 | parent:parent |
32 | parent:parent |
33 | }, |
33 | }, |
34 | error:function(jqXHR, textStatus, errorThrown) { |
34 | error:function(jqXHR, textStatus, errorThrown) { |
35 | alert("Error: " + errorThrown); |
35 | alert(_L("Error: %1",errorThrown)); |
36 | }, |
36 | }, |
37 | success:function(data) { |
37 | success:function(data) { |
38 | if ("error" in data) { |
38 | if ("error" in data) { |
39 | alert("Error: " + data.error); |
39 | alert(_L("Error: %1",data.error)); |
40 | } else if (data.status == 0/*OK*/) { |
40 | } else if (data.status == 0/*OK*/) { |
41 | //alert("Insert OK"); |
41 | //alert(_L("Insert OK")); |
42 | reloadContent(); |
42 | reloadContent(); |
43 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts eine neue zeile zur tabelle hinzufügen |
43 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts eine neue zeile zur tabelle hinzufügen |
44 | } else if (data.status == 1/*RaNotExisting*/) { |
44 | } else if (data.status == 1/*RaNotExisting*/) { |
45 | if (confirm("Update OK. However, the email address you have entered ("+document.getElementById('ra_email').value+") is not in our system. Do you want to send an invitation, so that the RA can register an account to manage their OIDs?")) { |
45 | if (confirm(_L("Update OK. However, the email address you have entered (%1) is not in our system. Do you want to send an invitation, so that the RA can register an account to manage their OIDs?",document.getElementById('ra_email').value))) { |
46 | crudActionSendInvitation(parent, document.getElementById('ra_email').value); |
46 | crudActionSendInvitation(parent, document.getElementById('ra_email').value); |
47 | } else { |
47 | } else { |
48 | reloadContent(); |
48 | reloadContent(); |
49 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts eine neue zeile zur tabelle hinzufügen |
49 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts eine neue zeile zur tabelle hinzufügen |
50 | } |
50 | } |
51 | } else if (data.status == 2/*RaNotExistingNoInvitation*/) { |
51 | } else if (data.status == 2/*RaNotExistingNoInvitation*/) { |
52 | //alert("Insert OK"); |
52 | //alert(_L("Insert OK")); |
53 | reloadContent(); |
53 | reloadContent(); |
54 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts eine neue zeile zur tabelle hinzufügen |
54 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts eine neue zeile zur tabelle hinzufügen |
55 | } else { |
55 | } else { |
56 | alert("Error: " + data); |
56 | alert(_L("Error: %1",data)); |
57 | } |
57 | } |
58 | } |
58 | } |
59 | }); |
59 | }); |
60 | } |
60 | } |
61 | 61 | ||
Line 73... | Line 73... | ||
73 | iris:(document.getElementById('iris_'+id) ? document.getElementById('iris_'+id).value : null), |
73 | iris:(document.getElementById('iris_'+id) ? document.getElementById('iris_'+id).value : null), |
74 | confidential:(document.getElementById('hide_'+id) ? document.getElementById('hide_'+id).checked : null), |
74 | confidential:(document.getElementById('hide_'+id) ? document.getElementById('hide_'+id).checked : null), |
75 | parent:parent |
75 | parent:parent |
76 | }, |
76 | }, |
77 | error:function(jqXHR, textStatus, errorThrown) { |
77 | error:function(jqXHR, textStatus, errorThrown) { |
78 | alert("Error: " + errorThrown); |
78 | alert(_L("Error: %1",errorThrown)); |
79 | }, |
79 | }, |
80 | success:function(data) { |
80 | success:function(data) { |
81 | if ("error" in data) { |
81 | if ("error" in data) { |
82 | alert("Error: " + data.error); |
82 | alert(_L("Error: %1",data.error)); |
83 | } else if (data.status == 0/*OK*/) { |
83 | } else if (data.status == 0/*OK*/) { |
84 | alert("Update OK"); |
84 | alert(_L("Update OK")); |
85 | // reloadContent(); |
85 | // reloadContent(); |
86 | $('#oidtree').jstree("refresh"); |
86 | $('#oidtree').jstree("refresh"); |
87 | } else if (data.status == 1/*RaNotExisting*/) { |
87 | } else if (data.status == 1/*RaNotExisting*/) { |
88 | if (confirm("Update OK. However, the email address you have entered ("+document.getElementById('ra_email_'+id).value+") is not in our system. Do you want to send an invitation, so that the RA can register an account to manage their OIDs?")) { |
88 | if (confirm(_L("Update OK. However, the email address you have entered (%1) is not in our system. Do you want to send an invitation, so that the RA can register an account to manage their OIDs?",document.getElementById('ra_email_'+id).value))) { |
89 | crudActionSendInvitation(parent, document.getElementById('ra_email_'+id).value); |
89 | crudActionSendInvitation(parent, document.getElementById('ra_email_'+id).value); |
90 | } else { |
90 | } else { |
91 | // reloadContent(); |
91 | // reloadContent(); |
92 | $('#oidtree').jstree("refresh"); |
92 | $('#oidtree').jstree("refresh"); |
93 | } |
93 | } |
94 | } else if (data.status == 2/*RaNotExistingNoInvitation*/) { |
94 | } else if (data.status == 2/*RaNotExistingNoInvitation*/) { |
95 | alert("Update OK"); |
95 | alert(_L("Update OK")); |
96 | // reloadContent(); |
96 | // reloadContent(); |
97 | $('#oidtree').jstree("refresh"); |
97 | $('#oidtree').jstree("refresh"); |
98 | } else { |
98 | } else { |
99 | alert("Error: " + data); |
99 | alert(_L("Error: %1",data)); |
100 | } |
100 | } |
101 | } |
101 | } |
102 | }); |
102 | }); |
103 | } |
103 | } |
104 | 104 | ||
105 | function crudActionDelete(id, parent) { |
105 | function crudActionDelete(id, parent) { |
106 | if(!window.confirm("Are you sure that you want to delete "+id+"?")) return false; |
106 | if(!window.confirm(_L("Are you sure that you want to delete %1?",id))) return false; |
107 | 107 | ||
108 | $.ajax({ |
108 | $.ajax({ |
109 | url:"ajax.php", |
109 | url:"ajax.php", |
110 | method:"POST", |
110 | method:"POST", |
111 | data: { |
111 | data: { |
Line 113... | Line 113... | ||
113 | action:"Delete", |
113 | action:"Delete", |
114 | id:id, |
114 | id:id, |
115 | parent:parent |
115 | parent:parent |
116 | }, |
116 | }, |
117 | error:function(jqXHR, textStatus, errorThrown) { |
117 | error:function(jqXHR, textStatus, errorThrown) { |
118 | alert("Error: " + errorThrown); |
118 | alert(_L("Error: %1",errorThrown)); |
119 | }, |
119 | }, |
120 | success:function(data) { |
120 | success:function(data) { |
121 | if ("error" in data) { |
121 | if ("error" in data) { |
122 | alert("Error: " + data.error); |
122 | alert(_L("Error: %1",data.error)); |
123 | } else if (data.status == 0) { |
123 | } else if (data.status == 0) { |
124 | reloadContent(); |
124 | reloadContent(); |
125 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts die zeile aus der tabelle löschen |
125 | // TODO: auf reloadContent() verzichten. stattdessen nur tree links aktualisieren, und rechts die zeile aus der tabelle löschen |
126 | } else { |
126 | } else { |
127 | alert("Error: " + data.error); |
127 | alert(_L("Error: %1",data.error)); |
128 | } |
128 | } |
129 | } |
129 | } |
130 | }); |
130 | }); |
131 | } |
131 | } |
132 | 132 | ||
Line 141... | Line 141... | ||
141 | title:(document.getElementById('titleedit') ? document.getElementById('titleedit').value : null), |
141 | title:(document.getElementById('titleedit') ? document.getElementById('titleedit').value : null), |
142 | //description:(document.getElementById('description') ? document.getElementById('description').value : null) |
142 | //description:(document.getElementById('description') ? document.getElementById('description').value : null) |
143 | description:tinyMCE.get('description').getContent() |
143 | description:tinyMCE.get('description').getContent() |
144 | }, |
144 | }, |
145 | error:function(jqXHR, textStatus, errorThrown) { |
145 | error:function(jqXHR, textStatus, errorThrown) { |
146 | alert("Error: " + errorThrown); |
146 | alert(_L("Error: %1",errorThrown)); |
147 | }, |
147 | }, |
148 | success:function(data) { |
148 | success:function(data) { |
149 | if ("error" in data) { |
149 | if ("error" in data) { |
150 | alert("Error: " + data.error); |
150 | alert(_L("Error: %1",data.error)); |
151 | } else if (data.status == 0) { |
151 | } else if (data.status == 0) { |
152 | alert("Update OK"); |
152 | alert(_L("Update OK")); |
153 | //reloadContent(); |
153 | //reloadContent(); |
154 | $('#oidtree').jstree("refresh"); |
154 | $('#oidtree').jstree("refresh"); |
155 | var h1s = document.getElementsByTagName("h1"); |
155 | var h1s = document.getElementsByTagName("h1"); |
156 | for (var i = 0; i < h1s.length; i++) { |
156 | for (var i = 0; i < h1s.length; i++) { |
157 | var h1 = h1s[i]; |
157 | var h1 = h1s[i]; |
Line 160... | Line 160... | ||
160 | document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), document.getElementById('titleedit').value); |
160 | document.title = combine_systemtitle_and_pagetitle(getOidPlusSystemTitle(), document.getElementById('titleedit').value); |
161 | 161 | ||
162 | var mce = tinymce.get('description'); |
162 | var mce = tinymce.get('description'); |
163 | if (mce != null) mce.isNotDirty = 1; |
163 | if (mce != null) mce.isNotDirty = 1; |
164 | } else { |
164 | } else { |
165 | alert("Error: " + data.error); |
165 | alert(_L("Error: %1",data.error)); |
166 | } |
166 | } |
167 | } |
167 | } |
168 | }); |
168 | }); |
169 | } |
169 | } |
170 | 170 |