check what is being written to our log files.
[Pman.Core] / Pman.Tab.GroupsList.js
index bf04588..4f073ae 100644 (file)
@@ -5,7 +5,7 @@
 
 
 Pman.Tab.GroupsList = function(config) {
-    Ext.apply(this, config);
+    Roo.apply(this, config);
 };
 
 Pman.Tab.GroupsList.prototype = {
@@ -18,8 +18,6 @@ Pman.Tab.GroupsList.prototype = {
     disabled : false,
     add : function(parentLayout, region) {
         
-        Roo.log('GroupsList add called!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
-        
         var _this = this;
         
         var refreshPager = function() {
@@ -47,8 +45,8 @@ Pman.Tab.GroupsList.prototype = {
         }
         
         var frm = parentLayout.getRegion(region).getEl().createChild({tag:'div'});
-        //this.grid = new Ext.grid.EditorGrid(frm,  {
-        this.grid = new Ext.grid.Grid(frm,  {
+        //this.grid = new Roo.grid.EditorGrid(frm,  {
+        this.grid = new Roo.grid.Grid(frm,  {
                 id: _this.id + '-groups',
                 
                 //enableDragDrop:true,
@@ -59,16 +57,16 @@ Pman.Tab.GroupsList.prototype = {
                 //    appendOnly : true,
                 //    ddGroup: 'groupDD' 
                 //},
-                ds:   new Ext.data.Store({
+                ds:   new Roo.data.Store({
                     // load using HTTP
                     
                     
-                    proxy: new Ext.data.HttpProxy({
-                        url: baseURL + '/Roo/Groups.html',
+                    proxy: new Roo.data.HttpProxy({
+                        url: baseURL + '/Roo/core_group',
                         method: 'GET'
                     }),
                     remoteSort: true,
-                    reader: Pman.Readers.Groups,
+                    reader: new Roo.data.JsonReader({}, []),
                     sortInfo: {
                         field: 'name', direction: 'ASC'
                     },
@@ -81,6 +79,8 @@ Pman.Tab.GroupsList.prototype = {
                             }
                             o.params.type = _this.type;
                             
+                            o.params._add_everyone = 1;
+                            
                             
                         },
                         load : function()
@@ -97,8 +97,8 @@ Pman.Tab.GroupsList.prototype = {
                     
                     }
                 }),
-                sm: new Ext.grid.RowSelectionModel({ singleSelect: true }),
-                cm: new Ext.grid.ColumnModel(
+                sm: new Roo.grid.RowSelectionModel({ singleSelect: true }),
+                cm: new Roo.grid.ColumnModel(
                     [{
                         id : _this.id + '-name',
                         header : "Name",
@@ -148,19 +148,19 @@ Pman.Tab.GroupsList.prototype = {
                     rowclick: function(g, ri, e)
                     {
                         refreshCenterPanel();
-                    } 
+                    }
                 }
                  
         });
         // add selection changed...
         
-        this.panel  = parentLayout.add(region,  new Ext.GridPanel(this.grid ,
-            { fitToframe: true,fitContainer: true, title: _this.title, id : _this.id, background: true})
+        this.panel  = parentLayout.add(region,  new Roo.GridPanel(this.grid ,
+            { fitToframe: true,fitContainer: true, title: _this.title, id : _this.id, background: false})
         );
         this.grid.render();
         
         
-        new Ext.dd.DropTarget(_this.grid.getView().mainBody, {  
+        new Roo.dd.DropTarget(_this.grid.getView().mainBody, {  
             ddGroup : 'groupDD',  
             copy       : true,
 
@@ -226,7 +226,7 @@ Pman.Tab.GroupsList.prototype = {
                 }
                 
                 new Pman.Request({
-                    url: baseURL + '/Core/GroupMembers.php',
+                    url: baseURL + '/Core/GroupMembers', // not a dataobject...
                     params: {
                         action : action,
                         group_id: action =='add' ? rid.id : s[0].data.id,
@@ -240,7 +240,7 @@ Pman.Tab.GroupsList.prototype = {
                     }, 
                     
                     failure: function() {
-                        //Ext.get(document.body).unmask();
+                        //Roo.get(document.body).unmask();
                         //if (cb) {
                         //    cb.call(false);
                         //}
@@ -262,7 +262,7 @@ Pman.Tab.GroupsList.prototype = {
         /*
         var gridFoot = this.grid.getView().getFooterPanel(true);
         
-        this.paging = new Ext.PagingToolbar(gridFoot, this.grid.getDataSource(), {
+        this.paging = new Roo.PagingToolbar(gridFoot, this.grid.getDataSource(), {
             pageSize: 25,
             displayInfo: true,
             displayMsg: '',
@@ -272,7 +272,7 @@ Pman.Tab.GroupsList.prototype = {
         var grid = this.grid;
  
         var gridHead = this.grid.getView().getHeaderPanel(true);
-        this.toolbar = new Ext.Toolbar(gridHead);
+        this.toolbar = new Roo.Toolbar(gridHead);
           
  
         var _dialog= this.getDialog();
@@ -280,14 +280,14 @@ Pman.Tab.GroupsList.prototype = {
             
             text: "Manage Groups",
             cls: 'x-btn-text-icon',
-            icon: Ext.rootURL + 'images/default/tree/leaf.gif',
+            icon: Roo.rootURL + 'images/default/tree/leaf.gif',
             menu : {
                 items : [
                     
                     {
                         text: "Add",
                          cls: 'x-btn-text-icon',
-                        icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
+                        icon: Roo.rootURL + 'images/default/dd/drop-add.gif',
                         hidden : !Pman.hasPerm('Core.Groups', 'A'),
                         handler : function(){
                             _dialog.show( { id : 0, type: _this.type }, refreshPager ); 
@@ -296,20 +296,20 @@ Pman.Tab.GroupsList.prototype = {
                     {
                         text: "Edit",
                         cls: 'x-btn-text-icon',
-                        icon: Ext.rootURL + 'images/default/tree/leaf.gif',
+                        icon: Roo.rootURL + 'images/default/tree/leaf.gif',
                         hidden : !Pman.hasPerm('Core.Groups', 'E'),
                         handler : function() {
                             var s = grid.getSelectionModel().getSelections();
                             if (!s.length || (s.length > 1))  {
-                                Ext.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
+                                Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
                                 return;
                             }
                             if ((s[0].data.name == 'Administrators') ||(s[0].data.name == 'Default')) {
-                                Ext.MessageBox.alert("Error", "You can not rename that group");
+                                Roo.MessageBox.alert("Error", "You can not rename that group");
                                 return;
                             }
                             if (s[0].data.id < 1) {
-                                Ext.MessageBox.alert("Error", "You can not rename that group");
+                                Roo.MessageBox.alert("Error", "You can not rename that group");
                                 return;
                             }
                             _dialog.show(s[0].data, refreshPager); 
@@ -327,13 +327,13 @@ Pman.Tab.GroupsList.prototype = {
                             for(var i = 0; i < s.length; i++) {
                                 
                                 if ((s[i].data.id < 1) || (s[i].data.name == 'Administrators')) {
-                                    Ext.MessageBox.alert("Error", "You can not delete that group");
+                                    Roo.MessageBox.alert("Error", "You can not delete that group");
                                     return;
                                 }
                             }
                             
                             
-                            Pman.genericDelete(_this, 'Groups'); 
+                            Pman.genericDelete(_this, 'core_group'); 
                         } 
                     } , '-',
                       {