]> source.dussan.org Git - archiva.git/commitdiff
role screen bulk add confirm dialog before saving all
authorOlivier Lamy <olamy@apache.org>
Mon, 13 Feb 2012 08:59:51 +0000 (08:59 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 13 Feb 2012 08:59:51 +0000 (08:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1243444 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js

index 9b03ca57d0eca7cb7821a2c8a07e5b11f249193b..1dc5f5032a13b3c64755234e188cc46c4c43d495 100644 (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)
 proxyconnector.delete.confirm=Are you sure to delete the Proxy Connector
 
+
+#roles
+role.bulk.save.confirm=Are you sure to update {0} Role(s)
+
index 51fcce8233397d443216252ba2d6c9c6307d1c16..e20d219f26e8aefa79334d8289360fd936408d85 100644 (file)
@@ -164,19 +164,32 @@ $(function() {
     }
 
     updateModifiedRoles=function(){
+
+
       var modifiedRoles = getModifiedRoles();
       $.log("modifiedRoles:"+modifiedRoles);
-      for(i=0;i<modifiedRoles.length;i++){
-        var modifiedRole=modifiedRoles[i];
-        if (modifiedRole.modified()){
-          modifiedRole.updateDescription();
-          modifiedRole.modified(false);
-        }
-        if (modifiedRole.usersModified()){
-          modifiedRole.updateUsers();
-          modifiedRole.usersModified(false);
-        }
-      }
+
+
+      openDialogConfirm(function(){
+                          for(i=0;i<modifiedRoles.length;i++){
+                            var modifiedRole=modifiedRoles[i];
+                            if (modifiedRole.modified()){
+                              modifiedRole.updateDescription();
+                              modifiedRole.modified(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){