Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0244D19BB7 for ; Thu, 21 Apr 2016 20:33:11 +0000 (UTC) Received: (qmail 54729 invoked by uid 500); 21 Apr 2016 20:33:10 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 54362 invoked by uid 500); 21 Apr 2016 20:33:10 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 54073 invoked by uid 99); 21 Apr 2016 20:33:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Apr 2016 20:33:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BD695DFF8A; Thu, 21 Apr 2016 20:33:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: swill@apache.org To: commits@cloudstack.apache.org Date: Thu, 21 Apr 2016 20:33:11 -0000 Message-Id: In-Reply-To: <33716ed347734be8a91aa550acba8970@git.apache.org> References: <33716ed347734be8a91aa550acba8970@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/8] git commit: updated refs/heads/master to 37afba0 CLOUDSTACK-9172 Added cross zones check to delete template and iso Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cfd2ce71 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cfd2ce71 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cfd2ce71 Branch: refs/heads/master Commit: cfd2ce71edbab431412f48b14011c8a137df1d22 Parents: e3e5be8 Author: Patrick Dube Authored: Wed Apr 20 16:16:32 2016 -0400 Committer: Patrick Dube Committed: Wed Apr 20 16:16:32 2016 -0400 ---------------------------------------------------------------------- ui/scripts/templates.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cfd2ce71/ui/scripts/templates.js ---------------------------------------------------------------------- diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index c8c5b89..fb01334 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -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) {