Author: sdumitriu
Date: 2007-12-19 14:12:33 +0100 (Wed, 19 Dec 2007)
New Revision: 6426

Modified:
   
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/saverights.vm
   
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/usersandgroups.js
Log:
XWIKI-1963: Various bugs in the new Rights Management UI
Fixed another two bugs.
Merged from [EMAIL PROTECTED]


Modified: 
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/saverights.vm
===================================================================
--- 
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/saverights.vm
    2007-12-19 13:11:52 UTC (rev 6425)
+++ 
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/saverights.vm
    2007-12-19 13:12:33 UTC (rev 6426)
@@ -21,7 +21,7 @@
           #set($levels = $levels + "," + $right)
 
 1. person: $pers; rule: allow; action: allow; levels: $levels
-          $obj.set('levels', $levels) ## set the new levels
+          $doc.getObject($clsname, $obj.number).set('levels', $levels) ## set 
the new levels
         #end
       #else ## deny or clean action
         #set($i = $levels.indexOf($right))
@@ -35,7 +35,7 @@
 
 2. person: $pers; rule: allow; action: deny/clean; levels: $levels
         #if($levels != "")
-          $obj.set('levels', $levels) ## set the new levels
+          $doc.getObject($clsname, $obj.number).set('levels', $levels) ## set 
the new levels
         #else ## no other righs in the levels, remove the rule completely
           #set($discard = $doc.removeObject($obj))
         #end
@@ -51,8 +51,6 @@
 
 3. person: $pers; rule: deny; action:deny; levels: $levels
           $doc.getObject($clsname, $obj.number).set('levels', $levels) ## set 
the new levels
-
-$doc.toXML()
         #end
       #else ## allow or clean action
         #set($i = $levels.indexOf($right))
@@ -66,7 +64,7 @@
 
 4. person: $pers; rule: deny; action: allow/clean; levels: $levels
         #if($levels != "")
-          $obj.set('levels', $levels) ## set the new levels
+          $doc.getObject($clsname, $obj.number).set('levels', $levels) ## set 
the new levels
         #else ## no other righs in the levels, remove the rule completely
           #set($discard = $doc.removeObject($obj))
         #end
@@ -75,7 +73,7 @@
   #elseif($pers.matches("^(.*,)?${fullname}(,.*)?$")) ## The person is in a 
multiple selection rule, remove it from there.
     #set($pers = $pers.replaceAll("^${fullname}(,|$)", ""))
     #set($pers = $pers.replaceAll("(^|,)${fullname}(,|$)", "$2"))
-    $obj.set($uorg, $pers)
+    $doc.getObject($clsname, $obj.number).set($uorg, $pers)
 
 5. person: $pers
   #end

Modified: 
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/usersandgroups.js
===================================================================
--- 
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/usersandgroups.js
        2007-12-19 13:11:52 UTC (rev 6425)
+++ 
xwiki-platform/web/branches/xwiki-web-1.2/standard/src/main/webapp/skins/albatross/usersandgroups.js
        2007-12-19 13:12:33 UTC (rev 6426)
@@ -66,8 +66,9 @@
 
     if (this.hasFilters) {
       this.filters = this.filter.getFilters();
-      if(this.filters != "" && this.filters != undefined)
-      url += this.filters;
+      if (this.filters != "" && this.filters != undefined) {
+        url += this.filters;
+      }
     }
 
     var self = this;
@@ -347,7 +348,9 @@
 
     this.domNode.style.height = outheight + "px";
     this.domNode.firstChild.style.height = inheight + "px";
-    this.domNode.scrollTop = scrollTop;
+    if (this.domNode.scrollTop != scrollTop) {
+      this.domNode.scrollTop = scrollTop;
+    }
     this.domNode.style.display = "block";
   }
 }
@@ -452,10 +455,14 @@
     * @todo Send the state number, or a generic map {state => sendValue}
     * @todo Configuration: automatic save, or just change the value.
     * @todo "Busy" icon when saving.
+    * @todo Changing the value should change the cache, not invalidate it.
+    * @todo The new state should be taken from the response, not just 
increment it.
     * @todo Make this a valid ARIA checkbox: 
http://www.w3.org/TR/aria-role/#checkbox
     */
-  initialize: function(domNode, right, saveUrl, defaultState)
+  initialize: function(domNode, right, saveUrl, defaultState, table, idx)
   {
+    this.table = table;
+    this.idx = idx;
     this.domNode = $(domNode);
     this.right = right;
     this.saveUrl = saveUrl;
@@ -494,6 +501,11 @@
   next: function()
   {
     this.state = (this.state + 1) % this.nrstates;
+    if (this.table != undefined) {
+      // TODO: Just update the cache, don't invalidate the row, once the 
rights are as stored as an
+      // array, and not as a string.
+      delete this.table.fetchedRows[this.idx];
+    }
     this.draw(this.state);
   },
 
@@ -721,7 +733,7 @@
   * Used in adminglobalrights.vm, adminspacerights.vm, editrights.vm.
   * @todo allows and denys should be arrays, not strings.
   */
-function displayUsersAndGroups(row, i, table)
+function displayUsersAndGroups(row, i, table, idx)
 {
   var userurl = row.userurl;
   var uorg = table.json.uorg;
@@ -758,7 +770,7 @@
     } else if (denys.indexOf(right) >= 0) {
       r = 2;
     }
-    var chbx = new MSCheckbox(td, right, saveUrl, r);
+    var chbx = new MSCheckbox(td, right, saveUrl, r, table, i);
     tr.appendChild(td);
   });
 

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to