_strings : {
'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
'2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
- 'aba9f7d7443652e858969bfc280690b1' :"Manage Groups ",
'7dce122004969d56ae2e0245cb754d35' :"Edit",
+ '01abfc750a0c942167651c40d088531d' :"#",
'dae8ace18bdcbcc6ae5aece263e14fe8' :"Options",
+ 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
'f2d346b1bb7c1c85ab6f7f21e3666b9f' :"Types",
- '4d1c8263ba1036754f8db14a98f9f006' :"Reload",
'49ee3087348e8d44e1feda1917443987' :"Name",
- 'f2a6c498fb90ee345d997f888fce3b18' :"Delete"
+ 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
+ '4d3d769b812b6faa6b76e1a8abaece2d' :"Active"
},
part : ["BAdmin", "CoreEnum" ],
listeners : {
activate : function (_self)
{
+ _this.type_edit_btn.hide();
+
if(_this.type_grid) {
_this.type_grid.footer.onClick('first');
}
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Button',
- glyphicon : 'plus',
- html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
- style : 'margin: 10px;',
- weight : 'primary',
- listeners : {
- click : function (_self, e)
- {
- Pman.Dialog.BAdminStaff.show({
- id : 0,
- company_id : Pman.Login.authUser.company_id
- }, function(res) {
-
- if(res.length_oath_key * 1 < 1){
- _this.member_grid.footer.onClick('first');
- return;
- }
-
- Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
- id : res.id
- }, function(res){
- _this.member_grid.footer.onClick('first');
- });
- });
-
- }
- },
+ xtype : 'Element',
xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Row',
+ cls : 'roo-toolbar',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'plus',
+ html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : 0
+ }, function(res) {
+ _this.type_grid.footer.onClick('first');
+ });
+
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ },
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'edit',
+ html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.type_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : sel.data.id
+ }, function(res) {
+ _this.type_grid.footer.onClick('first');
+ });
+ },
+ render : function (_self)
+ {
+ _this.type_edit_btn = this;
+
+ this.hide();
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
]
}
cls : 'table-fixed',
hover : true,
loadMask : true,
- responsive : true,
rowSelection : true,
striped : false,
listeners : {
{
_this.type_grid = _self;
+ },
+ rowdblclick : function (_self, el, rowIndex, e)
+ {
+ var r = _this.type_grid.store.getAt(rowIndex);
+
+ if(!r || r.data.id * 1 < 1){
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : r.data.id
+ }, function(res) {
+ _this.type_grid.footer.onClick('first');
+ });
}
},
xns : Roo.bootstrap,
xtype : 'PagingToolbar',
displayInfo : false,
name : 'footer',
- pageSize : 25,
+ pageSize : 100,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap'
},
listeners : {
beforeload : function (_self, o)
{
+ if (!Pman.buildCompleted) {
+ return false;
+ }
+
o.params = o.params || {};
o.params['query[empty_etype]'] = 1;
+ },
+ load : function (_self, records, options)
+ {
+ _this.type_edit_btn.hide();
}
},
xns : Roo.data,
listeners : {
selectionchange : function (_self)
{
- _this.option_grid.footer.onClick('first');
+ _this.type_edit_btn.hide();
+
+ if(this.getSelected()){
+ _this.type_edit_btn.show();
+ }
+
+ _this.option_grid.store.load({});
}
},
xns : Roo.bootstrap.Table,
cm : [
{
xtype : 'ColumnModel',
+ cursor : 'pointer',
dataIndex : 'display_name',
header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
- renderer : function(v,x,r) {
+ renderer : function(v,x,r) {
+ if (v.match(/Coba/g) || v.match(/Risk Question/g)) {
+ return String.format('<span tooltip="{1}">Coba: {0}</span>', v, r.data.name);
+ }
+
return String.format('<span tooltip="{1}">{0}</span>', v, r.data.name);
},
sortable : true,
listeners : {
activate : function (_self)
{
+ _this.edit_btn.hide();
+ _this.delete_btn.hide();
+
if (_this.option_grid) {
- _this.option_grid.footer.onClick('first');
+ _this.option_grid.store.load({});
}
},
render : function (_self)
{
- _this.options_panel = _self;
+ _this.option_panel = _self;
}
},
xns : Roo.bootstrap.panel,
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'NavSidebarItem',
- glyphicon : 'menu-hamburger',
- html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
- preventDefault : true,
+ xtype : 'NavItem',
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
- menu : {
- xtype : 'Menu',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'MenuItem',
- fa : 'fa fa-plus',
- html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
- isContainer : false,
- preventDefault : true,
- listeners : {
- click : function (_self, e)
- {
- Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
- _this.group_grid.store.load({});
- });
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- },
- {
- xtype : 'MenuItem',
- fa : 'fa fa-pencil',
- html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
- isContainer : false,
- preventDefault : true,
- listeners : {
- click : function (_self, e)
- {
- var sel = _this.group_grid.getSelectionModel().getSelected();
-
- if(!sel){
- Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
- return;
- }
-
- if(sel.data.id * 1 < 1){
- Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
- return;
- }
-
- Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
- _this.group_grid.store.load({});
- });
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- },
- {
- xtype : 'MenuItem',
- fa : 'fa fa-trash',
- html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
- isContainer : false,
- preventDefault : true,
- listeners : {
- click : function (_self, e)
- {
- var sel = _this.group_grid.getSelectionModel().getSelected();
-
- if(!sel){
- Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
- return;
- }
-
- if(sel.data.id * 1 < 1){
- Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
- return;
- }
-
- var deleteIt = function()
- {
- new Pman.Request({
- url: baseURL + '/Roo/Core_group',
- method: 'POST',
- params: {
- _delete : sel.data.id
- },
- success: function(res){
- _this.group_grid.store.load({});
- return;
- }
- });
- }
-
- Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
-
- if(ret == 'no'){
- return;
- }
-
- deleteIt();
-
- }, this);
-
-
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- },
- {
- xtype : 'MenuItem',
- fa : 'fa fa-refresh',
- html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
- isContainer : false,
- preventDefault : true,
- listeners : {
- click : function (_self, e)
+ items : [
+ {
+ xtype : 'Element',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Row',
+ cls : 'roo-toolbar',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
{
- _this.group_grid.store.load({});
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'plus',
+ html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.type_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : 0,
+ etype : sel.data.name
+ }, function(res) {
+ _this.option_grid.store.load({});
+ });
+
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ },
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'edit',
+ html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.option_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : sel.data.id
+ }, function(res) {
+ _this.option_grid.store.load({});
+ });
+
+ },
+ render : function (_self)
+ {
+ _this.edit_btn = this;
+
+ this.hide();
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ },
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'trash',
+ html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
+ weight : 'primary',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.option_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
+ return;
+ }
+
+ new Pman.Request({
+ url: baseURL + '/Roo/Core_enum.php',
+ method : 'POST',
+ params : {
+ _delete : sel.data.id
+ },
+ success : function(res) {
+ _this.option_grid.store.load({});
+ }
+ });
+
+ },
+ render : function (_self)
+ {
+ _this.delete_btn = this;
+
+ this.hide();
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
}
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
+ ]
+ }
+ ]
+ }
+ ]
}
]
}
},
grid : {
xtype : 'Table',
+ cellSelection : true,
cls : 'table-fixed',
footerShow : false,
hover : true,
loadMask : true,
- responsive : true,
rowSelection : true,
striped : true,
listeners : {
+ cellclick : function (_self, el, rowIndex, columnIndex, e)
+ {
+ var di = _this.option_grid.colModel.getDataIndex(columnIndex);
+
+ if (di != 'active') {
+ return;
+ }
+
+ var rec = _this.option_grid.store.getAt(rowIndex);
+
+ rec.set('active', rec.data.active ? 0 : 1);
+
+ rec.commit();
+
+ /*if(rec.data.active * 1 != 1){
+ var el = _this.option_grid.getRowDom(rowIndex);
+
+ el.addClass('x-grid-row-fadeout');
+
+ el.on('transitionend',function(){
+ _this.option_grid.ds.remove(rec);
+ el.remove();
+ },this,{single:true});
+ }*/
+ },
render : function (_self)
{
_this.option_grid = _self;
- if (_this.option_panel.active) {
- _this.option_grid.footer.onClick('first');
+ },
+ rowdblclick : function (_self, el, rowIndex, e)
+ {
+ var sel = _this.option_grid.store.getAt(rowIndex);
+
+ if(!sel || sel.data.id * 1 < 1){
+ return;
}
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : sel.data.id
+ }, function(res) {
+ _this.option_grid.store.load({});
+ });
+
}
},
xns : Roo.bootstrap,
store : {
xtype : 'Store',
remoteSort : true,
- sortinfo : { field : 'display_name', direction: 'ASC' },
+ sortInfo : { field : 'display_name', direction: 'ASC' },
listeners : {
beforeload : function (_self, o)
{
+ if (!Pman.buildCompleted) {
+ return false;
+ }
+
o.params = o.params || {};
var sel = _this.type_grid.getSelectionModel().getSelected();
o.params.etype = sel.data.name;
+ },
+ load : function (_self, records, options)
+ {
+ _this.edit_btn.hide();
+ _this.delete_btn.hide();
+ },
+ update : function (_self, record, operation)
+ {
+ if (operation != 'commit') {
+ return;
+ }
+
+ new Pman.Request({
+ url : baseURL + '/Roo/Core_enum',
+ method :'POST',
+ params : {
+ id : record.data.id,
+ active: record.data.active
+ },
+ success : function() {
+
+ },
+ failure : function()
+ {
+ Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ });
}
},
xns : Roo.data,
sm : {
xtype : 'RowSelectionModel',
singleSelect : true,
+ listeners : {
+ selectionchange : function (_self)
+ {
+ _this.edit_btn.hide();
+ _this.delete_btn.hide();
+
+ if (!this.getSelected()) {
+ return;
+ }
+
+ _this.edit_btn.show();
+ _this.delete_btn.show();
+
+ }
+ },
xns : Roo.bootstrap.Table,
'|xns' : 'Roo.bootstrap.Table'
},
cm : [
{
xtype : 'ColumnModel',
+ cursor : 'pointer',
+ dataIndex : 'id',
+ header : _this._strings['01abfc750a0c942167651c40d088531d'] /* # */,
+ md : 2,
+ renderer : function(v,x,r) {
+ //console.log(r.data.seqid);
+ //return String.format('{0}', v ? v : '');
+
+ return
+ String.format('{0}', r.data.seqid ? r.data.seqid : '')
+ +" <span style='color:lightgrey'>"
+ + String.format('{0}', r.data.id ? r.data.id : '')
+ +"</span>";
+ },
+ sm : 2,
+ sortable : false,
+ xs : 2,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ cursor : 'pointer',
dataIndex : 'name',
header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
- md : 12,
+ md : 4,
+ renderer : function(v,x,r) {
+ return String.format('{0}', v ? v : '');
+ },
+ sm : 4,
+ sortable : false,
+ xs : 4,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ cursor : 'pointer',
+ dataIndex : 'display_name',
+ header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
+ md : 4,
+ renderer : function(v,x,r) {
+ return String.format('{0}', v ? v : '');
+ },
+ sm : 4,
+ sortable : false,
+ xs : 4,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ cursor : 'pointer',
+ dataIndex : 'active',
+ header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
+ md : 2,
renderer : function(v,x,r) {
- if (r.data.id == 0) {
- return '<b>' + "All Staff" + '</b>';
- }
-
- if (r.data.id == -1) {
- return '<b>' + "Not in a Group" + '</b>';
- }
-
- if (v == 'Administrators') {
- return '<b>' + "Adminstrators" + '</b>';
- }
-
- if (r.data.leader) {
- return v + ' (' + r.data.leader_name + ')';
- }
+ var state = v > 0 ? 'check-' : '';
- return v;
+ //return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';
+ return '<i class="far fa-'+ state + 'square-o fa-2x" aria-hidden="true"></i>';
},
- sm : 12,
+ sm : 2,
sortable : false,
- xs : 12,
+ xs : 2,
xns : Roo.grid,
'|xns' : 'Roo.grid'
}