Merge pull request #1505 from pdube/CLOUDSTACK-9172-delete-cross-zones-template

CLOUDSTACK-9172 Added cross zones check to delete template and isoAdded a check to ignore the zoneid, in the delete template UI, if the template is cross zones.

reference : CLOUDSTACK-9172

* pr/1505:
  CLOUDSTACK-9172 Added cross zones check to delete template and iso

Signed-off-by: Will Stevens <williamstevens@gmail.com>
This commit is contained in:
Will Stevens 2016-04-21 16:30:50 -04:00
commit d13ff88cbc
1 changed files with 10 additions and 6 deletions

View File

@ -1451,8 +1451,12 @@
}
},
action: function(args) {
var queryParams = "deleteTemplate&id=" + args.context.templates[0].id;
if (!args.context.templates[0].crossZones){
queryParams += "&zoneid=" + args.context.zones[0].zoneid;
}
$.ajax({
url: createURL("deleteTemplate&id=" + args.context.templates[0].id + "&zoneid=" + args.context.zones[0].zoneid),
url: createURL(queryParams),
dataType: "json",
async: true,
success: function(json) {
@ -2536,12 +2540,12 @@
}
},
action: function(args) {
var array1 = [];
if (args.context.zones[0].zoneid != null)
array1.push("&zoneid=" + args.context.zones[0].zoneid);
var queryParams = "deleteIso&id=" + args.context.isos[0].id;
if (!args.context.isos[0].crossZones){
queryParams += "&zoneid=" + args.context.zones[0].zoneid;
}
$.ajax({
url: createURL("deleteIso&id=" + args.context.isos[0].id + "&zoneid=" + args.context.zones[0].zoneid),
url: createURL(queryParams),
dataType: "json",
async: true,
success: function(json) {