mirror of https://github.com/apache/cloudstack.git
bug 14760: cloudstack 2.2 UI - template page - edit template action - (1) not pass ispublic parameter to updateTemplatePermission API if ispublic field is not editable. (2) not pass isfeatured parameter to updateTemplatePermission API if isfeatured field is not editable.
This commit is contained in:
parent
a8e7d7b110
commit
fd374aeabd
|
|
@ -376,7 +376,7 @@ function templateJsonToDetailsTab() {
|
|||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listtemplatesresponse.template;
|
||||
var items = json.listtemplatesresponse.template;
|
||||
if(items != null && items.length > 0) {
|
||||
jsonObj = items[0];
|
||||
$midmenuItem1.data("jsonObj", jsonObj);
|
||||
|
|
@ -746,17 +746,22 @@ function doEditTemplate2($actionLink, $detailsTab, $midmenuItem1, $readonlyField
|
|||
}
|
||||
|
||||
//updateTemplatePermissions
|
||||
var array2 = [];
|
||||
var oldIsPublic = jsonObj.ispublic.toString();
|
||||
var newIsPublic = $detailsTab.find("#ispublic_edit").val();
|
||||
if(newIsPublic != oldIsPublic)
|
||||
array2.push("&ispublic="+newIsPublic);
|
||||
|
||||
var oldIsFeatured = jsonObj.isfeatured.toString();
|
||||
var newIsFeatured = $detailsTab.find("#isfeatured_edit").val();
|
||||
if(newIsFeatured != oldIsFeatured)
|
||||
array2.push("&isfeatured="+newIsFeatured);
|
||||
|
||||
var array2 = [];
|
||||
|
||||
if($detailsTab.find("#ispublic_edit").css("display") != "none" ) {
|
||||
var oldIsPublic = jsonObj.ispublic.toString();
|
||||
var newIsPublic = $detailsTab.find("#ispublic_edit").val();
|
||||
if(newIsPublic != oldIsPublic)
|
||||
array2.push("&ispublic="+newIsPublic);
|
||||
}
|
||||
|
||||
if($detailsTab.find("#isfeatured_edit").css("display") != "none" ) {
|
||||
var oldIsFeatured = jsonObj.isfeatured.toString();
|
||||
var newIsFeatured = $detailsTab.find("#isfeatured_edit").val();
|
||||
if(newIsFeatured != oldIsFeatured)
|
||||
array2.push("&isfeatured="+newIsFeatured);
|
||||
}
|
||||
|
||||
if(array2.length > 0) {
|
||||
$.ajax({
|
||||
data: createURL("command=updateTemplatePermissions&id="+id+array2.join("")),
|
||||
|
|
|
|||
Loading…
Reference in New Issue