1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.BAdminStaffGroups= function() {}
8 Roo.apply(Pman.Dialog.BAdminStaffGroups.prototype, {
11 '4910043d0b2c8c864a0e8672716fee94' :"Is a Member",
12 '566a352f95c879ff26e50bad767a28dc' :"Group Membership",
13 '6b79852e4370cae80ee551e0671616bb' :"Manage Users Group",
14 '28974c2c793e780427dfb571b26443e6' :"Group Name",
15 'd3d2e617335f08df83599665eef8a418' :"Close"
21 show : function(data, cb)
29 this.dialog.show.apply(this.dialog, Array.prototype.slice.call(arguments).slice(2));
32 this.form.setValues(data);
33 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
41 this.dialog = Roo.factory({
46 title : _this._strings['6b79852e4370cae80ee551e0671616bb'] /* Manage Users Group */,
48 render : function (_self)
52 show : function (_self)
54 this.setTitle("Manage Membership for " + _this.data.name);
55 if(_this.option_grid){
56 _this.option_grid.store.load({});
61 '|xns' : 'Roo.bootstrap',
65 html : _this._strings['d3d2e617335f08df83599665eef8a418'] /* Close */,
68 click : function (_self, e)
78 '|xns' : 'Roo.bootstrap'
85 render : function (_self)
90 xns : Roo.bootstrap.layout,
91 '|xns' : 'Roo.bootstrap.layout',
94 xns : Roo.bootstrap.layout,
95 '|xns' : 'Roo.bootstrap.layout'
104 title : _this._strings['566a352f95c879ff26e50bad767a28dc'] /* Group Membership */,
106 activate : function (_self)
111 render : function (_self)
113 _this.option_panel = this;
118 xns : Roo.bootstrap.panel,
119 '|xns' : 'Roo.bootstrap.panel',
122 cellSelection : true,
127 rowSelection : false,
129 cellclick : function (_self, el, rowIndex, columnIndex, e)
131 var di = _this.option_grid.colModel.getDataIndex(columnIndex);
134 if (di != 'is_in_group') {
138 var rec = _this.option_grid.store.getAt(rowIndex);
140 if(rec.data.name == 'Administrators' && _this.data.id == Pman.Login.authUser.id){
141 Roo.bootstrap.MessageBox.alert('Error', 'You can not remove yourself from Administrators group');
145 rec.set('is_in_group', rec.data.is_in_group * 1 == 1 ? 0 : 1);
149 render : function (_self)
151 _this.option_grid = this;
157 '|xns' : 'Roo.bootstrap',
161 sortInfo : { direction : 'ASC', field: 'display_name' },
163 beforeload : function (_self, options)
165 options.params = options.params || {};
167 if(_this.data.id * 1 < 1){
168 _this.option_grid.el.mask('Please save the member first');
172 options.params.limit = 200;
173 options.params._is_in_group = _this.data.id;
176 update : function (_self, record, operation)
178 if (operation != 'commit') {
183 user_ids : _this.data.id,
184 _action : (record.data.is_in_group * 1 == 0) ? 'sub' : 'add',
185 group_id : record.data.id
189 url : baseURL + '/Roo/Core_group',
192 success : function() {
193 //_this.option_grid.ds.load({});
203 url : baseURL + '/Roo/core_group',
208 xtype : 'JsonReader',
219 'name': 'display_name',
223 'name': 'is_in_group',
234 xtype : 'RowSelectionModel',
236 xns : Roo.bootstrap.Table,
237 '|xns' : 'Roo.bootstrap.Table'
241 xtype : 'ColumnModel',
244 dataIndex : 'is_in_group',
245 header : _this._strings['4910043d0b2c8c864a0e8672716fee94'] /* Is a Member */,
246 renderer : function(v) {
248 var state = v > 0 ? 'check-' : '';
249 var cls = v > 0 ? 'text-primary' : '';
251 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
260 xtype : 'ColumnModel',
262 dataIndex : 'display_name',
263 header : _this._strings['28974c2c793e780427dfb571b26443e6'] /* Group Name */,
264 renderer : function(v,x,r)
266 var vv = v.length ? v : r.data.name;
268 return String.format('{0}', vv);
284 Roo.apply(Pman.Dialog.BAdminStaffGroups, Pman.Dialog.BAdminStaffGroups.prototype);