role screen bulk add confirm dialog before saving all

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1243444 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-02-13 08:59:51 +00:00
parent 21cf00c48a
commit 1f838d43bc
2 changed files with 28 additions and 11 deletions

View File

@ -148,3 +148,7 @@ proxy-connectors.remoterepo.settings.networkproxy=Network Proxy
proxy.connector.bulk.save.confirm=Are you sure to update {0} Proxy Connector(s) proxy.connector.bulk.save.confirm=Are you sure to update {0} Proxy Connector(s)
proxyconnector.delete.confirm=Are you sure to delete the Proxy Connector proxyconnector.delete.confirm=Are you sure to delete the Proxy Connector
#roles
role.bulk.save.confirm=Are you sure to update {0} Role(s)

View File

@ -164,19 +164,32 @@ $(function() {
} }
updateModifiedRoles=function(){ updateModifiedRoles=function(){
var modifiedRoles = getModifiedRoles(); var modifiedRoles = getModifiedRoles();
$.log("modifiedRoles:"+modifiedRoles); $.log("modifiedRoles:"+modifiedRoles);
for(i=0;i<modifiedRoles.length;i++){
var modifiedRole=modifiedRoles[i];
if (modifiedRole.modified()){ openDialogConfirm(function(){
modifiedRole.updateDescription(); for(i=0;i<modifiedRoles.length;i++){
modifiedRole.modified(false); var modifiedRole=modifiedRoles[i];
} if (modifiedRole.modified()){
if (modifiedRole.usersModified()){ modifiedRole.updateDescription();
modifiedRole.updateUsers(); modifiedRole.modified(false);
modifiedRole.usersModified(false); }
} if (modifiedRole.usersModified()){
} modifiedRole.updateUsers();
modifiedRole.usersModified(false);
}
}
closeDialogConfirm();
},
$.i18n.prop('ok'),
$.i18n.prop('cancel'),
$.i18n.prop('bulk.save.confirm.title'),
$.i18n.prop('role.bulk.save.confirm',modifiedRoles.length));
} }
updateRole=function(modifiedRole){ updateRole=function(modifiedRole){