2 "name" : "Pman.Dialog.BAdminStaff",
5 "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminStaff.bjs",
9 "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
10 "566a352f95c879ff26e50bad767a28dc" : "Group Membership",
11 "4910043d0b2c8c864a0e8672716fee94" : "Is a Member",
12 "a60cdd3642fbe81545a3b93fe2b19dd6" : "Two-Factor Authentication",
13 "28974c2c793e780427dfb571b26443e6" : "Group Name",
14 "bcc254b55c4a1babdf1dcb82c207506b" : "Phone",
15 "a6b81fd617c4f1b94f83049793cac3cd" : "Show QR Code",
16 "a0f852ef8bfccd86a0e7217d7959e3e8" : "Add / Edit User",
17 "3ec365dd533ddb7ef3d1c111186ce872" : "Details",
18 "0bfe42db3eb05bf39f03812166391939" : "Use Secure Passwords",
19 "ea4788705e6873b424c65e91c2846b19" : "Cancel",
20 "73b00356c62eb391f571b6468be7c372" : "Generate QR Code",
21 "6f958ddaf50fd5ade7858ef1d1a63e51" : "Type again to confirm",
22 "49ee3087348e8d44e1feda1917443987" : "Name",
23 "bbbabdbe1b262f75d99d62880b953be1" : "Role",
24 "1960f813085537c64f981132e34181ca" : "Delete QR Code",
25 "c9cc8cce247e49bae79f15173ce97354" : "Save",
26 "828e70f83623b262e14187c039df99c0" : "Enable Two-Factor Authentication",
27 "acf45fd8829f809b29c601a3a193804f" : "Set / Change Password",
28 "01028205a11cf95a503c4c1d005989da" : "Generate One"
31 "email_placeholder" : "ce8ae9da5b7cd6c3df2929543a9af92d",
32 "secure_passwords_boxLabel" : "0bfe42db3eb05bf39f03812166391939",
33 "name_placeholder" : "49ee3087348e8d44e1feda1917443987",
34 "role_fieldLabel" : "bbbabdbe1b262f75d99d62880b953be1",
35 "name_fieldLabel" : "49ee3087348e8d44e1feda1917443987",
36 "role_placeholder" : "bbbabdbe1b262f75d99d62880b953be1",
37 "phone_fieldLabel" : "bcc254b55c4a1babdf1dcb82c207506b",
38 "_enable_oath_key_boxLabel" : "828e70f83623b262e14187c039df99c0",
39 "email_fieldLabel" : "ce8ae9da5b7cd6c3df2929543a9af92d",
40 "passwd2_placeholder" : "6f958ddaf50fd5ade7858ef1d1a63e51"
45 "show" : "function (_self)\n{\n \n}",
46 "render" : "function (_self)\n{\n\n}"
48 "String cls" : "add-user-dialog",
50 "int max_width" : 650,
51 "$ xns" : "Roo.bootstrap",
52 "String title" : "Add / Edit User",
56 "render" : "function (_self)\n{\n _this.layout = _self;\n}"
59 "$ xns" : "Roo.bootstrap.layout",
62 "alwaysShowTabs" : true,
63 "String tabPosition" : "top",
65 "$ xns" : "Roo.bootstrap.layout",
70 "activate" : "function (_self)\n{\n /*var url = 'about:blank';\n \n if(_this.data.id * 1 > 0){\n url = baseURL + '/Coba/Report/ApplicationSummary/' + _this.data.id;\n }\n \n _this.app_summary_frame.el.dom.src = url;*/\n \n}",
71 "render" : "function (_self)\n{\n _this.detail_tab = _self;\n}"
74 "Boolean fitContainer" : true,
76 "Boolean fitToFrame" : true,
77 "$ xns" : "Roo.bootstrap.panel",
78 "String region" : "center",
79 "String title" : "Details",
80 "Boolean autoScroll" : true,
81 "Boolean background" : false,
84 "String cls" : "col-md-12",
85 "xtype" : "Container",
86 "$ xns" : "Roo.bootstrap",
90 "actioncomplete" : "function (_self, action)\n{\n if(action.type == 'setdata'){\n \n _this.dialog.setTitle(\"Add / Edit User\");\n _this.form.findField('role').setDisabled(false);\n \n /*\n * Use for init -- Call from Pman.Login.js\n */\n if(typeof(_this.data.role) != 'undefined' && _this.data.role == 'Administrators') {\n _this.dialog.setTitle(\"Create Adminstrator\");\n _this.form.findField('role').setDisabled(true);\n }\n \n _this.form.findField('passwd1').el.select('input',true).first().dom.type=\"password\";\n _this.form.findField('passwd2').show();\n _this.passwordbox.collapse();\n \n _this.qrCodeBox.collapse();\n _this.qrCodeBox.el.hide();\n _this.form.findField('_enable_oath_key').setValue(1);\n _this.form.findField('_enable_oath_key').el.show();\n \n _this.generate_qrcode_btn.el.hide();\n _this.delete_qrcode_btn.el.hide();\n _this.show_qrcode_btn.el.hide();\n \n if(_this.data.id * 1 > 0) {\n this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});\n }\n \n this.clearInvalid();\n \n return;\n }\n \n if (action.type == 'load') {\n \n _this.data = action.result.data;\n \n _this.qrCodeBox.el.show();\n _this.form.findField('_enable_oath_key').setValue(0);\n _this.form.findField('_enable_oath_key').el.hide();\n \n _this.generate_qrcode_btn.el.show();\n _this.delete_qrcode_btn.el.hide();\n _this.show_qrcode_btn.el.hide();\n \n _this.qrCodeBox.collapse();\n \n if(_this.data.length_oath_key * 1 > 0){\n _this.delete_qrcode_btn.el.show();\n _this.show_qrcode_btn.el.show();\n _this.qrCodeBox.expand();\n }\n \n return;\n }\n \n if (action.type == 'submit') { // only submitted here if we are \n \n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(this, action.result.data);\n }\n \n return;\n \n }\n}",
91 "render" : "function (_self)\n{\n _this.form = _self;\n \n}"
93 "$ url" : "baseURL + '/Roo/core_person' ",
95 "style" : "margin-top: 20px;",
96 "String labelAlign" : "top",
97 "$ xns" : "Roo.bootstrap",
98 "string errorMask" : true,
102 "$ xns" : "Roo.bootstrap",
107 "$ xns" : "Roo.bootstrap",
110 "Boolean allowBlank" : false,
111 "String name" : "name",
113 "string placeholder" : "Name",
114 "String labelAlign" : "left",
115 "string fieldLabel" : "Name",
116 "$ xns" : "Roo.bootstrap"
124 "$ xns" : "Roo.bootstrap",
129 "$ xns" : "Roo.bootstrap",
132 "String name" : "role",
134 "string placeholder" : "Role",
135 "string fieldLabel" : "Role",
136 "String labelAlign" : "left",
137 "$ xns" : "Roo.bootstrap"
145 "$ xns" : "Roo.bootstrap",
150 "$ xns" : "Roo.bootstrap",
153 "Boolean allowBlank" : false,
154 "String name" : "email",
157 "string placeholder" : "Email",
158 "String labelAlign" : "left",
159 "string fieldLabel" : "Email",
160 "$ xns" : "Roo.bootstrap"
168 "$ xns" : "Roo.bootstrap",
173 "$ xns" : "Roo.bootstrap",
176 "String name" : "phone",
178 "string fieldLabel" : "Phone",
179 "String labelAlign" : "left",
180 "$ xns" : "Roo.bootstrap"
188 "$ xns" : "Roo.bootstrap",
193 "$ xns" : "Roo.bootstrap",
197 "render" : "function (_self)\n{\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}"
199 "String name" : "_enable_oath_key",
200 "Boolean checked" : true,
201 "xtype" : "CheckBox",
202 "String boxLabel" : "Enable Two-Factor Authentication",
203 "$ xns" : "Roo.bootstrap"
211 "$ xns" : "Roo.bootstrap",
216 "$ xns" : "Roo.bootstrap",
220 "render" : "function (_self)\n{\n _this.passwordbox = this;\n}"
222 "String header" : "Set / Change Password",
223 "Boolean expanded" : false,
224 "xtype" : "Container",
225 "String panel" : "primary",
226 "$ xns" : "Roo.bootstrap",
227 "Boolean expandable" : true,
231 "$ xns" : "Roo.bootstrap",
236 "$ xns" : "Roo.bootstrap",
239 "String name" : "passwd1",
241 "String inputType" : "password",
242 "$ xns" : "Roo.bootstrap"
249 "$ xns" : "Roo.bootstrap",
253 "click" : "function (_self, e)\n{\n var pw = Math.random().toString(36).slice(-12);\n _this.form.findField('passwd1').el.select('input',true).first().dom.type=\"input\";\n _this.form.findField('passwd1').setValue(pw);\n _this.form.findField('passwd2').hide();\n \n \n}"
256 "$ xns" : "Roo.bootstrap",
257 "String html" : "Generate One",
258 "String style" : "width:100%"
265 "String name" : "passwd2",
267 "string placeholder" : "Type again to confirm",
268 "String inputType" : "password",
269 "$ xns" : "Roo.bootstrap"
272 "String name" : "secure_passwords",
273 "xtype" : "CheckBox",
274 "String boxLabel" : "Use Secure Passwords",
275 "$ xns" : "Roo.bootstrap"
285 "$ xns" : "Roo.bootstrap",
290 "$ xns" : "Roo.bootstrap",
294 "render" : "function (_self)\n{\n _this.qrCodeBox = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}"
296 "String header" : "Two-Factor Authentication",
297 "Boolean expanded" : false,
298 "xtype" : "Container",
299 "String panel" : "primary",
300 "$ xns" : "Roo.bootstrap",
301 "Boolean expandable" : true,
305 "$ xns" : "Roo.bootstrap",
310 "$ xns" : "Roo.bootstrap",
314 "render" : "function (_self)\n{\n _this.generate_qrcode_btn = this;\n\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
315 "click" : "function (_self, e)\n{\n if(_this.data.id * 1 < 1){\n Roo.bootstrap.MessageBox.alert('Error', 'Please save the user first');\n return;\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/Core_person.php',\n method : 'POST',\n mask : 'Loading...',\n params : {\n id : _this.data.id,\n _generate_oath_key : 1\n }, \n success : function(res) {\n _this.delete_qrcode_btn.el.show();\n _this.show_qrcode_btn.el.show();\n \n Pman.Dialog.BAdminStaffTwoFactorQRCode.show({\n id : _this.data.id\n });\n \n return;\n }\n });\n}"
318 "$ xns" : "Roo.bootstrap",
319 "String html" : "Generate QR Code",
320 "String style" : "width:100%"
327 "$ xns" : "Roo.bootstrap",
331 "render" : "function (_self)\n{\n _this.delete_qrcode_btn = this;\n\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
332 "click" : "function (_self, e)\n{\n if(_this.data.id * 1 < 1){\n Roo.bootstrap.MessageBox.alert('Error', 'Please save the user first');\n return;\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/Core_person.php',\n method : 'POST',\n mask : 'Loading...',\n params : {\n id : _this.data.id,\n oath_key : ''\n }, \n success : function(res) {\n _this.delete_qrcode_btn.el.hide();\n _this.show_qrcode_btn.el.hide();\n \n return;\n }\n });\n}"
335 "$ xns" : "Roo.bootstrap",
336 "String html" : "Delete QR Code",
337 "String style" : "width:100%"
344 "$ xns" : "Roo.bootstrap",
348 "render" : "function (_self)\n{\n _this.show_qrcode_btn = this;\n\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
349 "click" : "function (_self, e)\n{\n if(_this.data.id * 1 < 1){\n Roo.bootstrap.MessageBox.alert('Error', 'Please save the user first');\n return;\n }\n \n Pman.Dialog.BAdminStaffTwoFactorQRCode.show({\n id : _this.data.id\n });\n}"
352 "$ xns" : "Roo.bootstrap",
353 "String html" : "Show QR Code",
354 "String style" : "width:100%"
368 "render" : "function (_self)\n{\n _this.userID = _self;\n}"
370 "String name" : "id",
372 "String labelAlign" : "left",
373 "String inputType" : "hidden",
374 "$ xns" : "Roo.bootstrap"
377 "String name" : "company_id",
379 "String inputType" : "hidden",
380 "$ xns" : "Roo.bootstrap"
390 "activate" : "function (_self)\n{\n if(_this.option_grid){\n _this.option_grid.store.load({});\n }\n \n}",
391 "render" : "function (_self)\n{\n _this.option_panel = this;\n \n \n}"
395 "String region" : "center",
396 "$ xns" : "Roo.bootstrap.panel",
397 "fitContainer" : true,
398 "String title" : "Group Membership",
399 "Boolean background" : true,
403 "cellclick" : "function (_self, el, rowIndex, columnIndex, e)\n{\n var di = _this.member_grid.colModel.getDataIndex(columnIndex);\n \n if (di != 'active') {\n return;\n }\n \n var rec = _this.member_grid.store.getAt(rowIndex);\n \n rec.set('active', rec.data.active ? 0 : 1);\n rec.commit();\n\n \n // get the row number to make class x-row-0, x-row-1\n \n if(rec.data.active * 1 != 1){\n var el = _this.member_grid.getRowDom(rowIndex);\n \n el.addClass('x-grid-row-fadeout');\n \n el.on('transitionend',function(){\n _this.member_grid.ds.remove(rec);\n el.remove();\n },this,{single:true});\n }\n}",
404 "render" : "function (_self)\n{\n _this.option_grid = this;\n \n this.store.load({})\n}"
406 "Boolean footerShow" : false,
407 "String cls" : "table-fixed",
409 "$ xns" : "Roo.bootstrap",
410 "cellSelection" : true,
411 "Boolean loadMask" : true,
413 "boolean condensed" : true,
414 "rowSelection" : true,
417 "Boolean singleSelect" : true,
418 "xtype" : "RowSelectionModel",
419 "$ xns" : "Roo.bootstrap.Table",
424 "beforeload" : "function (_self, options)\n{ \n options.params = options.params || {};\n \n options.params._with_in_group = _this.data.id;\n\n}"
426 "$ Object sortInfo" : "{ direction : 'ASC', field: 'id' }",
428 "boolean remoteSort" : true,
429 "$ xns" : "Roo.data",
433 "$ url" : "baseURL + '/Roo/core_group'",
434 "xtype" : "HttpProxy",
435 "$ xns" : "Roo.data",
436 "String method" : "GET",
440 "$ Array fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'display_name',\n 'type': 'string'\n },\n {\n 'name': 'in_group',\n 'type': 'int'\n }\n]",
441 "xtype" : "JsonReader",
442 "String root" : "data",
443 "$ xns" : "Roo.data",
450 "String header" : "Is a Member",
451 "String cursor" : "pointer",
452 "String dataIndex" : "in_group",
453 "xtype" : "ColumnModel",
455 "String align" : "center",
456 "$ xns" : "Roo.grid",
457 "$ renderer" : "function(v) { \n\n var state = v > 0 ? 'check-' : '';\n var cls = v > 0 ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n \n }",
458 "Boolean sortable" : false,
462 "String header" : "Group Name",
463 "cursor" : "pointer",
464 "String dataIndex" : "name",
465 "xtype" : "ColumnModel",
467 "$ xns" : "Roo.grid",
468 "Boolean sortable" : true,
479 "click" : "function (_self, e)\n{\n _this.dialog.hide(); \n}"
482 "$ xns" : "Roo.bootstrap",
483 "String html" : "Cancel",
484 "* prop" : "buttons[]"
488 "click" : "function (_self, e)\n{\n if(!_this.form.isValid()){\n //Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');\n return;\n }\n \n var myID = _this.form.findField('id').getValue() * 1;\n var myName = _this.form.findField('name').getValue();\n\n if (_this.form.findField('company_id') && !_this.form.findField('company_id').getValue()) {\n Roo.bootstrap.MessageBox.alert(\"Error\", \"Select a Company\");\n return;\n }\n \n // validate password match (only needed if we are not using generated one..\n if (_this.form.findField('passwd1') \n && _this.form.findField('passwd1').getValue().length > 0 \n && _this.form.findField('passwd1').inputEl().dom.type == \"password\") {\n \n var p1 = _this.form.findField('passwd1').getValue();\n var p2 = _this.form.findField('passwd2').getValue();\n \n \n if (Pman.Login.authUser.id < 0 && !p1.length) {\n Roo.bootstrap.MessageBox.alert(\"Error\", \"You must create a password for the admin account\");\n return;\n }\n \n \n if (p1.length || p2.length) {\n if (p1 != p2) {\n Roo.bootstrap.MessageBox.alert(\"Error\", \"Passwords do not match\");\n return;\n }\n }\n \n \n }\n \n // get the list of record with tick\n \n _this.form.doAction(\"submit\");\n \n return;\n\n}"
490 "String weight" : "primary",
492 "$ xns" : "Roo.bootstrap",
493 "String html" : "Save",
494 "* prop" : "buttons[]"