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"
33 "beforeshow" : "function (_self)\n{\n //_console.log(_this.detail_tab);\n}",
34 "show" : "function (_self)\n{\n //_this.dialog.items[0].getRegion('center').showPanel(0); \n\n //setting first adminstrator in open system\n \n if(typeof(_this.data.role) != 'undefined' && _this.data.role == 'Administrators') {\n \n Roo.select('.add-user-dialog .modal-title').first().dom.innerHTML = \"Create Adminstrator\";\n \n _this.form.findField('role').inputEl().dom.disabled = true;\n }\n _this.layout.showPanel('DetailPanel');\n}",
35 "render" : "function (_self)\n{\n this.bodyEl.setHeight(600);\n}"
37 "String cls" : "add-user-dialog",
38 "Boolean fitwindow" : false,
41 "$ xns" : "Roo.bootstrap",
42 "String title" : "Add / Edit User",
46 "render" : "function (_self)\n{\n _this.layout = _self;\n}"
49 "$ xns" : "Roo.bootstrap.layout",
52 "alwaysShowTabs" : true,
53 "String tabPosition" : "top",
55 "$ xns" : "Roo.bootstrap.layout",
60 "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}",
61 "render" : "function (_self)\n{\n _this.detail_tab = _self;\n}"
64 "Boolean fitContainer" : true,
66 "Boolean fitToFrame" : true,
67 "$ xns" : "Roo.bootstrap.panel",
68 "String region" : "center",
69 "String title" : "Details",
70 "Boolean autoScroll" : true,
71 "Boolean background" : false,
74 "String cls" : "col-md-12",
75 "xtype" : "Container",
76 "$ xns" : "Roo.bootstrap",
80 "actioncomplete" : "function (_self, action)\n{\n if(action.type == 'setdata'){\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}",
81 "beforeaction" : "function (_self, action)\n{\n\n}",
82 "render" : "function (_self)\n{\n _this.form = _self;\n \n //_this.findField('group_membership').setValue\n \n console.log(_this.form.data);\n}"
84 "$ url" : "baseURL + '/Roo/core_person' ",
85 "style" : "margin-top: 20px;",
87 "String labelAlign" : "top",
88 "$ xns" : "Roo.bootstrap",
89 "string errorMask" : true,
93 "$ xns" : "Roo.bootstrap",
98 "$ xns" : "Roo.bootstrap",
101 "Boolean allowBlank" : false,
102 "String name" : "name",
104 "string placeholder" : "Name",
105 "String labelAlign" : "left",
106 "string fieldLabel" : "Name",
107 "$ xns" : "Roo.bootstrap"
115 "$ xns" : "Roo.bootstrap",
120 "$ xns" : "Roo.bootstrap",
123 "String name" : "role",
125 "string placeholder" : "Role",
126 "string fieldLabel" : "Role",
127 "String labelAlign" : "left",
128 "$ xns" : "Roo.bootstrap"
136 "$ xns" : "Roo.bootstrap",
141 "$ xns" : "Roo.bootstrap",
144 "Boolean allowBlank" : false,
145 "String name" : "email",
148 "string placeholder" : "Email",
149 "String labelAlign" : "left",
150 "string fieldLabel" : "Email",
151 "$ xns" : "Roo.bootstrap"
159 "$ xns" : "Roo.bootstrap",
164 "$ xns" : "Roo.bootstrap",
167 "String name" : "phone",
169 "string fieldLabel" : "Phone",
170 "String labelAlign" : "left",
171 "$ xns" : "Roo.bootstrap"
179 "$ xns" : "Roo.bootstrap",
184 "$ xns" : "Roo.bootstrap",
188 "render" : "function (_self)\n{\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}"
190 "String name" : "_enable_oath_key",
191 "Boolean checked" : true,
192 "xtype" : "CheckBox",
193 "String boxLabel" : "Enable Two-Factor Authentication",
194 "$ xns" : "Roo.bootstrap"
202 "$ xns" : "Roo.bootstrap",
207 "$ xns" : "Roo.bootstrap",
211 "render" : "function (_self)\n{\n _this.passwordbox = this;\n}"
213 "String header" : "Set / Change Password",
214 "Boolean expanded" : false,
215 "xtype" : "Container",
216 "String panel" : "primary",
217 "$ xns" : "Roo.bootstrap",
218 "Boolean expandable" : true,
222 "$ xns" : "Roo.bootstrap",
227 "$ xns" : "Roo.bootstrap",
230 "String name" : "passwd1",
232 "String inputType" : "password",
233 "$ xns" : "Roo.bootstrap"
240 "$ xns" : "Roo.bootstrap",
244 "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}"
247 "$ xns" : "Roo.bootstrap",
248 "String html" : "Generate One",
249 "String style" : "width:100%"
256 "String name" : "passwd2",
258 "string placeholder" : "Type again to confirm",
259 "String inputType" : "password",
260 "$ xns" : "Roo.bootstrap"
263 "String name" : "secure_passwords",
264 "xtype" : "CheckBox",
265 "String boxLabel" : "Use Secure Passwords",
266 "$ xns" : "Roo.bootstrap"
276 "$ xns" : "Roo.bootstrap",
281 "$ xns" : "Roo.bootstrap",
285 "render" : "function (_self)\n{\n _this.qrCodeBox = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}"
287 "String header" : "Two-Factor Authentication",
288 "Boolean expanded" : false,
289 "xtype" : "Container",
290 "String panel" : "primary",
291 "$ xns" : "Roo.bootstrap",
292 "Boolean expandable" : true,
296 "$ xns" : "Roo.bootstrap",
301 "$ xns" : "Roo.bootstrap",
305 "render" : "function (_self)\n{\n _this.generate_qrcode_btn = this;\n\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
306 "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}"
309 "$ xns" : "Roo.bootstrap",
310 "String html" : "Generate QR Code",
311 "String style" : "width:100%"
318 "$ xns" : "Roo.bootstrap",
322 "render" : "function (_self)\n{\n _this.delete_qrcode_btn = this;\n\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
323 "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}"
326 "$ xns" : "Roo.bootstrap",
327 "String html" : "Delete QR Code",
328 "String style" : "width:100%"
335 "$ xns" : "Roo.bootstrap",
339 "render" : "function (_self)\n{\n _this.show_qrcode_btn = this;\n\n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
340 "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}"
343 "$ xns" : "Roo.bootstrap",
344 "String html" : "Show QR Code",
345 "String style" : "width:100%"
359 "render" : "function (_self)\n{\n _this.userID = _self;\n}"
361 "String name" : "id",
363 "String labelAlign" : "left",
364 "String inputType" : "hidden",
365 "$ xns" : "Roo.bootstrap"
368 "String name" : "company_id",
370 "String inputType" : "hidden",
371 "$ xns" : "Roo.bootstrap"
374 "String name" : "membership_list",
376 "String labelAlign" : "left",
377 "String inputType" : "hidden",
378 "$ xns" : "Roo.bootstrap"
388 "activate" : "function (_self)\n{\n if(_this.option_grid){\n _this.option_grid.store.load({});\n }\n \n}",
389 "render" : "function (_self)\n{\n _this.option_panel = this;\n \n \n}"
393 "String region" : "center",
394 "$ xns" : "Roo.bootstrap.panel",
395 "fitContainer" : true,
396 "String title" : "Group Membership",
397 "Boolean background" : true,
401 "render" : "function (_self)\n{\n _this.option_grid = this;\n \n this.store.load({})\n}",
402 "rowclick" : "function (_self, el, rowIndex, e)\n{\n //var di = this.colModel.getDataIndex(columnIndex);\n \n // check if the name is the result name from dataobject core_group_member\n /*if (di != 'group_membership_user_id') {\n return;\n }*/\n \n \n \n var rec = this.store.getAt(rowIndex);\n\n rec.set('group_membership_user_id', rec.data.group_membership_user_id * 1 == 0 ? -1 : 0);\n\n rec.commit();\n \n var membership_active_arr = [];\n // loop throught the new list , rebuild the list of current options\n \n // record is the first parameter\n \n _this.option_grid.store.each(function(record){\n var gmuid = record.data.group_membership_user_id;\n var gid = record.data.id;\n if(gmuid * 1 != 0){\n membership_active_arr.push(gid);\n }\n });\n \n var membership_active_list = \"\";\n membership_active_list = membership_active_arr.join();\n \n _this.form.findField(\"membership_list\").setValue(membership_active_list);\n}"
404 "Boolean footerShow" : false,
405 "String cls" : "table-fixed",
406 "String layout" : "fixed",
408 "$ xns" : "Roo.bootstrap",
409 "cellSelection" : false,
410 "Boolean loadMask" : true,
412 "boolean condensed" : true,
413 "rowSelection" : true,
417 "selectionchange" : "function (_self)\n{\n /*_this.type_edit_btn.hide();\n \n if(this.getSelected()){\n _this.type_edit_btn.show();\n }*/\n \n _this.option_grid.store.load({});\n \n \n}"
419 "Boolean singleSelect" : true,
420 "xtype" : "RowSelectionModel",
421 "$ xns" : "Roo.bootstrap.Table",
426 "beforeload" : "function (_self, options)\n{ \n options.params = options.params || {};\n \n options.params._with_membership_user = _this.data.id;\n\n /*if(typeof(_this.data.id) == 'undefined' || _this.data.id * 1 < 1){\n this.removeAll();\n return false;\n }\n \n options.params.is_active = 1;\n options.params.dec_type = 'checklist';\n \n options.params._ext_data_id = _this.data.id;\n \n options.params._with_others = 1;\n \n options.params._show_deleted = _this.documentStatusBtn.pressed ? 1 : 0;*/\n \n}"
428 "$ Object sortInfo" : "{ direction : 'ASC', field: 'id' }",
430 "boolean remoteSort" : true,
431 "$ xns" : "Roo.data",
435 "$ url" : "baseURL + '/Roo/core_group'",
436 "xtype" : "HttpProxy",
437 "$ xns" : "Roo.data",
438 "String method" : "GET",
442 "xtype" : "JsonReader",
443 "String root" : "data",
444 "$ xns" : "Roo.data",
451 "String header" : "Is a Member",
452 "String cursor" : "pointer",
453 "String dataIndex" : "group_membership_user_id",
454 "xtype" : "ColumnModel",
455 "$ xns" : "Roo.grid",
456 "$ renderer" : "function(v,x,r) {\n \n var state = v != 0 ? '-check' : '';\n \n return '<i class=\\\"far fa'+ state + '-square-o fa-2x\\\" aria-hidden=\\\"true\\\"></i>';\n}",
457 "Boolean sortable" : false,
461 "String header" : "Group Name",
462 "cursor" : "pointer",
463 "String dataIndex" : "name",
464 "xtype" : "ColumnModel",
465 "$ xns" : "Roo.grid",
466 "Boolean sortable" : true,
477 "click" : "function (_self, e)\n{\n _this.dialog.hide(); \n}"
480 "$ xns" : "Roo.bootstrap",
481 "String html" : "Cancel",
482 "* prop" : "buttons[]"
486 "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}"
488 "String weight" : "primary",
490 "$ xns" : "Roo.bootstrap",
491 "String html" : "Save",
492 "* prop" : "buttons[]"