Updated Branches:
  refs/heads/4.2 c0d2e3253 -> 64ab85069

CLOUDSTACK-3950: UI > template/ISO page > hide CopyTemplate/CopyISO action when 
it's region-wide (i.e. zoneid is null)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/64ab8506
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/64ab8506
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/64ab8506

Branch: refs/heads/4.2
Commit: 64ab85069d2d6fbad5cab4868c3be06fbb1fb790
Parents: c0d2e32
Author: Jessica Wang <[email protected]>
Authored: Fri Aug 16 19:50:16 2013 -0700
Committer: Jessica Wang <[email protected]>
Committed: Fri Aug 16 19:50:16 2013 -0700

----------------------------------------------------------------------
 ui/scripts/templates.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/64ab8506/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 4b544ab..d596bc2 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -1660,9 +1660,12 @@
         } else {
             allowedActions.push("edit");
 
-            if (havingSwift == false && havingS3 == false)
+            //Swift and S3 are region-wide secondary storage
+            //if (havingSwift == false && havingS3 == false)
+                       if (havingSwift == false && jsonObj.zoneid != null) { 
//"jsonObj.zoneid == null" means it is registered on region-wide S3 => global 
to all zones 
                 allowedActions.push("copyTemplate");
-
+            }
+                       
             //allowedActions.push("createVm"); // For Beta2, this simply 
doesn't work without a network.
         }
 
@@ -1697,8 +1700,10 @@
         } else {
             allowedActions.push("edit");
 
-            if (havingSwift == false)
+                       //Swift and S3 are region-wide secondary storage
+            if (havingSwift == false && jsonObj.zoneid != null) { 
//"jsonObj.zoneid == null" means it is registered on region-wide S3 => global 
to all zones 
                 allowedActions.push("copyISO");
+                       }
         }
 
         // "Create VM"

Reply via email to