Pman.Tab.BAdminIPAccess = new Roo.XComponent({
_strings : {
- 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
+ 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
+ '86f16ddf147752b95ffe69e2dfa769a1' :"Authorized By",
+ 'ec53a8c4f07baed5d8825072c89799be' :"Status",
'7dce122004969d56ae2e0245cb754d35' :"Edit",
- '01abfc750a0c942167651c40d088531d' :"#",
- 'dae8ace18bdcbcc6ae5aece263e14fe8' :"Options",
- 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
+ 'fc6f97505d89fe9277965c126744647a' :"No Companies found",
+ '11e8622b4aa4b1924aee81a9ec54c555' :"Create Date",
+ 'a12a3079e14ced46e69ba52b8a90b21a' :"IP",
+ '155ca6a755e25c15ad7ce45e2f638f10' :"Displaying Companies{0} - {1} of {2}",
+ '5a787141d53b573ec9b86e900bfe0d79' :"Expire Date",
'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
- '49ee3087348e8d44e1feda1917443987' :"Name",
- '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
'e3030abfa75de4573fb37032affa11e7' :"IP Access"
},
+ _named_strings : {
+ 'footer_displayMsg' : '155ca6a755e25c15ad7ce45e2f638f10' /* Displaying Companies{0} - {1} of {2} */ ,
+ 'footer_emptyMsg' : 'fc6f97505d89fe9277965c126744647a' /* No Companies found */
+ },
part : ["BAdmin", "IPAccess" ],
order : '006-Pman.Tab.BAdminIPAccess',
region : 'center',
- parent : false,
+ parent : 'Pman.Tab.BAdmin',
name : "unnamed module",
disabled : false,
permname : '',
items : [
{
xtype : 'Grid',
- background : false,
- fitContainer : true,
+ closable : false,
fitToFrame : true,
region : 'center',
- title : _this._strings['dae8ace18bdcbcc6ae5aece263e14fe8'] /* Options */,
+ title : _this._strings['e3030abfa75de4573fb37032affa11e7'] /* IP Access */,
listeners : {
activate : function (_self)
{
_this.edit_btn.hide();
_this.delete_btn.hide();
- if (_this.option_grid) {
- _this.option_grid.store.load({});
+ if (_this.table) {
+ _this.table.footer.onClick('first');
}
},
render : function (_self)
{
- _this.option_panel = _self;
+ _this.grid = _self;
}
},
xns : Roo.bootstrap.panel,
items : [
{
xtype : 'Column',
- md : 12,
+ md : 3,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Button',
- cls : 'roo-toolbar-button',
- glyphicon : 'plus',
- html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
- weight : 'default',
+ xtype : 'ComboBox',
+ allowBlank : false,
+ displayField : 'value',
+ editable : false,
+ hiddenName : 'status',
+ mode : 'local',
+ name : 'status_name',
+ tpl : '<div class=\"roo-select2-result\"><b>{value}</b></div>',
+ triggerAction : 'all',
+ valueField : 'code',
listeners : {
- click : function (_self, e)
+ render : function (_self)
{
- var sel = _this.type_grid.getSelectionModel().getSelected();
+ _this.status = this;
- 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({});
- });
-
+ this.setValue(0);
+ },
+ select : function (combo, record, index)
+ {
+ _this.table.footer.onClick('first');
}
},
xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- },
+ '|xns' : 'Roo.bootstrap',
+ store : {
+ xtype : 'SimpleStore',
+ data : [
+ ['0', 'Pending'],
+ ['1', 'Approve'],
+ ['-2', 'Temporary'],
+ ['-1', 'Reject']
+ ],
+ fields : [ 'code', 'value' ],
+ xns : Roo.data,
+ '|xns' : 'Roo.data'
+ }
+ }
+ ]
+ },
+ {
+ xtype : 'Column',
+ md : 9,
+ style : 'text-align: right;',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
{
xtype : 'Button',
cls : 'roo-toolbar-button',
listeners : {
click : function (_self, e)
{
- var sel = _this.option_grid.getSelectionModel().getSelected();
+ var sel = _this.table.getSelectionModel().getSelected();
if(!sel || sel.data.id * 1 < 1){
- Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a row');
return;
}
- Pman.Dialog.BAdminCoreEnum.show({
+ Pman.Dialog.BAdminIPAccess.show({
id : sel.data.id
}, function(res) {
- _this.option_grid.store.load({});
+ _this.table.store.load({});
});
},
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({});
- }
- });
+ Pman.genericDelete(_this.grid, 'core_ip_access');
},
render : function (_self)
},
grid : {
xtype : 'Table',
- cellSelection : true,
cls : 'table-fixed',
- footerShow : false,
hover : true,
loadMask : true,
- responsive : true,
rowSelection : true,
- striped : true,
+ striped : false,
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();
- },
render : function (_self)
{
- _this.option_grid = _self;
-
+ _this.table = this;
},
rowdblclick : function (_self, el, rowIndex, e)
{
- var sel = _this.option_grid.store.getAt(rowIndex);
+ var s = _this.table.store.getAt(rowIndex);
- if(!sel || sel.data.id * 1 < 1){
+ if(!s || s.data.id * 1 < 1){
return;
}
- Pman.Dialog.BAdminCoreEnum.show({
- id : sel.data.id
+ Pman.Dialog.BAdminIPAccess.show({
+ id : s.data.id
}, function(res) {
- _this.option_grid.store.load({});
+ _this.table.footer.onClick('first');
});
-
}
},
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
+ footer : {
+ xtype : 'PagingToolbar',
+ displayInfo : false,
+ displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */,
+ emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */,
+ name : 'footer',
+ pageSize : 25,
+ xns : Roo.bootstrap,
+ '|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 status = _this.status.getValue() * 1;
+
+ o.params.status = status;
},
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,
'type': 'int'
},
{
- 'name': 'etype',
+ 'name': 'created_dt',
+ 'type': 'date',
+ 'formatDate' : 'Y-m-d'
+ },
+ {
+ 'name': 'status',
+ 'type': 'int'
+ },
+ {
+ 'name': 'authorized_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'authorized_by_name',
'type': 'string'
},
{
- 'name': 'name',
+ 'name': 'authorized_by_email',
'type': 'string'
},
{
- 'name': 'display_name',
+ 'name': 'authorized_key',
'type': 'string'
},
{
- 'name': 'active',
- 'type': 'int'
+ 'name': 'email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'expire_dt',
+ 'type': 'date',
+ 'formatDate' : 'Y-m-d'
},
{
- 'name': 'seqid',
+ 'name': 'user_agent',
+ 'type': 'string'
+ },
+ {
+ 'name': 'updated_by',
'type': 'int'
+ },
+ {
+ 'name': 'updated_by_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'updated_by_email',
+ 'type': 'string'
}
+
],
id : 'id',
root : 'data',
{
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>";
+ dataIndex : 'created_dt',
+ header : _this._strings['11e8622b4aa4b1924aee81a9ec54c555'] /* Create Date */,
+ renderer : function(v,x,r) {
+ return String.format('{0}', v ? v.format('Y-m-d') : '');
},
- sm : 2,
- sortable : false,
+ sortable : true,
xs : 2,
xns : Roo.grid,
'|xns' : 'Roo.grid'
{
xtype : 'ColumnModel',
cursor : 'pointer',
- dataIndex : 'name',
- header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
- md : 4,
+ dataIndex : 'ip',
+ header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
renderer : function(v,x,r) {
return String.format('{0}', v ? v : '');
},
- sm : 4,
- sortable : false,
- xs : 4,
+ sortable : true,
+ xs : 2,
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 : '');
+ dataIndex : 'email',
+ header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
+ renderer : function(v,x,r)
+ {
+ return String.format('<a href="mailto:{0}">{0}</a>', v ? v : '')
},
- sm : 4,
- sortable : false,
- xs : 4,
+ sortable : true,
+ xs : 2,
xns : Roo.grid,
'|xns' : 'Roo.grid'
},
{
xtype : 'ColumnModel',
cursor : 'pointer',
- dataIndex : 'active',
- header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
- md : 2,
+ dataIndex : 'authorized_by',
+ header : _this._strings['86f16ddf147752b95ffe69e2dfa769a1'] /* Authorized By */,
+ renderer : function(v,x,r)
+ {
+ if(v * 1 == 0){
+ return '';
+ }
+
+ return String.format('{0}', r.data.authorized_by_name);
+ },
+ sortable : true,
+ xs : 2,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ cursor : 'pointer',
+ dataIndex : 'status',
+ header : _this._strings['ec53a8c4f07baed5d8825072c89799be'] /* Status */,
+ renderer : function(v,x,r)
+ {
+ v = v * 1;
+
+ var status = 'Pending';
+
+ switch (v) {
+ case 1 :
+ status = 'Approve';
+ break;
+ case -1 :
+ status = 'Reject';
+ break;
+ case -2 :
+ status = 'Temporary';
+ break;
+ default :
+ break;
+ }
+
+ return String.format('{0}', status);
+
+ },
+ sortable : true,
+ xs : 2,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ cursor : 'pointer',
+ dataIndex : 'expire_dt',
+ header : _this._strings['5a787141d53b573ec9b86e900bfe0d79'] /* Expire Date */,
renderer : function(v,x,r) {
- var state = v > 0 ? '-checked' : '';
-
- return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+
+ if(r.data.status * 1 != -2){
+ return '';
+ }
+
+ return String.format('{0}', v ? v.format('Y-m-d') : '');
},
- sm : 2,
- sortable : false,
+ sortable : true,
xs : 2,
xns : Roo.grid,
'|xns' : 'Roo.grid'