X-Git-Url: http://git.roojs.org/?p=Pman.Admin;a=blobdiff_plain;f=Pman.Tab.AdminContactsGroup.js;h=c248e6115b7dda2a1d25f9b386ea790531d5b160;hp=bfe914a3fd5db637639c7974d299887227fea4bf;hb=HEAD;hpb=bc1b6c8a4b0ff50a99eb5baf476ef06b7c8c7a59 diff --git a/Pman.Tab.AdminContactsGroup.js b/Pman.Tab.AdminContactsGroup.js index bfe914a..c248e61 100644 --- a/Pman.Tab.AdminContactsGroup.js +++ b/Pman.Tab.AdminContactsGroup.js @@ -23,20 +23,18 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ name : "Pman.Tab.AdminContactsGroup", disabled : false, permname : '', - _tree : function() + _tree : function(_data) { var _this = this; var MODULE = this; return { + xtype : 'GridPanel', background : true, fitContainer : true, fitToframe : true, region : 'west', - tableName : 'Groups', + tableName : 'core_group', title : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */, - xns : Roo, - '|xns' : 'Roo', - xtype : 'GridPanel', listeners : { activate : function() { _this.panel = this; @@ -45,14 +43,14 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ } } }, + xns : Roo, + '|xns' : 'Roo', grid : { + xtype : 'Grid', autoExpandColumn : 'name', ddGroup : 'groupDD', enableDrop : true, loadMask : true, - xns : Roo.grid, - '|xns' : 'Roo.grid', - xtype : 'Grid', listeners : { render : function() { @@ -64,7 +62,9 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ }, rowdblclick : function (_self, rowIndex, e) { - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } var s = this.getDataSource().getAt(rowIndex); if (s.data.id < 1 ) { return; @@ -74,45 +74,47 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ }); } }, + xns : Roo.grid, + '|xns' : 'Roo.grid', toolbar : { + xtype : 'Toolbar', xns : Roo, '|xns' : 'Roo', - xtype : 'Toolbar', items : [ { + xtype : 'Button', text : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */, xns : Roo.Toolbar, '|xns' : 'Roo.Toolbar', - xtype : 'Button', menu : { + xtype : 'Menu', xns : Roo.menu, '|xns' : 'Roo.menu', - xtype : 'Menu', items : [ { + xtype : 'Item', cls : 'x-btn-text-icon', icon : Roo.rootURL + 'images/default/dd/drop-add.gif', text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */, - xns : Roo.menu, - '|xns' : 'Roo.menu', - xtype : 'Item', listeners : { click : function() { - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } _this.dialog.show( { id : 0, type: 2 } , function() { _this.grid.ds.load({}); }); } - } + }, + xns : Roo.menu, + '|xns' : 'Roo.menu' }, { + xtype : 'Item', cls : 'x-btn-text-icon', icon : Roo.rootURL + 'images/default/tree/leaf.gif', text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */, - xns : Roo.menu, - '|xns' : 'Roo.menu', - xtype : 'Item', listeners : { click : function() { @@ -124,44 +126,48 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ if (s[0].data.id < 1 ) { return; } - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } _this.dialog.show(s[0].data, function() { _this.grid.ds.load({}); }); } - } + }, + xns : Roo.menu, + '|xns' : 'Roo.menu' }, { + xtype : 'Item', cls : 'x-btn-text-icon', icon : rootURL + '/Pman/templates/images/trash.gif', text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */, - xns : Roo.menu, - '|xns' : 'Roo.menu', - xtype : 'Item', listeners : { click : function() { - Pman.genericDelete(_this, 'Groups'); + Pman.genericDelete(_this, 'core_group'); } - } + }, + xns : Roo.menu, + '|xns' : 'Roo.menu' }, { + xtype : 'Separator', xns : Roo.menu, - '|xns' : 'Roo.menu', - xtype : 'Separator' + '|xns' : 'Roo.menu' }, { - text : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */, - xns : Roo.menu, - '|xns' : 'Roo.menu', xtype : 'Item', + text : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */, listeners : { click : function (_self, e) { _this.grid.ds.load({}); } - } + }, + xns : Roo.menu, + '|xns' : 'Roo.menu' } ] } @@ -169,16 +175,17 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ ] }, dataSource : { + xtype : 'Store', remoteSort : true, sortInfo : { field : 'name', direction: 'ASC' }, - xns : Roo.data, - '|xns' : 'Roo.data', - xtype : 'Store', listeners : { beforeload : function (_self, o) { o.params = o.params || {}; + o.params.type =2; + + o.params._add_everyone = 1; }, load : function (_self, records, options) { @@ -189,14 +196,17 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ Pman.Tab.AdminContacts.grid.footer.onClick('first'); } }, + xns : Roo.data, + '|xns' : 'Roo.data', proxy : { + xtype : 'HttpProxy', method : 'GET', - url : baseURL + '/Roo/Groups.php', + url : baseURL + '/Roo/core_group', xns : Roo.data, - '|xns' : 'Roo.data', - xtype : 'HttpProxy' + '|xns' : 'Roo.data' }, reader : { + xtype : 'JsonReader', fields : [ { 'name': 'id', @@ -283,15 +293,12 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ root : 'data', totalProperty : 'total', xns : Roo.data, - '|xns' : 'Roo.data', - xtype : 'JsonReader' + '|xns' : 'Roo.data' } }, dropTarget : { - ddGroup : 'groupDD', - xns : Roo.dd, - '|xns' : 'Roo.dd', xtype : 'DropTarget', + ddGroup : 'groupDD', listeners : { drop : function (source, e, data) { @@ -405,13 +412,13 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ // Roo.log('add'); //} } - } + }, + xns : Roo.dd, + '|xns' : 'Roo.dd' }, sm : { - singleSelect : true, - xns : Roo.grid, - '|xns' : 'Roo.grid', xtype : 'RowSelectionModel', + singleSelect : true, listeners : { afterselectionchange : function (_self) { @@ -420,10 +427,13 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ c.getActivePanel().grid.footer.onClick('first'); } - } + }, + xns : Roo.grid, + '|xns' : 'Roo.grid' }, colModel : [ { + xtype : 'ColumnModel', dataIndex : 'name', header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */, renderer : function(v,x,r) { @@ -450,8 +460,7 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ }, width : 200, xns : Roo.grid, - '|xns' : 'Roo.grid', - xtype : 'ColumnModel' + '|xns' : 'Roo.grid' } ] }