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.BAdminAddToGroup= function() {}
8 Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
11 '05b763f7d24f32575493b3c23f299b0e' :"Add To Group",
12 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
13 'c9cc8cce247e49bae79f15173ce97354' :"Save"
19 show : function(data, cb)
27 this.dialog.show(this.data._el);
30 this.form.setValues(data);
31 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
39 this.dialog = Roo.factory({
41 cls : 'enable-overflow',
42 title : _this._strings['05b763f7d24f32575493b3c23f299b0e'] /* Add To Group */,
44 '|xns' : 'Roo.bootstrap',
48 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
50 click : function (_self, e)
56 '|xns' : 'Roo.bootstrap'
60 html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
63 click : function (_self, e)
65 if(!_this.form.isValid()){
66 Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');
70 var myID = _this.form.findField('id').getValue() * 1;
71 var myName = _this.form.findField('name').getValue();
73 if (_this.form.findField('company_id') && !_this.form.findField('company_id').getValue()) {
74 Roo.bootstrap.MessageBox.alert("Error", "Select a Company");
78 // validate password match (only needed if we are not using generated one..
79 if (_this.form.findField('passwd1')
80 && _this.form.findField('passwd1').getValue().length > 0
81 && _this.form.findField('passwd1').inputEl().dom.type == "password") {
83 var p1 = _this.form.findField('passwd1').getValue();
84 var p2 = _this.form.findField('passwd2').getValue();
87 if (Pman.Login.authUser.id < 0 && !p1.length) {
88 Roo.bootstrap.MessageBox.alert("Error", "You must create a password for the admin account");
93 if (p1.length || p2.length) {
95 Roo.bootstrap.MessageBox.alert("Error", "Passwords do not match");
102 _this.form.doAction("submit");
110 '|xns' : 'Roo.bootstrap'
117 url : baseURL + '/Roo/Core_group_member',
119 actioncomplete : function (_self, action)
121 if(action.type == 'setdata'){
123 if(_this.data.id * 1 > 0) {
124 this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
130 if (action.type == 'load') {
131 _this.data = action.result.data;
136 if (action.type == 'submit') {
140 if (_this.callback) {
141 _this.callback.call(this, action.result.data);
147 actionfailed : function (_self, action)
150 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
152 render : function (_self)
158 '|xns' : 'Roo.bootstrap',
162 inputType : 'hidden',
165 '|xns' : 'Roo.bootstrap'
173 Roo.apply(Pman.Dialog.BAdminAddToGroup, Pman.Dialog.BAdminAddToGroup.prototype);