Improvement form Dashboard
This commit is contained in:
@@ -404,7 +404,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Risk date
|
//Risk date
|
||||||
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), round($riskTime), $data['TAS_TIMEUNIT'], $arrayCalendarData);
|
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $riskTime, $data['TAS_TIMEUNIT'], $arrayCalendarData);
|
||||||
|
|
||||||
return $riskDate;
|
return $riskDate;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ var frmDashboard;
|
|||||||
var addTabButton;
|
var addTabButton;
|
||||||
var tabPanel;
|
var tabPanel;
|
||||||
var dashboardIndicatorFields;
|
var dashboardIndicatorFields;
|
||||||
var dashboardIndicatorPanel;
|
|
||||||
var store;
|
var store;
|
||||||
|
|
||||||
var indexTab = 0;
|
var indexTab = 0;
|
||||||
@@ -49,7 +48,7 @@ var comboPageSize = 10;
|
|||||||
var resultTpl;
|
var resultTpl;
|
||||||
var storeIndicatorType;
|
var storeIndicatorType;
|
||||||
var storeGraphic;
|
var storeGraphic;
|
||||||
var storeFrecuency;
|
var storeFrequency;
|
||||||
var storeProject;
|
var storeProject;
|
||||||
var storeGroup;
|
var storeGroup;
|
||||||
var storeUsers;
|
var storeUsers;
|
||||||
@@ -63,13 +62,13 @@ var tabActivate = [];
|
|||||||
Ext.onReady( function() {
|
Ext.onReady( function() {
|
||||||
|
|
||||||
myMask = new Ext.LoadMask(Ext.getBody(), {msg:_('ID_LOADING')});
|
myMask = new Ext.LoadMask(Ext.getBody(), {msg:_('ID_LOADING')});
|
||||||
|
|
||||||
|
|
||||||
Ext.QuickTips.init();
|
Ext.QuickTips.init();
|
||||||
|
|
||||||
resultTpl = new Ext.XTemplate(
|
resultTpl = new Ext.XTemplate(
|
||||||
'<tpl for="."><div class="x-combo-list-item" style="white-space:normal !important;word-wrap: break-word;">',
|
'<tpl for="."><div class="x-combo-list-item" style="white-space:normal !important;word-wrap: break-word;">',
|
||||||
'<span> {APP_PRO_TITLE}</span>',
|
'<span> {APP_PRO_TITLE}</span>',
|
||||||
'</div></tpl>'
|
'</div></tpl>'
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -79,20 +78,21 @@ Ext.onReady( function() {
|
|||||||
items : [
|
items : [
|
||||||
{
|
{
|
||||||
id : 'DAS_TITLE',
|
id : 'DAS_TITLE',
|
||||||
fieldLabel : _('ID_DASHBOARD_TITLE'),
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_DASHBOARD_TITLE')) +'"> * </span>' + _('ID_DASHBOARD_TITLE'),
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
anchor : '85%',
|
anchor : '85%',
|
||||||
maxLength : 250,
|
maxLength : 250,
|
||||||
maskRe : /([a-zA-Z0-9\s]+)$/,
|
maskRe : /([a-zA-Z0-9_'\s]+)$/,
|
||||||
|
regex : /([a-zA-Z0-9_'\s]+)$/,
|
||||||
|
regexText : _('ID_INVALID_VALUE', _('ID_DASHBOARD_TITLE')),
|
||||||
allowBlank : false
|
allowBlank : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype : 'textarea',
|
xtype : 'textarea',
|
||||||
id : 'DAS_DESCRIPTION',
|
id : 'DAS_DESCRIPTION',
|
||||||
fieldLabel : _('ID_DESCRIPTION'),
|
fieldLabel : _('ID_DESCRIPTION'),
|
||||||
labelSeparator : '',
|
|
||||||
anchor : '85%',
|
anchor : '85%',
|
||||||
maskRe : /([a-zA-Z0-9\s]+)$/,
|
maskRe : /([a-zA-Z0-9_'\s]+)$/,
|
||||||
height : 50,
|
height : 50,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -238,7 +238,7 @@ Ext.onReady( function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
storeIndicatorType = new Ext.data.GroupingStore( {
|
storeIndicatorType = new Ext.data.GroupingStore( {
|
||||||
proxy : new Ext.data.HttpProxy({
|
proxy : new Ext.data.HttpProxy({
|
||||||
api: {
|
api: {
|
||||||
@@ -295,7 +295,7 @@ Ext.onReady( function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
storeFrecuency = new Ext.data.GroupingStore( {
|
storeFrequency = new Ext.data.GroupingStore( {
|
||||||
proxy : new Ext.data.HttpProxy({
|
proxy : new Ext.data.HttpProxy({
|
||||||
api: {
|
api: {
|
||||||
read : urlProxy + 'catalog/periodicity'
|
read : urlProxy + 'catalog/periodicity'
|
||||||
@@ -448,7 +448,7 @@ Ext.onReady( function() {
|
|||||||
return '<div class="search-item">' +
|
return '<div class="search-item">' +
|
||||||
'<h3><span>{owner_uid}</span>{owner_label}</h3>' +
|
'<h3><span>{owner_uid}</span>{owner_label}</h3>' +
|
||||||
'{excerpt}' +
|
'{excerpt}' +
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//pageSize : 10,
|
//pageSize : 10,
|
||||||
@@ -528,23 +528,24 @@ Ext.onReady( function() {
|
|||||||
flag = true;
|
flag = true;
|
||||||
break;
|
break;
|
||||||
case 'yes':
|
case 'yes':
|
||||||
|
tabPanel.getItem(component.id).show();
|
||||||
flag = false;
|
flag = false;
|
||||||
var dasIndUid = Ext.getCmp('DAS_IND_UID_'+component.id).getValue();
|
var dasIndUid = Ext.getCmp('DAS_IND_UID_'+component.id).getValue();
|
||||||
if (typeof dasIndUid != 'undefined' && dasIndUid != '') {
|
if (typeof dasIndUid != 'undefined' && dasIndUid != '') {
|
||||||
removeIndicator(dasIndUid);
|
removeIndicator(dasIndUid);
|
||||||
}
|
}
|
||||||
tabActivate.remove(component.id);
|
tabActivate.remove(component.id);
|
||||||
tabPanel.remove(component);
|
tabPanel.remove(component, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scope: that
|
scope: that
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
tabchange : function ( that, tab ) {
|
tabchange : function ( that, tab ) {
|
||||||
var id = tabPanel.getActiveTab().id;
|
var id = tabPanel.getActiveTab().id;
|
||||||
@@ -626,7 +627,7 @@ Ext.onReady( function() {
|
|||||||
items : [
|
items : [
|
||||||
addTabButton,
|
addTabButton,
|
||||||
tabPanel
|
tabPanel
|
||||||
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -644,11 +645,11 @@ Ext.onReady( function() {
|
|||||||
waitMsgTarget : true,
|
waitMsgTarget : true,
|
||||||
frame : true,
|
frame : true,
|
||||||
defaults : {
|
defaults : {
|
||||||
anchor : '100%',
|
anchor : '100%',
|
||||||
allowBlank : false,
|
allowBlank : false,
|
||||||
resizable : true,
|
resizable : true,
|
||||||
msgTarget : 'side',
|
msgTarget : 'side',
|
||||||
align : 'center'
|
align : 'center'
|
||||||
},
|
},
|
||||||
items : [
|
items : [
|
||||||
dashboardFields,
|
dashboardFields,
|
||||||
@@ -671,10 +672,9 @@ Ext.onReady( function() {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
ownerInfoGrid.store.load();
|
|
||||||
ownerInfoGrid.on("afterrender", function(component) {
|
ownerInfoGrid.on("afterrender", function(component) {
|
||||||
component.getBottomToolbar().refresh.hideParent = true;
|
component.getBottomToolbar().refresh.hideParent = true;
|
||||||
component.getBottomToolbar().refresh.hide();
|
component.getBottomToolbar().refresh.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
viewport = new Ext.Viewport({
|
viewport = new Ext.Viewport({
|
||||||
@@ -698,6 +698,7 @@ Ext.onReady( function() {
|
|||||||
}
|
}
|
||||||
dashboardOwnerFields.items.items[0].bindStore(dataUserGroup);
|
dashboardOwnerFields.items.items[0].bindStore(dataUserGroup);
|
||||||
} );
|
} );
|
||||||
|
|
||||||
storeUsers.on( 'load', function( store, records, options ) {
|
storeUsers.on( 'load', function( store, records, options ) {
|
||||||
for (var i=0; i< store.data.length; i++) {
|
for (var i=0; i< store.data.length; i++) {
|
||||||
row = [];
|
row = [];
|
||||||
@@ -730,243 +731,245 @@ var addTab = function (flag) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var tab = {
|
var tab = {
|
||||||
title : _('ID_INDICATOR')+ ' '+ (++indexTab),
|
title : _('ID_INDICATOR')+ ' '+ (++indexTab),
|
||||||
id : indexTab,
|
id : indexTab,
|
||||||
iconCls : 'tabs',
|
iconCls : 'tabs',
|
||||||
width : "100%",
|
width : "100%",
|
||||||
items : [
|
items : [
|
||||||
new Ext.Panel({
|
new Ext.Panel({
|
||||||
height : 230,
|
height : 230,
|
||||||
width : "100%",
|
width : "100%",
|
||||||
border : true,
|
border : true,
|
||||||
bodyStyle : 'padding:10px',
|
bodyStyle : 'padding:10px',
|
||||||
items : [
|
items : [
|
||||||
new Ext.form.FieldSet({
|
new Ext.form.FieldSet({
|
||||||
labelWidth : 150,
|
labelWidth : 150,
|
||||||
labelAlign :'right',
|
labelAlign :'right',
|
||||||
items : [
|
items : [
|
||||||
{
|
{
|
||||||
id : 'DAS_IND_UID_' + indexTab,
|
id : 'DAS_IND_UID_' + indexTab,
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
hidden : true
|
hidden : true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldLabel : _('ID_INDICATOR_TITLE'),
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_INDICATOR_TITLE')) +'"> * </span>' + _('ID_INDICATOR_TITLE'),
|
||||||
id : 'IND_TITLE_'+ indexTab,
|
id : 'IND_TITLE_'+ indexTab,
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
anchor : '85%',
|
anchor : '85%',
|
||||||
maskRe : /([a-zA-Z0-9\s]+)$/,
|
maskRe : /([a-zA-Z0-9_'\s]+)$/,
|
||||||
maxLength : 250,
|
regex : /([a-zA-Z0-9_'\s]+)$/,
|
||||||
allowBlank : false
|
regexText : _('ID_INVALID_VALUE', _('ID_INDICATOR_TITLE')),
|
||||||
},
|
maxLength : 250,
|
||||||
new Ext.form.ComboBox({
|
allowBlank : false
|
||||||
anchor : '85%',
|
},
|
||||||
editable : false,
|
new Ext.form.ComboBox({
|
||||||
id : 'IND_TYPE_'+ indexTab,
|
anchor : '85%',
|
||||||
fieldLabel : _('ID_INDICATOR_TYPE'),
|
editable : false,
|
||||||
displayField : 'CAT_LABEL_ID',
|
id : 'IND_TYPE_'+ indexTab,
|
||||||
valueField : 'CAT_UID',
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_INDICATOR_TYPE')) +'"> * </span>' + _('ID_INDICATOR_TYPE'),
|
||||||
forceSelection : false,
|
displayField : 'CAT_LABEL_ID',
|
||||||
emptyText : _('ID_SELECT'),
|
valueField : 'CAT_UID',
|
||||||
selectOnFocus : true,
|
forceSelection : false,
|
||||||
typeAhead : true,
|
emptyText : _('ID_SELECT'),
|
||||||
autocomplete : true,
|
selectOnFocus : true,
|
||||||
triggerAction : 'all',
|
typeAhead : true,
|
||||||
store : storeIndicatorType,
|
autocomplete : true,
|
||||||
listeners:{
|
triggerAction : 'all',
|
||||||
scope: this,
|
store : storeIndicatorType,
|
||||||
select: function(combo, record, index) {
|
listeners:{
|
||||||
var value = combo.getValue();
|
scope: this,
|
||||||
var field = '';
|
select: function(combo, record, index) {
|
||||||
var index = tabPanel.getActiveTab().id;
|
var value = combo.getValue();
|
||||||
var fields = ['DAS_IND_FIRST_FIGURE_'+index,'DAS_IND_FIRST_FREQUENCY_'+index,'DAS_IND_SECOND_FIGURE_'+index, 'DAS_IND_SECOND_FREQUENCY_'+index];
|
var field = '';
|
||||||
if (value == '1050') {
|
var index = tabPanel.getActiveTab().id;
|
||||||
field = Ext.getCmp('IND_PROCESS_'+index);
|
var fields = ['DAS_IND_FIRST_FIGURE_'+index,'DAS_IND_FIRST_FREQUENCY_'+index,'DAS_IND_SECOND_FIGURE_'+index, 'DAS_IND_SECOND_FREQUENCY_'+index];
|
||||||
|
if (value == '1050') {
|
||||||
|
field = Ext.getCmp('IND_PROCESS_'+index);
|
||||||
|
field.setValue('0');
|
||||||
|
field.disable();
|
||||||
|
field.hide();
|
||||||
|
} else {
|
||||||
|
field = Ext.getCmp('IND_PROCESS_'+index);
|
||||||
|
field.enable();
|
||||||
|
field.show();
|
||||||
|
}
|
||||||
|
if (value == '1010' || value == '1030' || value == '1050') {
|
||||||
|
for (var i=0; i<fields.length; i++) {
|
||||||
|
field = Ext.getCmp(fields[i]);
|
||||||
field.disable();
|
field.disable();
|
||||||
field.hide();
|
field.hide();
|
||||||
} else {
|
}
|
||||||
field = Ext.getCmp('IND_PROCESS_'+index);
|
} else {
|
||||||
|
for (var i=0; i<fields.length; i++) {
|
||||||
|
field = Ext.getCmp(fields[i]);
|
||||||
field.enable();
|
field.enable();
|
||||||
field.show();
|
field.show();
|
||||||
}
|
}
|
||||||
if (value == '1010' || value == '1030' || value == '1050') {
|
|
||||||
for (var i=0; i<fields.length; i++) {
|
|
||||||
field = Ext.getCmp(fields[i]);
|
|
||||||
field.disable();
|
|
||||||
field.hide();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (var i=0; i<fields.length; i++) {
|
|
||||||
field = Ext.getCmp(fields[i]);
|
|
||||||
field.enable();
|
|
||||||
field.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
new Ext.form.FieldSet({
|
|
||||||
title : _('ID_INDICATOR_GOAL'),
|
|
||||||
width : "90%",
|
|
||||||
id : 'fieldSet_'+ indexTab,
|
|
||||||
bodyStyle: 'paddingLeft: 75px;',
|
|
||||||
paddingLeft: "30px",
|
|
||||||
marginLeft : "60px",
|
|
||||||
layout : 'hbox',
|
|
||||||
hidden : true,
|
|
||||||
items : [
|
|
||||||
new Ext.form.ComboBox({
|
|
||||||
editable : false,
|
|
||||||
id : 'DAS_IND_DIRECTION_'+ indexTab,
|
|
||||||
displayField : 'label',
|
|
||||||
valueField : 'id',
|
|
||||||
value : '2',
|
|
||||||
forceSelection : false,
|
|
||||||
selectOnFocus : true,
|
|
||||||
typeAhead : true,
|
|
||||||
autocomplete : true,
|
|
||||||
width : 90,
|
|
||||||
triggerAction : 'all',
|
|
||||||
mode : 'local',
|
|
||||||
allowBlank : false,
|
|
||||||
store : new Ext.data.ArrayStore({
|
|
||||||
id: 2,
|
|
||||||
fields: [
|
|
||||||
'id',
|
|
||||||
'label'
|
|
||||||
],
|
|
||||||
data: [['1', _('ID_LESS_THAN')], ['2', _('ID_MORE_THAN')]]
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
fieldLabel : _('ID_INDICATOR_GOAL'),
|
|
||||||
id : 'IND_GOAL_'+ indexTab,
|
|
||||||
xtype : 'textfield',
|
|
||||||
anchor : '40%',
|
|
||||||
maskRe : /([0-9\.]+)$/,
|
|
||||||
maxLength : 9,
|
|
||||||
value : 1,
|
|
||||||
width : 80,
|
|
||||||
allowBlank : false,
|
|
||||||
listeners : {
|
|
||||||
focus : function(tb, e) {
|
|
||||||
Ext.QuickTips.register({
|
|
||||||
target: tb,
|
|
||||||
title: _('ID_HELP'),
|
|
||||||
text: _('ID_GOAL_HELP')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
listeners:
|
}
|
||||||
|
}),
|
||||||
|
new Ext.form.FieldSet({
|
||||||
|
title : _('ID_INDICATOR_GOAL'),
|
||||||
|
width : "90%",
|
||||||
|
id : 'fieldSet_'+ indexTab,
|
||||||
|
bodyStyle: 'paddingLeft: 75px;',
|
||||||
|
paddingLeft: "30px",
|
||||||
|
marginLeft : "60px",
|
||||||
|
layout : 'hbox',
|
||||||
|
hidden : true,
|
||||||
|
items : [
|
||||||
|
new Ext.form.ComboBox({
|
||||||
|
editable : false,
|
||||||
|
id : 'DAS_IND_DIRECTION_'+ indexTab,
|
||||||
|
displayField : 'label',
|
||||||
|
valueField : 'id',
|
||||||
|
value : '2',
|
||||||
|
forceSelection : false,
|
||||||
|
selectOnFocus : true,
|
||||||
|
typeAhead : true,
|
||||||
|
autocomplete : true,
|
||||||
|
width : 90,
|
||||||
|
triggerAction : 'all',
|
||||||
|
mode : 'local',
|
||||||
|
allowBlank : false,
|
||||||
|
store : new Ext.data.ArrayStore({
|
||||||
|
id: 2,
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
'label'
|
||||||
|
],
|
||||||
|
data: [['1', _('ID_LESS_THAN')], ['2', _('ID_MORE_THAN')]]
|
||||||
|
})
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
render: function()
|
fieldLabel : _('ID_INDICATOR_GOAL'),
|
||||||
{
|
id : 'IND_GOAL_'+ indexTab,
|
||||||
var index = tabPanel.getActiveTab().id;
|
xtype : 'textfield',
|
||||||
var myfieldset = document.getElementById('fieldSet_'+index);
|
anchor : '40%',
|
||||||
myfieldset.style.marginLeft = "70px";
|
maskRe : /([0-9\.]+)$/,
|
||||||
myfieldset.style.marginRight = "70px";
|
maxLength : 9,
|
||||||
|
value : 1,
|
||||||
|
width : 80,
|
||||||
|
allowBlank : false,
|
||||||
|
listeners : {
|
||||||
|
focus : function(tb, e) {
|
||||||
|
Ext.QuickTips.register({
|
||||||
|
target: tb,
|
||||||
|
title: _('ID_HELP'),
|
||||||
|
text: _('ID_GOAL_HELP')
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
listeners:
|
||||||
|
{
|
||||||
|
render: function()
|
||||||
|
{
|
||||||
|
var index = tabPanel.getActiveTab().id;
|
||||||
|
var myfieldset = document.getElementById('fieldSet_'+index);
|
||||||
|
myfieldset.style.marginLeft = "70px";
|
||||||
|
myfieldset.style.marginRight = "70px";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}),
|
}),
|
||||||
new Ext.form.ComboBox({
|
new Ext.form.ComboBox({
|
||||||
anchor : '85%',
|
anchor : '85%',
|
||||||
editable : false,
|
editable : false,
|
||||||
fieldLabel : _('ID_PROCESS'),
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_PROCESS')) +'"> * </span>' + _('ID_PROCESS'),
|
||||||
id : 'IND_PROCESS_'+ indexTab,
|
id : 'IND_PROCESS_'+ indexTab,
|
||||||
displayField : 'prj_name',
|
displayField : 'prj_name',
|
||||||
valueField : 'prj_uid',
|
valueField : 'prj_uid',
|
||||||
forceSelection : false,
|
forceSelection : true,
|
||||||
emptyText : _('ID_EMPTY_PROCESSES'),
|
emptyText : _('ID_EMPTY_PROCESSES'),
|
||||||
selectOnFocus : true,
|
selectOnFocus : true,
|
||||||
hidden : true,
|
hidden : true,
|
||||||
typeAhead : true,
|
typeAhead : true,
|
||||||
autocomplete : true,
|
autocomplete : true,
|
||||||
triggerAction : 'all',
|
triggerAction : 'all',
|
||||||
value : '0',
|
store : storeProject
|
||||||
store : storeProject
|
}),
|
||||||
}),
|
new Ext.form.ComboBox({
|
||||||
new Ext.form.ComboBox({
|
anchor : '85%',
|
||||||
anchor : '85%',
|
editable : false,
|
||||||
editable : false,
|
fieldLabel : _('ID_FIRST_FIGURE'),
|
||||||
fieldLabel : _('ID_FIRST_FIGURE'),
|
displayField : 'CAT_LABEL_ID',
|
||||||
displayField : 'CAT_LABEL_ID',
|
id : 'DAS_IND_FIRST_FIGURE_'+ indexTab,
|
||||||
id : 'DAS_IND_FIRST_FIGURE_'+ indexTab,
|
valueField : 'CAT_UID',
|
||||||
valueField : 'CAT_UID',
|
forceSelection : false,
|
||||||
forceSelection : false,
|
emptyText : _('ID_SELECT'),
|
||||||
emptyText : _('ID_SELECT'),
|
selectOnFocus : true,
|
||||||
selectOnFocus : true,
|
hidden : true,
|
||||||
hidden : true,
|
typeAhead : true,
|
||||||
typeAhead : true,
|
autocomplete : true,
|
||||||
autocomplete : true,
|
triggerAction : 'all',
|
||||||
triggerAction : 'all',
|
store : storeGraphic
|
||||||
store : storeGraphic
|
}),
|
||||||
}),
|
new Ext.form.ComboBox({
|
||||||
new Ext.form.ComboBox({
|
anchor : '85%',
|
||||||
anchor : '85%',
|
editable : false,
|
||||||
editable : false,
|
fieldLabel : _('ID_PERIODICITY'),
|
||||||
fieldLabel : _('ID_PERIODICITY'),
|
displayField : 'CAT_LABEL_ID',
|
||||||
displayField : 'CAT_LABEL_ID',
|
id : 'DAS_IND_FIRST_FREQUENCY_'+ indexTab,
|
||||||
id : 'DAS_IND_FIRST_FREQUENCY_'+ indexTab,
|
valueField : 'CAT_UID',
|
||||||
valueField : 'CAT_UID',
|
forceSelection : false,
|
||||||
forceSelection : false,
|
emptyText : _('ID_SELECT'),
|
||||||
emptyText : _('ID_SELECT'),
|
selectOnFocus : true,
|
||||||
selectOnFocus : true,
|
hidden : true,
|
||||||
hidden : true,
|
typeAhead : true,
|
||||||
typeAhead : true,
|
autocomplete : true,
|
||||||
autocomplete : true,
|
triggerAction : 'all',
|
||||||
triggerAction : 'all',
|
store : storeFrequency
|
||||||
store : storeFrecuency
|
}),
|
||||||
}),
|
new Ext.form.ComboBox({
|
||||||
new Ext.form.ComboBox({
|
anchor : '85%',
|
||||||
anchor : '85%',
|
editable : false,
|
||||||
editable : false,
|
fieldLabel : _('ID_SECOND_FIGURE'),
|
||||||
fieldLabel : _('ID_SECOND_FIGURE'),
|
id : 'DAS_IND_SECOND_FIGURE_'+ indexTab,
|
||||||
id : 'DAS_IND_SECOND_FIGURE_'+ indexTab,
|
displayField : 'CAT_LABEL_ID',
|
||||||
displayField : 'CAT_LABEL_ID',
|
valueField : 'CAT_UID',
|
||||||
valueField : 'CAT_UID',
|
forceSelection : false,
|
||||||
forceSelection : false,
|
emptyText : _('ID_SELECT'),
|
||||||
emptyText : _('ID_SELECT'),
|
selectOnFocus : true,
|
||||||
selectOnFocus : true,
|
hidden : true,
|
||||||
hidden : true,
|
typeAhead : true,
|
||||||
typeAhead : true,
|
autocomplete : true,
|
||||||
autocomplete : true,
|
triggerAction : 'all',
|
||||||
triggerAction : 'all',
|
store : storeGraphic
|
||||||
store : storeGraphic
|
}),
|
||||||
}),
|
new Ext.form.ComboBox({
|
||||||
new Ext.form.ComboBox({
|
anchor : '85%',
|
||||||
anchor : '85%',
|
editable : false,
|
||||||
editable : false,
|
fieldLabel : _('ID_PERIODICITY'),
|
||||||
fieldLabel : _('ID_PERIODICITY'),
|
displayField : 'CAT_LABEL_ID',
|
||||||
displayField : 'CAT_LABEL_ID',
|
id : 'DAS_IND_SECOND_FREQUENCY_'+ indexTab,
|
||||||
id : 'DAS_IND_SECOND_FREQUENCY_'+ indexTab,
|
valueField : 'CAT_UID',
|
||||||
valueField : 'CAT_UID',
|
forceSelection : false,
|
||||||
forceSelection : false,
|
emptyText : _('ID_SELECT'),
|
||||||
emptyText : _('ID_SELECT'),
|
selectOnFocus : true,
|
||||||
selectOnFocus : true,
|
hidden : true,
|
||||||
hidden : true,
|
typeAhead : true,
|
||||||
typeAhead : true,
|
autocomplete : true,
|
||||||
autocomplete : true,
|
triggerAction : 'all',
|
||||||
triggerAction : 'all',
|
store : storeFrequency
|
||||||
store : storeFrecuency
|
})
|
||||||
})
|
]
|
||||||
]
|
})
|
||||||
})
|
]
|
||||||
]
|
})
|
||||||
})
|
],
|
||||||
],
|
listeners : {
|
||||||
listeners : {
|
scope: this,
|
||||||
scope: this,
|
activate : function (that) {
|
||||||
activate : function (that) {
|
if (tabActivate.indexOf(that.id) == -1 ) {
|
||||||
if (tabActivate.indexOf(that.id) == -1 ) {
|
tabActivate.push(that.id);
|
||||||
tabActivate.push(that.id);
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
closable:true
|
},
|
||||||
};
|
closable:true
|
||||||
|
};
|
||||||
if (flag != 'load') {
|
if (flag != 'load') {
|
||||||
tabPanel.add(tab).show();
|
tabPanel.add(tab).show();
|
||||||
} else {
|
} else {
|
||||||
@@ -1028,7 +1031,7 @@ var validateNameDashboard = function () {
|
|||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_DIRECTORY_NAME_EXISTS_ENTER_ANOTHER', title));
|
PMExt.warning(_('ID_DASHBOARD'), _('ID_DIRECTORY_NAME_EXISTS_ENTER_ANOTHER', title));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
saveDashboard();
|
saveDashboard();
|
||||||
},
|
},
|
||||||
failure: function (response) {
|
failure: function (response) {
|
||||||
@@ -1086,7 +1089,6 @@ var saveDashboard = function () {
|
|||||||
},
|
},
|
||||||
data: JSON.stringify(data),
|
data: JSON.stringify(data),
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
|
||||||
saveAllDashboardOwner(DAS_UID);
|
saveAllDashboardOwner(DAS_UID);
|
||||||
saveAllIndicators(DAS_UID);
|
saveAllIndicators(DAS_UID);
|
||||||
myMask.hide();
|
myMask.hide();
|
||||||
@@ -1109,11 +1111,25 @@ var saveAllIndicators = function (DAS_UID) {
|
|||||||
tabPanel.getItem(tabActivate[tab]).show();
|
tabPanel.getItem(tabActivate[tab]).show();
|
||||||
var fieldsTab = tabPanel.getItem(tabActivate[tab]).items.items[0].items.items[0].items.items;
|
var fieldsTab = tabPanel.getItem(tabActivate[tab]).items.items[0].items.items[0].items.items;
|
||||||
|
|
||||||
|
if (fieldsTab[1].getValue().trim() == '') {
|
||||||
|
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TITLE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
||||||
|
fieldsTab[1].focus(true,10);
|
||||||
|
return false;
|
||||||
|
} else if (fieldsTab[2].getValue().trim() == '') {
|
||||||
|
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TYPE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
||||||
|
fieldsTab[2].focus(true,10);
|
||||||
|
return false;
|
||||||
|
} else if (fieldsTab[2].getValue() != '1050' && fieldsTab[4].getValue().trim() == '') {
|
||||||
|
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_PROCESS_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
||||||
|
fieldsTab[4].focus(true,10);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var goal = fieldsTab[3];
|
var goal = fieldsTab[3];
|
||||||
fieldsTab.push(goal.items.items[0]);
|
fieldsTab.push(goal.items.items[0]);
|
||||||
fieldsTab.push(goal.items.items[1]);
|
fieldsTab.push(goal.items.items[1]);
|
||||||
|
|
||||||
data = [];
|
var data = [];
|
||||||
data['DAS_UID'] = DAS_UID;
|
data['DAS_UID'] = DAS_UID;
|
||||||
|
|
||||||
for (var index in fieldsTab) {
|
for (var index in fieldsTab) {
|
||||||
@@ -1122,12 +1138,12 @@ var saveAllIndicators = function (DAS_UID) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = node.id;
|
var id = node.id;
|
||||||
if (typeof id == 'undefined' || id.indexOf('fieldSet_') != -1 ) {
|
if (typeof id == 'undefined' || id.indexOf('fieldSet_') != -1 ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
id = id.split('_');
|
id = id.split('_');
|
||||||
field = '';
|
var field = '';
|
||||||
for (var part = 0; part<id.length-1; part++) {
|
for (var part = 0; part<id.length-1; part++) {
|
||||||
if (part == 0) {
|
if (part == 0) {
|
||||||
field = id[part];
|
field = id[part];
|
||||||
@@ -1135,25 +1151,7 @@ var saveAllIndicators = function (DAS_UID) {
|
|||||||
field = field+'_'+id[part];
|
field = field+'_'+id[part];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value = node.getValue();
|
var value = node.getValue();
|
||||||
|
|
||||||
if (field == 'IND_TITLE' && value.trim() == '') {
|
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TITLE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
|
||||||
node.focus(true,10);
|
|
||||||
return false;
|
|
||||||
} else if (field == 'IND_TYPE' && value.trim() == '') {
|
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TYPE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
|
||||||
node.focus(true,10);
|
|
||||||
return false;
|
|
||||||
} else if (field == 'IND_GOAL' && value.trim() == '') {
|
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_GOAL_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
|
||||||
node.focus(true,10);
|
|
||||||
return false;
|
|
||||||
} else if (field == 'IND_PROCESS' && value.trim() == '') {
|
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_PROCESS_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
|
||||||
node.focus(true,10);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
field = field == 'IND_TITLE' ? 'DAS_IND_TITLE' : field;
|
field = field == 'IND_TITLE' ? 'DAS_IND_TITLE' : field;
|
||||||
field = field == 'IND_TYPE' ? 'DAS_IND_TYPE' : field;
|
field = field == 'IND_TYPE' ? 'DAS_IND_TYPE' : field;
|
||||||
@@ -1271,7 +1269,7 @@ var loadIndicators = function (DAS_UID) {
|
|||||||
addTab('load');
|
addTab('load');
|
||||||
}
|
}
|
||||||
dataIndicator = jsonResp;
|
dataIndicator = jsonResp;
|
||||||
|
|
||||||
for (var i=0; i<=jsonResp.length-1; i++) {
|
for (var i=0; i<=jsonResp.length-1; i++) {
|
||||||
addTab('load');
|
addTab('load');
|
||||||
tabPanel.getItem(i+1).setTitle(jsonResp[i]['DAS_IND_TITLE']);
|
tabPanel.getItem(i+1).setTitle(jsonResp[i]['DAS_IND_TITLE']);
|
||||||
|
|||||||
Reference in New Issue
Block a user