swal(gettext('Error'),"[ "+name+" ]"+gettext("Being used by the asset, please unbind the asset first."),"error");
swal(gettext('Error'),"[ "+name+" ]"+gettext("Being used by the asset, please unbind the asset first."),"error");
};
requestApi({
url:url,
...
...
@@ -336,6 +331,7 @@ function objectDelete(obj, name, url, redirectTo) {
error:fail
});
}
swal({
title:gettext('Are you sure about deleting it?'),
text:" ["+name+"] ",
...
...
@@ -350,22 +346,21 @@ function objectDelete(obj, name, url, redirectTo) {
});
}
functionorgDelete(obj,name,url,redirectTo){
functionorgDelete(obj,name,url,redirectTo){
functiondoDelete(){
varbody={};
varsuccess=function(){
varsuccess=function(){
if(!redirectTo){
$(obj).parent().parent().remove();
}else{
window.location.href=redirectTo;
window.location.href=redirectTo;
}
};
varfail=function(responseText,status){
if(status===400){
swal(gettext("Error"),"[ "+name+" ] "+gettext("The organization contains undeleted information. Please try again after deleting"),"error");
}
elseif(status===405){
swal(gettext("Error")," [ "+name+" ] "+gettext("Do not perform this operation under this organization. Try again after switching to another organization"),"error");
varfail=function(responseText,status){
if(status===400){
swal(gettext("Error"),"[ "+name+" ] "+gettext("The organization contains undeleted information. Please try again after deleting"),"error");
}elseif(status===405){
swal(gettext("Error")," [ "+name+" ] "+gettext("Do not perform this operation under this organization. Try again after switching to another organization"),"error");
}
};
requestApi({
...
...
@@ -377,6 +372,7 @@ function orgDelete(obj, name, url, redirectTo){
error:fail
});
}
swal({
title:gettext("Please ensure that the following information in the organization has been deleted"),