diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index a7572192aae..0d194aec8ec 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -1,5 +1,6 @@ #New - Add all new parameters here. - +force.delete=Force Delete +force.delete.domain.warning=Warning: Choosing this option will delete all child domains and accounts under this domain. #Labels diff --git a/ui/jsp/domain.jsp b/ui/jsp/domain.jsp index 59f06bcc936..5bb99787e89 100644 --- a/ui/jsp/domain.jsp +++ b/ui/jsp/domain.jsp @@ -371,4 +371,25 @@ dictionary = { - \ No newline at end of file + + + +
+ \ No newline at end of file diff --git a/ui/scripts/cloud.core.domain.js b/ui/scripts/cloud.core.domain.js index 1a4fb6b2cd3..2a68e6f015e 100644 --- a/ui/scripts/cloud.core.domain.js +++ b/ui/scripts/cloud.core.domain.js @@ -107,12 +107,15 @@ function domainAccountJSONToTemplate(jsonObj, $template) { function afterLoadDomainJSP() { hideMiddleMenu(); clearMiddleMenu(); - + + initDialog("dialog_confirmation_delete_domain"); + if(isAdmin()) { var $topButtonContainer = clearButtonsOnTop(); $("#top_buttons").appendTo($topButtonContainer); $("#top_buttons").find("#add_domain_button").show(); - initAddDomainDialog(); + initAddDomainDialog(); + $("#dialog_confirmation_delete_domain").find("#force_delete_domain_container").show(); } //switch between different tabs @@ -672,12 +675,12 @@ function doDeleteDomain($actionLink, $detailsTab, $midmenuItem1) { var jsonObj = $midmenuItem1.data("jsonObj"); var id = jsonObj.id; - $("#dialog_confirmation") - .text(dictionary["message.action.delete.domain"]) + $("#dialog_confirmation_delete_domain") .dialog('option', 'buttons', { "Confirm": function() { - $(this).dialog("close"); - var apiCommand = "command=deleteDomain&id="+id; + $(this).dialog("close"); + var isForced = $("#dialog_confirmation_delete_domain").find("#force_delete_domain").attr("checked").toString(); + var apiCommand = "command=deleteDomain&id="+id+"&cleanup="+isForced; doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $detailsTab); }, "Cancel": function() {