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.BAdminGroups= function() {}
8 Roo.apply(Pman.Dialog.BAdminGroups.prototype, {
11 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
12 'a0f852ef8bfccd86a0e7217d7959e3e8' :"Add / Edit User",
13 '49ee3087348e8d44e1feda1917443987' :"Name",
14 'c9cc8cce247e49bae79f15173ce97354' :"Save"
20 show : function(data, cb)
28 this.dialog.show(this.data._el);
31 this.form.setValues(data);
32 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
40 this.dialog = Roo.factory({
42 title : _this._strings['a0f852ef8bfccd86a0e7217d7959e3e8'] /* Add / Edit User */,
44 render : function (_self)
50 '|xns' : 'Roo.bootstrap',
54 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
56 click : function (_self, e)
62 '|xns' : 'Roo.bootstrap'
66 html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
69 click : function (_self, e)
71 if(!_this.form.isValid()){
72 Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');
76 var myID = _this.form.findField('id').getValue() * 1;
77 var myName = _this.form.findField('name').getValue();
79 if (_this.form.findField('company_id') && !_this.form.findField('company_id').getValue()) {
80 Roo.bootstrap.MessageBox.alert("Error", "Select a Company");
84 // validate password match (only needed if we are not using generated one..
85 if (_this.form.findField('passwd1')
86 && _this.form.findField('passwd1').getValue().length > 0
87 && _this.form.findField('passwd1').inputEl().dom.type == "password") {
89 var p1 = _this.form.findField('passwd1').getValue();
90 var p2 = _this.form.findField('passwd2').getValue();
93 if (Pman.Login.authUser.id < 0 && !p1.length) {
94 Roo.bootstrap.MessageBox.alert("Error", "You must create a password for the admin account");
99 if (p1.length || p2.length) {
101 Roo.bootstrap.MessageBox.alert("Error", "Passwords do not match");
108 _this.form.doAction("submit");
116 '|xns' : 'Roo.bootstrap'
123 url : baseURL + '/Roo/Core_group',
125 actioncomplete : function (_self, action)
127 if(action.type == 'setdata'){
129 if(_this.data.id * 1 > 0) {
130 this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
136 if (action.type == 'load') {
137 _this.data = action.result.data;
142 if (action.type == 'submit') {
146 if (_this.callback) {
147 _this.callback.call(this, action.result.data);
153 actionfailed : function (_self, action)
156 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
158 render : function (_self)
164 '|xns' : 'Roo.bootstrap',
169 placeholder : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
171 '|xns' : 'Roo.bootstrap'
175 inputType : 'hidden',
178 '|xns' : 'Roo.bootstrap'
186 Roo.apply(Pman.Dialog.BAdminGroups, Pman.Dialog.BAdminGroups.prototype);