Pman.Dialog.BAdminForgotPassword.bjs
[Pman.BAdmin] / Pman.Dialog.BAdminForgotPassword.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.BAdminForgotPassword= function() {}
8 Roo.apply(Pman.Dialog.BAdminForgotPassword.prototype, {
9
10  _strings : {
11   '6832ac593617c3e5f61c82a20b0d9a3a' :"Enter your email address",
12   '62dd7b9a2b2efd33b8074f88f8356d12' :"Management account recovery",
13   '10ac3d04253ef7e1ddc73e6091c0cd55' :"Next",
14   'c4ca4238a0b923820dcc509a6f75849b' :"1"
15  },
16  _named_strings : {
17   'ok_html' : '10ac3d04253ef7e1ddc73e6091c0cd55' /* Next */ ,
18   'ForgetPassword_value' : 'c4ca4238a0b923820dcc509a6f75849b' /* 1 */ ,
19   'username_fieldLabel' : '6832ac593617c3e5f61c82a20b0d9a3a' /* Enter your email address */ 
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     animate : true,
48     buttonPosition : 'center',
49     cls : 'enable-overflow roo-bootstrap-dialog',
50     title : _this._strings['62dd7b9a2b2efd33b8074f88f8356d12'] /* Management account recovery */,
51     listeners : {
52      show : function (_self)
53       {
54           _this.dialog.el.select('.modal-content', true).first().unmask();
55       }
56     },
57     xns : Roo.bootstrap,
58     '|xns' : 'Roo.bootstrap',
59     buttons : [
60      {
61       xtype : 'Button',
62       html : _this._strings['10ac3d04253ef7e1ddc73e6091c0cd55'] /* Next */,
63       name : 'ok',
64       weight : 'primary',
65       listeners : {
66        click : function (_self, e)
67         {
68             _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
69             _this.form.doAction('submit');
70         }
71       },
72       xns : Roo.bootstrap,
73       '|xns' : 'Roo.bootstrap'
74      }
75     ],
76     items  : [
77      {
78       xtype : 'Row',
79       xns : Roo.bootstrap,
80       '|xns' : 'Roo.bootstrap',
81       items  : [
82        {
83         xtype : 'Container',
84         cls : 'col-md-12',
85         xns : Roo.bootstrap,
86         '|xns' : 'Roo.bootstrap',
87         items  : [
88          {
89           xtype : 'Form',
90           labelAlign : 'top',
91           loadMask : false,
92           method : 'POST',
93           style : 'padding: 10px;',
94           url : baseURL + '/Login',
95           listeners : {
96            actioncomplete : function (_self, action) {
97             
98                 if (action.type == 'setdata') {
99                     
100                     _this.form.clearInvalid();
101                     
102                     return;
103                 }
104                 if (action.type == 'load') {
105                      
106                     return;
107                 }
108                 if (action.type =='submit') {
109                     
110                     _this.dialog.hide();
111                     
112                     if (_this.callback) {
113                         _this.callback.call(_this, action.result);
114                     }
115                     
116                     _this.form.reset();
117                     
118                     return;
119                     
120                 }
121             },
122            actionfailed : function (_self, action) {
123             
124                 Roo.log('action fail?');
125                 Roo.log(action);
126                 
127                 _this.dialog.el.select('.modal-content', true).first().unmask();
128                 
129                 var err = 'Fill in all the required fields';
130                 
131                 if (typeof(action) != 'undefined' && action.failureType == 'server') {
132                     err = action.result.errorMsg;
133                 }
134                 
135                 Roo.bootstrap.MessageBox.alert('Error', err);
136             },
137            render : function (_self) {
138                 _this.form = _self;
139             }
140           },
141           xns : Roo.bootstrap,
142           '|xns' : 'Roo.bootstrap',
143           items  : [
144            {
145             xtype : 'Row',
146             xns : Roo.bootstrap,
147             '|xns' : 'Roo.bootstrap',
148             items  : [
149              {
150               xtype : 'Column',
151               xs : 12,
152               xns : Roo.bootstrap,
153               '|xns' : 'Roo.bootstrap',
154               items  : [
155                {
156                 xtype : 'Input',
157                 allowBlank : false,
158                 fieldLabel : _this._strings['6832ac593617c3e5f61c82a20b0d9a3a'] /* Enter your email address */,
159                 indicatorpos : 'right',
160                 name : 'username',
161                 listeners : {
162                  specialkey : function (_self, e)
163                   {
164                       if(e.getKey() == 13){
165                           _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
166                           _this.form.doAction('submit');
167                       }
168                   }
169                 },
170                 xns : Roo.bootstrap,
171                 '|xns' : 'Roo.bootstrap'
172                }
173               ]
174              }
175             ]
176            },
177            {
178             xtype : 'Input',
179             inputType : 'hidden',
180             name : 'ForgetPassword',
181             value : 1,
182             xns : Roo.bootstrap,
183             '|xns' : 'Roo.bootstrap'
184            }
185           ]
186          }
187         ]
188        }
189       ]
190      }
191     ]
192    }  );
193  }
194 });
195 Roo.apply(Pman.Dialog.BAdminForgotPassword, Pman.Dialog.BAdminForgotPassword.prototype);