Created
May 17, 2017 03:45
-
-
Save dyazincahya/986af885e30a96077fcea6042d6d762f to your computer and use it in GitHub Desktop.
KCT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var services = { | |
read: site_url('freq_man/freq_man_worksheet/load_grid'), | |
updateRow: site_url('freq_man/freq_man_worksheet/update_row'), | |
destroy: site_url('freq_man/freq_man_worksheet/destroy'), | |
}; | |
/*Added by Satrio*/ | |
/*07-04-2015*/ | |
var addFreq = 0; | |
var addFreq2 = 0; | |
var addAnt = 0; | |
var neCmpName1 = ''; | |
var feCmpName1 = ''; | |
var neCmpName2 = ''; | |
var feCmpName2 = ''; | |
/*End*/ | |
Ext.define('KctApp.module.freq_man.freq_man_worksheet', { | |
id: 'parentFreqMan', | |
extend: 'Ext.panel.Panel', | |
mixins: ['KctApp.module.Base'], | |
autoScroll: true, | |
layout: 'fit', | |
constructor: function(config){ | |
var me = this; | |
var gridEditor = Ext.create('Ext.grid.plugin.RowEditing', { | |
pluginId: 'roweditor', | |
clicksToMoveEditor: 1 | |
}); | |
Ext.Ajax.request | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/get_auth'), | |
callback: function(o,s,r) | |
{ | |
if(s) | |
{ | |
var d = Ext.decode(r.responseText); | |
var colsValue = d.rows; | |
} | |
me.createGrid(colsValue); | |
} | |
} | |
); | |
this.callParent([config]); | |
this.initBase(); | |
}, | |
createGrid: function(colsValue){ | |
var me = this; | |
var cols = []; | |
var filters = []; | |
var fields = []; | |
var viewdata = 0; | |
cols.push | |
( | |
{ | |
header: '#', | |
dataIndex: 'RNUM', | |
width: 55, | |
sortable: false, | |
align: 'center' | |
} | |
); | |
for(var x = 0; x < colsValue.length; x++) | |
{ | |
if(colsValue[x].read == 1) | |
{ | |
if(colsValue[x].type_data == 'datetime') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
type: 'date', | |
format: 'd-M-Y H:i:s', | |
filter: | |
{ | |
type: 'date' | |
} | |
// renderer: function(v, prev, rec) | |
// { | |
// if(v == null) | |
// { | |
// return v; | |
// } | |
// else | |
// { | |
// return Ext.Date.format(neeew Date(v), 'd-M-Y H:i:s'); | |
// } | |
// } | |
} | |
); | |
} | |
else | |
{ | |
if(colsValue[x].type_data == 'string') | |
{ | |
if(colsValue[x].box_label == 'Province') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'string' | |
}, | |
editor: { | |
xtype:'textfield' | |
}, | |
} | |
); | |
} | |
else if(colsValue[x].box_label == 'Request Status') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'string' | |
}, | |
width: '200px', | |
editor: { | |
xtype: 'combo', | |
id: 'fm_request_type', | |
store: Ext.create('Ext.data.ArrayStore',{ | |
fields: ['value'], | |
data: [['NEED ISR'],['CANCEL ISR']] | |
}), | |
displayField: 'value', | |
valueField: 'value', | |
editable: false | |
}, | |
renderer: function(v, prev, rec) | |
{ | |
var val = v.toUpperCase(); | |
if (val == 'NEED ISR') | |
{ | |
prev.style = "background-color:#0AAAF1; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'CANCEL ISR') | |
{ | |
prev.style = "background-color:#F1CBBE; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'REJECTED') | |
{ | |
prev.style = "background-color:#FFA500; color:#000; text-align:center;"; | |
return val; | |
} | |
else | |
{ | |
prev.style = "background-color:#00FA9A; color:#000; text-align:center;"; | |
return val; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].box_label == 'Cart Active') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'string' | |
}, | |
renderer: function(v, prev, rec) | |
{ | |
if (v == 1) | |
{ | |
prev.style = "background-color:#2DC926; color:#000; text-align:center;"; | |
return 'Yes'; | |
} | |
else if (v == 0) | |
{ | |
prev.style = "background:#FF9696;text-align:center;"; | |
return 'No'; | |
} | |
else if (v == 3) | |
{ | |
prev.style = "background-color:#F5F5F5; color:#000; text-align:center;"; | |
return 'Already Process'; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].box_label == 'BHP (Rp.)') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'string' | |
}, | |
renderer: function(v) | |
{ | |
v = v.toString().replace(/\$|\,/g, ''); | |
if (isNaN(v)) | |
v = "0"; | |
sign = (v == (v = Math.abs(v))); | |
v = Math.floor(v * 100 + 0.50000000001); | |
cents = v % 100; | |
v = Math.floor(v / 100).toString(); | |
if (cents < 10) | |
cents = "0" + cents; | |
for (var i = 0; i < Math.floor((v.length - (1 + i)) / 3); i++) | |
v = v.substring(0, v.length - (4 * i + 3)) + ',' + | |
v.substring(v.length - (4 * i + 3)); | |
return (((sign) ? '' : '-') + v + '.' + cents); | |
} | |
} | |
); | |
} | |
else if(colsValue[x].box_label == 'Batch Number M2M') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'string' | |
}, | |
width: 140 | |
} | |
); | |
} | |
else | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'string' | |
} | |
} | |
); | |
} | |
} | |
else if(colsValue[x].type_data == 'number') | |
{ | |
if(colsValue[x].box_label == 'Receiver Freq MHz (FOP)') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'numeric' | |
}, | |
renderer: function(v, prev, rec) | |
{ | |
if (rec.data.fm_is_match_fop != 0 && rec.data.fm_rx_freq_fo != "") | |
{ | |
prev.style = "background-color:#2DC926; color:#000; text-align:center"; | |
return v; | |
} | |
else if (rec.data.fm_is_match_fop == 0 && rec.data.fm_rx_freq_fo != "") | |
{ | |
// prev.style = "background-color:#FF9696; color:#000; text-align:center"; | |
return v; | |
} | |
else | |
{ | |
return v; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].box_label == 'Receiver Freq MHz (Plan)') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'numeric' | |
}, | |
renderer: function(v, prev, rec) | |
{ | |
if (rec.data.fm_is_match_plan != 0 && rec.data.fm_rx_freq != "") | |
{ | |
prev.style = "background-color:#2DC926; color:#000; text-align:center"; | |
return v; | |
} | |
else if (rec.data.fm_is_match_plan == 0 && rec.data.fm_rx_freq != "") | |
{ | |
// prev.style = 'style="background-color:#FF9696; color:#000; text-align:center"'; | |
return v; | |
} | |
else | |
{ | |
return v; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].box_label == 'Transmitter Freq MHz (FOP)') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'numeric' | |
}, | |
renderer: function(v, prev, rec) | |
{ | |
if (rec.data.fm_is_match_fop != 0 && rec.data.fm_tx_freq_fo != "") | |
{ | |
prev.style = "background-color:#2DC926; color:#000; text-align:center"; | |
return v; | |
} | |
else if (rec.data.fm_is_match_fop == 0 && rec.data.fm_tx_freq_fo != "") | |
{ | |
prev.style = "background-color:#FF9696; color:#000; text-align:center"; | |
return v; | |
} | |
else | |
{ | |
return v; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].box_label == 'Transmitter Freq MHz (Plan)') | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'numeric' | |
}, | |
renderer: function(v, prev, rec) | |
{ | |
if (rec.data.fm_is_match_plan != 0 && rec.data.fm_tx_freq != "") | |
{ | |
prev.style = "background-color:#2DC926; color:#000; text-align:center"; | |
return v; | |
} | |
else if (rec.data.fm_is_match_plan == 0 && rec.data.fm_tx_freq != "") | |
{ | |
// prev.style = 'style="background-color:#FF9696; color:#000; text-align:center"'; | |
return v; | |
} | |
else | |
{ | |
return v; | |
} | |
} | |
} | |
); | |
} | |
else | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'numeric' | |
} | |
} | |
); | |
} | |
} | |
else | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
sortable: true, | |
filter: | |
{ | |
type: 'date' | |
} | |
} | |
); | |
} | |
} | |
} | |
else if(colsValue[x].read == null) | |
{ | |
cols.push | |
( | |
{ | |
header: colsValue[x].box_label, | |
dataIndex: colsValue[x].name_cols, | |
hidden: true | |
} | |
); | |
if(colsValue[x].name_cols == 'fm_lat_reg') | |
{ | |
cols.push | |
( | |
{ | |
header: 'Latitude', | |
dataIndex: '', | |
renderer: function(v, prev, rec) | |
{ | |
if(rec.data.fm_lat_deg != null) | |
{ | |
return rec.data.fm_lat_deg + '° ' + rec.data.fm_lat_min + "' " + rec.data.fm_lat_sec + "''" + rec.data.fm_lat_reg; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].name_cols == 'fm_long_reg') | |
{ | |
cols.push | |
( | |
{ | |
header: 'Longitude', | |
dataIndex: '', | |
renderer: function(v, prev, rec) | |
{ | |
if(rec.data.fm_long_deg != null) | |
{ | |
return rec.data.fm_long_deg + '° ' + rec.data.fm_long_min + "' " + rec.data.fm_long_sec + "''" + rec.data.fm_long_reg; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].name_cols == 'fm_lat_reg_fop') | |
{ | |
cols.push | |
( | |
{ | |
header: 'Latitude (FOP)', | |
dataIndex: '', | |
renderer: function(v, prev, rec) | |
{ | |
if(rec.data.fm_lat_deg_fop != null) | |
{ | |
return rec.data.fm_lat_deg_fop + '° ' + rec.data.fm_lat_min_fop + "' " + rec.data.fm_lat_sec_fop + "''" + rec.data.fm_lat_reg_fop; | |
} | |
} | |
} | |
); | |
} | |
else if(colsValue[x].name_cols == 'fm_long_reg_fop') | |
{ | |
cols.push | |
( | |
{ | |
header: 'Longitude (FOP)', | |
dataIndex: '', | |
renderer: function(v, prev, rec) | |
{ | |
if(rec.data.fm_long_deg != null) | |
{ | |
return rec.data.fm_long_deg + '° ' + rec.data.fm_long_min_fop + "' " + rec.data.fm_long_sec_fop + "''" + rec.data.fm_long_reg_fop; | |
} | |
} | |
} | |
); | |
} | |
} | |
if(colsValue[x].type_data == 'datetime') | |
{ | |
fields.push | |
( | |
{ | |
name: colsValue[x].name_cols, | |
type: colsValue[x].type_data, | |
dateFormat: 'c' | |
} | |
); | |
} | |
else | |
{ | |
if(colsValue[x].type_data == 'float') | |
{ | |
colsValue[x].type_data = 'string'; | |
} | |
fields.push | |
( | |
{ | |
name: colsValue[x].name_cols, | |
type: colsValue[x].type_data | |
} | |
); | |
} | |
} | |
fields.push | |
( | |
{ | |
name: 'RNUM', | |
type: 'string' | |
}, | |
{ | |
name: 'fm_ref_link_id', | |
type: 'int' | |
}, | |
{ | |
name: 'fm_link_simf_id', | |
type: 'string' | |
}, | |
{ | |
name: 'fm_ne_ant_id_1', | |
type: 'string' | |
}, | |
{ | |
name: 'fm_fe_ant_id_1', | |
type: 'string' | |
}, | |
{ | |
name: 'fm_fe_eqp_id', | |
type: 'string' | |
}, | |
{ | |
name: 'fm_ne_eqp_id', | |
type: 'string' | |
} | |
); | |
var ds = Ext.create('Ext.data.Store', { | |
fields: fields, | |
proxy: | |
{ | |
type: 'ajax', | |
url: services.read, | |
actionMethods: | |
{ | |
module: this.module, | |
}, | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
Ext.define('KctApp.module.freq_man.freq_man_worksheet_data', { | |
extend: 'Ext.grid.Panel', | |
mixins: ['KctApp.module.Base'], | |
module: 'freq_man', | |
id: 'grid', | |
store: ds, | |
columns: cols, | |
selModel: Ext.create('Ext.selection.CheckboxModel'), | |
columnLines: true, | |
features: | |
[ | |
Ext.create('KctApp.feature.GridSearch'), | |
Ext.create('KctApp.feature.GridLimit'), | |
Ext.create('KctApp.feature.GridFilter') | |
], | |
viewConfig: | |
{ | |
emptyText: 'No Data' | |
}, | |
plugins: [ | |
Ext.create('Ext.grid.plugin.RowEditing', { | |
pluginId: 'roweditor', | |
clicksToMoveEditor: 1, | |
listeners: { | |
scope: this, | |
edit: updateRow | |
} | |
}) | |
], | |
dockedItems: | |
[ | |
{ | |
xtype: 'pagingtoolbar', | |
displayInfo: true, | |
store: ds, | |
items: ['-',{ | |
xtype:'splitbutton', | |
text: '', | |
tooltip: 'Download', | |
iconCls: 'icon icon-download-2', | |
menu: [{text:'Download All',scope: this, handler: this.doDownloadAll, iconCls:'icon icon-download-2'} | |
,{text:'Download All (Spectra)', scope: this, handler: this.doDownloadAllSpect, iconCls:'icon icon-download-2'} | |
,{text:'Download Need ISR', scope: this, handler: this.doDownloadNeedIsr, iconCls:'icon icon-download-2'} | |
,{text:'Download Plan Dismantle', scope: this, handler: this.doDownloadPlanDis, iconCls:'icon icon-download-2'} | |
,{text:'Download ISR New', scope: this, handler: this.doDownloadIsrNew, iconCls:'icon icon-download-2'} | |
,{text:'Download ISR Renew', scope: this, handler: this.doDownloadIsrRenew, iconCls:'icon icon-download-2'} | |
], | |
reorderable: false | |
}] | |
} | |
], | |
onBoxReady: function() | |
{ | |
this.callParent(arguments); | |
Ext.defer(ds.load, 500, ds); | |
this.validateActions({ | |
module: this.module, | |
actions: this.toolbarButton, | |
scope: this, | |
callback: function(actions) { | |
this.getDockedItems('pagingtoolbar')[0].insert(16, actions); | |
} | |
}); | |
//added by diden | |
params = {}; | |
nesiteid = []; | |
fesiteid = []; | |
tx = []; | |
rx = []; | |
bandwith = []; | |
req_sts = []; | |
nestsnm = []; | |
festsnm = []; | |
neaddr = []; | |
feaddr = []; | |
link_simf_id = []; | |
fm_no_app = []; | |
ct = parent.parent.data; | |
if(ct !== undefined){ | |
for(i=0;i < ct.length;i++) | |
{ | |
// console.log(ct[i].fm_bandwidth); | |
// param{} | |
nesiteid[i] = ct[i].fm_ne_site_id; | |
fesiteid[i] = ct[i].fm_fe_site_id; | |
tx[i] = ct[i].fm_tx_freq; | |
rx[i] = ct[i].fm_rx_freq; | |
bandwith[i] = ct[i].fm_bandwidth; | |
req_sts[i] = ct[i].fm_req_status; | |
nestsnm[i] = ct[i].fm_ne_site_name; | |
festsnm[i] = ct[i].fm_ne_site_name; | |
neaddr[i] = ct[i].fm_addr; | |
feaddr[i] = ct[i].fm_addr; | |
if (typeof ct[i].fm_link_simf_id !== 'undefined') link_simf_id[i] = ct[i].fm_link_simf_id; | |
if (typeof ct[i].fm_no_app !== 'undefined') fm_no_app[i] = ct[i].fm_no_app; | |
} | |
/*params.nesiteid = nesiteid; | |
params.fesiteid = fesiteid; | |
params.tx = tx; | |
params.rx = rx; | |
params.bandwith = bandwith; | |
params.req_sts = req_sts; | |
params.nestsnm = nestsnm; | |
params.festsnm = festsnm; | |
params.neaddr = neaddr; | |
params.feaddr = feaddr;*/ | |
if(link_simf_id.length !== 0) params.link_simf_id = link_simf_id; | |
if(fm_no_app.length !== 0) params.fm_no_app = fm_no_app; | |
this.store.proxy.extraParams = {params : Ext.encode(params)}; | |
//end | |
} | |
}, | |
onEditClick: function() { | |
var rec = this.selModel.getSelection()[0] || null, | |
editor, fb; | |
if (!rec) | |
{ | |
this.showWarning('No record selected!'); | |
return; | |
} | |
// else | |
// { | |
// if(rec.data.fm_req_status == "CANCEL ISR") | |
// { | |
// this.showWarning("This record can't edited!"); | |
// return; | |
// } | |
// } | |
this.doEditItem(rec, 'freq_man'); | |
}, | |
onAddCartClick: function() { | |
var rs = this.selModel.getSelection(), | |
editor, fb, me = this; | |
if (rs.length < 1) { | |
this.showWarning('No record selected!'); | |
return; | |
} | |
if (rs.length > 30) { | |
this.showWarning('The cart can only accommodate max 30 Data !'); | |
return; | |
} | |
for (i = 0; i < rs.length; i++) { | |
if (rs[i].data.fm_is_flag == 1) { | |
this.showWarning('This data has been already in cart!'); | |
return; | |
} | |
if (rs[i].data.fm_is_flag == 3) { | |
if(rs[i].data.fm_no_app == null || rs[i].data.fm_no_app == 0){ | |
this.showWarning('App Number is empty!'); | |
return; | |
} | |
// this.showWarning('This data has already been processed !'); | |
// return; | |
} | |
if (rs[i].data.fm_req_status == 'NEED ISR' || rs[i].data.fm_req_status == 'need isr') { | |
if (rs[i].data.fm_tx_freq_fo == null || rs[i].data.fm_tx_freq_fo == 0 || rs[i].data.fm_tx_freq_fo == '') { | |
this.showWarning('Transmitter Freq Mhz (FOP) can not be null or 0!'); | |
return; | |
} | |
if (rs[i].data.fm_rx_freq_fo == null || rs[i].data.fm_rx_freq_fo == 0 || rs[i].data.fm_rx_freq_fo == '') { | |
this.showWarning('Receiver Freq Mhz (FOP) can not be null or 0!'); | |
return; | |
} | |
} | |
if(rs[i].data.fm_ne_ant_id_1 == null) { | |
this.showWarning('NE Antenna ID can not be null or 0!'); | |
return; | |
} | |
if(rs[i].data.fm_fe_ant_id_1 == null) { | |
this.showWarning('FE Antenna ID can not be null or 0!'); | |
return; | |
} | |
// if (rs[i].data.fm_req_status == 'CANCEL ISR' || rs[i].data.fm_req_status == 'cancel isr') { | |
// if (rs[i].data.fm_isr == null || rs[i].data.fm_isr == '' || rs[i].data.fm_isr == 0) { | |
// this.showWarning('isr can not be null!'); | |
// return; | |
// } | |
// } | |
} | |
Ext.Msg.confirm('Confirm', 'Add ' + rs.length + ' record(s) to cart?', function(b) { | |
if (b === 'yes') { | |
var keys = [], stat = [], i; | |
for (i = 0; i < rs.length; i++) { | |
keys.push( | |
{fm_link_simf_id: rs[i].data.fm_link_simf_id} | |
); | |
stat.push( | |
{fm_req_status: rs[i].data.fm_req_status} | |
); | |
} | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/add_to_cart'), | |
params: { | |
module: this.module, | |
keys: Ext.encode(keys), | |
stat: Ext.encode(stat) | |
}, | |
callback: function(o, s, r) { | |
me.showInfo('Information', r.responseText); | |
if (s) | |
this.getStore().reload(); | |
} | |
}); | |
} | |
}, this); | |
}, | |
showActiveCart: function() { | |
var me = this; | |
var tmpActStore = Ext.create('Ext.data.Store', { | |
fields: [ | |
'RNUM' | |
, {name: 'tfm_id', type: 'int'} | |
, {name: 'fm_link_type_id', type: 'string'} | |
, {name: 'fm_link_simf_id', type: 'string'} | |
, {name: 'fm_ne_site_id', type: 'string'} | |
, {name: 'fm_fe_site_id', type: 'string'} | |
, {name: 'fm_ne_site_name', type: 'string'} | |
, {name: 'fm_tx_freq_isr', type: 'string'} | |
, {name: 'fm_rx_freq_isr', type: 'string'} | |
, {name: 'fm_bandwidth_isr', type: 'string'} | |
, {name: 'fm_req_status', type: 'string'} | |
, {name: 'tfm_cart_pic', type: 'string'} | |
, {name: 'tfm_cart_index_increment', type: 'string'} | |
, {name: 'fm_is_flag', type: 'string'} | |
], | |
remoteSort: true, | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/load_store_tmp_act'), | |
actionMethods: {read: 'post'}, | |
extraParams: { | |
module: this.module | |
}, | |
reader: { | |
type: 'json', | |
root: 'data' | |
} | |
} | |
}).load(); | |
var gridCart = Ext.create('Ext.grid.Panel', { | |
store: tmpActStore, | |
loadMask: true, | |
border: false, | |
columns: [ | |
{header: '#', dataIndex: 'RNUM', width: 60}, | |
{header: '', width: 60, dataIndex: 'tfm_id', hidden: true}, | |
{header: 'pic', width: 60, dataIndex: 'tfm_cart_pic', hidden: true}, | |
{header: 'Link Id',width: 140, dataIndex: 'fm_link_type_id'}, | |
{header: 'Near End', dataIndex: 'fm_ne_site_id'}, | |
{header: 'Far End', dataIndex: 'fm_fe_site_id'}, | |
{header: 'NE Name', dataIndex: 'fm_ne_site_name'}, | |
{header: 'FE Name', dataIndex: 'fm_ne_site_name'}, | |
{header: 'Transmitter Freq Mhz(ISR)',width: '140px', dataIndex: 'fm_tx_freq_isr'}, | |
{header: 'Receiver Freq Mhz(ISR)',width: '140px', dataIndex: 'fm_rx_freq_isr'}, | |
{header: 'Bandwidth', dataIndex: 'fm_bandwidth_isr'}, | |
{header: 'Request Status',width: '140px', dataIndex: 'fm_req_status', renderer: function(val, prev, rec){ | |
if (val == 'NEED ISR' || val == 'Need ISR') | |
{ | |
prev.style = "background-color:#0AAAF1; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'CANCEL ISR') | |
{ | |
prev.style = "background-color:#F1CBBE; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'REJECTED') | |
{ | |
prev.style = "background-color:#FFA500; color:#000; text-align:center;"; | |
return val; | |
} | |
else | |
{ | |
prev.style = "background-color:#00FA9A; color:#000; text-align:center;"; | |
return val; | |
} | |
} | |
}, | |
{header: 'Flag Cart', dataIndex: 'fm_is_flag', renderer: function(v, prev, rec){ | |
if (v == 3) | |
{ | |
prev.style = "background-color:#F5F5F5; color:#000; text-align:center;"; | |
return 'Already Process'; | |
} | |
else | |
{ | |
prev.style = "background:#FF9696;text-align:center;"; | |
return 'No'; | |
} | |
} | |
} | |
], | |
columnLines: true, | |
features: [ | |
Ext.create('KctApp.feature.GridSearch'), | |
Ext.create('KctApp.feature.GridLimit'), | |
Ext.create('KctApp.feature.GridFilter') | |
], | |
selModel: Ext.create('Ext.selection.CheckboxModel'), | |
viewConfig: { | |
emptyText: 'No Data' | |
}, | |
dockedItems: [ | |
{ | |
xtype: 'pagingtoolbar', | |
displayInfo: true, | |
store: tmpActStore, | |
items: ['-', { | |
xtype: 'button', | |
text: 'Delete', | |
iconCls: 'icon icon-remove-3', | |
handler: function() { | |
doDeleteCartAct(); | |
} | |
}] | |
} | |
] | |
}); | |
var win = Ext.create('Ext.Window', { | |
width: 1000, | |
height: 400, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: 'Cart Active', | |
items: [gridCart], | |
buttons: [ | |
{ | |
text: 'Save Cart', | |
handler: function() { | |
var c = tmpActStore.load().getCount(); | |
if (c > 0) { | |
doSaveCartAct(); | |
} else { | |
me.showWarning('No Data in Cart Active!'); | |
} | |
} | |
}, | |
{ | |
text: 'Close', | |
handler: function() { | |
win.close(); | |
} | |
} | |
] | |
}); | |
win.show(); | |
function doSaveCartAct() { | |
var d = gridCart.selModel.getStore().data.items[1].data, | |
incr = d.tfm_cart_index_increment, | |
pic = d.tfm_cart_pic, | |
tgl = new Date(), | |
day = tgl.getDate().toString(), | |
month = (tgl.getMonth()+1).toString(), | |
year = tgl.getFullYear().toString(); | |
pic = pic.replace(' ','_'); | |
if(month.length == 1) month = '0'+month; | |
if(day.length == 1) day = '0'+day; | |
if(incr == '' || incr == null) incr = 1; | |
var dsCartType = Ext.create('Ext.data.Store', { | |
fields: [ | |
{name: 'ref_id', type: 'string'}, | |
{name: 'ref_combo', type: 'string'}, | |
{name: 'ref_status', type: 'string'} | |
], | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/ref_type_cart'), | |
actionMethods: { | |
read: 'post' | |
}, | |
extraParams: { | |
module: this.module, | |
flag: d.fm_is_flag | |
}, | |
reader: { | |
type: 'json', | |
root: 'data' | |
} | |
} | |
}); | |
var tanggal = year+'-'+month+'-'+day; | |
var pSave = Ext.create('Ext.form.Panel', { | |
border: false, | |
bodyPadding: 10, | |
width: 290, | |
items: [{ | |
xtype: 'combo', | |
fieldLabel: 'Type Cart', | |
name: 'tfm_cart_type', | |
id: 'tfm_cart_type', | |
store: dsCartType, | |
mode: 'local', | |
triggerAction: 'all', | |
displayField: 'ref_combo', | |
valueField: 'ref_combo', | |
editable: false, | |
forceSelection: true, | |
allowBlank: false, | |
listeners: { | |
select: function(a, b, c){ | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/get_increment_cart'), | |
params: { | |
'type': Ext.encode(a.value), | |
}, | |
callback: function(o, s, r) { | |
if (s) { | |
var cn = a.value+'_'+tanggal+'_'+pic+'_'+(Number(r.responseText)+1); | |
Ext.getCmp('crt_nm').setValue(cn); | |
} | |
} | |
}); | |
} | |
} | |
},{ | |
xtype: 'displayfield', | |
fieldLabel: 'Cart Name', | |
id: 'crt_nm' | |
}] | |
}); | |
var wSave = Ext.create('Ext.Window', { | |
width: 400, | |
height: 180, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: 'Save Cart', | |
items: [pSave], | |
buttons: [{ | |
text: 'Save', | |
handler: function() { | |
var type = Ext.getCmp('tfm_cart_type').getValue(); | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/save_cart_act'), | |
params: { | |
'type': Ext.encode(type), | |
}, | |
callback: function(o, s, r) { | |
me.showInfo('Information', r.responseText); | |
if (s) { | |
tmpActStore.reload(); | |
wSave.close(); | |
} | |
} | |
}); | |
} | |
}] | |
}); | |
wSave.show(); | |
} | |
function doDeleteCartAct() { | |
var rs = gridCart.selModel.getSelection(); | |
if (!rs.length) { | |
me.showWarning('No record(s) selected!'); | |
return; | |
} | |
Ext.Msg.confirm('Confirm', 'Delete selected record(s)?', function(b) { | |
if (b === 'yes') { | |
var keys = [], i; | |
for (i = 0; i < rs.length; i++) { | |
keys.push({ | |
fm_link_simf_id: rs[i].data.fm_link_simf_id, | |
fm_is_flag: rs[i].data.fm_is_flag | |
}); | |
} | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/delete_tmp'), | |
params: { | |
module: this.module, | |
keys: Ext.encode(keys) | |
}, | |
callback: function(o, s, r) { | |
me.showInfo('Information', r.responseText); | |
if (s) { | |
tmpActStore.reload(); | |
me.getStore().reload() | |
} | |
} | |
}); | |
} | |
}, this); | |
} | |
}, | |
doDownloadCartAct: function(params, type) { | |
var me = this; | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_cart_act'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
}, | |
doDownloadCartAll: function(params, type){ | |
var me = this; | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_cart_all'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
}, | |
doDownloadBuktiUpload: function(params, type){ | |
var me = this; | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_bukti_upload'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function(o, s, r) { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
}, | |
checkAllCart: function() { | |
console.log(sessPIC); | |
if(sessPIC == 'Andre Harjoko'){ | |
this.comboCartPic(); | |
} else { | |
this.showAllCart(); | |
} | |
}, | |
comboCartPic: function(){ | |
var me = this; | |
var storeCartPic = Ext.create('Ext.data.Store', { | |
fields: ['tfm_cart_pic'], | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_cart_pic'), | |
actionMethods: {read: 'POST'}, | |
reader: { | |
type: 'json', | |
root: 'data', | |
totalProperty: 'total' | |
} | |
}, | |
remoteSort: true, | |
autoload: true | |
}); | |
var form = Ext.create('Ext.form.Panel', { | |
bodyPadding: 10, | |
method: 'POST', | |
layout: 'column', | |
items: [{ | |
xtype: 'combo', | |
fieldLabel: 'Name', | |
id: 'pic_cart_name', | |
name: 'pic_cart_name', | |
disabled: false, | |
forceSelection: true, | |
editable: false, | |
store: storeCartPic, | |
queryMode: 'remote', | |
displayField: 'tfm_cart_pic', | |
valueField: 'tfm_cart_pic', | |
// allowBlank: false, | |
width: 280, | |
tabIndex: 6 | |
}] | |
}); | |
var win = Ext.create('Ext.Window', { | |
width: 350, | |
height: 150, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: 'Select PIC of Cart', | |
items: [form], | |
buttons: [{ | |
text: 'Open', | |
handler: function() { | |
var picName = Ext.getCmp('pic_cart_name').getValue(); | |
if(picName !== null){ | |
me.showAllCart(picName); | |
win.close(); | |
} | |
} | |
}, { | |
text: 'Close', | |
handler: function() { | |
win.close(); | |
} | |
}] | |
}); | |
win.show(); | |
}, | |
showAllCart: function(picName) { | |
var me = this; | |
if(picName == undefined) picName = 'kosong'; | |
var cartNameStore = Ext.create('Ext.data.Store', { | |
fields: [ | |
{name: 'tfm_cart_name', type: 'string'} | |
], | |
remoteSort: true, | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/load_cart_name'), | |
actionMethods: {read: 'post'}, | |
extraParams: { | |
module: this.module, | |
picName: picName | |
}, | |
reader: { | |
type: 'json', | |
root: 'data' | |
} | |
} | |
}).load(); | |
var dsCartType = Ext.create('Ext.data.Store', { | |
fields: [ | |
{name: 'ref_id', type: 'string'}, | |
{name: 'ref_combo', type: 'string'}, | |
{name: 'ref_status', type: 'string'} | |
], | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/ref_type_cart/true'), | |
actionMethods: { | |
read: 'post' | |
}, | |
extraParams: { | |
module: this.module | |
}, | |
reader: { | |
type: 'json', | |
root: 'data' | |
} | |
} | |
}).load(); | |
var gridSelectCart = Ext.create('Ext.grid.Panel', { | |
store: cartNameStore, | |
loadMask: true, | |
border: false, | |
columns: [ | |
Ext.create('Ext.grid.RowNumberer', {width: 30}), | |
{header: 'Cart Name', dataIndex: 'tfm_cart_name', width: 770}, | |
], | |
columnLines: true, | |
features: [ | |
Ext.create('KctApp.feature.GridSearch'), | |
Ext.create('KctApp.feature.GridLimit'), | |
Ext.create('KctApp.feature.GridFilter') | |
], | |
viewConfig: { | |
emptyText: 'No Data' | |
}, | |
dockedItems: [ | |
{ | |
xtype: 'pagingtoolbar', | |
displayInfo: true, | |
store: cartNameStore, | |
items: [ | |
{ | |
xtype: 'combo', | |
name: 'tfm_cart_type2', | |
id: 'tfm_cart_type2', | |
store: dsCartType, | |
mode: 'local', | |
width: 112, | |
triggerAction: 'all', | |
displayField: 'ref_combo', | |
valueField: 'ref_combo', | |
editable: false, | |
forceSelection: true, | |
listeners: { | |
select: function(a, b, c) | |
{ | |
cartNameStore.proxy.extraParams = { | |
module: this.module, | |
picName: picName, | |
combo: a.value | |
}; | |
cartNameStore.reload(); | |
} | |
} | |
}] | |
} | |
] | |
}); | |
var win = Ext.create('Ext.Window', { | |
width: 850, | |
height: 420, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: 'Select Cart', | |
items: [gridSelectCart], | |
buttons: [{ | |
text: 'Open Cart', | |
handler: function() { | |
doOpenCart(); | |
} | |
}, { | |
text: 'Close', | |
handler: function() { | |
win.close(); | |
} | |
}] | |
}); | |
win.show(); | |
function doOpenCart() { | |
var rs = gridSelectCart.selModel.getSelection(); | |
if (rs.length < 1) { | |
me.showWarning('No cart selected!'); | |
return; | |
} | |
var modHisHidden = true; | |
var cart_name = rs[0].data.tfm_cart_name; | |
var check = cart_name.substring(3,0); | |
if(check == 'Mod') modHisHidden = false; | |
var cartStore = Ext.create('Ext.data.Store', { | |
fields: [ | |
'RNUM' | |
, {name: 'tfm_id', type: 'int'} | |
, {name: 'tfm_cart_name', type: 'string'} | |
, {name: 'fm_link_type_id', type: 'string'} | |
, {name: 'fm_ne_site_id', type: 'string'} | |
, {name: 'fm_fe_site_id', type: 'string'} | |
, {name: 'fm_ne_site_name', type: 'string'} | |
, {name: 'fm_tx_freq_isr', type: 'string'} | |
, {name: 'fm_tx_freq_fo', type: 'string'} | |
, {name: 'fm_rx_freq_isr', type: 'string'} | |
, {name: 'fm_rx_freq_fo', type: 'string'} | |
, {name: 'fm_bandwidth', type: 'string'} | |
, {name: 'fm_bandwidth_isr', type: 'string'} | |
, {name: 'fm_req_status', type: 'string'} | |
, {name: 'fm_report_date', type: 'string'} | |
, {name: 'fm_no_app', type: 'string'} | |
, {name: 'fm_no_resi', type: 'string'} | |
, {name: 'fm_sta_no', type: 'string'} | |
, {name: 'fm_zona', type: 'string'} | |
, {name: 'fm_no_spp', type: 'string'} | |
, {name: 'fm_bhp', type: 'string'} | |
, {name: 'fm_no_po', type: 'string'} | |
, {name: 'fm_transfer_date', type: 'string'} | |
, {name: 'fm_no_isr', type: 'string'} | |
, {name: 'fm_isr_date', type: 'string'} | |
, {name: 'fm_no_dismantle', type: 'string'} | |
, {name: 'fm_dis_status', type: 'string'} | |
, {name: 'fm_ex_status', type: 'string'} | |
, {name: 'fm_status_fm', type: 'string'} | |
, {name: 'tfm_is_approved', type: 'string'} | |
, {name: 'fm_reason_reject', type: 'string'} | |
, {name: 'fm_soap_apid', type: 'string'} | |
, {name: 'fm_soap_aprefnumber', type: 'string'} | |
, {name: 'fm_soap_apname', type: 'string'} | |
, {name: 'fm_soap_apidnew', type: 'string'} | |
, {name: 'fm_soap_warning', type: 'string'} | |
, {name: 'fm_soap_error', type: 'string'} | |
, {name: 'fm_soap_acdid', type: 'string'} | |
, {name: 'fm_m2m_process_date', type: 'string'} | |
, {name: 'tfm_cart_type', type: 'string'} | |
, {name: 'fm_m2m_process_date', type: 'string'} | |
, {name: 'fm_soap_message', type: 'string'} | |
, {name: 'fm_soap_result_code', type: 'string'} | |
, {name: 'fm_soap_license_no', type: 'string'} | |
, {name: 'fm_soap_app_ref', type: 'string'} | |
, {name: 'fm_province', type: 'string'} | |
, {name: 'fm_site_height', type: 'string'} | |
, {name: 'fm_ref_link_id', type: 'int'} | |
, {name: 'fm_link_simf_id', type: 'string'} | |
, {name: 'fm_ne_ant_id_1', type: 'string'} | |
, {name: 'fm_fe_ant_id_1', type: 'string'} | |
, {name: 'fm_ne_eqp_id', type: 'string'} | |
, {name: 'fm_fe_eqp_id', type: 'string'} | |
, {name: 'fm_batch_number', type: 'string'} | |
, {name: 'fm_soap_batch_no', type: 'string'} | |
, {name: 'fm_ant_gain', type: 'string'} | |
, {name: 'fm_polarization', type: 'string'} | |
, {name: 'fm_data_source', type: 'string'} | |
, {name: 'fm_eqp_output_power', type: 'string'} | |
, {name: 'fm_reason_reject', type: 'string'} | |
, {name: 'fm_is_flag', type: 'string'} | |
, {name: 'fm_no_simf', type: 'string'} | |
], | |
remoteSort: true, | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/load_store_cart'), | |
actionMethods: {read: 'post'}, | |
extraParams: { | |
cart_name: Ext.encode(cart_name) | |
}, | |
reader: { | |
type: 'json', | |
root: 'data' | |
} | |
} | |
}).load(); | |
var gridCart = Ext.create('Ext.grid.Panel', { | |
store: cartStore, | |
loadMask: true, | |
border: false, | |
columns: [ | |
{header: '#', dataIndex: 'RNUM', width: 60}, | |
{header: '', width: 60, dataIndex: 'tfm_id', hidden: true}, | |
{header: 'Cart Name', width: 60, dataIndex: 'tfm_cart_name', hidden: true}, | |
{header: 'link simf id', width: 60, dataIndex: 'fm_link_simf_id', hidden: true}, | |
{header: 'Cart Type', width: 60, dataIndex: 'tfm_cart_type', hidden: true}, | |
{header: 'Link Id', dataIndex: 'fm_link_type_id'}, | |
{header: 'Near End', dataIndex: 'fm_ne_site_id'}, | |
{header: 'Far End', dataIndex: 'fm_fe_site_id'}, | |
{header: 'NE Name', dataIndex: 'fm_ne_site_name'}, | |
{header: 'FE Name', dataIndex: 'fm_ne_site_name'}, | |
{header: 'TX ISR', dataIndex: 'fm_tx_freq_isr'}, | |
{header: 'RX ISR', dataIndex: 'fm_rx_freq_isr'}, | |
// {header: 'TX FOP', dataIndex: 'fm_tx_freq_fo'}, | |
// {header: 'RX FOP', dataIndex: 'fm_rx_freq_fo'}, | |
// {header: 'Bandwidth', dataIndex: 'fm_bandwidth'}, | |
/* {header: 'TX FOP', dataIndex: 'fm_tx_freq_fo'}, | |
{header: 'RX FOP', dataIndex: 'fm_rx_freq_fo'}, | |
{header: 'Bandwidth', dataIndex: 'fm_bandwidth'}, */ | |
{header: 'Bandwidth ISR', dataIndex: 'fm_bandwidth_isr'}, | |
{header: 'Request Status', dataIndex: 'fm_req_status', | |
renderer: function(val, prev, rec){ | |
if (val == 'NEED ISR' || val == 'Need ISR') | |
{ | |
prev.style = "background-color:#0AAAF1; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'CANCEL ISR') | |
{ | |
prev.style = "background-color:#F1CBBE; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'REJECTED') | |
{ | |
prev.style = "background-color:#FFA500; color:#000; text-align:center;"; | |
return val; | |
} | |
else | |
{ | |
prev.style = "background-color:#00FA9A; color:#000; text-align:center;"; | |
return val; | |
} | |
} | |
}, | |
{header: 'Report Date', dataIndex: 'fm_report_date'}, | |
// {header: 'No App', dataIndex: 'fm_no_app'}, | |
{header: 'No Resi', dataIndex: 'fm_no_resi'}, | |
{header: 'STA No', dataIndex: 'fm_sta_no'}, | |
{header: 'Zona', dataIndex: 'fm_zona'}, | |
// {header: 'No Spp', dataIndex: 'fm_no_spp'}, | |
// {header: 'BHP', dataIndex: 'fm_bhp'}, | |
// {header: 'No PO Pembayaran', dataIndex: 'fm_no_po'}, | |
// {header: 'Tanggal Transfer', dataIndex: 'fm_transfer_date'}, | |
// {header: 'ISR No', dataIndex: 'fm_no_isr'}, | |
// {header: 'ISR Date', dataIndex: 'fm_isr_date'}, | |
{header: 'No Dismantle', dataIndex: 'fm_no_dismantle'}, | |
{header: 'Dismantle Status', dataIndex: 'fm_dis_status'}, | |
{header: 'Existing Status', dataIndex: 'fm_ex_status'}, | |
{header: 'Status FM', dataIndex: 'fm_status_fm'}, | |
{header: 'Reason', dataIndex: 'fm_reason_reject', width: 200}, | |
{header: 'Data Approved', dataIndex: 'tfm_is_approved', | |
renderer: function(value, prev, rec) { | |
if (value == 1) { | |
prev.style = "background-color:#2DC926; color:#000; text-align:center;"; | |
return 'Yes'; | |
} | |
else if (value == 0) { | |
// prev.style = "background-color:#FF9696; color:#000; text-align:center;"; | |
return 'No'; | |
} | |
} | |
}, | |
/* {header: 'Soap Acd id', dataIndex: 'fm_soap_acdid', width: 200}, | |
{header: 'Soap Ap id', dataIndex: 'fm_soap_apid', width: 200}, | |
{header: 'Soap Ap Ref Number', dataIndex: 'fm_soap_aprefnumber', width: 200}, | |
{header: 'Soap Ap Name', dataIndex: 'fm_soap_apname', width: 200}, | |
{header: 'Soap Ap Id New', dataIndex: 'fm_soap_apidnew', width: 200}, */ | |
{header: 'Message', dataIndex: 'fm_soap_message', width: 200}, | |
{header: 'Result Code', dataIndex: 'fm_soap_result_code', width: 200}, | |
{header: 'License No', dataIndex: 'fm_no_simf', width: 200}, | |
{header: 'No App', dataIndex: 'fm_soap_app_ref', width: 200},/* | |
{header: 'M2M Process', dataIndex: 'fm_m2m_process_date', width: 200, hidden:true}, | |
{header: 'Soap Error', dataIndex: 'fm_soap_error', width: 200}, */ | |
{header: 'M2M Process Date', dataIndex: 'fm_m2m_process_date', width: 200}, | |
{header: 'Height ASL m', dataIndex: 'fm_site_height', width: 200}, | |
{header: 'NE Antenna ID', dataIndex: 'fm_ne_ant_id_1', width: 160}, | |
{header: 'FE Antenna ID', dataIndex: 'fm_fe_ant_id_1', width: 160}, | |
{header: 'NE Equipment ID', dataIndex: 'fm_ne_eqp_id', width: 160}, | |
{header: 'FE Equipment ID', dataIndex: 'fm_fe_eqp_id', width: 160}, | |
{header: 'Batch Number', dataIndex: 'fm_batch_number', width: 160}, | |
{header: 'Batch Number M2M', dataIndex: 'fm_soap_batch_no', width: 160}, | |
{header: 'Antenna Polarization', dataIndex: 'fm_polarization', width: 160}, | |
{header: 'Source', dataIndex: 'fm_data_source', width: 160}, | |
{header: 'Reason Reject', dataIndex: 'fm_reason_reject', width: 270}, | |
{header: 'Province', dataIndex: 'fm_province', width: 200, hidden: true}, | |
{header: 'Antenna Gain', dataIndex: 'fm_ant_gain', width: 200, hidden: true}, | |
{header: 'EQP Output Power', dataIndex: 'fm_eqp_output_power', width: 200, hidden: true}, | |
{header: 'Flag Cart', dataIndex: 'fm_is_flag', renderer: function(v, prev, rec){ | |
if (v == 3) | |
{ | |
prev.style = "background-color:#F5F5F5; color:#000; text-align:center;"; | |
return 'Already Process'; | |
} | |
else | |
{ | |
prev.style = "background:#FF9696;text-align:center;"; | |
return 'No'; | |
} | |
} | |
} | |
], | |
columnLines: true, | |
selModel: Ext.create('Ext.selection.CheckboxModel'), | |
features: [ | |
Ext.create('KctApp.feature.GridSearch'), | |
Ext.create('KctApp.feature.GridLimit'), | |
Ext.create('KctApp.feature.GridFilter') | |
], | |
viewConfig: { | |
emptyText: 'No Data' | |
}, | |
dockedItems: [ | |
{ | |
xtype: 'pagingtoolbar', | |
displayInfo: true, | |
store: cartStore, | |
items: ['-', | |
{ | |
xtype:'splitbutton', | |
text: '', | |
tooltip: 'Download', | |
iconCls: 'icon icon-download-2', | |
menu: [ | |
{text:'Download Spectra', scope: this, handler: function(){me.doDownloadCartAct(cart_name)}, iconCls:'icon icon-download-2'} | |
,{text:'Download All', scope: this, handler: function(){me.doDownloadCartAll(cart_name)}, iconCls:'icon icon-download-2'} | |
,{text:'Download Bukti Upload', scope: this, handler: function(){me.doDownloadBuktiUpload(cart_name)}, iconCls:'icon icon-download-2'} | |
], | |
reorderable: false | |
} | |
// { | |
// xtype: 'button', | |
// text: 'Download', | |
// iconCls: 'icon icon-download-2', | |
// handler: function() { | |
// me.doDownloadCartAct(cart_name); | |
// } | |
// } | |
, { | |
xtype: 'button', | |
text: 'Upload', | |
iconCls: 'icon icon-upload-2', | |
handler: function() { | |
me.doUploadCart(cartStore); | |
} | |
}, { | |
xtype: 'button', | |
text: 'Approve', | |
iconCls: 'icon icon-check-alt', | |
handler: function() { | |
var rs = gridCart.selModel.getSelection(); | |
me.onApproveClick(rs, cartStore, wCart); | |
} | |
},{ | |
xtype: 'button', | |
text: 'Reject', | |
iconCls: 'icon icon-cancel', | |
handler: function() { | |
var rs = gridCart.selModel.getSelection(); | |
me.onRejectClick(rs, cartStore); | |
} | |
},{ | |
xtype: 'button', | |
text: 'Edit', | |
iconCls: 'icon icon-pencil-2', | |
handler: function() { | |
doEditCart(); | |
} | |
},{ | |
xtype: 'button', | |
text: 'Delete', | |
iconCls: 'icon icon-remove-3', | |
handler: function() { | |
doDeleteCart(); | |
} | |
},{ | |
xtype: 'button', | |
text: 'M2M Process', | |
iconCls: 'icon icon-power', | |
handler: function() { | |
var rs = gridCart.selModel.getSelection(); | |
me.doM2MProcess(rs, cartStore, wCart); | |
} | |
},{ | |
xtype: 'button', | |
text: 'Mail', | |
iconCls: 'icon icon-mail', | |
handler: function(){ | |
var rs = gridCart.selModel.getSelection(); | |
me.doDownloadMail(rs, cartStore, wCart); | |
} | |
},{ | |
xtype: 'button', | |
text: 'Status', | |
iconCls: 'icon icon-info', | |
handler: function(){ | |
var rs = gridCart.selModel.getSelection(); | |
me.doM2MStatus(rs, cartStore, wCart); | |
} | |
},{ | |
xtype: 'button', | |
iconCls: 'icon icon-history-2', | |
hidden: modHisHidden, | |
handler: function(){ | |
var rs = gridCart.selModel.getSelection(); | |
me.doModifHistory(rs, cartStore, wCart); | |
} | |
}] | |
} | |
] | |
}); | |
var wCart = Ext.create('Ext.Window', { | |
width: 1260, | |
height: 400, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: cart_name, | |
items: [gridCart], | |
}); | |
wCart.show(); | |
function doEditCart() { | |
var rs = gridCart.selModel.getSelection(); | |
var freqHidden = false; | |
if (!rs.length) { | |
me.showWarning('No record(s) selected!'); | |
return; | |
} | |
var typeCart = rs[0].data.tfm_cart_type; | |
if(typeCart == 'Modification'){ | |
freqHidden = true; | |
} | |
me.doEditItem(rs[0], 'tmp', cartStore, freqHidden); | |
} | |
function doDeleteCart() { | |
var rs = gridCart.selModel.getSelection(); | |
if (!rs.length) { | |
me.showWarning('No record(s) selected!'); | |
return; | |
} | |
for (i = 0; i < rs.length; i++) { | |
if (rs[i].data.fm_m2m_process_date && rs[i].data.fm_is_flag != '3') { | |
me.showWarning('Can not delete data, This data has already process'); | |
return; | |
} | |
} | |
Ext.Msg.confirm('Confirm', 'Delete selected record(s)?', function(b) { | |
if (b === 'yes') { | |
var keys = [], i; | |
for (i = 0; i < rs.length; i++) { | |
keys.push({ | |
fm_link_simf_id: rs[i].data.fm_link_simf_id, | |
fm_is_flag: rs[i].data.fm_is_flag | |
}); | |
} | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/delete_tmp'), | |
params: { | |
module: this.module, | |
keys: Ext.encode(keys) | |
}, | |
callback: function(o, s, r) { | |
me.showInfo('Information', r.responseText); | |
if (s) { | |
cartStore.reload(); | |
me.getStore().reload(); | |
cartNameStore.reload(); | |
} | |
} | |
}); | |
} | |
}, this); | |
}; | |
}; | |
}, | |
// doUploadCart: function(cartStore) { | |
// var me = this; | |
// var form = Ext.create('Ext.form.Panel', { | |
// bodyPadding: 10, | |
// method: 'POST', | |
// layout: 'column', | |
// items: [{ | |
// columnWidth: 0.50, | |
// flex: 1, | |
// items: [{ | |
// xtype: 'fieldcontainer', | |
// layout: 'hbox', | |
// items: [{ | |
// xtype: 'fieldcontainer', | |
// layout: 'hbox', | |
// items: [{ | |
// xtype: 'filefield', | |
// name: 'file_excel', | |
// fieldLabel: 'File', | |
// buttonText: 'Select File', | |
// labelWidth: 70, | |
// width: 370, | |
// emptyText: 'Select a file', | |
// buttonConfig: { | |
// iconCls: 'icon icon-folder' | |
// } | |
// }] | |
// }] | |
// }] | |
// }] | |
// }); | |
// var editor = Ext.create('Ext.window.Window', { | |
// title: 'Upload Excel', | |
// width: 800, | |
// layout: 'fit', | |
// modal: true, | |
// autoHeight: true, | |
// items: form, | |
// buttons: [{ | |
// text: 'Upload', | |
// handler: function() { | |
// var fp = form.getForm(); | |
// if (fp.isValid()) { | |
// fp.submit({ | |
// url: INDEX_URL + 'freq_man/freq_man_worksheet/dx_update_cart', | |
// waitMsg: 'Uploading... Please wait.', | |
// params: params, | |
// success: function(f, a) { | |
// editor.close(); | |
// me.getStore().reload(); | |
// cartStore.reload(); | |
// me.showInfo('Upload is Successfully..'); | |
// }, | |
// failure: function() { | |
// me.showError('An error ocurred while uploading record!'); | |
// } | |
// }); | |
// } | |
// } | |
// }, | |
// { | |
// text: 'Cancel', | |
// handler: function() { | |
// editor.close(); | |
// } | |
// } | |
// ] | |
// }); | |
// editor.show(); | |
// }, | |
doUploadCart: function(cartStore){ | |
var me = this; | |
var form = Ext.create('Ext.form.Panel', { | |
bodyPadding: 10, | |
method: 'POST', | |
layout: 'column', | |
items: [{ | |
columnWidth: 0.50, | |
flex: 1, | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
style: {marginBottom: '10px'}, | |
items: [{ | |
xtype: 'combo', | |
fieldLabel: 'Template', | |
name: 'file_excel_type', | |
id: 'file_excel_type', | |
store: new Ext.data.ArrayStore({ | |
fields: ['type'], | |
data: [['Spectra'], ['ALL']] | |
}), | |
mode: 'local', | |
triggerAction: 'all', | |
displayField: 'type', | |
valueField: 'type', | |
value: 'Spectra', | |
editable: false, | |
forceSelection: true, | |
allowBlank: true, | |
labelWidth: 70, | |
width: 160 | |
}] | |
}] | |
},{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'filefield', | |
name: 'file_excel', | |
fieldLabel: 'File', | |
buttonText: 'Select File', | |
labelWidth: 70, | |
width: 370, | |
emptyText: 'Select a file', | |
buttonConfig: { | |
iconCls: 'icon icon-folder' | |
} | |
}] | |
}] | |
}] | |
}] | |
}); | |
var editor = Ext.create('Ext.window.Window', { | |
title: 'Upload Excel', | |
// width: 800, | |
layout: 'fit', | |
modal: true, | |
autoHeight: true, | |
items: form, | |
buttons: [{ | |
text: 'Upload', | |
handler: function() { | |
var fp = form.getForm(); | |
var tp = Ext.getCmp('file_excel_type').getValue(); | |
if (fp.isValid()) { | |
fp.submit({ | |
url: INDEX_URL + 'freq_man/freq_man_worksheet/dx_update_cart', | |
waitMsg: 'Uploading... Please wait.', | |
params: { | |
'tp': Ext.encode(tp) | |
}, | |
success: function(f, a) { | |
editor.close(); | |
me.getStore().reload(); | |
cartStore.reload(); | |
me.showInfo('Upload is Successfully..'); | |
}, | |
failure: function(f, a) { | |
var msg = a.result.error; | |
if(msg == undefined) { | |
me.showError('An error ocurred while uploading record!'); | |
} else { | |
me.showError('Error Data', msg); | |
} | |
} | |
}); | |
} | |
} | |
}, | |
{ | |
text: 'Cancel', | |
handler: function() { | |
editor.close(); | |
} | |
} | |
] | |
}); | |
editor.show(); | |
}, | |
onDeleteClick: function(){ | |
var rs = this.selModel.getSelection(); | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
Ext.Msg.confirm('Confirm', 'Delete selected record(s)?', function(b) { | |
if (b === 'yes') { | |
var key = [], keys = [], i; | |
for (i = 0; i < rs.length; i++) { | |
key.push( | |
{fm_link_simf_id: rs[i].data.fm_link_simf_id}, | |
{fm_is_flag: rs[i].data.fm_is_flag} | |
); | |
keys.push(key); | |
key = []; | |
} | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/delete_freq_man'), | |
params: { | |
module: this.module, | |
keys: Ext.encode(keys) | |
}, | |
callback: function(o, s, r) { | |
this.showInfo('Information', r.responseText); | |
if (s) { | |
this.getStore().reload() | |
} | |
} | |
}); | |
} | |
}, this); | |
}, | |
onApproveClick: function(rs, cartStore, win){ | |
var myMask = new Ext.LoadMask(win, {msg:"Please wait..."}); | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
for (i = 0; i < rs.length; i++) { | |
if (rs[i].data.tfm_is_approved == 1) { | |
this.showWarning('This data ever been approved, can not approve data more than 1 time!'); | |
return; | |
} | |
} | |
Ext.Msg.confirm('Confirm', 'Approve selected record(s)?', function(b){ | |
if(b === 'yes'){ | |
myMask.show(); | |
var keys = [], i; | |
for (i = 0; i < rs.length; i++) { | |
keys.push( | |
{ | |
fm_link_simf_id: rs[i].data.fm_link_simf_id, | |
tfm_cart_name: rs[i].data.tfm_cart_name, | |
tfm_cart_type: rs[i].data.tfm_cart_type | |
} | |
); | |
} | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/approve'), | |
params: { | |
module: this.module, | |
keys: Ext.encode(keys) | |
}, | |
callback: function(o, s, r) { | |
this.showInfo('Information', r.responseText); | |
if (s) { | |
cartStore.reload(); | |
this.getStore().reload(); | |
} | |
myMask.hide(); | |
} | |
}); | |
} | |
}, this); | |
}, | |
onRejectClick: function(rs, cartStore){ | |
var me = this; | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
// for (i = 0; i < rs.length; i++) { | |
// if (rs[i].data.tfm_is_approved == 1) { | |
// this.showWarning('Can not reject data! <br /> This data has been approved '); | |
// return; | |
// } | |
// } | |
var keys = [], i; | |
for (i = 0; i < rs.length; i++) { | |
keys.push( | |
{fm_link_simf_id: rs[i].data.fm_link_simf_id} | |
); | |
} | |
var fReason = Ext.create('Ext.form.Panel', { | |
border: false, | |
bodyPadding: 10, | |
width: 680, | |
items: [{ | |
xtype: 'textarea', | |
id: 'fm_reason_reject', | |
fieldLabel: 'Reason', | |
anchor: '97%' | |
}] | |
}); | |
var wReason = Ext.create('Ext.Window', { | |
width: 500, | |
height: 200, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: 'Reason Reject', | |
items: [fReason], | |
buttons: [{ | |
text: 'Save', | |
handler: function(){ | |
var reason = Ext.getCmp('fm_reason_reject').getValue(), | |
link = rs[0].data.fm_link_simf_id; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/reject'), | |
params: { | |
'reason': Ext.encode(reason), | |
'link': Ext.encode(keys) | |
}, | |
callback: function(o, s, r) { | |
me.showInfo('Information', r.responseText); | |
if (s) { | |
wReason.close(); | |
cartStore.reload(); | |
me.getStore().reload(); | |
} | |
} | |
}); | |
} | |
},{ | |
text: 'Cancel', | |
handler: function(){ | |
wReason.close(); | |
} | |
}] | |
}); | |
wReason.show(); | |
}, | |
onRejectWSClick: function(){ | |
var me = this; | |
var rs = this.selModel.getSelection(); | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
var keys = [], i; | |
for (i = 0; i < rs.length; i++) { | |
keys.push( | |
{fm_link_simf_id: rs[i].data.fm_link_simf_id} | |
); | |
} | |
var fReason = Ext.create('Ext.form.Panel', { | |
border: false, | |
bodyPadding: 10, | |
width: 680, | |
items: [{ | |
xtype: 'textarea', | |
id: 'fm_reason_reject', | |
fieldLabel: 'Reason', | |
anchor: '97%' | |
}] | |
}); | |
var wReason = Ext.create('Ext.Window', { | |
width: 500, | |
height: 200, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: 'Reason Reject', | |
items: [fReason], | |
buttons: [{ | |
text: 'Save', | |
handler: function(){ | |
var reason = Ext.getCmp('fm_reason_reject').getValue(), | |
link = rs[0].data.fm_link_simf_id; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/rejectWS'), | |
params: { | |
'reason': Ext.encode(reason), | |
'link': Ext.encode(keys) | |
}, | |
callback: function(o, s, r) { | |
me.showInfo('Information', r.responseText); | |
if (s) { | |
wReason.close(); | |
me.getStore().reload(); | |
} | |
} | |
}); | |
} | |
},{ | |
text: 'Cancel', | |
handler: function(){ | |
wReason.close(); | |
} | |
}] | |
}); | |
wReason.show(); | |
}, | |
onUploadBalClick: function(){ | |
var me = this; | |
var form = Ext.create('Ext.form.Panel', { | |
bodyPadding: 10, | |
method: 'POST', | |
layout: 'column', | |
items: [{ | |
columnWidth: 0.50, | |
flex: 1, | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'filefield', | |
name: 'file_excel', | |
fieldLabel: 'File', | |
buttonText: 'Select File', | |
labelWidth: 70, | |
width: 370, | |
emptyText: 'Select a file', | |
buttonConfig: { | |
iconCls: 'icon icon-folder' | |
} | |
}] | |
}] | |
},{ | |
xtype: 'displayfield', | |
value: 'Don\'t have excel upload template ?<br> Click <a href="' + site_url('freq_man/modresfile/template_balmon.xlsx') + '"><b>here</b></a> to download.', | |
width: 250, | |
hideLabel: true, | |
style: 'font-size: 11px; margin-top: 20px' | |
}] | |
}] | |
}); | |
var editor = Ext.create('Ext.window.Window', { | |
title: 'Upload Data Balmon', | |
// width: 800, | |
layout: 'fit', | |
modal: true, | |
autoHeight: true, | |
items: form, | |
buttons: [{ | |
text: 'Upload', | |
handler: function() { | |
var fp = form.getForm(); | |
if (fp.isValid()) { | |
fp.submit({ | |
url: INDEX_URL + 'freq_man/freq_man_worksheet/dx_upload_freq_man', | |
waitMsg: 'Uploading... Please wait.', | |
//params: params, | |
success: function(f, a) { | |
editor.close(); | |
me.getStore().reload(); | |
// cartStore.reload(); | |
me.showInfo('Upload is Successfully..'); | |
}, | |
failure: function(f, a) { | |
var err = Ext.decode(a.response.responseText); | |
if(err.error == null || err.error == '' || !err.error){ | |
console.log('1'); | |
me.showError('An error ocurred while uploading record!'); | |
} else { | |
console.log('2'); | |
me.showError('Error', err.error); | |
} | |
} | |
}); | |
} | |
} | |
}, | |
{ | |
text: 'Cancel', | |
handler: function() { | |
editor.close(); | |
} | |
} | |
] | |
}); | |
editor.show(); | |
}, | |
onUploadSpecClick: function(){ | |
var me = this; | |
var form = Ext.create('Ext.form.Panel', { | |
bodyPadding: 10, | |
method: 'POST', | |
layout: 'column', | |
items: [{ | |
columnWidth: 0.50, | |
flex: 1, | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
style: {marginBottom: '10px'}, | |
items: [{ | |
xtype: 'combo', | |
fieldLabel: 'Template', | |
name: 'file_excel_type', | |
id: 'file_excel_type', | |
store: new Ext.data.ArrayStore({ | |
fields: ['type'], | |
data: [['Spectra'], ['ISR'], ['ALL']] | |
}), | |
mode: 'local', | |
triggerAction: 'all', | |
displayField: 'type', | |
valueField: 'type', | |
value: 'Spectra', | |
editable: false, | |
forceSelection: true, | |
allowBlank: true, | |
labelWidth: 70, | |
width: 160, | |
listeners: { | |
change: function(a, b, c){ | |
if(a.value == 'ISR') | |
{ | |
Ext.getCmp('file_desc').setValue( | |
'If you want to update data ISR New please click <a href="'+site_url('freq_man/freq_man_worksheet/download_isr_new')+'" ><b>here</b></a>. <br />'+ | |
'If you want to update data ISR Renew please click <a href="'+site_url('freq_man/freq_man_worksheet/download_isr_renew')+'" ><b>here</b></a>.' | |
); | |
} | |
else if(a.value == 'ALL') | |
{ | |
Ext.getCmp('file_desc').setValue( | |
'If you want to update data balmon validation please click <a class="balmon" href="#"><b>here</b></a>. <br />'+ | |
'If you want to update data all worksheet data please click <a href="'+site_url('freq_man/freq_man_worksheet/download_all')+'" ><b>here</b></a>.' | |
); | |
// Ext.getCmp('file_desc').setValue('Template can be get in \'Download Need ISR\' or \'Download Plan Dismantle\''); | |
} | |
else | |
{ | |
Ext.getCmp('file_desc').setValue( | |
'If you want to update data Need ISR please click <a href="'+site_url('freq_man/freq_man_worksheet/download_need_isr')+'" ><b>here</b></a>. <br />'+ | |
'If you want to update data Plan Dismantle please click <a href="'+site_url('freq_man/freq_man_worksheet/download_plan_dis')+'" ><b>here</b></a>.' | |
); | |
// Ext.getCmp('file_desc').setValue('Template can be get in \'Download Need ISR\' or \'Download Plan Dismantle\''); | |
} | |
} | |
} | |
}] | |
}] | |
},{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'filefield', | |
name: 'file_excel', | |
fieldLabel: 'File', | |
buttonText: 'Select File', | |
labelWidth: 70, | |
width: 370, | |
emptyText: 'Select a file', | |
buttonConfig: { | |
iconCls: 'icon icon-folder' | |
} | |
}] | |
}] | |
},{ | |
xtype: 'displayfield', | |
id: 'file_desc', | |
// value: 'Templatasase can be get in \'Download Need ISR\' or \'Download Plan Dismantle\'', | |
value: 'If you want to update data Need ISR please click <a href="'+site_url('freq_man/freq_man_worksheet/download_need_isr')+'" ><b>here</b></a>. <br />'+ | |
'If you want to update data Plan Dismantle please click <a href="'+site_url('freq_man/freq_man_worksheet/download_plan_dis')+'" ><b>here</b></a>.', | |
width: 350, | |
hideLabel: true, | |
style: 'font-size: 11px; margin-top: 20px', | |
listeners: { | |
change: function(a){ | |
var target = Ext.get(a.getEl().query('.balmon')); | |
target.on('click', function(e,el){ | |
me.doDownloadDataBalmon(); | |
}); | |
} | |
} | |
}] | |
}] | |
}); | |
var editor = Ext.create('Ext.window.Window', { | |
title: 'Update Data', | |
// width: 400, | |
layout: 'fit', | |
modal: true, | |
autoHeight: true, | |
items: form, | |
buttons: [{ | |
text: 'Upload', | |
handler: function() { | |
var fp = form.getForm(); | |
var tp = Ext.getCmp('file_excel_type').getValue(); | |
if (fp.isValid()) { | |
fp.submit({ | |
url: INDEX_URL + 'freq_man/freq_man_worksheet/dx_upload_spec', | |
waitMsg: 'Uploading... Please wait.', | |
params: { | |
'tp': Ext.encode(tp) | |
}, | |
success: function(f, a) { | |
editor.close(); | |
me.getStore().reload(); | |
me.showInfo('Upload is Successfully..'); | |
}, | |
failure: function(f, a) { | |
var msg = a.result.error; | |
if(msg == undefined) { | |
me.showError('An error ocurred while uploading record!'); | |
} else { | |
me.showError('Error Data', msg); | |
} | |
} | |
}); | |
} | |
} | |
}, | |
{ | |
text: 'Cancel', | |
handler: function() { | |
editor.close(); | |
} | |
} | |
] | |
}); | |
editor.show(); | |
}, | |
onStatusClick: function(){ | |
// alert('Still Developing, Please wait :)'); return; | |
var me = this; | |
var rs = this.selModel.getSelection(); | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
if (rs.length > 1) { | |
this.showWarning('Please select 1 record !'); | |
return; | |
} | |
if (!rs[0].data.fm_no_app) { | |
this.showWarning("Can't process, app ref number is empty."); | |
return; | |
} | |
if (!rs[0].data.fm_batch_number_m2m) { | |
this.showWarning("Can't process, Batch Number is empty."); | |
return; | |
} | |
var keys = []; | |
keys.push({ | |
fm_link_simf_id: rs[0].data.fm_link_simf_id, | |
fm_no_app: rs[0].data.fm_no_app, | |
fm_batch_number_m2m: rs[0].data.fm_batch_number_m2m | |
}); | |
var link = 'soap/getStatusRegM2M'; | |
Ext.getBody().mask('Loading .. Please wait'); | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url(link), | |
scriptTag:true, | |
params: { | |
module: this.module, | |
key: Ext.encode(keys) | |
}, | |
success: function(res){ | |
var obj = Ext.decode(res.responseText); | |
var msg = obj.msg; | |
var idx, city, k1, k2, site_id_name, simf_id; | |
Ext.Msg.alert('Info', msg); | |
this.getStore().reload() | |
Ext.getBody().unmask(); | |
}, | |
failure: function(res){ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success == true){ | |
Ext.Msg.alert('Info',obj.msg); | |
}else{ | |
Ext.Msg.alert('Error','Process Time Out, Please Check Your Connection'); | |
} | |
this.getStore().reload(); | |
Ext.getBody().unmask(); | |
} | |
}); | |
// var rs = gridCart.selModel.getSelection(); | |
// me.doM2MStatus(rs, cartStore, wCart); | |
}, | |
doDownloadDataBalmon: function() { | |
var me = this; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/check_download_data_balmon'), | |
callback: function(a,b,c){ | |
if(c.responseText != 'false') | |
{ | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_all/true'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
} else { | |
this.showInfo('Info', 'Data is empty !'); | |
} | |
} | |
}); | |
}, | |
test2: function(){ | |
alert('halo'); | |
}, | |
doM2MProcess: function(rs, cartStore, win){ | |
var me = this; | |
var myMask = new Ext.LoadMask(win, {msg:"Please wait..."}); | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
for (i = 0; i < rs.length; i++) { | |
if (rs[i].data.fm_m2m_process_date && rs[i].data.fm_is_flag != '3') { | |
this.showWarning('Can not process data more than 1 time!'); | |
myMask.hide(); | |
return; | |
} | |
} | |
Ext.Msg.confirm('Confirm', 'Do M2M Process selected record(s)?', function(b) { | |
if (b === 'yes') { | |
myMask.show(); | |
var key = [], keys = [], bhp_v = [], bhp = [], i, link; | |
for (i = 0; i < rs.length; i++) { | |
// keys.push(rs[i].data.fm_link_simf_id); | |
keys.push( | |
{ | |
fm_link_simf_id: rs[i].data.fm_link_simf_id, | |
fm_req_status: rs[i].data.fm_req_status, | |
tfm_cart_name: rs[i].data.tfm_cart_name | |
} | |
); | |
bhp_v.push( | |
{fm_zona: rs[i].data.fm_zona, | |
fm_bandwidth: rs[i].data.fm_bandwidth, | |
fm_eqp_output_power: rs[i].data.fm_eqp_output_power, | |
fm_link_simf_id: rs[i].data.fm_link_simf_id, | |
fm_ant_gain: rs[i].data.fm_ant_gain} | |
); | |
bhp.push(bhp_v); | |
bhp_v = []; | |
} | |
if(rs[0].data.tfm_cart_type.toLowerCase() == 'registration' || rs[0].data.tfm_cart_type.toLowerCase() == 'validation'){ | |
link = 'soap/exec/n'; | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'dismantle'){ | |
link = 'soap/exec/c'; | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'modification'){ | |
link = 'soap/exec/m'; | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'reconfirm'){ | |
link = 'soap/exec/r'; | |
} | |
else { | |
link = 'soap/exec'; | |
} | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url(link), | |
scriptTag:true, | |
params: { | |
module: this.module, | |
ids: Ext.encode(keys) | |
}, | |
success: function(res){ | |
var obj = Ext.decode(res.responseText); | |
var msg = obj.msg.new; | |
var idx, city, k1, k2, site_id_name, simf_id; | |
if(obj.success == true){ | |
//get and update bhp projection | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/bhp_projection'), | |
scriptTag:true, | |
params: { | |
params: Ext.encode(bhp) | |
} | |
}); | |
Ext.Msg.alert('Info',obj.msg); | |
}else{ | |
if(rs[0].data.tfm_cart_type.toLowerCase() == 'registration' || rs[0].data.tfm_cart_type.toLowerCase() == 'validation'){ | |
// Ext.Msg.alert('Info',obj.msg.new); | |
Ext.Msg.buttonText.ok = "Confirm"; | |
Ext.Msg.alert('Info',obj.msg.new, function(b){ | |
if(msg.indexOf('cvc-datatype-valid.1.2.1:') > -1){ | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/revision_m2m_process'), | |
params: { | |
simf_id: Ext.encode(rs[0].data.fm_link_simf_id), | |
type: Ext.encode('coordinate') | |
}, | |
success: function(res){ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success == true){ | |
Ext.Msg.alert('Info', 'Value NULL on the Coordinate has been changed to zero (0)'); | |
} | |
} | |
}); | |
} | |
else if(msg.indexOf('AD_CITY') > -1){ | |
idx = msg.indexOf('should be:'); | |
city = msg.substring(idx+11); | |
simf_id = obj.simf_id; | |
k1 = msg.indexOf('TCS_NAME: '); | |
k2 = msg.indexOf('. The correct'); | |
site_id_name = msg.substring(k1+10,k2); | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/revision_m2m_process'), | |
params: { | |
city: Ext.encode(city), | |
site_id_name: Ext.encode(site_id_name), | |
simf_id: Ext.encode(simf_id), | |
type: Ext.encode('city') | |
}, | |
success: function(res){ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success == true){ | |
Ext.Msg.alert('Info', 'Value of City has been changed'); | |
} | |
} | |
}); | |
} else if(msg.indexOf('AD_DISTRICT') > -1) { | |
idx = msg.indexOf('should be:'); | |
district = msg.substring(idx+11); | |
simf_id = obj.simf_id; | |
k1 = msg.indexOf('TCS_NAME: '); | |
k2 = msg.indexOf('. The correct'); | |
site_id_name = msg.substring(k1+10,k2); | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/revision_m2m_process'), | |
params: { | |
district: Ext.encode(district), | |
site_id_name: Ext.encode(site_id_name), | |
simf_id: Ext.encode(simf_id), | |
type: Ext.encode('district') | |
}, | |
success: function(res){ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success == true){ | |
Ext.Msg.alert('Info', 'Value of District has been changed'); | |
} | |
} | |
}); | |
} else if(msg.indexOf('AD_COUNTY') > -1) { | |
idx = msg.indexOf('should be:'); | |
county = msg.substring(idx+11); | |
simf_id = obj.simf_id; | |
k1 = msg.indexOf('TCS_NAME: '); | |
k2 = msg.indexOf('. The correct'); | |
site_id_name = msg.substring(k1+10,k2); | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/revision_m2m_process'), | |
params: { | |
county: Ext.encode(county), | |
site_id_name: Ext.encode(site_id_name), | |
simf_id: Ext.encode(simf_id), | |
type: Ext.encode('county') | |
}, | |
success: function(res){ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success == true){ | |
Ext.Msg.alert('Info', 'Value of County (Province) has been changed'); | |
} | |
} | |
}); | |
} | |
}, this); | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'dismantle'){ | |
Ext.Msg.alert('Info',obj.msg.cancel); | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'modification'){ | |
me.up().alertMsg('Info',obj.msg.modif); | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'reconfirm'){ | |
me.up().alertMsg('Info',obj.msg.reconfirm); | |
} | |
} | |
this.getStore().reload(); | |
cartStore.reload(); | |
myMask.hide(); | |
}, | |
failure: function(res){ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success == true){ | |
Ext.Msg.alert('Info',obj.msg); | |
}else{ | |
if(rs[0].data.tfm_cart_type.toLowerCase() == 'registration'){ | |
Ext.Msg.alert('Error',obj.msg.new); | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'dismantle'){ | |
Ext.Msg.alert('Info',obj.msg.cancel); | |
} | |
else{ | |
Ext.Msg.alert('Error','Process Time Out, Please Check Your Connection'); | |
} | |
} | |
this.getStore().reload(); | |
cartStore.reload(); | |
myMask.hide(); | |
} | |
}); | |
} | |
}, this); | |
}, | |
doModifHistory: function(rs, cartStore, win){ | |
var me = this; | |
var myMask = new Ext.LoadMask(win, {msg:"Please wait..."}); | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
if (rs.length > 1) { | |
this.showWarning('Please select 1 record !'); | |
return; | |
} | |
// myMask.show(); | |
var historyStore = Ext.create('Ext.data.Store', { | |
fields: [ | |
{name: 'tfml_time', type: 'date'} | |
, {name: 'tfml_action', type: 'string'} | |
, {name: 'tfml_cart_pic', type: 'string'} | |
, {name: 'tfm_id', type: 'int'} | |
, {name: 'tfm_cart_name', type: 'string'} | |
, {name: 'fm_link_type_id', type: 'string'} | |
, {name: 'fm_ne_site_id', type: 'string'} | |
, {name: 'fm_fe_site_id', type: 'string'} | |
, {name: 'fm_ne_site_name', type: 'string'} | |
, {name: 'fm_tx_freq_isr', type: 'string'} | |
, {name: 'fm_tx_freq_fo', type: 'string'} | |
, {name: 'fm_rx_freq_isr', type: 'string'} | |
, {name: 'fm_rx_freq_fo', type: 'string'} | |
, {name: 'fm_bandwidth', type: 'string'} | |
, {name: 'fm_bandwidth_isr', type: 'string'} | |
, {name: 'fm_req_status', type: 'string'} | |
, {name: 'fm_report_date', type: 'string'} | |
, {name: 'fm_no_app', type: 'string'} | |
, {name: 'fm_no_resi', type: 'string'} | |
, {name: 'fm_sta_no', type: 'string'} | |
, {name: 'fm_zona', type: 'string'} | |
, {name: 'fm_no_spp', type: 'string'} | |
, {name: 'fm_bhp', type: 'string'} | |
, {name: 'fm_no_po', type: 'string'} | |
, {name: 'fm_transfer_date', type: 'string'} | |
, {name: 'fm_no_isr', type: 'string'} | |
, {name: 'fm_isr_date', type: 'string'} | |
, {name: 'fm_no_dismantle', type: 'string'} | |
, {name: 'fm_dis_status', type: 'string'} | |
, {name: 'fm_ex_status', type: 'string'} | |
, {name: 'fm_status_fm', type: 'string'} | |
, {name: 'tfm_is_approved', type: 'string'} | |
, {name: 'fm_reason_reject', type: 'string'} | |
, {name: 'fm_soap_apid', type: 'string'} | |
, {name: 'fm_soap_aprefnumber', type: 'string'} | |
, {name: 'fm_soap_apname', type: 'string'} | |
, {name: 'fm_soap_apidnew', type: 'string'} | |
, {name: 'fm_soap_warning', type: 'string'} | |
, {name: 'fm_soap_error', type: 'string'} | |
, {name: 'fm_soap_acdid', type: 'string'} | |
, {name: 'fm_m2m_process_date', type: 'string'} | |
, {name: 'tfm_cart_type', type: 'string'} | |
, {name: 'fm_m2m_process_date', type: 'string'} | |
, {name: 'fm_soap_message', type: 'string'} | |
, {name: 'fm_soap_result_code', type: 'string'} | |
, {name: 'fm_soap_license_no', type: 'string'} | |
, {name: 'fm_soap_app_ref', type: 'string'} | |
, {name: 'fm_province', type: 'string'} | |
, {name: 'fm_site_height', type: 'string'} | |
, {name: 'fm_ref_link_id', type: 'int'} | |
, {name: 'fm_link_simf_id', type: 'string'} | |
, {name: 'fm_ne_ant_id_1', type: 'string'} | |
, {name: 'fm_fe_ant_id_1', type: 'string'} | |
, {name: 'fm_ne_eqp_id', type: 'string'} | |
, {name: 'fm_fe_eqp_id', type: 'string'} | |
, {name: 'fm_batch_number', type: 'string'} | |
, {name: 'fm_soap_batch_no', type: 'string'} | |
, {name: 'fm_ant_gain', type: 'string'} | |
, {name: 'fm_polarization', type: 'string'} | |
, {name: 'fm_data_source', type: 'string'} | |
, {name: 'fm_eqp_output_power', type: 'string'} | |
, {name: 'fm_reason_reject', type: 'string'} | |
, {name: 'fm_is_flag', type: 'string'} | |
, {name: 'fm_no_simf', type: 'string'} | |
], | |
remoteSort: true, | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/tmp_freq_history'), | |
actionMethods: {read: 'post'}, | |
extraParams: { | |
id_freqnya: rs[0].data.tfm_id | |
}, | |
reader: { | |
type: 'json', | |
root: 'data' | |
} | |
} | |
}).load(); | |
var gridHistory = Ext.create('Ext.grid.Panel', { | |
store: historyStore, | |
loadMask: true, | |
border: false, | |
columns: [ | |
{header: 'Time', dataIndex: 'tfml_time', width: 250}, | |
{header: 'Action', dataIndex: 'tfml_action', width: 70}, | |
{header: 'PIC', dataIndex: 'tfml_cart_pic', width: 150}, | |
{header: '', width: 60, dataIndex: 'tfm_id', hidden: true}, | |
{header: 'Cart Name', width: 60, dataIndex: 'tfm_cart_name', hidden: true}, | |
{header: 'link simf id', width: 60, dataIndex: 'fm_link_simf_id', hidden: true}, | |
{header: 'Cart Type', width: 60, dataIndex: 'tfm_cart_type', hidden: true}, | |
{header: 'Link Id', dataIndex: 'fm_link_type_id'}, | |
{header: 'Near End', dataIndex: 'fm_ne_site_id'}, | |
{header: 'Far End', dataIndex: 'fm_fe_site_id'}, | |
{header: 'NE Name', dataIndex: 'fm_ne_site_name'}, | |
{header: 'FE Name', dataIndex: 'fm_ne_site_name'}, | |
{header: 'TX ISR', dataIndex: 'fm_tx_freq_isr'}, | |
{header: 'RX ISR', dataIndex: 'fm_rx_freq_isr'}, | |
// {header: 'TX FOP', dataIndex: 'fm_tx_freq_fo'}, | |
// {header: 'RX FOP', dataIndex: 'fm_rx_freq_fo'}, | |
// {header: 'Bandwidth', dataIndex: 'fm_bandwidth'}, | |
/* {header: 'TX FOP', dataIndex: 'fm_tx_freq_fo'}, | |
{header: 'RX FOP', dataIndex: 'fm_rx_freq_fo'}, | |
{header: 'Bandwidth', dataIndex: 'fm_bandwidth'}, */ | |
{header: 'Bandwidth ISR', dataIndex: 'fm_bandwidth_isr'}, | |
{header: 'Request Status', dataIndex: 'fm_req_status', | |
renderer: function(val, prev, rec){ | |
if (val == 'NEED ISR' || val == 'Need ISR') | |
{ | |
prev.style = "background-color:#0AAAF1; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'CANCEL ISR') | |
{ | |
prev.style = "background-color:#F1CBBE; color:#000; text-align:center;"; | |
return val; | |
} | |
else if (val == 'REJECTED') | |
{ | |
prev.style = "background-color:#FFA500; color:#000; text-align:center;"; | |
return val; | |
} | |
else | |
{ | |
prev.style = "background-color:#00FA9A; color:#000; text-align:center;"; | |
return val; | |
} | |
} | |
}, | |
{header: 'Report Date', dataIndex: 'fm_report_date'}, | |
// {header: 'No App', dataIndex: 'fm_no_app'}, | |
{header: 'No Resi', dataIndex: 'fm_no_resi'}, | |
{header: 'STA No', dataIndex: 'fm_sta_no'}, | |
{header: 'Zona', dataIndex: 'fm_zona'}, | |
// {header: 'No Spp', dataIndex: 'fm_no_spp'}, | |
// {header: 'BHP', dataIndex: 'fm_bhp'}, | |
// {header: 'No PO Pembayaran', dataIndex: 'fm_no_po'}, | |
// {header: 'Tanggal Transfer', dataIndex: 'fm_transfer_date'}, | |
// {header: 'ISR No', dataIndex: 'fm_no_isr'}, | |
// {header: 'ISR Date', dataIndex: 'fm_isr_date'}, | |
{header: 'No Dismantle', dataIndex: 'fm_no_dismantle'}, | |
{header: 'Dismantle Status', dataIndex: 'fm_dis_status'}, | |
{header: 'Existing Status', dataIndex: 'fm_ex_status'}, | |
{header: 'Status FM', dataIndex: 'fm_status_fm'}, | |
{header: 'Reason', dataIndex: 'fm_reason_reject', width: 200}, | |
{header: 'Data Approved', dataIndex: 'tfm_is_approved', | |
renderer: function(value, prev, rec) { | |
if (value == 1) { | |
prev.style = "background-color:#2DC926; color:#000; text-align:center;"; | |
return 'Yes'; | |
} | |
else if (value == 0) { | |
// prev.style = "background-color:#FF9696; color:#000; text-align:center;"; | |
return 'No'; | |
} | |
} | |
}, | |
/* {header: 'Soap Acd id', dataIndex: 'fm_soap_acdid', width: 200}, | |
{header: 'Soap Ap id', dataIndex: 'fm_soap_apid', width: 200}, | |
{header: 'Soap Ap Ref Number', dataIndex: 'fm_soap_aprefnumber', width: 200}, | |
{header: 'Soap Ap Name', dataIndex: 'fm_soap_apname', width: 200}, | |
{header: 'Soap Ap Id New', dataIndex: 'fm_soap_apidnew', width: 200}, */ | |
{header: 'Message', dataIndex: 'fm_soap_message', width: 200}, | |
{header: 'Result Code', dataIndex: 'fm_soap_result_code', width: 200}, | |
{header: 'License No', dataIndex: 'fm_no_simf', width: 200}, | |
{header: 'No App', dataIndex: 'fm_soap_app_ref', width: 200},/* | |
{header: 'M2M Process', dataIndex: 'fm_m2m_process_date', width: 200, hidden:true}, | |
{header: 'Soap Error', dataIndex: 'fm_soap_error', width: 200}, */ | |
{header: 'M2M Process Date', dataIndex: 'fm_m2m_process_date', width: 200}, | |
{header: 'Height ASL m', dataIndex: 'fm_site_height', width: 200}, | |
{header: 'NE Antenna ID', dataIndex: 'fm_ne_ant_id_1', width: 160}, | |
{header: 'FE Antenna ID', dataIndex: 'fm_fe_ant_id_1', width: 160}, | |
{header: 'NE Equipment ID', dataIndex: 'fm_ne_eqp_id', width: 160}, | |
{header: 'FE Equipment ID', dataIndex: 'fm_fe_eqp_id', width: 160}, | |
{header: 'Batch Number', dataIndex: 'fm_batch_number', width: 160}, | |
{header: 'Batch Number M2M', dataIndex: 'fm_soap_batch_no', width: 160}, | |
{header: 'Antenna Polarization', dataIndex: 'fm_polarization', width: 160}, | |
{header: 'Source', dataIndex: 'fm_data_source', width: 160}, | |
{header: 'Reason Reject', dataIndex: 'fm_reason_reject', width: 270}, | |
{header: 'Province', dataIndex: 'fm_province', width: 200, hidden: true}, | |
{header: 'Antenna Gain', dataIndex: 'fm_ant_gain', width: 200, hidden: true}, | |
{header: 'EQP Output Power', dataIndex: 'fm_eqp_output_power', width: 200, hidden: true}, | |
{header: 'Flag Cart', dataIndex: 'fm_is_flag', renderer: function(v, prev, rec){ | |
if (v == 3) | |
{ | |
prev.style = "background-color:#F5F5F5; color:#000; text-align:center;"; | |
return 'Already Process'; | |
} | |
else | |
{ | |
prev.style = "background:#FF9696;text-align:center;"; | |
return 'No'; | |
} | |
} | |
} | |
], | |
columnLines: true, | |
selModel: Ext.create('Ext.selection.CheckboxModel'), | |
features: [ | |
Ext.create('KctApp.feature.GridSearch'), | |
Ext.create('KctApp.feature.GridLimit'), | |
Ext.create('KctApp.feature.GridFilter') | |
], | |
viewConfig: { | |
emptyText: 'No Data' | |
}, | |
dockedItems: | |
[ | |
{ | |
xtype: 'pagingtoolbar', | |
displayInfo: true, | |
store: historyStore, | |
items: ['-'] | |
} | |
] | |
}); | |
var win = Ext.create('Ext.Window', { | |
width: 1260, | |
height: 400, | |
border: false, | |
modal: true, | |
layout: 'fit', | |
title: '[HISTORY] '+rs[0].data.fm_link_type_id, | |
items: [gridHistory], | |
buttons: [{ | |
text: 'Close', | |
handler: function() { | |
win.close(); | |
} | |
}] | |
}); | |
win.show(); | |
}, | |
doM2MStatus: function(rs, cartStore, win){ | |
var me = this; | |
var myMask = new Ext.LoadMask(win, {msg:"Please wait..."}); | |
if (!rs.length) { | |
this.showWarning('No record(s) selected!'); | |
return; | |
} | |
if (rs.length > 1) { | |
this.showWarning('Please select 1 record !'); | |
return; | |
} | |
if (!rs[0].data.fm_soap_app_ref) { | |
this.showWarning("Can't process, app ref number is empty."); | |
return; | |
} | |
if (!rs[0].data.fm_soap_batch_no) { | |
this.showWarning("Can't process, Batch Number is empty."); | |
return; | |
} | |
myMask.show(); | |
var keys = []; | |
keys.push({ | |
fm_link_simf_id: rs[0].data.fm_link_simf_id, | |
fm_soap_aprefnumber: rs[0].data.fm_soap_app_ref, | |
fm_soap_batch_no: rs[0].data.fm_soap_batch_no | |
}); | |
var link = 'soap/getStatusRegM2M'; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url(link), | |
scriptTag:true, | |
params: { | |
module: this.module, | |
key: Ext.encode(keys) | |
}, | |
success: function(res){ | |
var obj = Ext.decode(res.responseText); | |
var msg = obj.msg; | |
var idx, city, k1, k2, site_id_name, simf_id; | |
Ext.Msg.alert('Info', msg); | |
this.getStore().reload(); | |
cartStore.reload(); | |
myMask.hide(); | |
}, | |
failure: function(res){ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success == true){ | |
Ext.Msg.alert('Info',obj.msg); | |
}else{ | |
if(rs[0].data.tfm_cart_type.toLowerCase() == 'registration'){ | |
Ext.Msg.alert('Error',obj.msg.new); | |
} | |
else if(rs[0].data.tfm_cart_type.toLowerCase() == 'dismantle'){ | |
Ext.Msg.alert('Info',obj.msg.cancel); | |
} | |
else{ | |
Ext.Msg.alert('Error','Process Time Out, Please Check Your Connection'); | |
} | |
} | |
this.getStore().reload(); | |
cartStore.reload(); | |
myMask.hide(); | |
} | |
}); | |
}, | |
doDownloadMail: function(rs, cartStore, win){ | |
var key = [], keys = [], i; | |
var me = this; | |
for (i = 0; i < cartStore.data.length; i++) { | |
key.push( | |
{fm_rnum: cartStore.data.items[i].data.RNUM}, | |
{fm_province: cartStore.data.items[i].data.fm_province} | |
); | |
keys.push(key); | |
key = []; | |
} | |
var xlsWriterFormPanel = Ext.create('Ext.form.Panel', { | |
method: 'post', | |
url: site_url('freq_man/freq_man_worksheet/download_mail'), | |
items:[{ | |
xtype:'hidden', | |
name:'params', | |
id:'params', | |
value: Ext.encode(keys) | |
}], | |
standardSubmit: true, | |
renderTo: Ext.getBody() | |
}); | |
Ext.create('Ext.Window', { | |
title: 'Downloading...', | |
width: 310, | |
height: 130, | |
padding: 5, | |
html: 'Please wait while the file is being processed...<br />Close this window when the download box has appeared.', | |
draggable: false, | |
resizable: false, | |
modal: true, | |
listeners: { | |
close: function() { | |
xlsWriterFormPanel.destroy(); | |
}, | |
afterrender: function() { | |
xlsWriterFormPanel.submit(); | |
} | |
} | |
}).show(); | |
// KctApp.util.download({ | |
// url: site_url('freq_man/freq_man_worksheet/download_mail'), | |
// waitMsg: 'Downloading...', | |
// // params: params, | |
// scope: this, | |
// callback: function() { | |
// console.log('abc'); | |
// // this.showInfo('Info','Download finished!'); | |
// } | |
// }); | |
}, | |
doUpdateIsr: function(){ | |
var me = this; | |
var form = Ext.create('Ext.form.Panel', { | |
bodyPadding: 10, | |
method: 'POST', | |
layout: 'column', | |
items: [{ | |
columnWidth: 0.50, | |
flex: 1, | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'fieldcontainer', | |
layout: 'hbox', | |
items: [{ | |
xtype: 'filefield', | |
name: 'file_excel', | |
fieldLabel: 'File', | |
buttonText: 'Select File', | |
labelWidth: 70, | |
width: 370, | |
emptyText: 'Select a file', | |
buttonConfig: { | |
iconCls: 'icon icon-folder' | |
} | |
}] | |
}] | |
}] | |
}] | |
}); | |
var editor = Ext.create('Ext.window.Window', { | |
title: 'Upload Data Spectra', | |
// width: 800, | |
layout: 'fit', | |
modal: true, | |
autoHeight: true, | |
items: form, | |
buttons: [{ | |
text: 'Upload', | |
handler: function() { | |
var fp = form.getForm(); | |
if (fp.isValid()) { | |
fp.submit({ | |
url: INDEX_URL + 'freq_man/freq_man_worksheet/dx_update_isr', | |
waitMsg: 'Uploading... Please wait.', | |
//params: params, | |
success: function(f, a) { | |
editor.close(); | |
me.getStore().reload(); | |
me.showInfo('Upload is Successfully..'); | |
}, | |
failure: function() { | |
me.showError('An error ocurred while uploading record!'); | |
} | |
}); | |
} | |
} | |
}, | |
{ | |
text: 'Cancel', | |
handler: function() { | |
editor.close(); | |
} | |
} | |
] | |
}); | |
editor.show(); | |
}, | |
/*Added by Satrio*/ | |
/*30-03-2015*/ | |
doEditItem: function(rec, to, ss, freqHidden) | |
{ | |
var me = this; | |
Ext.getBody().mask('Loading .. Please wait'); | |
Ext.Ajax.request | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/check_lock'), | |
method: 'post', | |
loadMask: true, | |
params: | |
{ | |
'link_simf_id': rec.data.fm_link_simf_id, | |
'tmp' : (to == 'tmp' ? true : false) | |
}, | |
success: function(res) | |
{ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success) | |
{ | |
me.doEdit(obj.rows, rec, to, ss, freqHidden); | |
} | |
else{ | |
Ext.getBody().unmask(); | |
// me.showInfo('This data is being edited'); | |
me.showInfo('Data is being editing by another user'); | |
} | |
}, | |
failure: function(res) | |
{ | |
Ext.getBody().unmask(); | |
me.showInfo('Data is being editing by another user'); | |
} | |
} | |
); | |
}, | |
doEdit: function(data, rec, to, ss, freqHidden) | |
{ | |
var arData = data; | |
var isTrue = true; | |
var me = this; | |
var isComp = rec.data.fm_status_fm; | |
if(arData['fm_pic'] != sessPIC && arData['fm_is_lock'] == 1) | |
{ | |
isTrue = false; | |
} | |
if(arData['is_own'] === false) | |
{ | |
isTrue = false; | |
} | |
else | |
{ | |
isTrue = true; | |
} | |
if(usg_id == 27 && isTrue === true && isComp == 'ISR') | |
{ | |
Ext.MessageBox.confirm('Confirmation', "You can't edit selected FM data, request editing approval?", function(btn) | |
{ | |
if(btn == 'yes') | |
{ | |
doYes(); | |
} | |
}); | |
function doYes() | |
{ | |
var bodyMask = new Ext.LoadMask(Ext.getBody(), {msg: 'Processing, please wait...'}); | |
bodyMask.show(); | |
Ext.Ajax.request | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/do_approval_request'), | |
method: 'post', | |
params: | |
{ | |
'link_simf_id': rec.data.fm_link_simf_id | |
}, | |
success: function(res) | |
{ | |
bodyMask.hide(); | |
Ext.Msg.alert('Info', 'Edit request has been sent'); | |
this.store.reload(); | |
}, | |
failure: function(res) | |
{ | |
bodyMask.hide(); | |
Ext.Msg.alert('Error', "Selected FM data can't be request."); | |
} | |
} | |
); | |
} | |
} | |
else if(isTrue) | |
{ | |
if(to == 'tmp'){ | |
url_lock = site_url('freq_man/freq_man_worksheet/do_lock_data_tmp'); | |
} | |
else{ | |
url_lock = site_url('freq_man/freq_man_worksheet/do_lock_data'); | |
} | |
Ext.Ajax.request | |
( | |
{ | |
url: url_lock, | |
method: 'post', | |
loadMask: true, | |
params: | |
{ | |
'link_simf_id': rec.data.fm_link_simf_id | |
}, | |
success: function(res) | |
{ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success) | |
{ | |
if(to == 'tmp'){ | |
url = site_url('freq_man/freq_man_worksheet/check_ref_link_simf_tmp'); | |
} | |
else{ | |
url = site_url('freq_man/freq_man_worksheet/check_ref_link_simf'); | |
} | |
Ext.Ajax.request | |
( | |
{ | |
url: url, | |
method: 'post', | |
loadMask: true, | |
params: | |
{ | |
'link_simf_id[]': rec.data.fm_link_simf_id, | |
'ne_site_id[]': rec.data.fm_ne_site_id, | |
'fe_site_id[]': rec.data.fm_fe_site_id | |
}, | |
success: function(res) | |
{ | |
var obj = Ext.decode(res.responseText); | |
if(obj.success) | |
{ | |
me.edit_item(obj.rows, rec, to, ss, freqHidden); | |
} | |
}, | |
failure: function(res) | |
{ | |
Ext.getBody().unmask(); | |
me.showInfo('Something error with database'); | |
} | |
} | |
); | |
} | |
else{ | |
Ext.getBody().unmask(); | |
me.showInfo('Something error with database'); | |
} | |
}, | |
failure: function(res) | |
{ | |
Ext.getBody().unmask(); | |
me.showInfo('Something error with database'); | |
} | |
} | |
); | |
} | |
else | |
{ | |
Ext.getBody().unmask(); | |
Ext.MessageBox.confirm('Confirmation', "You can't edit selected FM data, selected data are being edit by " + arData['fm_pic'], function(btn) | |
{ | |
if(btn == 'yes') | |
{ | |
this.store.reload(); | |
} | |
}); | |
} | |
// if(usg_id == 7 && isTrue && isComp == 'ISR') | |
// { | |
// } | |
}, | |
edit_item: function(data, rec, to, ss, freqHidden = false) | |
{ | |
var norFreqHidden = true; | |
// console.log('lalala'); | |
// console.log(freqHidden); | |
// return; | |
if(freqHidden == true) | |
norFreqHidden = false; | |
var me = this; | |
var brand = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'rb_brand_id', | |
'rb_brand_name' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_brand'), | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var idu = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'ri_idu_id', | |
'ri_idu_name', | |
'rim_idu_model_name' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_idu'), | |
actionMethods: { | |
read: 'post' | |
}, | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var capacity = Ext.create('Ext.data.Store', { | |
fields: | |
[ | |
'rc_cap_id', | |
'rc_cap_name' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_capacity'), | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var idx = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'ridx_idx_id', | |
'ridx_idx_low', | |
'ridx_idx_high' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_index'), | |
actionMethods: { | |
read: 'post' | |
}, | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var configStore = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'rsc_sys_conf_id', | |
'rsc_sys_conf_name' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_config'), | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var statusStore = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'rs_status_id', | |
'rs_status_name' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_status'), | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var radioStore = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'rr_radio_id', | |
'rr_radio_freq' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_radio'), | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var getAntId = Ext.create('Ext.data.Store', { | |
fields: ['ant_id'], | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_ant_id'), | |
actionMethods: {read: 'POST'}, | |
extraParams: { | |
// position : 'remote', | |
// se_eqp_name: rec.se_eqp_name, | |
// // se_rx_freq:rec.se_rx_freq, | |
// se_tx_freq:rec.se_tx_freq, | |
// se_eqp_output_power:rec.se_eqp_output_power | |
// se_ne_fe:rec.se_ne_fe | |
}, | |
reader: { | |
type: 'json', | |
root: 'data', | |
totalProperty: 'total' | |
} | |
}, | |
// sorters: [{ | |
// // property: 'asm_name', | |
// // direction: 'ASC' | |
// }], | |
remoteSort: true, | |
autoload: true | |
}); | |
var refFreq = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'rf_freq_low', | |
'rf_freq_high' | |
], | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_freq'), | |
actionMethods: {read: 'POST'}, | |
extraParams: { | |
// position : 'remote', | |
bandwidth: rec.data.fm_bandwidth | |
// // se_rx_freq:rec.se_rx_freq, | |
// se_tx_freq:rec.se_tx_freq, | |
// se_eqp_output_power:rec.se_eqp_output_power | |
// se_ne_fe:rec.se_ne_fe | |
}, | |
reader: { | |
type: 'json', | |
root: 'data', | |
totalProperty: 'total' | |
} | |
}, | |
// sorters: [{ | |
// // property: 'asm_name', | |
// // direction: 'ASC' | |
// }], | |
remoteSort: true, | |
autoload: true | |
}); | |
var getEqpId = Ext.create('Ext.data.Store', { | |
fields: ['eqp_id'], | |
proxy: { | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_eqp_id'), | |
actionMethods: {read: 'POST'}, | |
extraParams: { | |
// position : 'remote', | |
// se_eqp_name: rec.se_eqp_name, | |
// // se_rx_freq:rec.se_rx_freq, | |
// se_tx_freq:rec.se_tx_freq, | |
// se_eqp_output_power:rec.se_eqp_output_power | |
// se_ne_fe:rec.se_ne_fe | |
}, | |
reader: { | |
type: 'json', | |
root: 'data', | |
totalProperty: 'total' | |
} | |
}, | |
// sorters: [{ | |
// // property: 'asm_name', | |
// // direction: 'ASC' | |
// }], | |
remoteSort: true, | |
autoload: true | |
}); | |
var selectAction = { | |
xtype: 'fieldset', | |
title: 'Action Edit', | |
hidden: freqHidden == true ? false : true, | |
width:500, | |
items:[{ | |
xtype: 'combo', | |
name: 'fm_action_modification', | |
id: 'fm_action_modification', | |
fieldLabel: 'Action', | |
width:450, | |
store : ['Change Freq', 'Ganti Perangkat', 'Rename Site ID', 'Relokasi', 'Ganti Alamat'], | |
multiSelect:false, | |
listeners:{ | |
render:function(a,b,c) | |
{ | |
Ext.getCmp('winEdit').body.mask('Loading ...'); | |
setTimeout(function() { | |
// console.log('dirender'); | |
Ext.getCmp('fm_bandwidth').setDisabled(true); | |
Ext.getCmp('fm_tx_freq_isr_2').setDisabled(true); | |
Ext.getCmp('fm_rx_freq_isr_2').setDisabled(true); | |
Ext.getCmp('fm_tx_freq_isr_2').setDisabled(false); | |
Ext.getCmp('fm_rx_freq_isr_2').setDisabled(false); | |
Ext.getCmp('fm_ne_ant_id_1').setDisabled(true); | |
Ext.getCmp('fm_fe_ant_id_1').setDisabled(true); | |
Ext.getCmp('fm_ne_eqp_id').setDisabled(true); | |
Ext.getCmp('fm_fe_eqp_id').setDisabled(true); | |
Ext.getCmp('fm_ne_site_id').setDisabled(true); | |
Ext.getCmp('fm_ne_site_name').setDisabled(true); | |
Ext.getCmp('fm_fe_site_id').setDisabled(true); | |
Ext.getCmp('fm_fe_site_name').setDisabled(true); | |
Ext.getCmp('fm_ne_province').setDisabled(true); | |
Ext.getCmp('fm_ne_region').setDisabled(true); | |
Ext.getCmp('fm_ne_city').setDisabled(true); | |
Ext.getCmp('fm_ne_district').setDisabled(true); | |
Ext.getCmp('fm_ne_zona').setDisabled(true); | |
Ext.getCmp('fm_ne_zip_isr').setDisabled(true); | |
Ext.getCmp('fm_ne_zip_isr').setDisabled(false); | |
Ext.getCmp('fm_fe_province').setDisabled(true); | |
Ext.getCmp('fm_fe_region').setDisabled(true); | |
Ext.getCmp('fm_fe_city').setDisabled(true); | |
Ext.getCmp('fm_fe_district').setDisabled(true); | |
Ext.getCmp('fm_fe_zona').setDisabled(true); | |
Ext.getCmp('fm_fe_zip_isr').setDisabled(true); | |
Ext.getCmp('fm_fe_zip_isr').setDisabled(false); | |
Ext.getCmp('fm_ne_long_deg').setDisabled(true); | |
Ext.getCmp('fm_ne_long_min').setDisabled(true); | |
Ext.getCmp('fm_ne_long_sec').setDisabled(true); | |
Ext.getCmp('fm_ne_long_reg').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_deg').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_min').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_sec').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_reg').setDisabled(true); | |
Ext.getCmp('fm_fe_long_deg').setDisabled(true); | |
Ext.getCmp('fm_fe_long_min').setDisabled(true); | |
Ext.getCmp('fm_fe_long_sec').setDisabled(true); | |
Ext.getCmp('fm_fe_long_reg').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_deg').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_min').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_sec').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_reg').setDisabled(true); | |
Ext.getCmp('fm_ne_long_deg').setDisabled(false); | |
Ext.getCmp('fm_ne_long_min').setDisabled(false); | |
Ext.getCmp('fm_ne_long_sec').setDisabled(false); | |
Ext.getCmp('fm_ne_long_reg').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_deg').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_min').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_sec').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_reg').setDisabled(false); | |
Ext.getCmp('fm_fe_long_deg').setDisabled(false); | |
Ext.getCmp('fm_fe_long_min').setDisabled(false); | |
Ext.getCmp('fm_fe_long_sec').setDisabled(false); | |
Ext.getCmp('fm_fe_long_reg').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_deg').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_min').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_sec').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_reg').setDisabled(false); | |
Ext.getCmp('fm_ne_addr').setDisabled(true); | |
Ext.getCmp('fm_fe_addr').setDisabled(true); | |
Ext.getCmp('winEdit').body.unmask(); | |
}, 5000); | |
}, | |
select: function(){ | |
Ext.getCmp('fm_action_modification').setDisabled(true); | |
}, | |
change:function(a, b, c) | |
{ | |
// console.log(b.length); | |
if(Ext.Array.contains(b, 'Upgrade BW')){ | |
Ext.getCmp('fm_bandwidth').setDisabled(false); | |
Ext.getCmp('fm_tx_freq_isr_2').setDisabled(false); | |
Ext.getCmp('fm_rx_freq_isr_2').setDisabled(false); | |
Ext.getCmp('fm_bandwidth').setDisabled(false); | |
Ext.getCmp('fm_tx_freq_isr_2').setDisabled(false); | |
Ext.getCmp('fm_rx_freq_isr_2').setDisabled(false); | |
} | |
else{ | |
Ext.getCmp('fm_bandwidth').setDisabled(true); | |
Ext.getCmp('fm_tx_freq_isr_2').setDisabled(true); | |
Ext.getCmp('fm_rx_freq_isr_2').setDisabled(true); | |
} | |
if(Ext.Array.contains(b, 'Ganti Perangkat')){ | |
Ext.getCmp('fm_ne_ant_id_1').setDisabled(false); | |
Ext.getCmp('fm_fe_ant_id_1').setDisabled(false); | |
Ext.getCmp('fm_ne_eqp_id').setDisabled(false); | |
Ext.getCmp('fm_fe_eqp_id').setDisabled(false); | |
Ext.getCmp('fm_ne_ant_id_1').setDisabled(false); | |
Ext.getCmp('fm_fe_ant_id_1').setDisabled(false); | |
Ext.getCmp('fm_ne_eqp_id').setDisabled(false); | |
Ext.getCmp('fm_fe_eqp_id').setDisabled(false); | |
} | |
else{ | |
Ext.getCmp('fm_ne_ant_id_1').setDisabled(true); | |
Ext.getCmp('fm_fe_ant_id_1').setDisabled(true); | |
Ext.getCmp('fm_ne_eqp_id').setDisabled(true); | |
Ext.getCmp('fm_fe_eqp_id').setDisabled(true); | |
} | |
if(Ext.Array.contains(b, 'Rename Site ID')){ | |
Ext.getCmp('fm_ne_site_id').setDisabled(false); | |
Ext.getCmp('fm_ne_site_name').setDisabled(false); | |
Ext.getCmp('fm_fe_site_id').setDisabled(false); | |
Ext.getCmp('fm_fe_site_name').setDisabled(false); | |
Ext.getCmp('fm_ne_site_id').setDisabled(false); | |
Ext.getCmp('fm_ne_site_name').setDisabled(false); | |
Ext.getCmp('fm_fe_site_id').setDisabled(false); | |
Ext.getCmp('fm_fe_site_name').setDisabled(false); | |
} | |
else{ | |
Ext.getCmp('fm_ne_site_id').setDisabled(true); | |
Ext.getCmp('fm_ne_site_name').setDisabled(true); | |
Ext.getCmp('fm_fe_site_id').setDisabled(true); | |
Ext.getCmp('fm_fe_site_name').setDisabled(true); | |
} | |
if(Ext.Array.contains(b, 'Relokasi')){ | |
Ext.getCmp('fm_ne_long_deg').setDisabled(false); | |
Ext.getCmp('fm_ne_long_min').setDisabled(false); | |
Ext.getCmp('fm_ne_long_sec').setDisabled(false); | |
Ext.getCmp('fm_ne_long_reg').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_deg').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_min').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_sec').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_reg').setDisabled(false); | |
Ext.getCmp('fm_ne_long_deg').setDisabled(false); | |
Ext.getCmp('fm_ne_long_min').setDisabled(false); | |
Ext.getCmp('fm_ne_long_sec').setDisabled(false); | |
Ext.getCmp('fm_ne_long_reg').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_deg').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_min').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_sec').setDisabled(false); | |
Ext.getCmp('fm_ne_lat_reg').setDisabled(false); | |
Ext.getCmp('fm_fe_long_deg').setDisabled(false); | |
Ext.getCmp('fm_fe_long_min').setDisabled(false); | |
Ext.getCmp('fm_fe_long_sec').setDisabled(false); | |
Ext.getCmp('fm_fe_long_reg').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_deg').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_min').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_sec').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_reg').setDisabled(false); | |
Ext.getCmp('fm_fe_long_deg').setDisabled(false); | |
Ext.getCmp('fm_fe_long_min').setDisabled(false); | |
Ext.getCmp('fm_fe_long_sec').setDisabled(false); | |
Ext.getCmp('fm_fe_long_reg').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_deg').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_min').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_sec').setDisabled(false); | |
Ext.getCmp('fm_fe_lat_reg').setDisabled(false); | |
Ext.getCmp('fm_ne_province').setDisabled(false); | |
Ext.getCmp('fm_ne_region').setDisabled(false); | |
Ext.getCmp('fm_ne_city').setDisabled(false); | |
Ext.getCmp('fm_ne_district').setDisabled(false); | |
Ext.getCmp('fm_ne_zona').setDisabled(false); | |
Ext.getCmp('fm_ne_zip_isr').setDisabled(false); | |
Ext.getCmp('fm_ne_province').setDisabled(false); | |
Ext.getCmp('fm_ne_region').setDisabled(false); | |
Ext.getCmp('fm_ne_city').setDisabled(false); | |
Ext.getCmp('fm_ne_district').setDisabled(false); | |
Ext.getCmp('fm_ne_zona').setDisabled(false); | |
Ext.getCmp('fm_ne_zip_isr').setDisabled(false); | |
Ext.getCmp('fm_fe_province').setDisabled(false); | |
Ext.getCmp('fm_fe_region').setDisabled(false); | |
Ext.getCmp('fm_fe_city').setDisabled(false); | |
Ext.getCmp('fm_fe_district').setDisabled(false); | |
Ext.getCmp('fm_fe_zona').setDisabled(false); | |
Ext.getCmp('fm_fe_zip_isr').setDisabled(false); | |
Ext.getCmp('fm_fe_province').setDisabled(false); | |
Ext.getCmp('fm_fe_region').setDisabled(false); | |
Ext.getCmp('fm_fe_city').setDisabled(false); | |
Ext.getCmp('fm_fe_district').setDisabled(false); | |
Ext.getCmp('fm_fe_zona').setDisabled(false); | |
Ext.getCmp('fm_fe_zip_isr').setDisabled(false); | |
} | |
else{ | |
Ext.getCmp('fm_ne_long_deg').setDisabled(true); | |
Ext.getCmp('fm_ne_long_min').setDisabled(true); | |
Ext.getCmp('fm_ne_long_sec').setDisabled(true); | |
Ext.getCmp('fm_ne_long_reg').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_deg').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_min').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_sec').setDisabled(true); | |
Ext.getCmp('fm_ne_lat_reg').setDisabled(true); | |
Ext.getCmp('fm_fe_long_deg').setDisabled(true); | |
Ext.getCmp('fm_fe_long_min').setDisabled(true); | |
Ext.getCmp('fm_fe_long_sec').setDisabled(true); | |
Ext.getCmp('fm_fe_long_reg').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_deg').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_min').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_sec').setDisabled(true); | |
Ext.getCmp('fm_fe_lat_reg').setDisabled(true); | |
Ext.getCmp('fm_ne_province').setDisabled(true); | |
Ext.getCmp('fm_ne_region').setDisabled(true); | |
Ext.getCmp('fm_ne_city').setDisabled(true); | |
Ext.getCmp('fm_ne_district').setDisabled(true); | |
Ext.getCmp('fm_ne_zona').setDisabled(true); | |
Ext.getCmp('fm_ne_zip_isr').setDisabled(true); | |
Ext.getCmp('fm_ne_zip_isr').setDisabled(true); | |
Ext.getCmp('fm_fe_province').setDisabled(true); | |
Ext.getCmp('fm_fe_region').setDisabled(true); | |
Ext.getCmp('fm_fe_city').setDisabled(true); | |
Ext.getCmp('fm_fe_district').setDisabled(true); | |
Ext.getCmp('fm_fe_zona').setDisabled(true); | |
Ext.getCmp('fm_fe_zip_isr').setDisabled(true); | |
Ext.getCmp('fm_fe_zip_isr').setDisabled(true); | |
} | |
if(Ext.Array.contains(b, 'Ganti Alamat')){ | |
Ext.getCmp('fm_ne_addr').setDisabled(false); | |
Ext.getCmp('fm_fe_addr').setDisabled(false); | |
Ext.getCmp('fm_ne_addr').setDisabled(false); | |
Ext.getCmp('fm_fe_addr').setDisabled(false); | |
} | |
else{ | |
Ext.getCmp('fm_ne_addr').setDisabled(true); | |
Ext.getCmp('fm_fe_addr').setDisabled(true); | |
} | |
} | |
} | |
// value: data.ne[0].fm_ne_site_id, | |
// readOnly: true, | |
// size: 60 | |
}] | |
} | |
var nearEndInfo = { | |
xtype: 'fieldset', | |
title: 'Near End Info', | |
width: 575, | |
items: [{ | |
xtype: 'textfield', | |
id: 'fm_ne_site_id', | |
name: 'fm_ne_site_id', | |
fieldLabel: 'NE Site ID', | |
value: data.ne[0].fm_ne_site_id, | |
disabled: true, | |
size: 60 | |
},{ | |
xtype: 'textfield', | |
id: 'fm_ne_site_name', | |
name: 'fm_ne_site_name', | |
fieldLabel: 'NE Site Name', | |
value: data.ne[0].fm_ne_site_name, | |
disabled: norFreqHidden, | |
size: 60 | |
},{ | |
layout: 'column', | |
anchor: '95%', | |
defaults: { | |
bodyStyle: 'padding-right:10px' | |
}, | |
items: [{ | |
xtype: 'label', | |
text: 'Latitude * : ', | |
style: {marginRight: '65px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name: 'fm_ne_lat_deg', | |
id: 'fm_ne_lat_deg', | |
// allowBlank: false, | |
value: data.ne[0].fm_lat_deg, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_lat_min', | |
id : 'fm_ne_lat_min', | |
allowBlank: true, | |
value: data.ne[0].fm_lat_min, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
//emptyText:'Minute', | |
// value: s.NE_LONG_MIN_FOP | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_lat_sec', | |
id : 'fm_ne_lat_sec', | |
allowBlank: true, | |
value: data.ne[0].fm_lat_sec, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
//emptyText:'Minute', | |
// value: s.NE_LONG_MIN_FOP | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_ne_lat_reg', | |
id : 'fm_ne_lat_reg', | |
value: data.ne[0].fm_lat_reg, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['S'],['N']] | |
}), | |
mode : 'local', | |
//emptyText: 'Direction', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
allowBlank: true, | |
disabled: (usg_id == 26 ? false : true) | |
// value:s.NE_LAT_REG_FOP | |
}] | |
},{ | |
xtype: 'splitter' | |
},{ | |
layout:'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items:[{ | |
xtype: 'label', | |
text: 'Longitude * : ', | |
style: {marginRight: '57px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_long_deg', | |
id : 'fm_ne_long_deg', | |
// allowBlank: false, | |
value: data.ne[0].fm_long_deg, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
// value:s.NE_LONG_DEG | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_long_min', | |
id : 'fm_ne_long_min', | |
// allowBlank: false, | |
value: data.ne[0].fm_long_min, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
// value: s.NE_LONG_MIN | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_long_sec', | |
id : 'fm_ne_long_sec', | |
// allowBlank: false, | |
value: data.ne[0].fm_long_sec, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
// value: s.NE_LONG_SEC | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_ne_long_reg', | |
id : 'fm_ne_long_reg', | |
value: data.ne[0].fm_long_reg, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['E'],['W']] | |
}), | |
mode : 'local', | |
//emptyText: 'Direction', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
// allowBlank: false, | |
disabled: (usg_id == 26 ? false : true) | |
// value:s.NE_LONG_REG | |
}] | |
},{ | |
xtype: 'splitter' | |
},{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'label', | |
text: 'Latitude (FOP) * : ', | |
style: {marginRight: '30px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_lat_deg_fop', | |
id : 'fm_ne_lat_deg_fop', | |
// allowBlank: false, | |
// value: data.ne[0].fm_lat_deg_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_lat_deg_fop) | |
{ | |
this.setValue(data.ne[0].fm_lat_deg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_lat_deg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LONG_DEG | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_lat_min_fop', | |
id : 'fm_ne_lat_min_fop', | |
// allowBlank: false, | |
// value: data.ne[0].fm_lat_min_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_lat_min_fop) | |
{ | |
this.setValue(data.ne[0].fm_lat_min_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_lat_min').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_MIN | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_lat_sec_fop', | |
id : 'fm_ne_lat_sec_fop', | |
// allowBlank: false, | |
// value: data.ne[0].fm_lat_sec_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_lat_sec_fop) | |
{ | |
this.setValue(data.ne[0].fm_lat_sec_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_lat_sec').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_SEC | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_ne_lat_reg_fop', | |
id : 'fm_ne_lat_reg_fop', | |
// value: data.ne[0].fm_lat_reg_fop, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['S'],['N']] | |
}), | |
mode : 'local', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
allowBlank: true, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_lat_reg_fop) | |
{ | |
this.setValue(data.ne[0].fm_lat_reg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_lat_reg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LAT_REG_FOP | |
}] | |
},{ | |
xtype: 'splitter' | |
},{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'label', | |
text: 'Longitude (FOP) * : ', | |
style: {marginRight: '23px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_long_deg_fop', | |
id : 'fm_ne_long_deg_fop', | |
// allowBlank: false, | |
// value: data.ne[0].fm_long_deg_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_long_deg_fop) | |
{ | |
this.setValue(data.ne[0].fm_long_deg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_long_deg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LONG_DEG | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_long_min_fop', | |
id : 'fm_ne_long_min_fop', | |
// allowBlank: false, | |
// value: data.ne[0].fm_long_min_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_long_min_fop) | |
{ | |
this.setValue(data.ne[0].fm_long_min_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_long_min').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_MIN | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_ne_long_sec_fop', | |
id : 'fm_ne_long_sec_fop', | |
// allowBlank: false, | |
// value: data.ne[0].fm_long_sec_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_long_sec_fop) | |
{ | |
this.setValue(data.ne[0].fm_long_sec_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_long_sec').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_SEC | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_ne_long_reg_fop', | |
id : 'fm_ne_long_reg_fop', | |
// value: data.ne[0].fm_long_reg_fop, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['E'],['W']] | |
}), | |
mode : 'local', | |
//emptyText: 'Direction', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
// allowBlank: false, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.ne[0].fm_long_reg_fop) | |
{ | |
this.setValue(data.ne[0].fm_long_reg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_ne_long_reg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LONG_REG | |
}] | |
},{ | |
xtype: 'splitter' | |
},{ | |
xtype: 'textarea', | |
anchor: '93%', | |
// disabled: true, | |
id: 'fm_ne_addr', | |
fieldLabel: 'NE Address', | |
name: 'fm_ne_addr', | |
value: data.ne[0].fm_addr | |
},{ | |
xtype: 'textarea', | |
anchor: '93%', | |
id: 'fm_ne_addr_isr', | |
name: 'fm_ne_addr_isr', | |
fieldLabel: 'NE Address (ISR)', | |
emptyText: data.ne[0].fm_addr, | |
value: data.ne[0].fm_addr_isr, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
layout: 'column', | |
defaults: { | |
style: 'padding-right:10px', | |
anchor:'95%', | |
}, | |
// hidden: (usg_id == 26 ? false : true), | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'ZIP Code (ISR)', | |
name: 'fm_ne_zip_isr', | |
id: 'fm_ne_zip_isr', | |
value: data.ne[0].fm_zip_isr, | |
style: {marginRight: '187px'}, | |
width: 220, | |
// hidden: (usg_id == 26 ? false : true), | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if (usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
}, | |
{ | |
xtype: 'button', | |
text: 'Get Spatial', | |
width: 75, | |
hidden: true, | |
listeners: | |
{ | |
render: function() | |
{ | |
me.validateActions({ | |
module: me.module+'_worksheet', | |
actions: 'BTN-SPATIAL', | |
scope: this, | |
callback: function(actions) { | |
this.setVisible(true); | |
// this.getDockedItems('pagingtoolbar')[0].insert(16, actions); | |
} | |
}); | |
// if(usg_id == 26) | |
// { | |
// this.setVisible(true); | |
// } | |
// else | |
// { | |
// this.setVisible(false); | |
// } | |
} | |
}, | |
handler: function() | |
{ | |
var bodyMask = new Ext.LoadMask(Ext.getBody(), {msg: 'Get spatial data, please wait...'}); | |
bodyMask.show(); | |
Ext.Ajax.request | |
({ | |
url: site_url('freq_man/freq_man_worksheet/get_spatial_data'), | |
method: 'post', | |
params: | |
{ | |
'lat_deg_fop': Ext.getCmp('fm_ne_lat_deg_fop').value, | |
'lat_min_fop': Ext.getCmp('fm_ne_lat_min_fop').value, | |
'lat_sec_fop': Ext.getCmp('fm_ne_lat_sec_fop').value, | |
'lat_reg_fop': Ext.getCmp('fm_ne_lat_reg_fop').value, | |
'long_deg_fop': Ext.getCmp('fm_ne_long_deg_fop').value, | |
'long_min_fop': Ext.getCmp('fm_ne_long_min_fop').value, | |
'long_sec_fop': Ext.getCmp('fm_ne_long_sec_fop').value, | |
'long_reg_fop': Ext.getCmp('fm_ne_long_reg_fop').value | |
}, | |
success: function(res) | |
{ | |
var obj = Ext.decode(res.responseText); | |
bodyMask.hide(); | |
if(obj.success) | |
{ | |
if(typeof obj.rows.propinsi != 'undefined') | |
{ | |
Ext.getCmp('fm_ne_province').setValue(obj.rows.propinsi); | |
} | |
else | |
{ | |
Ext.getCmp('fm_ne_province').setValue(null); | |
} | |
if(typeof obj.rows.region != 'undefined') | |
{ | |
Ext.getCmp('fm_ne_region').setValue(obj.rows.region); | |
} | |
else | |
{ | |
Ext.getCmp('fm_ne_region').setValue(null); | |
} | |
if(typeof obj.rows.kabupaten != 'undefined') | |
{ | |
Ext.getCmp('fm_ne_city').setValue(obj.rows.kabupaten); | |
} | |
else | |
{ | |
Ext.getCmp('fm_ne_city').setValue(null); | |
} | |
if(typeof obj.rows.kecamatan != 'undefined') | |
{ | |
Ext.getCmp('fm_ne_district').setValue(obj.rows.kecamatan); | |
} | |
else | |
{ | |
Ext.getCmp('fm_ne_district').setValue(null); | |
} | |
if(obj.rows.zone != 'undefined') | |
{ | |
Ext.getCmp('fm_ne_zona').setValue(obj.rows.zone); | |
} | |
else | |
{ | |
Ext.getCmp('fm_ne_zona').setValue(null); | |
} | |
if(obj.rows.kode_pos != 'undefined') | |
{ | |
Ext.getCmp('fm_ne_zip_isr').setValue(obj.rows.kode_pos); | |
} | |
else | |
{ | |
Ext.getCmp('fm_ne_zip_isr').setValue(null); | |
} | |
} | |
else | |
{ | |
bodyMask.hide(); | |
me.showInfo('Longitude and latitude are not valid!'); | |
} | |
}, | |
failure: function() | |
{ | |
bodyMask.hide(); | |
me.showInfo('Longitude and latitude are not valid!'); | |
} | |
}); | |
} | |
} | |
] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'NE Bearing', | |
name: 'fm_ne_bearing', | |
id: 'fm_ne_bearing', | |
style: {marginRight: '5px'}, | |
width: 220, | |
value: data.ne[0].fm_bearing, | |
disabled: true, | |
enableKeyEvents: true, | |
listeners: | |
{ | |
keyup: function(a,b) | |
{ | |
var valA = a.getRawValue(); | |
if(valA > 360) | |
{ | |
a.setValue(360); | |
} | |
valA = a.getValue(); | |
if(valA != '') | |
{ | |
if(valA > 180) | |
{ | |
Ext.getCmp('fm_fe_bearing').setValue(valA - 180); | |
} | |
else if (valA < 180) | |
{ | |
Ext.getCmp('fm_fe_bearing').setValue(180 + valA); | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_bearing').setValue(0); | |
} | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_bearing').setValue(null); | |
Ext.getCmp('fm_fe_bearing').clearInvalid(); | |
} | |
} | |
} | |
},{ | |
xtype: 'label', | |
text: 'Degree', | |
style: {marginRight: '40px'} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Province', | |
name: 'fm_ne_province', | |
id: 'fm_ne_province', | |
value: data.ne[0].fm_province, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'NE ANT Height', | |
name: 'fm_ne_ant_height', | |
id: 'fm_ne_ant_height', | |
value: data.ne[0].fm_ant_height, | |
style: {marginRight: '5px'}, | |
width: 220 | |
// disabled: true | |
},{ | |
xtype: 'label', | |
text: 'magl', | |
style: {marginRight: '51px'} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Region', | |
name: 'fm_ne_region', | |
id: 'fm_ne_region', | |
value: data.ne[0].fm_region, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'NE Output Power', | |
name: 'fm_ne_output_power', | |
id: 'fm_ne_output_power', | |
value: data.ne[0].fm_eqp_output_power, | |
style: {marginRight: '82px'}, | |
width: 220, | |
disabled: true | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'City', | |
name: 'fm_ne_city', | |
id: 'fm_ne_city', | |
value: data.ne[0].fm_city, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'NE Antenna Gain', | |
name: 'fm_ne_ant_gain', | |
id: 'fm_ne_ant_gain', | |
value: data.ne[0].fm_ant_gain, | |
style: {marginRight: '82px'}, | |
width: 220, | |
disabled: true | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'District', | |
name: 'fm_ne_district', | |
id: 'fm_ne_district', | |
value: data.ne[0].fm_district, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: {marginBottom:'10px'} | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'Receive Level', | |
name: 'fm_ne_receive_level', | |
id: 'fm_ne_receive_level', | |
value: data.ne[0].fm_receive_level, | |
style: {marginRight: '5px'}, | |
width: 220, | |
disabled: true | |
},{ | |
xtype: 'label', | |
text: 'dBm', | |
style: {marginRight: '51px'} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'NE Site Height', | |
name: 'fm_ne_site_height', | |
id: 'fm_ne_site_height', | |
value: data.ne[0].fm_site_height, | |
style: {marginRight: '5px', marginBottom:'10px'}, | |
width: 220, | |
}] | |
},{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: {marginBottom:'10px'} | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'Zona', | |
name: 'fm_ne_zona', | |
id: 'fm_ne_zona', | |
value: data.ne[0].fm_zona, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}] | |
} | |
var farEndInfo = { | |
xtype: 'fieldset', | |
title: 'Far End Info', | |
width: 575, | |
items: [{ | |
xtype: 'textfield', | |
name: 'fm_fe_site_id', | |
id: 'fm_fe_site_id', | |
fieldLabel: 'FE Site ID', | |
value: data.fe[0].fm_ne_site_id, | |
disabled: norFreqHidden, | |
size: 60 | |
},{ | |
xtype: 'textfield', | |
name: 'fm_fe_site_name', | |
id: 'fm_fe_site_name', | |
fieldLabel: 'FE Site Name', | |
value: data.fe[0].fm_ne_site_name, | |
disabled: true, | |
size: 60 | |
},{ | |
layout: 'column', | |
anchor: '95%', | |
defaults: { | |
bodyStyle: 'padding-right:10px' | |
}, | |
items: [{ | |
xtype: 'label', | |
text: 'Latitude * : ', | |
style: {marginRight: '65px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name: 'fm_fe_lat_deg', | |
id: 'fm_fe_lat_deg', | |
// allowBlank: false, | |
value: data.fe[0].fm_lat_deg, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'}, | |
disabled: (usg_id == 26 ? false : true) | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_lat_min', | |
id : 'fm_fe_lat_min', | |
allowBlank: true, | |
value: data.fe[0].fm_lat_min, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
//emptyText:'Minute', | |
// value: s.NE_LONG_MIN_FOP | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_lat_sec', | |
id : 'fm_fe_lat_sec', | |
allowBlank: true, | |
value: data.fe[0].fm_lat_sec, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
//emptyText:'Minute', | |
// value: s.NE_LONG_MIN_FOP | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_fe_lat_reg', | |
id : 'fm_fe_lat_reg', | |
value: data.fe[0].fm_lat_reg, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['S'],['N']] | |
}), | |
mode : 'local', | |
//emptyText: 'Direction', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
allowBlank: true, | |
disabled: (usg_id == 26 ? false : true) | |
// value:s.NE_LAT_REG_FOP | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout:'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items:[{ | |
xtype: 'label', | |
text: 'Longitude * : ', | |
style: {marginRight: '57px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_long_deg', | |
id : 'fm_fe_long_deg', | |
// allowBlank: false, | |
value: data.fe[0].fm_long_deg, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
// value:s.NE_LONG_DEG | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_long_min', | |
id : 'fm_fe_long_min', | |
// allowBlank: false, | |
value: data.fe[0].fm_long_min, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
// value: s.NE_LONG_MIN | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_long_sec', | |
id : 'fm_fe_long_sec', | |
// allowBlank: false, | |
value: data.fe[0].fm_long_sec, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 26 ? false : true) | |
// value: s.NE_LONG_SEC | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_fe_long_reg', | |
id : 'fm_fe_long_reg', | |
value: data.fe[0].fm_long_reg, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['E'],['W']] | |
}), | |
mode : 'local', | |
//emptyText: 'Direction', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
allowBlank: false, | |
disabled: (usg_id == 26 ? false : true) | |
// value:s.NE_LONG_REG | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'label', | |
text: 'Latitude (FOP) * : ', | |
style: {marginRight: '30px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_lat_deg_fop', | |
id : 'fm_fe_lat_deg_fop', | |
allowBlank: false, | |
// value: data.fe[0].fm_lat_deg_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_lat_deg_fop) | |
{ | |
this.setValue(data.fe[0].fm_lat_deg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_lat_deg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LONG_DEG | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_lat_min_fop', | |
id : 'fm_fe_lat_min_fop', | |
allowBlank: false, | |
// value: data.fe[0].fm_lat_min_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_lat_min_fop) | |
{ | |
this.setValue(data.fe[0].fm_lat_min_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_lat_min').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_MIN | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_lat_sec_fop', | |
id : 'fm_fe_lat_sec_fop', | |
allowBlank: false, | |
// value: data.fe[0].fm_lat_sec_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_lat_sec_fop) | |
{ | |
this.setValue(data.fe[0].fm_lat_sec_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_lat_sec').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_SEC | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_fe_lat_reg_fop', | |
id : 'fm_fe_lat_reg_fop', | |
// value: data.fe[0].fm_lat_reg_fop, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['S'],['N']] | |
}), | |
mode : 'local', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
allowBlank: true, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_lat_reg_fop) | |
{ | |
this.setValue(data.fe[0].fm_lat_reg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_lat_reg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LAT_REG_FOP | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'label', | |
text: 'Longitude (FOP) * : ', | |
style: {marginRight: '23px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_long_deg_fop', | |
id : 'fm_fe_long_deg_fop', | |
allowBlank: false, | |
// value: data.fe[0].fm_long_deg_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_long_deg_fop) | |
{ | |
this.setValue(data.fe[0].fm_long_deg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_long_deg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LONG_DEG | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '°', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_long_min_fop', | |
id : 'fm_fe_long_min_fop', | |
allowBlank: false, | |
// value: data.fe[0].fm_long_min_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_long_min_fop) | |
{ | |
this.setValue(data.fe[0].fm_long_min_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_long_min').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_MIN | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '′', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.15, | |
xtype: 'numberfield', | |
allowDecimals: true, | |
name : 'fm_fe_long_sec_fop', | |
id : 'fm_fe_long_sec_fop', | |
allowBlank: false, | |
// value: data.fe[0].fm_long_sec_fop, | |
style: {marginRight: '2px'}, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_long_sec_fop) | |
{ | |
this.setValue(data.fe[0].fm_long_sec_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_long_sec').getValue()); | |
} | |
} | |
} | |
// value: s.NE_LONG_SEC | |
},{ | |
style: 'padding-left:2px', | |
columnWidth:.03, | |
xtype: 'label', | |
html: '″', | |
style: {marginRight: '20px'} | |
},{ | |
columnWidth:.16, | |
xtype: 'combo', | |
name : 'fm_fe_long_reg_fop', | |
id : 'fm_fe_long_reg_fop', | |
// value: data.fe[0].fm_long_reg_fop, | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['E'],['W']] | |
}), | |
mode : 'local', | |
//emptyText: 'Direction', | |
triggerAction : 'all', | |
displayField : 'id', | |
valueField : 'id', | |
editable : false, | |
forceSelection: true, | |
allowBlank: false, | |
disabled: (usg_id == 27 ? false : true), | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.fe[0].fm_long_reg_fop) | |
{ | |
this.setValue(data.fe[0].fm_long_reg_fop); | |
} | |
else | |
{ | |
this.setValue(Ext.getCmp('fm_fe_long_reg').getValue()); | |
} | |
} | |
} | |
// value:s.NE_LONG_REG | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
xtype: 'textarea', | |
anchor: '93%', | |
// disabled: true, | |
id: 'fm_fe_addr', | |
fieldLabel: 'FE Address', | |
name: 'fm_fe_addr', | |
value: data.fe[0].fm_addr | |
},{ | |
xtype: 'textarea', | |
anchor: '93%', | |
id: 'fm_fe_addr_isr', | |
name: 'fm_fe_addr_isr', | |
fieldLabel: 'FE Address (ISR)', | |
emptyText: data.fe[0].fm_addr, | |
value: data.fe[0].fm_addr_isr, | |
hidden: (usg_id == 26 ? false : true), | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
layout: 'column', | |
defaults: { | |
style: 'padding-right:10px', | |
anchor:'95%', | |
}, | |
// hidden: (usg_id == 26 ? false : true), | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'ZIP Code (ISR)', | |
name: 'fm_fe_zip_isr', | |
id: 'fm_fe_zip_isr', | |
value: data.fe[0].fm_zip_isr, | |
style: {marginRight: '187px'}, | |
width: 220, | |
// hidden: (usg_id == 26 ? false : true), | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: {afterrender: function() | |
{ | |
if (usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'button', | |
text: 'Get Spatial', | |
width: 75, | |
hidden: true, | |
listeners: | |
{ | |
render: function() | |
{ | |
me.validateActions({ | |
module: me.module+'_worksheet', | |
actions: 'BTN-SPATIAL', | |
scope: this, | |
callback: function(actions) { | |
this.setVisible(true); | |
// this.getDockedItems('pagingtoolbar')[0].insert(16, actions); | |
} | |
}); | |
// if(usg_id == 26) | |
// { | |
// this.setVisible(true); | |
// } | |
// else | |
// { | |
// this.setVisible(true); | |
// } | |
} | |
}, | |
handler: function() | |
{ | |
var bodyMask = new Ext.LoadMask(Ext.getBody(), {msg: 'Get spatial data, please wait...'}); | |
bodyMask.show(); | |
Ext.Ajax.request | |
({ | |
url: site_url('freq_man/freq_man_worksheet/get_spatial_data'), | |
method: 'post', | |
params: | |
{ | |
'lat_deg_fop': Ext.getCmp('fm_fe_lat_deg_fop').value, | |
'lat_min_fop': Ext.getCmp('fm_fe_lat_min_fop').value, | |
'lat_sec_fop': Ext.getCmp('fm_fe_lat_sec_fop').value, | |
'lat_reg_fop': Ext.getCmp('fm_fe_lat_reg_fop').value, | |
'long_deg_fop': Ext.getCmp('fm_fe_long_deg_fop').value, | |
'long_min_fop': Ext.getCmp('fm_fe_long_min_fop').value, | |
'long_sec_fop': Ext.getCmp('fm_fe_long_sec_fop').value, | |
'long_reg_fop': Ext.getCmp('fm_fe_long_reg_fop').value | |
}, | |
success: function(res) | |
{ | |
bodyMask.hide(); | |
var obj = Ext.decode(res.responseText); | |
if(obj.success) | |
{ | |
if(typeof obj.rows.propinsi != 'undefined') | |
{ | |
Ext.getCmp('fm_fe_province').setValue(obj.rows.propinsi); | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_province').setValue(null); | |
} | |
if(typeof obj.rows.region != 'undefined') | |
{ | |
Ext.getCmp('fm_fe_region').setValue(obj.rows.region); | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_region').setValue(null); | |
} | |
if(typeof obj.rows.kabupaten != 'undefined') | |
{ | |
Ext.getCmp('fm_fe_city').setValue(obj.rows.kabupaten); | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_city').setValue(null); | |
} | |
if(typeof obj.rows.kecamatan != 'undefined') | |
{ | |
Ext.getCmp('fm_fe_district').setValue(obj.rows.kecamatan); | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_district').setValue(null); | |
} | |
if(obj.rows.ZONE != 'undefined') | |
{ | |
Ext.getCmp('fm_fe_zona').setValue(obj.rows.ZONE); | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_zona').setValue(null); | |
} | |
if(obj.rows.KODE_POS != 'undefined') | |
{ | |
Ext.getCmp('fm_fe_zip_isr').setValue(obj.rows.KODE_POS); | |
} | |
else | |
{ | |
Ext.getCmp('fm_fe_zip_isr').setValue(null); | |
} | |
} | |
else | |
{ | |
bodyMask.hide(); | |
me.showInfo('Longitude and latitude are not valid!'); | |
} | |
}, | |
failure: function() | |
{ | |
bodyMask.hide(); | |
me.showInfo('Longitude and latitude are not valid!'); | |
} | |
}); | |
} | |
}] | |
},{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'FE Bearing', | |
name: 'fm_fe_bearing', | |
id: 'fm_fe_bearing', | |
value: data.fe[0].fm_bearing, | |
style: {marginRight: '5px'}, | |
width: 220, | |
disabled: true | |
},{ | |
xtype: 'label', | |
text: 'Degree', | |
style: {marginRight: '40px'} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Province', | |
name: 'fm_fe_province', | |
id: 'fm_fe_province', | |
value: data.fe[0].fm_province, | |
width: 220, | |
disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'FE ANT Height', | |
name: 'fm_fe_ant_height', | |
id: 'fm_fe_ant_height', | |
value: data.fe[0].fm_ant_height, | |
style: {marginRight: '5px'}, | |
width: 220 | |
// disabled: true | |
},{ | |
xtype: 'label', | |
text: 'magl', | |
style: {marginRight: '51px'} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Region', | |
name: 'fm_fe_region', | |
id: 'fm_fe_region', | |
value: data.fe[0].fm_region, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'FE Output Power', | |
name: 'fm_fe_output_power', | |
id: 'fm_fe_output_power', | |
value: data.fe[0].fm_eqp_output_power, | |
style: {marginRight: '82px'}, | |
width: 220, | |
disabled: true | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'City', | |
name: 'fm_fe_city', | |
id: 'fm_fe_city', | |
value: data.fe[0].fm_city, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: 'padding-right:10px', | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'FE Antenna Gain', | |
name: 'fm_fe_ant_gain', | |
id: 'fm_fe_ant_gain', | |
value: data.fe[0].fm_ant_gain, | |
style: {marginRight: '82px'}, | |
width: 220, | |
disabled: true | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'District', | |
name: 'fm_fe_district', | |
id: 'fm_fe_district', | |
value: data.fe[0].fm_district, | |
width: 220, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}, | |
{xtype: 'splitter'}, | |
{ | |
layout: 'column', | |
anchor:'95%', | |
defaults: { | |
style: {marginBottom:'10px'} | |
}, | |
items: [{ | |
xtype: 'textfield', | |
fieldLabel: 'FE Site Height', | |
name: 'fm_fe_site_height', | |
id: 'fm_fe_site_height', | |
value: data.fe[0].fm_site_height, | |
style: {marginRight: '12px', marginBottom:'10px'}, | |
width: 220 | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Zona', | |
name: 'fm_fe_zona', | |
id: 'fm_fe_zona', | |
value: data.fe[0].fm_zona, | |
width: 220, | |
style: {marginLeft: '70px', marginBottom:'10px'}, | |
// disabled: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
}] | |
}] | |
} | |
var configInfo = { | |
xtype: 'fieldset', | |
title: 'Config', | |
collapsible: true, | |
width: 575, | |
items: [{ | |
xtype: 'combo' | |
, allowBlank: false | |
, fieldLabel: 'Polarization' | |
, id: 'fm_polarization' | |
, name: 'fm_polarization' | |
, ref: 'fm_polarization' | |
// , disabled: true | |
, width: 300 | |
, triggerAction: 'all' | |
, value: data.config[0].fm_polarization | |
, store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['H'], ['V']] | |
}) | |
, displayField: 'id' | |
, valueField: 'id' | |
, mode: 'local' | |
, forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, tabIndex: 1 | |
},{ | |
xtype: 'combo' | |
// , allowBlank: false | |
, fieldLabel: 'Brand' | |
, id: 'fm_brand' | |
, name: 'fm_brand' | |
, width: 300 | |
, value: data.config[0].fm_brand | |
, store: brand | |
, displayField: 'rb_brand_name' | |
, valueField: 'rb_brand_id' | |
, mode: 'remote' | |
, disabled: true | |
// , triggerAction: 'all' | |
// , forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, tabIndex: 1 | |
, listeners: | |
{ | |
select: function() | |
{ | |
if(this.getValue()) | |
{ | |
Ext.getCmp('fm_ne_idx').setValue(''); | |
Ext.getCmp('fm_ne_idx').clearInvalid(); | |
Ext.getCmp('fm_fe_idx').setValue(''); | |
Ext.getCmp('fm_fe_idx').clearInvalid(); | |
me.checkForFreq(); | |
me.generate_eqp_name(); | |
if(Ext.getCmp('fm_ne_ant_type_1')) | |
{ | |
Ext.getCmp('fm_ne_ant_type_1').setDisabled(false); | |
} | |
if(Ext.getCmp('fm_fe_ant_type_1')) | |
{ | |
Ext.getCmp('fm_fe_ant_type_1').setDisabled(false); | |
} | |
if(Ext.getCmp('fm_ne_ant_type_2')) | |
{ | |
Ext.getCmp('fm_ne_ant_type_2').setDisabled(false); | |
} | |
if(Ext.getCmp('fm_fe_ant_type_2')) | |
{ | |
Ext.getCmp('fm_fe_ant_type_2').setDisabled(false); | |
} | |
} | |
} | |
} | |
},{ | |
xtype: 'combo' | |
// , allowBlank: false | |
, fieldLabel: 'Frequency' | |
, id: 'fm_frequency' | |
, name: 'fm_frequency' | |
, width: 300 | |
, value: data.config[0].fm_frequency | |
, store: radioStore | |
, displayField: 'rr_radio_freq' | |
, valueField: 'rr_radio_freq' | |
, disabled: true | |
, mode: 'remote' | |
// , triggerAction: 'all' | |
// , forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, listeners: | |
{ | |
select: function() | |
{ | |
me.checkForFreq(); | |
me.generate_eqp_name(); | |
} | |
} | |
, tabIndex: 1 | |
},{ | |
xtype: 'combo' | |
// , allowBlank: false | |
, fieldLabel: 'Configuration' | |
, id: 'fm_configuration' | |
, fieldLabel: 'Configuration' | |
, name: 'fm_configuration' | |
, disabled: true | |
, width: 300 | |
, value: data.config[0].fm_configuration | |
, store: configStore | |
, displayField: 'rsc_sys_conf_name' | |
, valueField: 'rsc_sys_conf_name' | |
, mode: 'remote' | |
// , triggerAction: 'all' | |
// , forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, tabIndex: 1 | |
, listeners: | |
{ | |
select: function() | |
{ | |
// showConfigAdd(this.getValue(), false, 'fEdit', Ext.getCmp()); | |
me.checkForFreq(); | |
} | |
} | |
},{ | |
layout: 'column', | |
anchor: '95%', | |
items: [{ | |
xtype: 'label', | |
text: 'Indoor Unit (IDU): ', | |
style: {marginRight: '14px'} | |
},{ | |
xtype: 'combo', | |
allowBlank: true, | |
id: 'fm_ne_idu_ref_id', | |
name: 'fm_ne_idu_ref_id', | |
hiddenName: 'fm_ne_idu_ref_id', | |
value: data.ne[0].fm_ne_idu_ref_id, | |
// hiddenValue: 'IDU_ID', | |
width: 85, | |
disabled: true, | |
store: idu, | |
displayField: 'ri_idu_name', | |
valueField: 'ri_idu_id', | |
mode: 'remote', | |
// triggerAction: 'all', | |
// forceSelection: true, | |
editable: false, | |
listClass: 'center', | |
tabIndex: 10, | |
style: {marginRight: '25px'}, | |
listeners: | |
{ | |
select: function() | |
{ | |
me.generate_eqp_name(); | |
}, | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
var brand_val = Ext.getCmp('fm_brand').getValue(); | |
if(brand_val != '') | |
{ | |
var params = this.store.getProxy().getLastParams(); | |
params.brand = brand_val; | |
this.store.proxy.extraParams = params; | |
} | |
} | |
} | |
},{ | |
xtype: 'combo', | |
allowBlank: true, | |
id: 'fm_fe_idu_ref_id', | |
name: 'fm_fe_idu_ref_id', | |
hiddenName: 'fm_fe_idu_ref_id', | |
value: data.fe[0].fm_fe_idu_ref_id, | |
disabled: true, | |
// hiddenValue: 'IDU_ID', | |
width: 85, | |
store: idu, | |
displayField: 'ri_idu_name', | |
valueField: 'ri_idu_id', | |
mode: 'remote', | |
// triggerAction: 'all', | |
// forceSelection: true, | |
editable: false, | |
listClass: 'center', | |
tabIndex: 11, | |
listeners: | |
{ | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
var brand_val = Ext.getCmp('fm_brand').getValue(); | |
if(brand_val != '') | |
{ | |
var params = this.store.getProxy().getLastParams(); | |
params.brand = brand_val; | |
this.store.proxy.extraParams = params; | |
} | |
} | |
} | |
}] | |
},{ | |
xtype: 'splitter' | |
},{ | |
xtype: 'combo', | |
fieldLabel: 'Capacity HW', | |
id: 'fm_capacity_hw', | |
name: 'fm_capacity_hw', | |
hiddenName: 'fm_capacity_hw', | |
width: 300, | |
typeAhead: true, | |
triggerAction: 'all', | |
value: data.config[0].fm_capacity_hw, | |
store: capacity, | |
displayField: 'rc_cap_name', | |
valueField: 'rc_cap_name', | |
disabled: true, | |
mode: 'remote', | |
lazyRender: false, | |
listClass: 'x-combo-list-small', | |
allowBlank: true, | |
editable: false, | |
tabIndex: 12, | |
selectOnFocus: true, | |
enableKeyEvents: true | |
// listeners: { | |
// beforeQuery: function(query) { | |
// delete query.combo.lastQuery; | |
// } | |
// } | |
},{ | |
xtype: 'combo', | |
fieldLabel: 'Capacity SW', | |
id: 'fm_capacity_sw', | |
name: 'fm_capacity_sw', | |
hiddenName: 'fm_capacity_sw', | |
width: 300, | |
typeAhead: true, | |
disabled: true, | |
triggerAction: 'all', | |
value: data.config[0].fm_capacity_sw, | |
store: capacity, | |
displayField: 'rc_cap_name', | |
valueField: 'rc_cap_name', | |
mode: 'remote', | |
listClass: 'x-combo-list-small', | |
allowBlank: true, | |
editable: false, | |
tabIndex: 13, | |
selectOnFocus: true, | |
enableKeyEvents: true, | |
listeners: { | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
} | |
} | |
}, | |
/*{ | |
layout: 'column', | |
anchor: '95%', | |
items: [{ | |
xtype: 'label', | |
text: 'Antenna: ', | |
style: {marginRight: '59px'} | |
},{ | |
xtype: 'combo' | |
, allowBlank: false | |
, id: 'fm_antenna' | |
, name: 'fm_antenna' | |
, width: 85 | |
, store: idx | |
, displayField: 'ridx_idx_low' | |
, valueField: 'ridx_idx_low' | |
, mode: 'remote' | |
, triggerAction: 'all' | |
, forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, disabled: true | |
// , listeners: {'select': function(el, rec, idx) { | |
// Ext.getCmp('IDX_ID').setValue(rec.get('IDX_ID')); | |
// Ext.getCmp('FE_IDX').setValue(rec.get('IDX_HIGH')); | |
// if (this.getValue() != '') | |
// checkForFreq(); | |
// }} | |
, listeners: | |
{ | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
var brand_val = Ext.getCmp('fm_brand').getValue(); | |
if(brand_val != '') | |
{ | |
var params = this.store.getProxy().getLastParams(); | |
params.brand = brand_val; | |
this.store.proxy.extraParams = params; | |
} | |
} | |
} | |
, tabIndex: 2 | |
,style: {marginRight: '25px'} | |
},{ | |
xtype: 'combo' | |
, allowBlank: false | |
, id: 'fm_antenna_2' | |
, name: 'fm_antenna_2' | |
, width: 85 | |
, store: idx | |
, displayField: 'ridx_idx_low' | |
, valueField: 'ridx_idx_low' | |
, mode: 'remote' | |
, triggerAction: 'all' | |
, forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, disabled: true | |
// , listeners: {'select': function(el, rec, idx) { | |
// Ext.getCmp('IDX_ID').setValue(rec.get('IDX_ID')); | |
// Ext.getCmp('NE_IDX').setValue(rec.get('IDX_HIGH')); | |
// checkForFreq(); | |
// }}, | |
, listeners: | |
{ | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
var brand_val = Ext.getCmp('fm_brand').getValue(); | |
if(brand_val != '') | |
{ | |
var params = this.store.getProxy().getLastParams(); | |
params.brand = brand_val; | |
this.store.proxy.extraParams = params; | |
} | |
} | |
} | |
,tabIndex: 2 | |
}] | |
},*/ | |
{ | |
id: 'antRefAdd' | |
},{ | |
xtype: 'splitter' | |
},{ | |
layout: 'column', | |
anchor: '95%', | |
items: [{ | |
xtype: 'label', | |
text: 'Index: ', | |
style: {marginRight: '74px'} | |
},{ | |
xtype: 'combo' | |
// , allowBlank: false | |
, id: 'fm_ne_idx' | |
, name: 'fm_ne_idx' | |
, width: 85 | |
, store: idx | |
, displayField: 'ridx_idx_low' | |
, valueField: 'ridx_idx_low' | |
, value:data.ne[0].fm_ne_idx | |
, mode: 'remote' | |
// , triggerAction: 'all' | |
// , forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, disabled: true | |
, tabIndex: 2 | |
, listeners: | |
{ | |
select: function(el, rec, idx) | |
{ | |
// Ext.getCmp('IDX_ID').setValue(rec.get('IDX_ID')); | |
// Ext.getCmp('FE_IDX').setValue(rec.get('IDX_HIGH')); | |
Ext.getCmp('fm_fe_idx').setValue(rec[0].data.ridx_idx_high); | |
if (this.getValue() != '') | |
{ | |
me.checkForFreq(); | |
} | |
}, | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
var brand_val = Ext.getCmp('fm_brand').getValue(); | |
if(brand_val != '') | |
{ | |
var params = this.store.getProxy().getLastParams(); | |
params.brand = brand_val; | |
this.store.proxy.extraParams = params; | |
} | |
} | |
} | |
,style: {marginRight: '25px'} | |
},{ | |
xtype: 'combo' | |
// , allowBlank: false | |
, id: 'fm_fe_idx' | |
, name: 'fm_fe_idx' | |
// , ref: 'FE_IDX' | |
, width: 85 | |
, store: idx | |
, displayField: 'ridx_idx_low' | |
, valueField: 'ridx_idx_low' | |
, value:data.ne[0].fm_fe_idx | |
, mode: 'remote' | |
// , triggerAction: 'all' | |
// , forceSelection: true | |
, editable: false | |
, listClass: 'center' | |
, disabled: true | |
// , listeners: {'select': function(el, rec, idx) { | |
// Ext.getCmp('IDX_ID').setValue(rec.get('IDX_ID')); | |
// Ext.getCmp('NE_IDX').setValue(rec.get('IDX_HIGH')); | |
// checkForFreq(); | |
// }}, | |
, listeners: | |
{ | |
select: function(el, rec, idx) | |
{ | |
Ext.getCmp('fm_ne_idx').setValue(rec[0].data.ridx_idx_high); | |
if(this.getValue()) | |
{ | |
me.checkForFreq(); | |
} | |
}, | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
var brand_val = Ext.getCmp('fm_brand').getValue(); | |
if(brand_val != '') | |
{ | |
var params = this.store.getProxy().getLastParams(); | |
params.brand = brand_val; | |
this.store.proxy.extraParams = params; | |
} | |
} | |
} | |
,tabIndex: 2 | |
}] | |
},{ | |
xtype: 'splitter' | |
},{ | |
xtype: 'combo', | |
fieldLabel: 'NE Antenna ID', | |
id: 'fm_ne_ant_id_1', | |
name: 'fm_ne_ant_id_1', | |
disabled: false, | |
store: getAntId, | |
queryMode: 'remote', | |
// ref: 'fm_simf_ant_name', | |
displayField: 'ant_id', | |
valueField: 'ant_id', | |
value: data.ne[0].fm_ne_ant_id_1, | |
width: 300, | |
tabIndex: 6 | |
},{ | |
xtype: 'combo', | |
fieldLabel: 'FE Antenna ID', | |
id: 'fm_fe_ant_id_1', | |
name: 'fm_fe_ant_id_1', | |
disabled: false, | |
store: getAntId, | |
queryMode: 'remote', | |
// ref: 'fm_simf_ant_name', | |
displayField: 'ant_id', | |
valueField: 'ant_id', | |
value: data.ne[0].fm_fe_ant_id_1, | |
width: 300, | |
tabIndex: 6 | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Antenna Name', | |
id: 'fm_ant_name', | |
name: 'fm_ant_name', | |
disabled: true, | |
// ref: 'fm_simf_ant_name', | |
value: data.config[0].fm_ant_name, | |
width: 300, | |
tabIndex: 6 | |
}, | |
{ | |
xtype: 'textfield', | |
fieldLabel: 'Bandwidth Plan', | |
id: 'fm_bandwidth', | |
name: 'fm_bandwidth', | |
value: data.config[0].fm_bandwidth, | |
disabled: true, | |
width: 300, | |
tabIndex: 6 | |
}, | |
{ | |
xtype: 'combo', | |
fieldLabel: 'Bandwidth ISR', | |
allowBlank: (usg_id != 26 ? false : true), | |
emptyText: (data.config[0].fm_bandwidth_isr != null ? data.config[0].fm_bandwidth_isr : data.config[0].fm_bandwidth), | |
id: 'fm_bandwidth_isr', | |
name: 'fm_bandwidth_isr', | |
ref: 'fm_simf_bw_isr', | |
value: data.config[0].fm_bandwidth_isr, | |
width: 300, | |
triggerAction: 'all', | |
store: new Ext.data.ArrayStore({ | |
fields: ['id'], | |
data: [['7000000'], ['14000000'], ['28000000'], ['29650000'], ['40000000']] | |
}), | |
displayField: 'id', | |
valueField: 'id', | |
mode: 'local', | |
forceSelection: true, | |
editable: false, | |
disabled: freqHidden, | |
// hidden: (usg_id == 26 ? false : true), | |
listClass: 'center', | |
tabIndex: 1 | |
// , listeners: {afterrender: function() { | |
// if (usg_id == 3 && Ext.getCmp('REQUEST_STATUS').getValue() != 'CANCEL ISR') { | |
// this.setDisabled(false); | |
// } else { | |
// this.setDisabled(true); | |
// } | |
// }} | |
},{ | |
xtype: 'splitter' | |
},{ | |
layout: 'column', | |
items: | |
[ | |
{ | |
id: 'freqAdd2' | |
} | |
] | |
},{ | |
xtype: 'splitter' | |
},{ | |
layout: 'column', | |
items: | |
[ | |
{ | |
id: 'freqAdd' | |
} | |
] | |
},{ | |
xtype: 'splitter' | |
},{ | |
layout: 'column', | |
items: | |
[ | |
{ | |
id: 'antModRefAdd' | |
} | |
] | |
}, | |
{ | |
layout: 'column', | |
anchor: '95%', | |
items: [{ | |
xtype: 'label', | |
html: 'TX/RX Frequency <br /> (FOP):', | |
style: {marginRight: '15px'} | |
},{ | |
xtype: 'combo', | |
width: 85, | |
id: 'fm_tx_freq_fo_1', | |
name: 'fm_tx_freq_fo_1', | |
store: refFreq, | |
value: data.ne[0].fm_tx_freq_fo, | |
displayField: 'rf_freq_low', | |
style: {marginRight: '25px'}, | |
queryMode: 'remote', | |
disabled: freqHidden, | |
// editable:false, | |
listeners: { | |
beforequery: function(q) { | |
// console.log(q); | |
delete q.combo.lastQuery; | |
var fm_bandwidth = Ext.getCmp('fm_bandwidth').getValue(); | |
var params = this.store.getProxy().extraParams = { | |
'bandwidth' : fm_bandwidth | |
}; | |
}, | |
select: function(a, b) { | |
// console.log(a); | |
// console.log(b); | |
// console.log(Ext.getCmp('se_rx_freq')); | |
Ext.getCmp('fm_rx_freq_fo_1').setValue(b[0].data.rf_freq_high); | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
width: 85, | |
id: 'fm_rx_freq_fo_1', | |
name: 'fm_rx_freq_fo_1', | |
value: data.ne[0].fm_rx_freq_fo, | |
style: {marginRight: '2px'}, | |
disabled: freqHidden | |
},{ | |
xtype: 'label', | |
text: 'MHz' | |
}] | |
}, | |
{ | |
xtype: 'splitter' | |
}, | |
{ | |
layout: 'column', | |
anchor: '95%', | |
items: [{ | |
xtype: 'label', | |
html: 'TX/RX Frequency <br /> (ISR):', | |
style: {marginRight: '15px'} | |
},{ | |
xtype: 'combo', | |
width: 85, | |
id: 'fm_tx_freq_isr_2', | |
name: 'fm_tx_freq_isr_2', | |
store: refFreq, | |
value: data.ne[0].fm_tx_freq_isr, | |
displayField: 'rf_freq_low', | |
queryMode: 'remote', | |
style: {marginRight: '25px'}, | |
disabled: freqHidden, | |
// editable:false, | |
listeners: { | |
beforequery: function(q) { | |
// console.log(q); | |
delete q.combo.lastQuery; | |
var fm_bandwidth = Ext.getCmp('fm_bandwidth').getValue(); | |
var params = this.store.getProxy().extraParams = { | |
'bandwidth' : fm_bandwidth | |
}; | |
}, | |
select: function(a, b) { | |
// console.log(a); | |
// console.log(b); | |
// console.log(Ext.getCmp('se_rx_freq')); | |
Ext.getCmp('fm_rx_freq_isr_2').setValue(b[0].data.rf_freq_high); | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
width: 85, | |
id: 'fm_rx_freq_isr_2', | |
name: 'fm_rx_freq_isr_2', | |
value: data.ne[0].fm_rx_freq_isr, | |
style: {marginRight: '2px'}, | |
disabled: freqHidden | |
},{ | |
xtype: 'label', | |
text: 'MHz' | |
}] | |
}, | |
{ | |
xtype: 'splitter' | |
}, | |
{ | |
layout: 'column', | |
anchor: '95%', | |
items: [{ | |
xtype: 'label', | |
text: 'Antenna Model: ', | |
style: {marginRight: '25px'} | |
},{ | |
xtype: 'combo', | |
width: 85, | |
id: 'fm_ne_ant_type_1', | |
name: 'fm_ne_ant_type_1', | |
value: data.config[0].fm_ne_ant_type_1, | |
style: {marginRight: '25px'} | |
},{ | |
xtype: 'combo', | |
width: 85, | |
id: 'fm_fe_ant_type_1', | |
name: 'fm_fe_ant_type_1', | |
value: data.config[0].fm_fe_ant_type_1, | |
style: {marginRight: '2px'} | |
}] | |
}, | |
{ | |
xtype: 'splitter' | |
}, | |
{ | |
xtype: 'combo', | |
fieldLabel: 'NE Eqp.ID', | |
store:getEqpId, | |
id: 'fm_ne_eqp_id', | |
name: 'fm_ne_eqp_id', | |
displayField: 'eqp_id', | |
value: data.ne[0].fm_ne_eqp_id, | |
valueField: 'eqp_id', | |
queryMode: 'remote', | |
disabled: false, | |
width: 300, | |
}, | |
{ | |
xtype: 'combo', | |
fieldLabel: 'FE Eqp.ID', | |
store:getEqpId, | |
id: 'fm_fe_eqp_id', | |
name: 'fm_fe_eqp_id', | |
displayField: 'eqp_id', | |
value: data.ne[0].fm_fe_eqp_id, | |
valueField: 'eqp_id', | |
queryMode: 'remote', | |
disabled: false, | |
width: 300, | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Eqp.Name', | |
id: 'fm_eqp_name', | |
name: 'fm_eqp_name', | |
value: data.config[0].fm_eqp_name, | |
disabled: true, | |
width: 300, | |
},{ | |
xtype: 'textarea', | |
fieldLabel: 'Remark', | |
id: 'fm_remark', | |
name: 'fm_remark', | |
value: data.config[0].fm_remark, | |
width: 300, | |
hidden: (usg_id == 27 ? false : true) | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Client ID', | |
id: 'fm_client_id', | |
name: 'fm_client_id', | |
value: data.config[0].fm_client_id, | |
hidden: (usg_id == 26 ? false : true), | |
width: 300, | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(true); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Application Number', | |
id: 'fm_no_app', | |
name: 'fm_no_app', | |
value: data.config[0].fm_no_app, | |
hidden: (usg_id == 26 ? false : true), | |
width: 300, | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Receipt Number', | |
id: 'fm_no_resi', | |
name: 'fm_no_resi', | |
value: data.config[0].fm_no_resi, | |
hidden: (usg_id == 26 ? false : true), | |
width: 300, | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'NE Station Number', | |
id: 'fm_ne_sta_no', | |
name: 'fm_ne_sta_no', | |
value: data.ne[0].fm_sta_no, | |
hidden: (usg_id == 26 ? false : true), | |
width: 300 | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'FE Station Number', | |
id: 'fm_fe_sta_no', | |
name: 'fm_fe_sta_no', | |
value: data.fe[0].fm_sta_no, | |
hidden: (usg_id == 26 ? false : true), | |
width: 300 | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Spp Number', | |
id: 'fm_no_spp', | |
name: 'fm_no_spp', | |
value: data.config[0].fm_no_spp, | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_status_fm == 'LAPOR')) | |
{ | |
this.setDisabled(false); | |
} | |
else if((usg_id == 26 && rec.data.fm_status_fm != 'LAPOR') || (usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR')) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'datefield', | |
fieldLabel: 'SPP Due Date', | |
name: 'fm_spp_date', | |
id: 'fm_spp_date', | |
value: data.config[0].fm_spp_date, | |
format: 'd-M-y', | |
editable: false, | |
allowBlank: true, | |
hidden: true, | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_status_fm == 'LAPOR')) | |
{ | |
this.setDisabled(false); | |
} | |
else if((usg_id == 26 && rec.data.fm_status_fm != 'LAPOR') || (usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR')) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'datefield', | |
fieldLabel: 'ISR Expired Date', | |
id: 'fm_isr_date', | |
name: 'fm_isr_date', | |
value: Ext.Date.format(new Date(data.config[0].fm_isr_date), "Y-m-d"), | |
format: 'd-m-Y', | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function(a,b,c) | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_status_fm == 'LAPOR')) | |
{ | |
this.setDisabled(false); | |
} | |
else if((usg_id == 26 && rec.data.fm_status_fm != 'LAPOR') || (usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR')) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'combo', | |
allowBlank: true, | |
id: 'fm_isr_status', | |
name: 'fm_isr_status', | |
fieldLabel: 'Status', | |
hiddenName: 'fm_isr_status', | |
value: data.config[0].fm_isr_status, | |
width: 300, | |
store: statusStore, | |
displayField: 'rs_status_name', | |
valueField: 'rs_status_name', | |
hidden: (usg_id == 26 ? false : true), | |
// mode: 'remote', | |
// triggerAction: 'all', | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_status_fm == 'LAPOR')) | |
{ | |
this.setDisabled(false); | |
} | |
else if((usg_id == 26 && rec.data.fm_status_fm != 'LAPOR') || (usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR')) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'NE BHP (Rp.)', | |
id: 'fm_ne_bhp', | |
name: 'fm_ne_bhp', | |
value: data.ne[0].fm_bhp, | |
width: 300, | |
hidden: (usg_id == 26 || usg_id == 30 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_status_fm == 'LAPOR')) | |
{ | |
this.setDisabled(false); | |
} | |
else if((usg_id == 26 && rec.data.fm_status_fm != 'LAPOR') || (usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR')) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'FE BHP (Rp.)', | |
id: 'fm_fe_bhp', | |
name: 'fm_fe_bhp', | |
value: data.fe[0].fm_bhp, | |
width: 300, | |
hidden: (usg_id == 26 || usg_id == 30 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_status_fm == 'LAPOR')) | |
{ | |
this.setDisabled(false); | |
} | |
else if((usg_id == 26 && rec.data.fm_status_fm != 'LAPOR') || (usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR')) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Company Name', | |
id: 'fm_comp_name', | |
name: 'fm_comp_name', | |
value: data.config[0].fm_comp_name, | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_status_fm == 'LAPOR')) | |
{ | |
this.setDisabled(false); | |
} | |
else if((usg_id == 26 && rec.data.fm_status_fm != 'LAPOR') || (usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR')) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textarea', | |
fieldLabel: 'Company Address', | |
id: 'fm_comp_addr', | |
name: 'fm_comp_addr', | |
value: data.config[0].fm_comp_addr, | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
// allowBlank: (rec.data.fm_status_fm == 'ISR' ? false: true), | |
fieldLabel: 'NE ISR Number', | |
id: 'fm_ne_no_isr', | |
name: 'fm_ne_no_isr', | |
value: data.ne[0].fm_no_isr, | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR' && rec.data.fm_tx_freq_fo != null) || (usg_id == 26 && rec.data.fm_status_fm == 'SPP' && rec.data.fm_tx_freq_fo != null)) | |
{ | |
this.setDisabled(false); | |
} | |
else if(((usg_id == 26 && rec.data.fm_status_fm != 'SPP') || (usg_id == 26 && rec.data.fm_tx_freq_fo == null)) || ((usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_tx_freq_fo == null))) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
// allowBlank: (rec.data.fm_status_fm == 'ISR' ? false: true), | |
fieldLabel: 'FE ISR Number', | |
id: 'fm_fe_no_isr', | |
name: 'fm_fe_no_isr', | |
value: data.fe[0].fm_no_isr, | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if((usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR' && rec.data.fm_tx_freq_fo != null) || (usg_id == 26 && rec.data.fm_status_fm == 'SPP' && rec.data.fm_tx_freq_fo != null)) | |
{ | |
this.setDisabled(false); | |
} | |
else if(((usg_id == 26 && rec.data.fm_status_fm != 'SPP') || (usg_id == 26 && rec.data.fm_tx_freq_fo == null)) || ((usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR') || (usg_id == 26 && rec.data.fm_tx_freq_fo == null))) | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'No SIMF', | |
id: 'fm_no_simf', | |
name: 'fm_no_simf', | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
value: data.fe[0].fm_no_simf | |
},{ | |
xtype: 'filefield', | |
fieldLabel: 'Attach File', | |
id: 'fm_attach_file_isr', | |
name: 'fm_attach_file_isr', | |
width: 300, | |
hidden: (usg_id == 26 ? false : true), | |
listeners: | |
{ | |
afterrender: function() | |
{ | |
if(usg_id == 26 && rec.data.fm_req_status != 'CANCEL ISR') | |
{ | |
this.setDisabled(false); | |
} | |
else | |
{ | |
this.setDisabled(true); | |
} | |
} | |
} | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Data Source', | |
id: 'fm_data_source', | |
name: 'fm_data_source', | |
value: data.config[0].fm_data_source, | |
hidden: (usg_id == 26 ? false : true), | |
width: 300, | |
hidden: false, | |
disabled: true | |
},{ | |
xtype: 'textarea', | |
id: 'fm_reason_reject', | |
name: 'fm_reason_reject', | |
fieldLabel: 'Reason', | |
anchor: '97%', | |
width: 300, | |
value: data.config[0].fm_reason_reject | |
},{ | |
xtype: 'hidden', | |
id: 'fm_batch_number_m2m', | |
name: 'fm_batch_number_m2m', | |
value: data.config[0].fm_batch_number_m2m | |
},{ | |
xtype: 'textfield', | |
fieldLabel: 'Application Number', | |
id: 'fm_no_app', | |
name: 'fm_no_app', | |
value: data.config[0].fm_no_app, | |
// hidden: (usg_id == 26 ? false : true), | |
width: 300, | |
disabled: false, | |
listeners: { | |
'afterrender': function(a,b){ | |
var a = Ext.getCmp('fm_batch_number_m2m').getValue(); | |
if(a){ | |
Ext.getCmp('fm_no_app').setDisabled(true); | |
} | |
} | |
} | |
}] | |
} | |
var fEdit = Ext.create('Ext.form.Panel',{ | |
id: 'fEdit', | |
name: 'fEdit', | |
border: false, | |
bodyPadding: 10, | |
width: 1180, | |
items: [{ | |
xtype: 'container', | |
flex: 1, | |
autoWidth: true, | |
layout: 'vbox', | |
items: [ | |
selectAction, | |
{ | |
xtype: 'container', | |
flex: 1, | |
layout: 'hbox', | |
autoWidth: true, | |
items: [ | |
nearEndInfo, | |
{xtype: 'splitter'}, | |
farEndInfo | |
] | |
},configInfo] | |
}], | |
listeners: | |
{ | |
render: function() | |
{ | |
if(data.config[0].fm_configuration) | |
{ | |
// me.showConfigAdd(data.config[0].fm_configuration, true, 'fEdit', data, rec); | |
} | |
} | |
} | |
}); | |
var wEdit = Ext.create('Ext.window.Window',{ | |
title: 'Edit', | |
id: 'winEdit', | |
width: 1195, | |
closable:false, | |
height: 550, | |
autoScroll: true, | |
defaults: { | |
border: false, | |
bodyPadding: 20 | |
}, | |
closable: false, | |
items: [fEdit], | |
buttons: [{ | |
text: (rec.data.fm_req_status == 'CANCEL ISR' ? 'Confirm Dismantle': 'Save'), | |
handler: function() | |
{ | |
var bodyMask = new Ext.LoadMask(Ext.getBody(), {msg: 'Updating selected record, please wait...'}); | |
var valid = fEdit.getForm().isValid(); | |
console.log(fEdit.getForm().isValid()) | |
if(valid) | |
{ | |
if(to == 'tmp'){ | |
// console.log(to); | |
Ext.getCmp('winEdit').body.mask('Updating ...'); | |
fEdit.getForm().submit | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/update_record_tmp'), | |
params: | |
{ | |
ref_link_id: rec.data.fm_link_simf_id | |
}, | |
success: function(form, action) | |
{ | |
var cek = Ext.decode(action.response.responseText); | |
Ext.getCmp('winEdit').body.unmask(); | |
if(cek.success) | |
{ | |
me.showInfo('Success'); | |
ss.load(); | |
wEdit.close(); | |
} | |
else | |
{ | |
me.showInfo('Failed!'); | |
} | |
}, | |
failure: function(form, action) | |
{ | |
Ext.getCmp('winEdit').body.unmask(); | |
Ext.Msg.alert('Failed', 'Failed!'); | |
} | |
} | |
); | |
} | |
else{ | |
if(usg_id != 27) | |
{ | |
if(Ext.getCmp('fm_fe_no_isr').getValue() != '' && Ext.getCmp('fm_ne_no_isr').getValue() != '' && Ext.getCmp('fm_fe_no_isr').getValue() === Ext.getCmp('fm_ne_no_isr').getValue() != '') | |
{ | |
Ext.Msg.alert('Info', 'ISR Number cannot be same.'); | |
} | |
else | |
{ | |
// Ext.getCmp('winEdit').body.mask('Updating ...'); | |
fEdit.getForm().submit | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/update_record'), | |
params: | |
{ | |
ref_link_id: rec.data.fm_link_simf_id | |
}, | |
method:'POST', | |
waitMsg: 'Submitting...', | |
scope: this, | |
success: function(form, action) | |
{ | |
var cek = Ext.decode(action.response.responseText); | |
Ext.getCmp('winEdit').body.unmask(); | |
if(cek.success) | |
{ | |
me.showInfo('Success'); | |
me.getStore().reload(); | |
wEdit.close(); | |
} | |
else | |
{ | |
me.showInfo('Failed!'); | |
} | |
}, | |
failure: function(form, action) | |
{ | |
console.log(form) | |
Ext.getCmp('winEdit').body.unmask(); | |
Ext.Msg.alert('Failed', 'Failed!'); | |
} | |
} | |
); | |
} | |
} | |
else | |
{ | |
Ext.getCmp('winEdit').body.mask('Checking ...'); | |
Ext.Ajax.request | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/get_match'), | |
method: 'post', | |
params: | |
{ | |
bandwidth: rec.data.fm_bandwidth, | |
radio: rec.data.fm_frequency, | |
ant_name: rec.data.fm_ant_name, | |
brand: rec.data.fm_brand, | |
ne_idx: rec.data.fm_ne_idx, | |
fe_idx: rec.data.fm_fe_idx, | |
ne_freq_fo_1: Ext.getCmp('fm_tx_freq_fo_2').getValue(), | |
fe_freq_fo_1: Ext.getCmp('fm_rx_freq_fo_2').getValue() | |
}, | |
success: function(response) | |
{ | |
var jsonObj = Ext.decode(response.responseText); | |
Ext.getCmp('winEdit').body.unmask(); | |
if(jsonObj.success) | |
{ | |
Ext.getCmp('winEdit').body.mask('Updating ...'); | |
fEdit.getForm().submit | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/update_record'), | |
params: | |
{ | |
ref_link_id: rec.data.fm_link_simf_id | |
}, | |
success: function(form, action) | |
{ | |
var cek = Ext.decode(action.response.responseText); | |
Ext.getCmp('winEdit').body.unmask(); | |
if(cek.success) | |
{ | |
me.showInfo('Success'); | |
me.getStore().reload(); | |
wEdit.close(); | |
} | |
else | |
{ | |
me.showInfo('Failed!'); | |
} | |
}, | |
failure: function(form, action) | |
{ | |
Ext.getCmp('winEdit').body.unmask(); | |
Ext.Msg.alert('Failed', 'Failed!'); | |
} | |
} | |
); | |
} | |
else | |
{ | |
Ext.MessageBox.confirm('Confirm', 'Selected Frequency is not exist in kominfo data, Save Anyway?', function(btn) | |
{ | |
if(btn == 'yes') | |
{ | |
Ext.getCmp('winEdit').body.mask('Updating ...'); | |
fEdit.getForm().submit | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/update_record'), | |
params: | |
{ | |
ref_link_id: rec.data.fm_link_simf_id | |
}, | |
success: function(form, action) | |
{ | |
var cek = Ext.decode(action.response.responseText); | |
Ext.getCmp('winEdit').body.unmask(); | |
if(cek.success) | |
{ | |
me.showInfo('Success'); | |
me.getStore().reload(); | |
wEdit.close(); | |
} | |
else | |
{ | |
me.showInfo('Failed!'); | |
} | |
}, | |
failure: function(form, action) | |
{ | |
Ext.getCmp('winEdit').body.unmask(); | |
Ext.Msg.alert('Failed', 'Failed!'); | |
} | |
} | |
); | |
} | |
}); | |
} | |
}, | |
failure: function() | |
{ | |
Ext.getCmp('winEdit').body.unmask(); | |
Ext.Msg.alert('Failed', 'An error occured while deleting record!'); | |
} | |
} | |
); | |
} | |
} | |
} | |
else | |
{ | |
me.showWarning('Please check again your form!'); | |
} | |
} | |
},{ | |
text: 'Cancel', | |
handler: function() | |
{ | |
var bodyMask = new Ext.LoadMask(Ext.getBody(), {msg: 'Canceling, please wait...'}); | |
Ext.getCmp('winEdit').body.mask('Canceling ...'); | |
Ext.Ajax.request | |
( | |
{ | |
url: site_url('freq_man/freq_man_worksheet/do_unlock_data'), | |
method: 'post', | |
loadMask: true, | |
params: | |
{ | |
link_simf_id: rec.data.fm_link_simf_id, | |
'tmp' : (to == 'tmp' ? true : false) | |
}, | |
success: function(res) | |
{ | |
var obj = Ext.decode(res.responseText); | |
Ext.getCmp('winEdit').body.unmask(); | |
if(obj.success) | |
{ | |
wEdit.close(); | |
} | |
else{ | |
Ext.getCmp('winEdit').body.unmask(); | |
me.showWarning('Failed!'); | |
} | |
}, | |
failure: function() | |
{ | |
Ext.getCmp('winEdit').body.unmask(); | |
me.showWarning('Failed!'); | |
} | |
} | |
); | |
} | |
}] | |
}); | |
// return wEdit; | |
wEdit.show(); | |
Ext.getBody().unmask(); | |
}, | |
checkForFreq: function() | |
{ | |
var a = Ext.getCmp('fm_frequency'); | |
var b = Ext.getCmp('fm_ne_idx'); | |
var c = Ext.getCmp('fm_brand'); | |
if (a.getValue() != '' && b.getValue() != '' && c.getValue() != '') | |
{ | |
if(typeof(Ext.getCmp(neCmpName1)) != 'undefined') | |
{ | |
Ext.getCmp(neCmpName1).clearInvalid(); | |
Ext.getCmp(feCmpName1).setDisabled(false); | |
} | |
if(typeof(Ext.getCmp(feCmpName1)) != 'undefined') | |
{ | |
Ext.getCmp(feCmpName1).clearInvalid(); | |
Ext.getCmp(feCmpName1).setDisabled(false); | |
} | |
if(typeof(Ext.getCmp(neCmpName2)) != 'undefined') | |
{ | |
Ext.getCmp(neCmpName2).clearInvalid(); | |
Ext.getCmp(neCmpName2).setDisabled(false); | |
} | |
if(typeof(Ext.getCmp(feCmpName2)) != 'undefined') | |
{ | |
Ext.getCmp(feCmpName2).clearInvalid(); | |
Ext.getCmp(feCmpName2).setDisabled(false); | |
} | |
} | |
else | |
{ | |
if(typeof(Ext.getCmp(neCmpName1)) != 'undefined') | |
{ | |
Ext.getCmp(neCmpName1).clearInvalid(); | |
Ext.getCmp(feCmpName1).setDisabled(true); | |
} | |
if(typeof(Ext.getCmp(feCmpName1)) != 'undefined') | |
{ | |
Ext.getCmp(feCmpName1).clearInvalid(); | |
Ext.getCmp(feCmpName1).setDisabled(true); | |
} | |
if(typeof(Ext.getCmp(neCmpName2)) != 'undefined') | |
{ | |
Ext.getCmp(neCmpName2).clearInvalid(); | |
Ext.getCmp(neCmpName2).setDisabled(true); | |
} | |
if(typeof(Ext.getCmp(feCmpName2)) != 'undefined') | |
{ | |
Ext.getCmp(feCmpName2).clearInvalid(); | |
Ext.getCmp(feCmpName2).setDisabled(true); | |
} | |
} | |
}, | |
generate_eqp_name: function() | |
{ | |
var brand = Ext.getCmp('fm_brand'); | |
var series = Ext.getCmp('fm_ne_idu_ref_id'); | |
var freq = Ext.getCmp('fm_frequency'); | |
if(series.store.data.items[series.selectedIndex]) | |
{ | |
var series_name = series.store.data.items[series.selectedIndex].get('rm_idu_model_name'); | |
} | |
else | |
{ | |
var series_name = ''; | |
} | |
if(freq.store.data.items[series.selectedIndex]) | |
{ | |
var freq_name = freq.store.data.items[freq.selectedIndex].get('freq_freq_num'); | |
} | |
else | |
{ | |
var freq_name = ''; | |
} | |
Ext.getCmp('fm_eqp_name').setValue(brand.getRawValue()+' '+series_name+' '+freq_name); | |
}, | |
showConfigAdd: function(val,getBool,form,data,rec) | |
{ | |
var refFreq = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'rf_freq_low', | |
'rf_freq_high' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_freq'), | |
actionMethods: | |
{ | |
read: 'post' | |
}, | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true, | |
listeners: | |
{ | |
beforeload: function(store, options) | |
{ | |
var params = | |
{ | |
'bandwidth': Ext.getCmp('fm_bandwidth').getValue(), | |
'ant_name': Ext.getCmp('fm_ant_name').getValue() | |
}; | |
Ext.apply(options.params, params); | |
} | |
} | |
}); | |
var antDia = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'ra_ant_id', | |
'ra_ant_diameter' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_antenna'), | |
extraParams: | |
{ | |
'brand': Ext.getCmp('fm_brand').getValue() | |
}, | |
actionMethods: | |
{ | |
read: 'post' | |
}, | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
var antModel = Ext.create('Ext.data.Store', | |
{ | |
fields: | |
[ | |
'ram_ant_mdl_id', | |
'ram_ant_mdl_type', | |
'ran_ant_name' | |
], | |
proxy: | |
{ | |
type: 'ajax', | |
url: site_url('freq_man/freq_man_worksheet/get_antenna_model'), | |
actionMethods: | |
{ | |
read: 'post' | |
}, | |
reader: | |
{ | |
type: 'json', | |
root: 'data' | |
} | |
}, | |
autoLoad: true | |
}); | |
link = Ext.getCmp(form); | |
Ext.Ajax.request | |
({ | |
method: 'POST', | |
url: site_url('freq_man/freq_man_worksheet/get_config_add'), | |
params: {'config_value': val}, | |
success: function(result){ | |
var obj = Ext.decode(result.responseText); | |
if (obj.freq > 0) | |
{ | |
if (addFreq2 > 0) | |
{ | |
Ext.getCmp('freqAdd2').removeAll(); | |
addFreq2 = 0; | |
} | |
link.doLayout(); | |
var siteTitle = ''; | |
for (var x = 1; x <= obj.freq; x++) | |
{ | |
console.log(x); | |
console.log(usg_id); | |
addFreq2 = x; | |
if (x > 0 && usg_id == 26 || usg_id == 30) | |
{ | |
siteTitle = 'TX/RX Frequency (FOP):';userTitle= 'fo';separator='_'; | |
ne_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
ne_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
fe_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
fe_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
ne_def_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
ne_def_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
fe_def_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
fe_def_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
neCmpName1 = 'fm_tx_freq_fo_1'; | |
feCmpName1 = 'fm_rx_freq_fo_1'; | |
/* ne_val1 = ob.NE_FREQ_FO_1;ne_val2 = ob.NE_FREQ_FO_2; | |
fe_val1 = ob.FE_FREQ_FO_1;fe_val2 = ob.FE_FREQ_FO_2; | |
ne_def_val1 = ob.NE_FREQ_1;ne_def_val2 = ob.NE_FREQ_2; | |
fe_def_val1 = ob.FE_FREQ_1;fe_def_val2 = ob.FE_FREQ_2; */ | |
} | |
else if (x > 0 && usg_id == 27 || usg_id == 30) | |
{ | |
siteTitle = 'TX/RX Frequency (PLAN):';userTitle= '';separator=''; | |
ne_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
ne_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
fe_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
fe_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
ne_def_val1 = ''; | |
ne_def_val2 = ''; | |
fe_def_val1 = ''; | |
fe_def_val2 = ''; | |
neCmpName1 = 'fm_tx_freq_1'; | |
feCmpName1 = 'fm_rx_freq_1'; | |
} | |
else if (x > 0 && usg_id == 28 || usg_id == 30) | |
{ | |
siteTitle = 'TX/RX Frequency (PLAN):';userTitle= '';separator=''; | |
ne_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
ne_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
fe_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
fe_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
ne_def_val1 = ''; | |
ne_def_val2 = ''; | |
fe_def_val1 = ''; | |
fe_def_val2 = ''; | |
neCmpName1 = 'fm_tx_freq_1'; | |
feCmpName1 = 'fm_rx_freq_1'; | |
/* ne_val1 = ob.NE_FREQ_FO_1;ne_val2 = ob.NE_FREQ_FO_2; | |
fe_val1 = ob.FE_FREQ_FO_1;fe_val2 = ob.FE_FREQ_FO_2; | |
ne_def_val1 = ob.NE_FREQ_1;ne_def_val2 = ob.NE_FREQ_2; | |
fe_def_val1 = ob.FE_FREQ_1;fe_def_val2 = ob.FE_FREQ_2; */ | |
} | |
else | |
{ | |
siteTitle = ''; | |
userTitle=''; | |
ne_val1=''; | |
ne_val2=''; | |
fe_val1=''; | |
fe_val2=''; | |
ne_def_val1=''; | |
ne_def_val2=''; | |
ne_def2_val1=''; | |
ne_def2_val2='' | |
fe_def_val1 = ''; | |
fe_def_val2=''; | |
fe_def2_val1=''; | |
fe_def2_val2='' | |
} | |
console.log(ne_def_val1); | |
Ext.getCmp('freqAdd2').add | |
({ | |
layout: 'column', | |
style: 'padding-bottom: 4px;', | |
items: [{ | |
xtype: 'displayfield' | |
, value: siteTitle | |
, width: 105 | |
, style: 'font-size: 12px;' | |
}, { | |
xtype: 'combo' | |
, id: neCmpName1 | |
, name: neCmpName1 | |
, ref: neCmpName1 | |
, value: (data ? (x > 1 ? ne_val2 : ne_val1) : '') | |
//, emptyText: (data ? (ne_def_val1 != null || ne_def_val2 != null ?(x > 1 ? ne_def_val2 : ne_def_val1):(x > 1 ? ne_def2_val2 : ne_def2_val1)) : '') | |
, width: 85 | |
, store: refFreq | |
, displayField: 'rf_freq_low' | |
, valueField: 'rf_freq_low' | |
// , mode: 'remote' | |
// , triggerAction: 'all' | |
, minChars: 3 | |
, disabled: false | |
//, editable: true | |
, style: {marginRight: '25px'} | |
, listeners: | |
{ | |
select: function(a, b, c) | |
{ | |
var oppX = a.getId().split('_')[3]; | |
//console.log(oppX); | |
//Ext.getCmp('FE_FREQ_'+userTitle+separator+oppX).setValue(b.get('FREQ_OPP')); | |
// Ext.getCmp('fm_fe_freq_'+userTitle+separator+oppX).setValue(rec[0].data.rf_freq_high); | |
Ext.getCmp(feCmpName1).setValue(b[0].data.rf_freq_high); | |
} | |
} | |
, tabIndex: 2 | |
}, { | |
xtype: 'displayfield' | |
, value: '' | |
, style: 'width: 27px;' | |
}, { | |
xtype: 'textfield' | |
, id: feCmpName1 | |
, name: feCmpName1 | |
, ref: feCmpName1 | |
, value: (data ? (x > 1 ? fe_val2 : fe_val1) : '') | |
// , emptyText: (data ? (fe_def_val1 != null || fe_def_val2 != null ?(x > 1 ? fe_def_val2 : fe_def_val1):(x > 1 ? fe_def2_val2 : fe_def2_val1)) : '') | |
, width: 85 | |
//, disabled: true | |
//, readOnly: true | |
}, { | |
xtype: 'displayfield' | |
, value: 'MHz' | |
, style: 'padding-bottom: 4px; font-size: 12px; margin-top: 2px; margin-left: 5px;' | |
}] | |
}); | |
link.doLayout(); | |
if (typeof(rowreferenceData) !== 'undefined' && getBool) | |
{ | |
if (rowreferenceData['fm_ne_freq_'+userTitle+separator+x] != '') | |
{ | |
Ext.getCmp('fm_ne_freq_'+userTitle+separator+x).setValue(rowreferenceData['fm_ne_freq_'+userTitle+separator+x]); | |
Ext.getCmp('fm_ne_freq_'+userTitle+separator+x).setDisabled(false); | |
} | |
if (rowreferenceData['fm_fe_freq_'+userTitle+'_'+x] != ''){ | |
Ext.getCmp('fm_fe_freq_'+userTitle+separator+x).setValue(rowreferenceData['fm_fe_freq_'+userTitle+separator+x]); | |
Ext.getCmp('fm_fe_freq_'+userTitle+separator+x).setDisabled(false); | |
} | |
} | |
} | |
} | |
if (obj.freq > 0){ | |
if (addFreq > 0){ | |
Ext.getCmp('freqAdd').removeAll(); | |
addFreq = 0; | |
} | |
link.doLayout(); | |
var siteTitle = ''; | |
for (var x = 1; x <= obj.freq; x++){ | |
addFreq = x; | |
if (x > 0 && usg_id == 26 || usg_id == 30) | |
{ | |
siteTitle = 'TX/RX Frequency (ISR):';userTitle='isr';separator='_'; | |
ne_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq_isr : data.config[0].fm_tx_freq_isr) : ''); | |
ne_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq_isr : data.config[0].fm_tx_freq_isr) : ''); | |
fe_val1 = (data? (x > 1 ? data.config[0].fm_rx_freq_isr : data.config[0].fm_rx_freq_isr) : ''); | |
fe_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq_isr : data.config[0].fm_rx_freq_isr) : ''); | |
ne_def_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
ne_def_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
fe_def_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
fe_def_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
ne_def2_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
ne_def2_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
fe_def2_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
fe_def2_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
neCmpName2 = 'fm_tx_freq_isr_2'; | |
feCmpName2 = 'fm_rx_freq_isr_2'; | |
// ne_val2 = ob.NE_FREQ_ISR_2; | |
// fe_val1 = ob.FE_FREQ_ISR_1;fe_val2 = ob.FE_FREQ_ISR_2; | |
// ne_def_val1 = ob.NE_FREQ_FO_1;ne_def_val2 = ob.NE_FREQ_FO_2; | |
// fe_def_val1 = ob.FE_FREQ_FO_1;fe_def_val2 = ob.FE_FREQ_FO_2; | |
} | |
else if (x > 0 && usg_id == 27 || usg_id == 30) | |
{ | |
// console.log(x); | |
siteTitle = 'TX/RX Frequency (FOP):';userTitle= 'fo';separator='_'; | |
ne_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
ne_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
fe_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
fe_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
ne_def_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
ne_def_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq_fo : data.config[0].fm_tx_freq_fo) : ''); | |
fe_def_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
fe_def_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq_fo : data.config[0].fm_rx_freq_fo) : ''); | |
neCmpName2 = 'fm_tx_freq_fo_2'; | |
feCmpName2 = 'fm_rx_freq_fo_2'; | |
/* ne_val1 = ob.NE_FREQ_FO_1;ne_val2 = ob.NE_FREQ_FO_2; | |
fe_val1 = ob.FE_FREQ_FO_1;fe_val2 = ob.FE_FREQ_FO_2; | |
ne_def_val1 = ob.NE_FREQ_1;ne_def_val2 = ob.NE_FREQ_2; | |
fe_def_val1 = ob.FE_FREQ_1;fe_def_val2 = ob.FE_FREQ_2; */ | |
} | |
else if (x > 0 && usg_id == 28 || usg_id == 30) | |
{ | |
siteTitle = 'TX/RX Frequency (PLAN):';userTitle= '';separator=''; | |
ne_val1 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
ne_val2 = (data ? (x > 1 ? data.config[0].fm_tx_freq : data.config[0].fm_tx_freq) : ''); | |
fe_val1 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
fe_val2 = (data ? (x > 1 ? data.config[0].fm_rx_freq : data.config[0].fm_rx_freq) : ''); | |
ne_def_val1 = ''; | |
ne_def_val2 = ''; | |
fe_def_val1 = ''; | |
fe_def_val2 = ''; | |
neCmpName2 = 'fm_tx_freq_2'; | |
feCmpName2 = 'fm_rx_freq_2'; | |
/* ne_val1 = ob.NE_FREQ_FO_1;ne_val2 = ob.NE_FREQ_FO_2; | |
fe_val1 = ob.FE_FREQ_FO_1;fe_val2 = ob.FE_FREQ_FO_2; | |
ne_def_val1 = ob.NE_FREQ_1;ne_def_val2 = ob.NE_FREQ_2; | |
fe_def_val1 = ob.FE_FREQ_1;fe_def_val2 = ob.FE_FREQ_2; */ | |
} | |
else | |
{ | |
siteTitle = ''; | |
userTitle=''; | |
ne_val1=''; | |
ne_val2=''; | |
fe_val1=''; | |
fe_val2=''; | |
ne_def_val1=''; | |
ne_def_val2=''; | |
ne_def2_val1=''; | |
ne_def2_val2='' | |
fe_def_val1 = ''; | |
fe_def_val2=''; | |
fe_def2_val1=''; | |
fe_def2_val2='' | |
} | |
Ext.getCmp('freqAdd').add({ | |
layout: 'column', | |
style: 'padding-bottom: 4px;', | |
items: [{ | |
xtype: 'displayfield' | |
, value: siteTitle | |
, width: 105 | |
, style: 'font-size: 12px;' | |
}, { | |
xtype: 'combo' | |
, id: neCmpName2 | |
, name: neCmpName2 | |
, ref: neCmpName2 | |
, value: (data ? (x > 1 ? ne_val2 : ne_val1) : '') | |
, emptyText: (data ? (ne_def_val1 != null || ne_def_val2 != null ?(x > 1 ? ne_def_val2 : ne_def_val1):(x > 1 ? ne_def2_val2 : ne_def2_val1)) : '') | |
, width: 85 | |
, store: refFreq | |
, displayField: 'rf_freq_low' | |
, valueField: 'rf_freq_low' | |
// , mode: 'remote' | |
, maskRe: /[0-9.]/ | |
, regex: /^[0-9]+(?:\.[0-9]+)?$/ | |
// , triggerAction: 'all' | |
, minChars: 3 | |
//, disabled: (ob?(usg_id==3 &&ne_def_val1 == null?true:false):false) | |
, style: {marginRight: '25px'} | |
//, editable: false | |
, listeners: | |
{ | |
select: function(a, b, c) | |
{ | |
var oppX = a.getId().split('_')[3]; | |
//console.log(oppX); | |
//Ext.getCmp('FE_FREQ_'+userTitle+separator+oppX).setValue(b.get('FREQ_OPP')); | |
// Ext.getCmp('FE_FREQ_'+userTitle+separator+oppX).setValue(b.get('FREQ_HIGH')); | |
Ext.getCmp(feCmpName2).setValue(b[0].data.rf_freq_high); | |
}, | |
afterrender: function() | |
{ | |
/*if(usg_id == 26 && ne_def_val1 == null) | |
{ | |
this.setDisabled(true); | |
} | |
else if(usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR') | |
{ | |
this.setDisabled(true); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
}*/ | |
} | |
} | |
, tabIndex: 2 | |
}, { | |
xtype: 'displayfield' | |
, value: '' | |
, style: 'width: 27px;' | |
}, { | |
xtype: 'numberfield' | |
, id: feCmpName2 | |
, name: feCmpName2 | |
, ref: feCmpName2 | |
, value: (data ? (x > 1 ? fe_val2 : fe_val1) : '') | |
, emptyText: (data ? (fe_def_val1 != null || fe_def_val2 != null ?(x > 1 ? fe_def_val2 : fe_def_val1):(x > 1 ? fe_def2_val2 : fe_def2_val1)) : '') | |
, width: 85 | |
//, disabled: (ob?(usg_id==3 &&fe_def_val1 == null?true:false):false) | |
//, readOnly: true | |
, listeners: | |
{ | |
afterrender: function() | |
{ | |
/*if(usg_id == 26 && fe_def_val1 == null) | |
{ | |
this.setDisabled(true); | |
} | |
else if(usg_id == 26 && rec.data.fm_req_status == 'CANCEL ISR') | |
{ | |
this.setDisabled(true); | |
} | |
else | |
{ | |
this.setDisabled(false); | |
}*/ | |
} | |
} | |
}, { | |
xtype: 'displayfield' | |
, value: 'MHz' | |
, style: 'padding-bottom: 4px; font-size: 12px; margin-top: 2px; margin-left: 5px;' | |
}] | |
}); | |
link.doLayout(); | |
if (typeof(rowreferenceData) !== 'undefined' && getBool) | |
{ | |
if (rowreferenceData['fm_ne_freq_'+userTitle+separator+x] != '') | |
{ | |
Ext.getCmp('fm_ne_freq_'+userTitle+separator+x).setValue(rowreferenceData['fm_ne_freq_'+userTitle+separator+x]); | |
Ext.getCmp('fm_ne_freq_'+userTitle+separator+x).setDisabled(false); | |
} | |
if (rowreferenceData['fm_fe_freq_'+userTitle+'_'+x] != '') | |
{ | |
Ext.getCmp('fm_fe_freq_'+userTitle+separator+x).setValue(rowreferenceData['fm_fe_freq_'+userTitle+separator+x]); | |
Ext.getCmp('fm_fe_freq_'+userTitle+separator+x).setDisabled(false); | |
} | |
} | |
} | |
} | |
// console.log(obj.ant); | |
if (obj.ant > 0){ | |
if (addAnt > 0){ | |
Ext.getCmp('antRefAdd').removeAll(); | |
addAnt = 0; | |
} | |
link.doLayout(); | |
var antName = ''; | |
for (var x = 1; x <= obj.ant; x++){ | |
addAnt = x; | |
if (x == 1){antName = 'Antenna:';} | |
else {antName = '';} | |
Ext.getCmp('antRefAdd').add({ | |
layout: 'column' | |
, style: 'padding-bottom: 4px;' | |
, items: [ | |
{ | |
xtype: 'displayfield' | |
, value: antName | |
, width: 105 | |
, style: 'font-size: 12px;' | |
}, { | |
xtype: 'combo' | |
// , allowBlank: false | |
, id: 'fm_ne_ant_'+x | |
, name: 'fm_ne_ant_'+x | |
, ref: 'fm_ne_ant_'+x | |
, width: 85 | |
, store: antDia | |
, displayField: 'ra_ant_diameter' | |
, valueField: 'ra_ant_diameter' | |
, value: (data ? (x > 1 ? data.config[0].fm_ne_ant_2 : data.config[0].fm_ne_ant_1) : '') | |
// , mode: 'remote' | |
// , triggerAction: 'all' | |
// , forceSelection: true | |
, editable: false | |
, disabled: true | |
, listClass: 'center' | |
, tabIndex: 1 | |
, style: {marginRight: '25px'} | |
}, { | |
xtype: 'displayfield', | |
value: '', | |
width: 50 | |
}, { | |
xtype: 'combo', | |
allowBlank: true, | |
id: 'fm_fe_ant_'+x, | |
name: 'fm_fe_ant_'+x, | |
ref: 'fm_fe_ant_'+x, | |
width: 85, | |
store: antDia, | |
displayField: 'ra_ant_diameter', | |
//disabled: true, | |
valueField: 'ra_ant_diameter', | |
value: (data ? (x > 1 ? data.config[0].fm_fe_ant_2 : data.config[0].fm_fe_ant_1) : ''), | |
mode: 'remote', | |
// triggerAction: 'all', | |
// forceSelection: true, | |
//editable: false, | |
listClass: 'center', | |
tabIndex: 1 | |
} | |
] | |
}); | |
link.doLayout(); | |
if (typeof(rowNbwoData) !== 'undefined') | |
{ | |
if (rowNbwoData['fm_ne_ant_'+x] != ''){Ext.getCmp('fm_ne_ant_'+x).setValue(rowNbwoData['fm_ne_ant_'+x]);} | |
if (rowNbwoData['fm_fe_ant_'+x] != ''){Ext.getCmp('fm_fe_ant_'+x).setValue(rowNbwoData['fm_fe_ant_'+x]);} | |
} | |
} | |
} | |
//console.log(ob); | |
if (obj.ant > 0){ | |
if (addAnt > 0){ | |
Ext.getCmp('antModRefAdd').removeAll(); | |
addAnt = 0; | |
} | |
link.doLayout(); | |
var antModRefAdd = ''; | |
for (var x = 1; x <= obj.ant; x++){ | |
addAnt = x; | |
if (x == 1){antModRefAdd = 'Antenna Model:';} | |
else {antModRefAdd = '';} | |
Ext.getCmp('antModRefAdd').add({ | |
layout: 'column' | |
, style: 'padding-bottom: 4px;' | |
, items: [ | |
{ | |
xtype: 'displayfield' | |
, value: antModRefAdd | |
, width: 105 | |
, style: 'font-size: 12px;' | |
}, { | |
xtype: 'combo' | |
// , allowBlank: true | |
, id: 'fm_ne_ant_type_'+x | |
, name: 'fm_ne_ant_type_'+x | |
, ref: 'fm_ne_ant_type_'+x | |
, width: 85 | |
, store: antModel | |
, displayField: 'ram_ant_mdl_type' | |
, valueField: 'ram_ant_mdl_type' | |
, value: (data ? (x > 1 ? data.config[0].fm_ne_ant_type_2 : data.config[0].fm_ne_ant_type_1) : '') | |
// , mode: 'remote' | |
, disabled: true | |
// , triggerAction: 'all' | |
// , forceSelection: true | |
//, editable: false | |
, listClass: 'center' | |
, tabIndex: 1 | |
, style: {marginRight: '25px'} | |
, listeners: { | |
beforeQuery: function(query) | |
{ | |
delete query.combo.lastQuery; | |
//console.log(Ext.getCmp('BRAND').getValue()); | |
// var brand = isNaN(parseInt(Ext.getCmp('fm_brand').getValue()))?ob.BRAND_ID:Ext.getCmp('BRAND').getValue(); | |
// this.store.setBaseParam('BRAND_ID',brand); | |
var brand = Ext.getCmp('fm_brand').getValue(); | |
var params = this.store.getProxy().getLastParams(); | |
params.brand = brand; | |
this.store.proxy.extraParams = params; | |
}, | |
'select': function(el,rec) | |
{ | |
//console.log(rec); | |
Ext.getCmp('fm_ant_name').setValue(rec[0].data.ran_ant_name); | |
} | |
} | |
}, { | |
xtype: 'displayfield', | |
value: '', | |
width: 50 | |
}, { | |
xtype: 'combo', | |
allowBlank: true, | |
id: 'fm_fe_ant_type_'+x, | |
name: 'fm_fe_ant_type_'+x, | |
ref: 'fm_fe_ant_type_'+x, | |
width: 85, | |
store: antModel, | |
displayField: 'ram_ant_mdl_type', | |
valueField: 'ram_ant_mdl_type', | |
value: (data ? (x > 1 ? data.config[0].fm_fe_ant_type_2 : data.config[0].fm_fe_ant_type_1) : ''), | |
// mode: 'remote', | |
// triggerAction: 'all', | |
// forceSelection: true, | |
editable: false, | |
listClass: 'center', | |
tabIndex: 1, | |
disabled:true | |
} | |
] | |
}); | |
link.doLayout(); | |
if (typeof(rowreferenceData) !== 'undefined') | |
{ | |
if (rowreferenceData['fm_ne_ant_'+x] != ''){Ext.getCmp('fm_ne_ant_'+x).setValue(rowreferenceData['fm_ne_ant_'+x]);} | |
if (rowreferenceData['fm_fe_ant_'+x] != ''){Ext.getCmp('fm_fe_ant_'+x).setValue(rowreferenceData['fm_fe_ant_'+x]);} | |
} | |
} | |
} | |
if (!getBool) | |
{ | |
Ext.getCmp('fm_ne_idx').setValue(''); | |
Ext.getCmp('fm_fe_idx').setValue(''); | |
Ext.getCmp('fm_ne_idx').clearInvalid(); | |
Ext.getCmp('fm_fe_idx').clearInvalid(); | |
} | |
} | |
}); | |
}, | |
cancelUpdateRow: function(){ | |
var me = this; | |
var bodyMask = new Ext.LoadMask(Ext.getBody(), {msg: 'updating data, please wait...'}); | |
bodyMask.show(); | |
Ext.Ajax.request({ | |
url: services.read, | |
scope: this, | |
waitMsg: 'Updating... Please wait.', | |
callback: function(o, s, r) { | |
if (s) { | |
bodyMask.hide(); | |
} | |
} | |
}); | |
} | |
/*End*/ | |
}); | |
function updateRow(editor, evt) { | |
var me = this, | |
rec = evt.record, | |
params = Ext.apply(rec.data), | |
req_status = params.fm_req_status, | |
link_id = params.fm_link_simf_id; | |
province = params.fm_province; | |
sta_no = params.fm_sta_no; | |
var bodyMask = new Ext.LoadMask(Ext.getBody(), {msg: 'updating data, please wait...'}); | |
bodyMask.show(); | |
Ext.Ajax.request({ | |
url: site_url('freq_man/freq_man_worksheet/update_row/'), | |
params: { | |
'req_status' : Ext.encode(req_status), | |
'link_id' : Ext.encode(link_id) , | |
'province' : Ext.encode(province) , | |
'sta_no' : Ext.encode(sta_no) , | |
}, | |
scope: this, | |
waitMsg: 'Updating... Please wait.', | |
callback: function(o, s, r) { | |
if (s) { | |
this.showInfo('Information', r.responseText); | |
bodyMask.hide(); | |
ds.reload(); | |
} | |
} | |
}); | |
} | |
var freqManGrid = Ext.create('KctApp.module.freq_man.freq_man_worksheet_data'); | |
// console.log(Ext.getCmp('fm-workSheet')); | |
Ext.getCmp('parentFreqMan').removeAll(); | |
Ext.getCmp('parentFreqMan').add(freqManGrid); | |
Ext.getCmp('parentFreqMan').doLayout(); | |
Ext.tip.QuickTipManager.init(); | |
}, | |
doDownloadAll: function() { | |
var me = this; | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_all'), | |
waitMsg: 'Downloading...', | |
// params: { | |
// 'name': Ext.encode(params) | |
// }, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
}, | |
doDownloadAllSpect: function() { | |
var me = this; | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_all_spect'), | |
waitMsg: 'Downloading...', | |
// params: { | |
// 'name': Ext.encode(params) | |
// }, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
}, | |
doDownloadNeedIsr: function() { | |
var me = this; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/check_download_need_isr'), | |
callback: function(a,b,c){ | |
if(c.responseText != 'false') | |
{ | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_need_isr'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function(a, b, c) { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
} else { | |
this.showInfo('Info', 'Data is empty !'); | |
} | |
} | |
}); | |
}, | |
doDownloadPlanDis: function() { | |
var me = this; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/check_download_plan_dis'), | |
callback: function(a,b,c){ | |
if(c.responseText != 'false') | |
{ | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_plan_dis'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
} else { | |
this.showInfo('Info', 'Data is empty !'); | |
} | |
} | |
}); | |
}, | |
doDownloadIsrRenew: function() { | |
var me = this; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/check_download_isr_renew'), | |
callback: function(a,b,c){ | |
if(c.responseText != 'false') | |
{ | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_isr_renew'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
} else { | |
this.showInfo('Info', 'Data is empty !'); | |
} | |
} | |
}); | |
}, | |
doDownloadIsrNew: function() { | |
var me = this; | |
Ext.Ajax.request({ | |
scope: this, | |
url: site_url('freq_man/freq_man_worksheet/check_download_isr_new'), | |
callback: function(a,b,c){ | |
if(c.responseText != 'false') | |
{ | |
KctApp.util.download({ | |
url: site_url('freq_man/freq_man_worksheet/download_isr_new'), | |
waitMsg: 'Downloading...', | |
params: { | |
'name': Ext.encode(params) | |
}, | |
scope: this, | |
callback: function() { | |
this.showInfo('Info', 'Download finished!'); | |
} | |
}); | |
} else { | |
this.showInfo('Info', 'Data is empty !'); | |
} | |
} | |
}); | |
}, | |
alertMsg: function(type, msg){ | |
Ext.Msg.show({ | |
title: type, | |
msg: msg, | |
buttons: Ext.Msg.OK, | |
icon: Ext.Msg.INFO | |
}); | |
} | |
}); | |
Ext.onReady(function(){ | |
Ext.tip.QuickTipManager.init(); | |
// Ext.Ajax.timeout = 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; | |
Ext.Ajax.timeout = 820000; // 60 seconds | |
Ext.override(Ext.form.Basic, {timeout: Ext.Ajax.timeout / 1000}); | |
Ext.override(Ext.data.proxy.Server, {timeout: Ext.Ajax.timeout}); | |
Ext.override(Ext.data.Connection, {timeout: Ext.Ajax.timeout}); | |
Ext.create('Ext.Viewport', { | |
layout: 'fit', | |
items: Ext.create('KctApp.module.freq_man.freq_man_worksheet') | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment