PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminAddToGroup.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.BAdminAddToGroup= function() {}
8 Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
9
10  _strings : {
11   '34ec78fcc91ffb1e54cd85e4a0924332' :"add",
12   '05b763f7d24f32575493b3c23f299b0e' :"Add To Group",
13   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
14   'df1eb600b1e8e619756781831c41e346' :"Please select a group",
15   'c9cc8cce247e49bae79f15173ce97354' :"Save"
16  },
17  _named_strings : {
18   'group_id_name_placeholder' : 'df1eb600b1e8e619756781831c41e346' /* Please select a group */ ,
19   '_action_value' : '34ec78fcc91ffb1e54cd85e4a0924332' /* add */ 
20  },
21
22  dialog : false,
23  callback:  false,
24
25  show : function(data, cb)
26  {
27   if (!this.dialog) {
28    this.create();
29   }
30
31   this.callback = cb;
32   this.data = data;
33   this.dialog.show(this.data._el);
34   if (this.form) {
35    this.form.reset();
36    this.form.setValues(data);
37    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
38   }
39
40  },
41
42  create : function()
43  {
44   var _this = this;
45   this.dialog = Roo.factory({
46     xtype : 'Modal',
47     cls : 'enable-overflow',
48     title : _this._strings['05b763f7d24f32575493b3c23f299b0e'] /* Add To Group */,
49     xns : Roo.bootstrap,
50     '|xns' : 'Roo.bootstrap',
51     buttons : [
52      {
53       xtype : 'Button',
54       html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
55       listeners : {
56        click : function (_self, e)
57         {
58             _this.dialog.hide(); 
59         }
60       },
61       xns : Roo.bootstrap,
62       '|xns' : 'Roo.bootstrap'
63      },
64      {
65       xtype : 'Button',
66       html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
67       weight : 'primary',
68       listeners : {
69        click : function (_self, e)
70         {
71             _this.form.doAction("submit");
72         
73             return;
74         }
75       },
76       xns : Roo.bootstrap,
77       '|xns' : 'Roo.bootstrap'
78      }
79     ],
80     items  : [
81      {
82       xtype : 'Form',
83       labelAlign : 'top',
84       url : baseURL + '/Roo/Core_group',
85       listeners : {
86        actioncomplete : function (_self, action)
87         {
88             if(action.type == 'setdata'){
89                 
90                 _this.form.clearInvalid();
91                 
92                 return;
93             }
94            
95             if (action.type == 'load') {
96                 _this.data = action.result.data;
97                 return;
98             }
99             
100             
101             if (action.type == 'submit') {
102             
103                 _this.dialog.hide();
104                
105                 if (_this.callback) {
106                     _this.callback.call(this, action.result.data);
107                 }
108                 
109                 return; 
110             }
111         },
112        actionfailed : function (_self, action)
113         {
114             Roo.log(action);
115             
116             var err = 'Please fill in all the request fields';
117             
118             if (typeof(action) != 'undefined' && (action.failureType == 'server' || action.failureType == 'load')) {    
119                 err = action.result.errorMsg;
120             }
121             
122             Roo.bootstrap.MessageBox.alert('Error', err);
123         
124         },
125        render : function (_self)
126         {
127             _this.form = _self;
128         }
129       },
130       xns : Roo.bootstrap,
131       '|xns' : 'Roo.bootstrap',
132       items  : [
133        {
134         xtype : 'ComboBox',
135         allowBlank : false,
136         alwaysQuery : true,
137         displayField : 'name',
138         editable : false,
139         hiddenName : 'group_id',
140         minChars : 2,
141         name : 'group_id_name',
142         pageSize : 25,
143         placeholder : _this._strings['df1eb600b1e8e619756781831c41e346'] /* Please select a group */,
144         queryParam : 'query[name_starts]',
145         tpl : '<div class=\"roo-select2-result\"><b>{name}</b></div>',
146         triggerAction : 'all',
147         typeAhead : true,
148         valueField : 'id',
149         xns : Roo.bootstrap,
150         '|xns' : 'Roo.bootstrap',
151         store : {
152          xtype : 'Store',
153          remoteSort : true,
154          sortInfo : { field: 'name', direction: 'ASC'},
155          listeners : {
156           beforeload : function (_self, o)
157            {
158                o.params = o.params || {};
159                o.params.type = 0;
160            }
161          },
162          xns : Roo.data,
163          '|xns' : 'Roo.data',
164          proxy : {
165           xtype : 'HttpProxy',
166           method : 'GET',
167           url : baseURL+'/Roo/Core_group',
168           xns : Roo.data,
169           '|xns' : 'Roo.data'
170          },
171          reader : {
172           xtype : 'JsonReader',
173           fields : [
174               {
175                   'name': 'id',
176                   'type': 'int'
177               },
178               {
179                   'name': 'name',
180                   'type': 'string'
181               }
182           ],
183           xns : Roo.data,
184           '|xns' : 'Roo.data'
185          }
186         }
187        },
188        {
189         xtype : 'Input',
190         inputType : 'hidden',
191         name : 'user_ids',
192         xns : Roo.bootstrap,
193         '|xns' : 'Roo.bootstrap'
194        },
195        {
196         xtype : 'Input',
197         inputType : 'hidden',
198         name : '_action',
199         value : _this._strings['34ec78fcc91ffb1e54cd85e4a0924332'] /* add */,
200         xns : Roo.bootstrap,
201         '|xns' : 'Roo.bootstrap'
202        },
203        {
204         xtype : 'Input',
205         inputType : 'hidden',
206         name : 'id',
207         xns : Roo.bootstrap,
208         '|xns' : 'Roo.bootstrap'
209        }
210       ]
211      }
212     ]
213    }  );
214  }
215 });
216 Roo.apply(Pman.Dialog.BAdminAddToGroup, Pman.Dialog.BAdminAddToGroup.prototype);