_strings : {
'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
- '566a352f95c879ff26e50bad767a28dc' :"Group Membership",
- '4910043d0b2c8c864a0e8672716fee94' :"Is a Member",
- 'a60cdd3642fbe81545a3b93fe2b19dd6' :"Two-Factor Authentication",
- '28974c2c793e780427dfb571b26443e6' :"Group Name",
'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
- 'a6b81fd617c4f1b94f83049793cac3cd' :"Show QR Code",
'a0f852ef8bfccd86a0e7217d7959e3e8' :"Add / Edit User",
- '3ec365dd533ddb7ef3d1c111186ce872' :"Details",
'0bfe42db3eb05bf39f03812166391939' :"Use Secure Passwords",
'ea4788705e6873b424c65e91c2846b19' :"Cancel",
- '73b00356c62eb391f571b6468be7c372' :"Generate QR Code",
'6f958ddaf50fd5ade7858ef1d1a63e51' :"Type again to confirm",
- '49ee3087348e8d44e1feda1917443987' :"Name",
'bbbabdbe1b262f75d99d62880b953be1' :"Role",
- '1960f813085537c64f981132e34181ca' :"Delete QR Code",
+ '49ee3087348e8d44e1feda1917443987' :"Name",
'c9cc8cce247e49bae79f15173ce97354' :"Save",
'828e70f83623b262e14187c039df99c0' :"Enable Two-Factor Authentication",
'acf45fd8829f809b29c601a3a193804f' :"Set / Change Password",
this.callback = cb;
this.data = data;
- this.dialog.show(this.data._el);
+ this.dialog.show.apply(this.dialog, Array.prototype.slice.call(arguments).slice(2));
if (this.form) {
this.form.reset();
this.form.setValues(data);
this.dialog = Roo.factory({
xtype : 'Modal',
cls : 'add-user-dialog',
- fitwindow : false,
- maxWidth : 650,
+ fit_content : true,
title : _this._strings['a0f852ef8bfccd86a0e7217d7959e3e8'] /* Add / Edit User */,
listeners : {
- beforeshow : function (_self)
- {
- //_console.log(_this.detail_tab);
- },
render : function (_self)
{
- this.bodyEl.setHeight(600);
- },
- show : function (_self)
- {
- //_this.dialog.items[0].getRegion('center').showPanel(0);
-
- //setting first adminstrator in open system
-
- if(typeof(_this.data.role) != 'undefined' && _this.data.role == 'Administrators') {
-
- Roo.select('.add-user-dialog .modal-title').first().dom.innerHTML = "Create Adminstrator";
-
- _this.form.findField('role').inputEl().dom.disabled = true;
- }
- _this.layout.showPanel('DetailPanel');
+ _this.dialog = this;
}
},
xns : Roo.bootstrap,
],
items : [
{
- xtype : 'Border',
+ xtype : 'Form',
+ errorMask : true,
+ labelAlign : 'top',
+ style : 'margin-top: 20px;',
+ url : baseURL + '/Roo/core_person',
listeners : {
+ actioncomplete : function (_self, action)
+ {
+ if(action.type == 'setdata'){
+
+ // _this.layout.showPanel('DetailPanel');
+
+ _this.dialog.setTitle(_this.data.id *1 > 0 ? "Edit User: " + _this.data.name : 'Add User');
+ _this.form.findField('role').setDisabled(false);
+
+ /*
+ * Use for init -- Call from Pman.Login.js
+ */
+ if(
+ typeof(_this.data.role) != 'undefined' &&
+ _this.data.role == 'Administrators'
+ ) {
+ _this.dialog.setTitle("Create Adminstrator");
+ _this.form.findField('role').setDisabled(true);
+ }
+
+ _this.form.findField('passwd1').el.select('input',true).first().dom.type="password";
+ _this.form.findField('passwd2').show();
+ _this.passwordbox.collapse();
+
+ _this.form.findField('secure_passwords').setValue(1);
+
+ if(_this.data.id * 1 > 0) {
+ this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
+ }
+
+
+
+ this.clearInvalid();
+
+ _this.dialog.resize();
+
+ return;
+ }
+
+ if (action.type == 'load') {
+
+ _this.data = action.result.data;
+
+ // oath handling...
+
+ _this.form.findField('_enable_oath_key').setChecked(false,false);
+
+ if(_this.data.length_oath_key != '0') {
+ _this.form.findField('_enable_oath_key').setChecked(true,false);
+ }
+
+ return;
+ }
+
+ if (action.type == 'submit') { // only submitted here if we are
+
+ _this.dialog.hide();
+
+ if (_this.callback) {
+ _this.callback.call(this, action.result.data);
+ }
+
+ return;
+ }
+ },
render : function (_self)
{
- _this.layout = _self;
+ _this.form = this;
}
},
- xns : Roo.bootstrap.layout,
- '|xns' : 'Roo.bootstrap.layout',
- center : {
- xtype : 'Region',
- alwaysShowTabs : true,
- tabPosition : 'top',
- xns : Roo.bootstrap.layout,
- '|xns' : 'Roo.bootstrap.layout'
- },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Content',
- autoScroll : true,
- background : false,
- fitContainer : true,
- fitToFrame : true,
- id : 'DetailPanel',
- region : 'center',
- title : _this._strings['3ec365dd533ddb7ef3d1c111186ce872'] /* Details */,
- listeners : {
- activate : function (_self)
- {
- /*var url = 'about:blank';
-
- if(_this.data.id * 1 > 0){
- url = baseURL + '/Coba/Report/ApplicationSummary/' + _this.data.id;
- }
-
- _this.app_summary_frame.el.dom.src = url;*/
-
- },
- render : function (_self)
- {
- _this.detail_tab = _self;
- }
- },
- xns : Roo.bootstrap.panel,
- '|xns' : 'Roo.bootstrap.panel',
+ xtype : 'Row',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Input',
+ allowBlank : false,
+ fieldLabel : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
+ labelAlign : 'left',
+ name : 'name',
+ placeholder : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ xtype : 'Row',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Input',
+ fieldLabel : _this._strings['bbbabdbe1b262f75d99d62880b953be1'] /* Role */,
+ labelAlign : 'left',
+ name : 'role',
+ placeholder : _this._strings['bbbabdbe1b262f75d99d62880b953be1'] /* Role */,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ xtype : 'Row',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Container',
- cls : 'col-md-12',
+ xtype : 'Column',
+ md : 12,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Form',
- errorMask : true,
- labelAlign : 'top',
- style : 'margin-top: 20px;',
- url : baseURL + '/Roo/core_person',
+ xtype : 'Input',
+ allowBlank : false,
+ fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
+ labelAlign : 'left',
+ name : 'email',
+ placeholder : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
+ vtype : 'email',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ xtype : 'Row',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Input',
+ fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
+ labelAlign : 'left',
+ name : 'phone',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ xtype : 'Row',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'CheckBox',
+ boxLabel : _this._strings['828e70f83623b262e14187c039df99c0'] /* Enable Two-Factor Authentication */,
+ name : '_enable_oath_key',
listeners : {
- actioncomplete : function (_self, action)
+ check : function (_self, checked)
{
- if(action.type == 'setdata'){
-
- _this.form.findField('passwd1').el.select('input',true).first().dom.type="password";
- _this.form.findField('passwd2').show();
- _this.passwordbox.collapse();
-
- _this.qrCodeBox.collapse();
- _this.qrCodeBox.el.hide();
- _this.form.findField('_enable_oath_key').setValue(1);
- _this.form.findField('_enable_oath_key').el.show();
-
- _this.generate_qrcode_btn.el.hide();
- _this.delete_qrcode_btn.el.hide();
- _this.show_qrcode_btn.el.hide();
+ if(checked) {
- if(_this.data.id * 1 > 0) {
- this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
- }
-
- this.clearInvalid();
+ this.setBoxLabel('Untick to disable Two Factor authentication');
return;
}
-
- if (action.type == 'load') {
- _this.data = action.result.data;
-
- _this.qrCodeBox.el.show();
- _this.form.findField('_enable_oath_key').setValue(0);
- _this.form.findField('_enable_oath_key').el.hide();
-
- _this.generate_qrcode_btn.el.show();
- _this.delete_qrcode_btn.el.hide();
- _this.show_qrcode_btn.el.hide();
-
- _this.qrCodeBox.collapse();
-
- if(_this.data.length_oath_key * 1 > 0){
- _this.delete_qrcode_btn.el.show();
- _this.show_qrcode_btn.el.show();
- _this.qrCodeBox.expand();
- }
-
+ this.setBoxLabel('Enable Two Factor Authentication');
+ },
+ click : function (_self, e)
+ {
+ if(!Pman.Login.authUser) {
+ Roo.bootstrap.MessageBox.alert('Error', 'Please login again');
return;
}
- if (action.type == 'submit') { // only submitted here if we are
+ e.preventDefault();
- _this.dialog.hide();
-
- if (_this.callback) {
- _this.callback.call(this, action.result.data);
- }
+ if(!this.checked) {
- return;
+ Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
+ id: _this.data.id,
+ allow_close: false,
+ allow_cancel : true
+ }, function(valid){
+ if(valid) {
+ _this.dialog.hide({});
+ return;
+ }
+
+ _this.form.findField('_enable_oath_key').setChecked(false,false);
+ }
+ );
+ return;
}
- },
- beforeaction : function (_self, action)
- {
-
- },
+
+ new Pman.Request({
+ url : baseURL + '/Roo/Core_person',
+ method :'GET',
+ params : {
+ oath_key_disable: 1,
+ id: _this.data.id
+ },
+ success : function(res)
+ {
+ switch(res.data) {
+ case 'DONE':
+ Roo.bootstrap.MessageBox.alert('Success', 'The two factor authentication has been disabled');
+ break;
+ default:
+ Roo.log('invalid usage');
+ break;
+ }
+ },
+ failure : function(res)
+ {
+ Roo.bootstrap.MessageBox.alert('Error', res);
+ }
+ });
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ xtype : 'Row',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Container',
+ expandable : true,
+ expanded : false,
+ header : _this._strings['acf45fd8829f809b29c601a3a193804f'] /* Set / Change Password */,
+ panel : 'primary',
+ listeners : {
render : function (_self)
{
- _this.form = _self;
-
- //_this.findField('group_membership').setValue
-
- console.log(_this.form.data);
+ _this.passwordbox = this;
}
},
xns : Roo.bootstrap,
items : [
{
xtype : 'Column',
- md : 12,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Input',
- allowBlank : false,
- fieldLabel : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
- labelAlign : 'left',
- name : 'name',
- placeholder : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
- ]
- },
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- md : 12,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Input',
- fieldLabel : _this._strings['bbbabdbe1b262f75d99d62880b953be1'] /* Role */,
- labelAlign : 'left',
- name : 'role',
- placeholder : _this._strings['bbbabdbe1b262f75d99d62880b953be1'] /* Role */,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
- ]
- },
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- md : 12,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Input',
- allowBlank : false,
- fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
- labelAlign : 'left',
- name : 'email',
- placeholder : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
- vtype : 'email',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
- ]
- },
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- md : 12,
+ xs : 8,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
{
xtype : 'Input',
- fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
- labelAlign : 'left',
- name : 'phone',
+ inputType : 'password',
+ name : 'passwd1',
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap'
}
]
- }
- ]
- },
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
+ },
{
xtype : 'Column',
- md : 12,
+ xs : 4,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'CheckBox',
- boxLabel : _this._strings['828e70f83623b262e14187c039df99c0'] /* Enable Two-Factor Authentication */,
- checked : true,
- name : '_enable_oath_key',
+ xtype : 'Button',
+ html : _this._strings['01028205a11cf95a503c4c1d005989da'] /* Generate One */,
+ style : 'width:100%',
listeners : {
- render : function (_self)
+ click : function (_self, e)
{
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.hide();
+ var pw = Math.random().toString(36).replace('0.', '');
+ _this.form.findField('passwd1').el.select('input',true).first().dom.type="input";
+ _this.form.findField('passwd1').setValue(pw);
+ _this.form.findField('passwd2').hide();
}
},
xns : Roo.bootstrap,
}
]
},
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- md : 12,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Container',
- expandable : true,
- expanded : false,
- header : _this._strings['acf45fd8829f809b29c601a3a193804f'] /* Set / Change Password */,
- panel : 'primary',
- listeners : {
- render : function (_self)
- {
- _this.passwordbox = this;
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- xs : 8,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Input',
- inputType : 'password',
- name : 'passwd1',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- },
- {
- xtype : 'Column',
- xs : 4,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Button',
- html : _this._strings['01028205a11cf95a503c4c1d005989da'] /* Generate One */,
- style : 'width:100%',
- listeners : {
- click : function (_self, e)
- {
- var pw = Math.random().toString(36).slice(-12);
- _this.form.findField('passwd1').el.select('input',true).first().dom.type="input";
- _this.form.findField('passwd1').setValue(pw);
- _this.form.findField('passwd2').hide();
-
-
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
- ]
- },
- {
- xtype : 'Input',
- inputType : 'password',
- name : 'passwd2',
- placeholder : _this._strings['6f958ddaf50fd5ade7858ef1d1a63e51'] /* Type again to confirm */,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- },
- {
- xtype : 'CheckBox',
- boxLabel : _this._strings['0bfe42db3eb05bf39f03812166391939'] /* Use Secure Passwords */,
- name : 'secure_passwords',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
- ]
- }
- ]
- },
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- md : 12,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Container',
- expandable : true,
- expanded : false,
- header : _this._strings['a60cdd3642fbe81545a3b93fe2b19dd6'] /* Two-Factor Authentication */,
- panel : 'primary',
- listeners : {
- render : function (_self)
- {
- _this.qrCodeBox = this;
-
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.hide();
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- xs : 4,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Button',
- html : _this._strings['73b00356c62eb391f571b6468be7c372'] /* Generate QR Code */,
- style : 'width:100%',
- listeners : {
- click : function (_self, e)
- {
- if(_this.data.id * 1 < 1){
- Roo.bootstrap.MessageBox.alert('Error', 'Please save the user first');
- return;
- }
-
- new Pman.Request({
- url: baseURL + '/Roo/Core_person.php',
- method : 'POST',
- mask : 'Loading...',
- params : {
- id : _this.data.id,
- _generate_oath_key : 1
- },
- success : function(res) {
- _this.delete_qrcode_btn.el.show();
- _this.show_qrcode_btn.el.show();
-
- Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
- id : _this.data.id
- });
-
- return;
- }
- });
- },
- render : function (_self)
- {
- _this.generate_qrcode_btn = this;
-
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.hide();
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- },
- {
- xtype : 'Column',
- xs : 4,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Button',
- html : _this._strings['1960f813085537c64f981132e34181ca'] /* Delete QR Code */,
- style : 'width:100%',
- listeners : {
- click : function (_self, e)
- {
- if(_this.data.id * 1 < 1){
- Roo.bootstrap.MessageBox.alert('Error', 'Please save the user first');
- return;
- }
-
- new Pman.Request({
- url: baseURL + '/Roo/Core_person.php',
- method : 'POST',
- mask : 'Loading...',
- params : {
- id : _this.data.id,
- oath_key : ''
- },
- success : function(res) {
- _this.delete_qrcode_btn.el.hide();
- _this.show_qrcode_btn.el.hide();
-
- return;
- }
- });
- },
- render : function (_self)
- {
- _this.delete_qrcode_btn = this;
-
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.hide();
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- },
- {
- xtype : 'Column',
- xs : 4,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Button',
- html : _this._strings['a6b81fd617c4f1b94f83049793cac3cd'] /* Show QR Code */,
- style : 'width:100%',
- listeners : {
- click : function (_self, e)
- {
- if(_this.data.id * 1 < 1){
- Roo.bootstrap.MessageBox.alert('Error', 'Please save the user first');
- return;
- }
-
- Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
- id : _this.data.id
- });
- },
- render : function (_self)
- {
- _this.show_qrcode_btn = this;
-
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.hide();
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- xtype : 'Input',
- inputType : 'hidden',
- labelAlign : 'left',
- name : 'id',
- listeners : {
- render : function (_self)
- {
- _this.userID = _self;
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- },
{
xtype : 'Input',
- inputType : 'hidden',
- name : 'company_id',
+ inputType : 'password',
+ name : 'passwd2',
+ placeholder : _this._strings['6f958ddaf50fd5ade7858ef1d1a63e51'] /* Type again to confirm */,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap'
},
{
- xtype : 'Input',
- inputType : 'hidden',
- labelAlign : 'left',
- name : 'membership_list',
+ xtype : 'CheckBox',
+ boxLabel : _this._strings['0bfe42db3eb05bf39f03812166391939'] /* Use Secure Passwords */,
+ name : 'secure_passwords',
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap'
}
]
},
{
- xtype : 'Grid',
- background : true,
- fitContainer : true,
- fitToFrame : true,
- region : 'center',
- title : _this._strings['566a352f95c879ff26e50bad767a28dc'] /* Group Membership */,
+ xtype : 'Input',
+ inputType : 'hidden',
+ labelAlign : 'left',
+ name : 'id',
listeners : {
- activate : function (_self)
- {
- if(_this.option_grid){
- _this.option_grid.store.load({});
- }
-
- },
render : function (_self)
{
- _this.option_panel = this;
-
-
+ _this.userID = _self;
}
},
- xns : Roo.bootstrap.panel,
- '|xns' : 'Roo.bootstrap.panel',
- grid : {
- xtype : 'Table',
- cellSelection : false,
- cls : 'table-fixed',
- condensed : true,
- footerShow : false,
- loadMask : true,
- rowSelection : true,
- listeners : {
- render : function (_self)
- {
- _this.option_grid = this;
-
- this.store.load({})
- },
- rowclick : function (_self, el, rowIndex, e)
- {
- //var di = this.colModel.getDataIndex(columnIndex);
-
- // check if the name is the result name from dataobject core_group_member
- /*if (di != 'group_membership_user_id') {
- return;
- }*/
-
-
-
- var rec = this.store.getAt(rowIndex);
-
- rec.set('group_membership_user_id', rec.data.group_membership_user_id * 1 == 0 ? -1 : 0);
-
- rec.commit();
-
- var membership_active_arr = [];
- // loop throught the new list , rebuild the list of current options
-
- // record is the first parameter
-
- _this.option_grid.store.each(function(record){
- var gmuid = record.data.group_membership_user_id;
- var gid = record.data.id;
- if(gmuid * 1 != 0){
- membership_active_arr.push(gid);
- }
- });
-
- var membership_active_list = "";
- membership_active_list = membership_active_arr.join();
-
- _this.form.findField("membership_list").setValue(membership_active_list);
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- store : {
- xtype : 'Store',
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'id' },
- listeners : {
- beforeload : function (_self, options)
- {
- options.params = options.params || {};
-
- options.params._with_membership_user = _this.data.id;
-
- /*if(typeof(_this.data.id) == 'undefined' || _this.data.id * 1 < 1){
- this.removeAll();
- return false;
- }
-
- options.params.is_active = 1;
- options.params.dec_type = 'checklist';
-
- options.params._ext_data_id = _this.data.id;
-
- options.params._with_others = 1;
-
- options.params._show_deleted = _this.documentStatusBtn.pressed ? 1 : 0;*/
-
- }
- },
- xns : Roo.data,
- '|xns' : 'Roo.data',
- proxy : {
- xtype : 'HttpProxy',
- method : 'GET',
- url : baseURL + '/Roo/core_group',
- xns : Roo.data,
- '|xns' : 'Roo.data'
- },
- reader : {
- xtype : 'JsonReader',
- id : 'id',
- root : 'data',
- xns : Roo.data,
- '|xns' : 'Roo.data'
- }
- },
- sm : {
- xtype : 'RowSelectionModel',
- singleSelect : true,
- listeners : {
- selectionchange : function (_self)
- {
- /*_this.type_edit_btn.hide();
-
- if(this.getSelected()){
- _this.type_edit_btn.show();
- }*/
-
- _this.option_grid.store.load({});
-
-
- }
- },
- xns : Roo.bootstrap.Table,
- '|xns' : 'Roo.bootstrap.Table'
- },
- cm : [
- {
- xtype : 'ColumnModel',
- cursor : 'pointer',
- dataIndex : 'group_membership_user_id',
- header : _this._strings['4910043d0b2c8c864a0e8672716fee94'] /* Is a Member */,
- renderer : function(v,x,r) {
-
- var state = v != 0 ? '-check' : '';
-
- return '<i class=\"far fa'+ state + '-square-o fa-2x\" aria-hidden=\"true\"></i>';
- },
- sortable : false,
- xs : 1,
- xns : Roo.grid,
- '|xns' : 'Roo.grid'
- },
- {
- xtype : 'ColumnModel',
- cursor : 'pointer',
- dataIndex : 'name',
- header : _this._strings['28974c2c793e780427dfb571b26443e6'] /* Group Name */,
- sortable : true,
- xs : 11,
- xns : Roo.grid,
- '|xns' : 'Roo.grid'
- }
- ]
- }
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ },
+ {
+ xtype : 'Input',
+ inputType : 'hidden',
+ name : 'company_id',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
}
]
}