|
408 | 408 | osTypeId: { |
409 | 409 | label: 'label.os.type', |
410 | 410 | docID: 'helpRegisterTemplateOSType', |
411 | | - select: function(args) { |
412 | | - if (ostypeObjs == undefined) { |
413 | | - $.ajax({ |
414 | | - url: createURL("listOsTypes"), |
415 | | - dataType: "json", |
416 | | - async: false, |
417 | | - success: function(json) { |
418 | | - ostypeObjs = json.listostypesresponse.ostype; |
419 | | - } |
420 | | - }); |
421 | | - } |
422 | | - args.response.success({ |
423 | | - data: ostypeObjs |
424 | | - }); |
| 411 | + select: function(args) { |
| 412 | + $.ajax({ |
| 413 | + url: createURL("listOsTypes"), |
| 414 | + dataType: "json", |
| 415 | + async: true, |
| 416 | + success: function(json) { |
| 417 | + var ostypeObjs = json.listostypesresponse.ostype; |
| 418 | + args.response.success({ |
| 419 | + data: ostypeObjs |
| 420 | + }); |
| 421 | + } |
| 422 | + }); |
425 | 423 | } |
426 | 424 | }, |
427 | 425 |
|
|
849 | 847 | } |
850 | 848 |
|
851 | 849 | if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) { |
852 | | - if (ostypeObjs == undefined) { |
853 | | - $.ajax({ |
854 | | - url: createURL("listOsTypes"), |
855 | | - dataType: "json", |
856 | | - async: false, |
857 | | - success: function(json) { |
858 | | - ostypeObjs = json.listostypesresponse.ostype; |
859 | | - } |
860 | | - }); |
861 | | - } |
| 850 | + var ostypeObjs; |
| 851 | + $.ajax({ |
| 852 | + url: createURL("listOsTypes"), |
| 853 | + dataType: "json", |
| 854 | + async: false, |
| 855 | + success: function(json) { |
| 856 | + var ostypeObjs = json.listostypesresponse.ostype; |
| 857 | + } |
| 858 | + }); |
| 859 | + |
862 | 860 | if (ostypeObjs != undefined) { |
863 | 861 | var ostypeName; |
864 | 862 | for (var i = 0; i < ostypeObjs.length; i++) { |
|
963 | 961 | label: 'label.os.type', |
964 | 962 | isEditable: true, |
965 | 963 | select: function(args) { |
966 | | - if (ostypeObjs == undefined) { |
967 | | - $.ajax({ |
968 | | - url: createURL("listOsTypes"), |
969 | | - dataType: "json", |
970 | | - async: false, |
971 | | - success: function(json) { |
972 | | - ostypeObjs = json.listostypesresponse.ostype; |
973 | | - } |
974 | | - }); |
975 | | - } |
| 964 | + var ostypeObjs; |
| 965 | + $.ajax({ |
| 966 | + url: createURL("listOsTypes"), |
| 967 | + dataType: "json", |
| 968 | + async: false, |
| 969 | + success: function(json) { |
| 970 | + ostypeObjs = json.listostypesresponse.ostype; |
| 971 | + } |
| 972 | + }); |
| 973 | + |
976 | 974 | var items = []; |
977 | 975 | $(ostypeObjs).each(function() { |
978 | 976 | items.push({ |
|
1231 | 1229 | } |
1232 | 1230 |
|
1233 | 1231 | if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) { |
1234 | | - if (ostypeObjs == undefined) { |
1235 | | - $.ajax({ |
1236 | | - url: createURL("listOsTypes"), |
1237 | | - dataType: "json", |
1238 | | - async: false, |
1239 | | - success: function(json) { |
1240 | | - ostypeObjs = json.listostypesresponse.ostype; |
1241 | | - } |
1242 | | - }); |
1243 | | - } |
| 1232 | + var ostypeObjs; |
| 1233 | + $.ajax({ |
| 1234 | + url: createURL("listOsTypes"), |
| 1235 | + dataType: "json", |
| 1236 | + async: false, |
| 1237 | + success: function(json) { |
| 1238 | + ostypeObjs = json.listostypesresponse.ostype; |
| 1239 | + } |
| 1240 | + }); |
| 1241 | + |
1244 | 1242 | if (ostypeObjs != undefined) { |
1245 | 1243 | var ostypeName; |
1246 | 1244 | for (var i = 0; i < ostypeObjs.length; i++) { |
|
1362 | 1360 | label: 'label.os.type', |
1363 | 1361 | isEditable: true, |
1364 | 1362 | select: function(args) { |
1365 | | - if (ostypeObjs == undefined) { |
1366 | | - $.ajax({ |
1367 | | - url: createURL("listOsTypes"), |
1368 | | - dataType: "json", |
1369 | | - async: false, |
1370 | | - success: function(json) { |
1371 | | - ostypeObjs = json.listostypesresponse.ostype; |
1372 | | - } |
1373 | | - }); |
1374 | | - } |
| 1363 | + var ostypeObjs; |
| 1364 | + $.ajax({ |
| 1365 | + url: createURL("listOsTypes"), |
| 1366 | + dataType: "json", |
| 1367 | + async: false, |
| 1368 | + success: function(json) { |
| 1369 | + ostypeObjs = json.listostypesresponse.ostype; |
| 1370 | + } |
| 1371 | + }); |
| 1372 | + |
1375 | 1373 | var items = []; |
1376 | 1374 | $(ostypeObjs).each(function() { |
1377 | 1375 | items.push({ |
|
1565 | 1563 | required: true |
1566 | 1564 | }, |
1567 | 1565 | select: function(args) { |
1568 | | - if (ostypeObjs == undefined) { |
1569 | | - $.ajax({ |
1570 | | - url: createURL("listOsTypes"), |
1571 | | - dataType: "json", |
1572 | | - async: false, |
1573 | | - success: function(json) { |
1574 | | - ostypeObjs = json.listostypesresponse.ostype; |
1575 | | - } |
1576 | | - }); |
1577 | | - } |
1578 | | - var items = []; |
1579 | | - //items.push({id: "", description: "None"}); //shouldn't have None option when bootable is checked |
1580 | | - $(ostypeObjs).each(function() { |
1581 | | - items.push({ |
1582 | | - id: this.id, |
1583 | | - description: this.description |
1584 | | - }); |
1585 | | - }); |
1586 | | - args.response.success({ |
1587 | | - data: items |
1588 | | - }); |
| 1566 | + $.ajax({ |
| 1567 | + url: createURL("listOsTypes"), |
| 1568 | + dataType: "json", |
| 1569 | + async: true, |
| 1570 | + success: function(json) { |
| 1571 | + var ostypeObjs = json.listostypesresponse.ostype; |
| 1572 | + var items = []; |
| 1573 | + //items.push({id: "", description: "None"}); //shouldn't have None option when bootable is checked |
| 1574 | + $(ostypeObjs).each(function() { |
| 1575 | + items.push({ |
| 1576 | + id: this.id, |
| 1577 | + description: this.description |
| 1578 | + }); |
| 1579 | + }); |
| 1580 | + args.response.success({ |
| 1581 | + data: items |
| 1582 | + }); |
| 1583 | + } |
| 1584 | + }); |
1589 | 1585 | } |
1590 | 1586 | }, |
1591 | 1587 |
|
|
2286 | 2282 | label: 'label.os.type', |
2287 | 2283 | isEditable: true, |
2288 | 2284 | select: function(args) { |
2289 | | - if (ostypeObjs == undefined) { |
2290 | | - $.ajax({ |
2291 | | - url: createURL("listOsTypes"), |
2292 | | - dataType: "json", |
2293 | | - async: false, |
2294 | | - success: function(json) { |
2295 | | - ostypeObjs = json.listostypesresponse.ostype; |
2296 | | - } |
2297 | | - }); |
2298 | | - } |
| 2285 | + var ostypeObjs; |
| 2286 | + $.ajax({ |
| 2287 | + url: createURL("listOsTypes"), |
| 2288 | + dataType: "json", |
| 2289 | + async: false, |
| 2290 | + success: function(json) { |
| 2291 | + ostypeObjs = json.listostypesresponse.ostype; |
| 2292 | + } |
| 2293 | + }); |
| 2294 | + |
2299 | 2295 | var items = []; |
2300 | 2296 | $(ostypeObjs).each(function() { |
2301 | 2297 | items.push({ |
|
0 commit comments