improvement formDashboards ff
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
<script type="text/javascript" src="/js/jquery/jquery-1.7.1.min.js"></script>
|
||||||
<div style="padding: 15px">
|
<div style="padding: 15px">
|
||||||
<div id="list-panel"></div>
|
<div id="list-panel"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -208,7 +208,8 @@ Ext.onReady( function() {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
store: store,
|
store: store,
|
||||||
displayInfo: true,
|
displayInfo: true,
|
||||||
displayMsg: _('ID_GRID_PAGE_DISPLAYING_0WNER_MESSAGE') + ' ',
|
//displayMsg: _('ID_GRID_PAGE_DISPLAYING_0WNER_MESSAGE') + ' ',
|
||||||
|
displayMsg : '',
|
||||||
//emptyMsg: _('ID_GRID_PAGE_NO_OWNER_MESSAGE')
|
//emptyMsg: _('ID_GRID_PAGE_NO_OWNER_MESSAGE')
|
||||||
emptyMsg: ''
|
emptyMsg: ''
|
||||||
});
|
});
|
||||||
@@ -216,12 +217,12 @@ Ext.onReady( function() {
|
|||||||
cmodel = new Ext.grid.ColumnModel({
|
cmodel = new Ext.grid.ColumnModel({
|
||||||
defaults: {
|
defaults: {
|
||||||
width: 50,
|
width: 50,
|
||||||
sortable: true
|
sortable: false
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{ id:'DAS_UID', dataIndex: 'DAS_UID', hidden:true, hideable:false},
|
{ id:'DAS_UID', dataIndex: 'DAS_UID', hidden:true, hideable:false},
|
||||||
{ header: _("ID_OWNER"), dataIndex: "OWNER_LABEL", width: 150, hidden: false, align: "left"},
|
{ header: _("ID_OWNER"), dataIndex: "OWNER_LABEL", width: 150, hidden: false, align: "left"},
|
||||||
{ header: _("ID_OWNER_TYPE"), dataIndex: "OWNER_TYPE", width: 80, hidden: false, align: "left"}
|
{ header: _("ID_OWNER_TYPE"), dataIndex: "OWNER_TYPE", width: 80, hidden: false, align: "left"}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -396,6 +397,7 @@ Ext.onReady( function() {
|
|||||||
enableHdMenu: true,
|
enableHdMenu: true,
|
||||||
frame : false,
|
frame : false,
|
||||||
columnLines : false,
|
columnLines : false,
|
||||||
|
sortable : false,
|
||||||
store: store,
|
store: store,
|
||||||
cm: cmodel,
|
cm: cmodel,
|
||||||
sm: smodel,
|
sm: smodel,
|
||||||
@@ -462,10 +464,11 @@ Ext.onReady( function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sw) {
|
if (!sw) {
|
||||||
|
label = selection.data.field1.split('(');
|
||||||
var ow = new owner({
|
var ow = new owner({
|
||||||
DAS_UID : '',
|
DAS_UID : '',
|
||||||
OWNER_UID : selection.data.field2,
|
OWNER_UID : selection.data.field2,
|
||||||
OWNER_LABEL : selection.data.field1,
|
OWNER_LABEL : label[0],
|
||||||
OWNER_TYPE : selection.data.field3
|
OWNER_TYPE : selection.data.field3
|
||||||
});
|
});
|
||||||
ownerInfoGrid.store.insert(store.getCount(), ow);
|
ownerInfoGrid.store.insert(store.getCount(), ow);
|
||||||
@@ -663,6 +666,10 @@ Ext.onReady( function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ownerInfoGrid.store.load();
|
ownerInfoGrid.store.load();
|
||||||
|
ownerInfoGrid.on("afterrender", function(component) {
|
||||||
|
component.getBottomToolbar().refresh.hideParent = true;
|
||||||
|
component.getBottomToolbar().refresh.hide();
|
||||||
|
});
|
||||||
|
|
||||||
viewport = new Ext.Viewport({
|
viewport = new Ext.Viewport({
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
@@ -677,7 +684,7 @@ Ext.onReady( function() {
|
|||||||
for (var i=0; i< store.data.length; i++) {
|
for (var i=0; i< store.data.length; i++) {
|
||||||
row = [];
|
row = [];
|
||||||
if (store.data.items[i].data.grp_status == 'ACTIVE') {
|
if (store.data.items[i].data.grp_status == 'ACTIVE') {
|
||||||
row.push(store.data.items[i].data.grp_title);
|
row.push(store.data.items[i].data.grp_title + ' (' + _('ID_GROUP') + ')' );
|
||||||
row.push(store.data.items[i].data.grp_uid);
|
row.push(store.data.items[i].data.grp_uid);
|
||||||
row.push('GROUP');
|
row.push('GROUP');
|
||||||
dataUserGroup.push(row);
|
dataUserGroup.push(row);
|
||||||
@@ -689,7 +696,7 @@ Ext.onReady( function() {
|
|||||||
for (var i=0; i< store.data.length; i++) {
|
for (var i=0; i< store.data.length; i++) {
|
||||||
row = [];
|
row = [];
|
||||||
if (store.data.items[i].data.usr_status == 'ACTIVE') {
|
if (store.data.items[i].data.usr_status == 'ACTIVE') {
|
||||||
row.push(storeUsers.data.items[i].data.usr_firstname + ' ' + storeUsers.data.items[i].data.usr_lastname);
|
row.push(storeUsers.data.items[i].data.usr_firstname + ' ' + storeUsers.data.items[i].data.usr_lastname + ' (' + _('ID_USER') + ')' );
|
||||||
row.push(storeUsers.data.items[i].data.usr_uid);
|
row.push(storeUsers.data.items[i].data.usr_uid);
|
||||||
row.push('USER');
|
row.push('USER');
|
||||||
dataUserGroup.push(row);
|
dataUserGroup.push(row);
|
||||||
@@ -1013,65 +1020,63 @@ var validateNameDashboard = function () {
|
|||||||
|
|
||||||
var saveDashboard = function () {
|
var saveDashboard = function () {
|
||||||
var title = Ext.getCmp('DAS_TITLE').getValue();
|
var title = Ext.getCmp('DAS_TITLE').getValue();
|
||||||
title = title.trim();
|
var data = {};
|
||||||
if (title == '') {
|
if (title == '') {
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_DASHBOARD_TITLE') + ' '+ _('ID_IS_REQUIRED'));
|
PMExt.warning(_('ID_DASHBOARD'), _('ID_DASHBOARD_TITLE') + ' '+ _('ID_IS_REQUIRED'));
|
||||||
Ext.getCmp('DAS_TITLE').focus(true,10);
|
Ext.getCmp('DAS_TITLE').focus(true,10);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
data['DAS_TITLE'] = title;
|
||||||
var description = Ext.getCmp('DAS_DESCRIPTION').getValue();
|
var description = Ext.getCmp('DAS_DESCRIPTION').getValue();
|
||||||
|
|
||||||
|
data['DAS_DESCRIPTION'] = description;
|
||||||
myMask.msg = _('ID_SAVING');
|
myMask.msg = _('ID_SAVING');
|
||||||
myMask.show();
|
myMask.show();
|
||||||
|
|
||||||
if (DAS_UID == '') {
|
if (DAS_UID == '') {
|
||||||
Ext.Ajax.request({
|
$.ajax({
|
||||||
url : urlProxy + 'dashboard',
|
url : urlProxy + 'dashboard',
|
||||||
method: 'POST',
|
type: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Authorization': 'Bearer ' + credentials.access_token
|
'Authorization': 'Bearer ' + credentials.access_token
|
||||||
},
|
},
|
||||||
jsonData: {
|
data: JSON.stringify(data),
|
||||||
"DAS_TITLE" : title,
|
|
||||||
"DAS_DESCRIPTION" : description
|
|
||||||
},
|
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
DAS_UID = response;
|
||||||
DAS_UID = jsonResp;
|
saveAllDashboardOwner(response);
|
||||||
saveAllDashboardOwner(jsonResp);
|
saveAllIndicators(response);
|
||||||
saveAllIndicators(jsonResp);
|
|
||||||
myMask.hide();
|
myMask.hide();
|
||||||
},
|
},
|
||||||
failure: function (response) {
|
failure: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
myMask.hide();
|
myMask.hide();
|
||||||
PMExt.error(_('ID_ERROR'), jsonResp.error.message);
|
PMExt.error(_('ID_ERROR'), jsonResp.error.message);
|
||||||
}
|
},
|
||||||
|
async: false
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Ext.Ajax.request({
|
data['DAS_UID'] = DAS_UID
|
||||||
|
$.ajax({
|
||||||
url : urlProxy + 'dashboard',
|
url : urlProxy + 'dashboard',
|
||||||
method: 'PUT',
|
type: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Authorization': 'Bearer ' + credentials.access_token
|
'Authorization': 'Bearer ' + credentials.access_token
|
||||||
},
|
},
|
||||||
jsonData: {
|
data: JSON.stringify(data),
|
||||||
"DAS_UID" : DAS_UID,
|
|
||||||
"DAS_TITLE" : title,
|
|
||||||
"DAS_DESCRIPTION" : description
|
|
||||||
},
|
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
saveAllDashboardOwner(jsonResp);
|
saveAllDashboardOwner(DAS_UID);
|
||||||
saveAllIndicators(jsonResp);
|
saveAllIndicators(DAS_UID);
|
||||||
myMask.hide();
|
myMask.hide();
|
||||||
},
|
},
|
||||||
failure: function (response) {
|
failure: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
myMask.hide();
|
myMask.hide();
|
||||||
PMExt.error(_('ID_ERROR'), jsonResp.error.message);
|
PMExt.error(_('ID_ERROR'), jsonResp.error.message);
|
||||||
}
|
},
|
||||||
|
async: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1143,65 +1148,56 @@ var saveAllIndicators = function (DAS_UID) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var saveDashboardIndicator = function (options) {
|
var saveDashboardIndicator = function (options) {
|
||||||
|
var data = {};
|
||||||
|
data["DAS_UID"] = options['DAS_UID'];
|
||||||
|
data["DAS_IND_TYPE"] = options['DAS_IND_TYPE'];
|
||||||
|
data["DAS_IND_TITLE"] = options['DAS_IND_TITLE'];
|
||||||
|
data["DAS_IND_GOAL"] = options['DAS_IND_GOAL'];
|
||||||
|
data["DAS_IND_DIRECTION"] = options['DAS_IND_DIRECTION'];
|
||||||
|
data["DAS_UID_PROCESS"] = options['DAS_UID_PROCESS'];
|
||||||
|
data["DAS_IND_FIRST_FIGURE"] = options['DAS_IND_FIRST_FIGURE'];
|
||||||
|
data["DAS_IND_FIRST_FREQUENCY"] = options['DAS_IND_FIRST_FREQUENCY'];
|
||||||
|
data["DAS_IND_SECOND_FIGURE"] = options['DAS_IND_SECOND_FIGURE'];
|
||||||
|
data["DAS_IND_SECOND_FREQUENCY"] = options['DAS_IND_SECOND_FREQUENCY'];
|
||||||
|
|
||||||
if (options['DAS_IND_UID'] == '') {
|
if (options['DAS_IND_UID'] == '') {
|
||||||
Ext.Ajax.request({
|
$.ajax({
|
||||||
url : urlProxy + 'dashboard/indicator',
|
url : urlProxy + 'dashboard/indicator',
|
||||||
method: 'POST',
|
type: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Authorization': 'Bearer ' + credentials.access_token
|
'Authorization': 'Bearer ' + credentials.access_token
|
||||||
},
|
},
|
||||||
jsonData: {
|
data: JSON.stringify(data),
|
||||||
"DAS_UID" : options['DAS_UID'],
|
|
||||||
"DAS_IND_TYPE" : options['DAS_IND_TYPE'],
|
|
||||||
"DAS_IND_TITLE" : options['DAS_IND_TITLE'],
|
|
||||||
"DAS_IND_GOAL" : options['DAS_IND_GOAL'],
|
|
||||||
"DAS_IND_DIRECTION" : options['DAS_IND_DIRECTION'],
|
|
||||||
"DAS_UID_PROCESS" : options['DAS_UID_PROCESS'],
|
|
||||||
"DAS_IND_FIRST_FIGURE" : options['DAS_IND_FIRST_FIGURE'],
|
|
||||||
"DAS_IND_FIRST_FREQUENCY" : options['DAS_IND_FIRST_FREQUENCY'],
|
|
||||||
"DAS_IND_SECOND_FIGURE" : options['DAS_IND_SECOND_FIGURE'],
|
|
||||||
"DAS_IND_SECOND_FREQUENCY" : options['DAS_IND_SECOND_FREQUENCY']
|
|
||||||
},
|
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
},
|
},
|
||||||
failure: function (response) {
|
failure: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
||||||
}
|
},
|
||||||
|
async: false
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Ext.Ajax.request({
|
data["DAS_IND_UID"] = options['DAS_IND_UID'];
|
||||||
|
$.ajax({
|
||||||
url : urlProxy + 'dashboard/indicator',
|
url : urlProxy + 'dashboard/indicator',
|
||||||
method: 'PUT',
|
type: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Authorization': 'Bearer ' + credentials.access_token
|
'Authorization': 'Bearer ' + credentials.access_token
|
||||||
},
|
},
|
||||||
jsonData: {
|
data: JSON.stringify(data),
|
||||||
"DAS_UID" : options['DAS_UID'],
|
|
||||||
"DAS_IND_UID" : options['DAS_IND_UID'],
|
|
||||||
"DAS_IND_TYPE" : options['DAS_IND_TYPE'],
|
|
||||||
"DAS_IND_TITLE" : options['DAS_IND_TITLE'],
|
|
||||||
"DAS_IND_GOAL" : options['DAS_IND_GOAL'],
|
|
||||||
"DAS_IND_DIRECTION" : options['DAS_IND_DIRECTION'],
|
|
||||||
"DAS_UID_PROCESS" : options['DAS_UID_PROCESS'],
|
|
||||||
"DAS_IND_FIRST_FIGURE" : options['DAS_IND_FIRST_FIGURE'],
|
|
||||||
"DAS_IND_FIRST_FREQUENCY" : options['DAS_IND_FIRST_FREQUENCY'],
|
|
||||||
"DAS_IND_SECOND_FIGURE" : options['DAS_IND_SECOND_FIGURE'],
|
|
||||||
"DAS_IND_SECOND_FREQUENCY" : options['DAS_IND_SECOND_FREQUENCY']
|
|
||||||
},
|
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
},
|
},
|
||||||
failure: function (response) {
|
failure: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
||||||
}
|
},
|
||||||
|
async: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var saveAllDashboardOwner = function (DAS_UID) {
|
var saveAllDashboardOwner = function (DAS_UID) {
|
||||||
@@ -1218,25 +1214,26 @@ var saveAllDashboardOwner = function (DAS_UID) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var saveDashboardOwner = function (DAS_UID, uid, type) {
|
var saveDashboardOwner = function (DAS_UID, uid, type) {
|
||||||
Ext.Ajax.request({
|
var data = {};
|
||||||
|
data['DAS_UID'] = DAS_UID;
|
||||||
|
data['OWNER_UID'] = uid;
|
||||||
|
data['OWNER_TYPE'] = type;
|
||||||
|
$.ajax({
|
||||||
url : urlProxy + 'dashboard/owner',
|
url : urlProxy + 'dashboard/owner',
|
||||||
method: 'POST',
|
type: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Authorization': 'Bearer ' + credentials.access_token
|
'Authorization': 'Bearer ' + credentials.access_token
|
||||||
},
|
},
|
||||||
jsonData: {
|
data: JSON.stringify(data),
|
||||||
"DAS_UID" : DAS_UID,
|
|
||||||
"OWNER_UID" : uid,
|
|
||||||
"OWNER_TYPE" : type
|
|
||||||
},
|
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
},
|
},
|
||||||
failure: function (response) {
|
failure: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
||||||
}
|
},
|
||||||
|
async: false
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user