1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.AdminContactsGroupRight = new Roo.XComponent({
6 part : ["Admin","ContactsGroupRight"],
7 order : '001-Pman.Tab.AdminContactsGroupRight',
9 parent : 'Pman.Tab.AdminContactsManager',
10 name : "unnamed module",
21 activate : function() {
24 _this.grid.footer.onClick('first');
43 _this.dialog = Pman.Dialog.PersonEdit;
46 //_this.dialog = Pman.Dialog.FILL_IN
47 if (_this.panel.active) {
48 this.footer.onClick('first');
51 rowdblclick : function (_self, rowIndex, e)
53 if (!_this.dialog) return;
54 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
55 _this.grid.footer.onClick('first');
58 cellclick : function (_self, rowIndex, columnIndex, e)
60 _this.dataUpdate = typeof(_this.dataUpdate) =='undefined' ? {} : _this.dataUpdate;
62 var di = this.colModel.getDataIndex(columnIndex);
63 var i = di.split('_').shift();
64 var k = di.split('_').pop();
65 if (i != 'accessmask') {
68 var rec = _this.grid.ds.getAt(rowIndex);
70 var fm = rec.data.FullMask.split('');
71 Roo.each(fm, function(e){
72 rec.set(i+'_'+e, rec.data[i+'_'+k] ? 0 : 1);
75 rec.set(i+'_'+k, rec.data[i+'_'+k] ? 0 : 1);
76 //rec.data.accessmask = rec.data.accessmask + rec
78 _this.dataUpdate[rec.data.id] = rec.data.accessmask;
92 beforeload : function (_self, o)
97 var s = Pman.Tab.AdminContactsGroup.grid.getSelectionModel().getSelections();
99 o.params.group_id = -1;
101 o.params.group_id = s[0].data.id;
103 if (o.params.group_id < 0) {
104 _this.grid.getView().el.mask("You can not set permissions for that group");
107 _this.grid.getView().el.unmask();
111 update : function (_self, record, operation)
113 if (operation != 'commit') {
116 // only used to change active status.
119 url : baseURL + '/Roo/GroupRights.php',
123 active: record.data.active
126 success : function() {
129 _this.grid.ds.remove(record);
134 Roo.MessageBox.alert("Error", "saving failed", function() {
135 _this.grid.footer.onClick('first');
140 load : function (_self, records, options)
142 Roo.each(records, function(e){
143 var k = e.data.accessmask.split('');
144 Roo.each(k, function(ee){
145 e.set('accessmask_'+ee, 1);
147 if(e.data.accessmask == e.data.FullMask){
148 e.set('accessmask_AA', 1);
154 sortInfo : { field : 'id', direction: 'ASC' },
159 url : baseURL + '/Admin/GroupRights.php'
166 totalProperty : 'total',
181 'name': 'accessmask',
196 xtype: 'PagingToolbar',
200 displayMsg : "Displaying Person{0} - {1} of {2}",
201 emptyMsg : "No Person found",
206 text : "Drag person to add or remove from group"
218 click : function (_self, e)
222 url : baseURL + '/GroupRights.php',
225 dataUpdate : _this.dataUpdate,
226 dataAdd : _this.dataAdd
228 success : function() {
231 //_this.grid.ds.remove(record);
236 Roo.MessageBox.alert("Error", "saving failed", function() {
237 _this.grid.footer.onClick('first');
249 xtype: 'ColumnModel',
251 dataIndex : 'accessmask_AA',
255 renderer : function(v,x,r) {
257 var state = v> 0 ? '-checked' : '';
259 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
263 xtype: 'ColumnModel',
265 dataIndex : 'rightname',
269 renderer : function(v,x,r) {
273 return String.format('<span qtip="{1}">{0}</span>', v.split('.').shift(), v);
277 xtype: 'ColumnModel',
279 dataIndex : 'descript',
280 header : 'Permission',
283 renderer : function(v,x,r)
285 if (r.json.descript && r.json.descript.length) {
286 return String.format('{0}',r.json.descript);
293 xtype: 'ColumnModel',
295 dataIndex : 'accessmask_A',
298 renderer : function(v) {
299 var state = v> 0 ? '-checked' : '';
301 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
306 xtype: 'ColumnModel',
308 dataIndex : 'accessmask_E',
311 renderer : function(v) {
312 var state = v> 0 ? '-checked' : '';
314 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
319 xtype: 'ColumnModel',
321 dataIndex : 'accessmask_D',
324 renderer : function(v) {
325 var state = v> 0 ? '-checked' : '';
327 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
332 xtype: 'ColumnModel',
334 dataIndex : 'accessmask_S',
335 header : 'List/View',
337 renderer : function(v) {
338 var state = v> 0 ? '-checked' : '';
340 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
345 xtype: 'ColumnModel',
347 dataIndex : 'accessmask_P',
348 header : 'Print/Export',
350 renderer : function(v,x,r) {
352 var state = v> 0 ? '-checked' : '';
354 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';