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