diff --git a/workflow/engine/classes/model/AppDelegation.php b/workflow/engine/classes/model/AppDelegation.php index 91b444eef..724088f89 100755 --- a/workflow/engine/classes/model/AppDelegation.php +++ b/workflow/engine/classes/model/AppDelegation.php @@ -404,7 +404,7 @@ class AppDelegation extends BaseAppDelegation } //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; } catch (Exception $e) { diff --git a/workflow/engine/templates/strategicDashboard/formDashboard.js b/workflow/engine/templates/strategicDashboard/formDashboard.js index ab4025611..92803ba86 100644 --- a/workflow/engine/templates/strategicDashboard/formDashboard.js +++ b/workflow/engine/templates/strategicDashboard/formDashboard.js @@ -41,7 +41,6 @@ var frmDashboard; var addTabButton; var tabPanel; var dashboardIndicatorFields; -var dashboardIndicatorPanel; var store; var indexTab = 0; @@ -49,7 +48,7 @@ var comboPageSize = 10; var resultTpl; var storeIndicatorType; var storeGraphic; -var storeFrecuency; +var storeFrequency; var storeProject; var storeGroup; var storeUsers; @@ -63,13 +62,13 @@ var tabActivate = []; Ext.onReady( function() { myMask = new Ext.LoadMask(Ext.getBody(), {msg:_('ID_LOADING')}); - + Ext.QuickTips.init(); resultTpl = new Ext.XTemplate( '
', - ' {APP_PRO_TITLE}', + ' {APP_PRO_TITLE}', '
' ); @@ -79,20 +78,21 @@ Ext.onReady( function() { items : [ { id : 'DAS_TITLE', - fieldLabel : _('ID_DASHBOARD_TITLE'), + fieldLabel : ' * ' + _('ID_DASHBOARD_TITLE'), xtype : 'textfield', anchor : '85%', 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 }, { xtype : 'textarea', id : 'DAS_DESCRIPTION', fieldLabel : _('ID_DESCRIPTION'), - labelSeparator : '', anchor : '85%', - maskRe : /([a-zA-Z0-9\s]+)$/, + maskRe : /([a-zA-Z0-9_'\s]+)$/, height : 50, } ] @@ -238,7 +238,7 @@ Ext.onReady( function() { } }); - + storeIndicatorType = new Ext.data.GroupingStore( { proxy : new Ext.data.HttpProxy({ api: { @@ -295,7 +295,7 @@ Ext.onReady( function() { } }); - storeFrecuency = new Ext.data.GroupingStore( { + storeFrequency = new Ext.data.GroupingStore( { proxy : new Ext.data.HttpProxy({ api: { read : urlProxy + 'catalog/periodicity' @@ -448,7 +448,7 @@ Ext.onReady( function() { return '
' + '

{owner_uid}{owner_label}

' + '{excerpt}' + - '
'; + ''; } }, //pageSize : 10, @@ -528,23 +528,24 @@ Ext.onReady( function() { flag = true; break; case 'yes': + tabPanel.getItem(component.id).show(); flag = false; var dasIndUid = Ext.getCmp('DAS_IND_UID_'+component.id).getValue(); if (typeof dasIndUid != 'undefined' && dasIndUid != '') { removeIndicator(dasIndUid); } tabActivate.remove(component.id); - tabPanel.remove(component); + tabPanel.remove(component, true); break; } }, scope: that }); - return false; + return false; } else { flag = true; } - + }, tabchange : function ( that, tab ) { var id = tabPanel.getActiveTab().id; @@ -626,7 +627,7 @@ Ext.onReady( function() { items : [ addTabButton, tabPanel - + ] }); @@ -644,11 +645,11 @@ Ext.onReady( function() { waitMsgTarget : true, frame : true, defaults : { - anchor : '100%', - allowBlank : false, - resizable : true, - msgTarget : 'side', - align : 'center' + anchor : '100%', + allowBlank : false, + resizable : true, + msgTarget : 'side', + align : 'center' }, items : [ dashboardFields, @@ -671,10 +672,9 @@ Ext.onReady( function() { ] }); - ownerInfoGrid.store.load(); ownerInfoGrid.on("afterrender", function(component) { component.getBottomToolbar().refresh.hideParent = true; - component.getBottomToolbar().refresh.hide(); + component.getBottomToolbar().refresh.hide(); }); viewport = new Ext.Viewport({ @@ -698,6 +698,7 @@ Ext.onReady( function() { } dashboardOwnerFields.items.items[0].bindStore(dataUserGroup); } ); + storeUsers.on( 'load', function( store, records, options ) { for (var i=0; i< store.data.length; i++) { row = []; @@ -730,243 +731,245 @@ var addTab = function (flag) { return false; } var tab = { - title : _('ID_INDICATOR')+ ' '+ (++indexTab), - id : indexTab, - iconCls : 'tabs', - width : "100%", - items : [ - new Ext.Panel({ - height : 230, - width : "100%", - border : true, - bodyStyle : 'padding:10px', - items : [ - new Ext.form.FieldSet({ - labelWidth : 150, - labelAlign :'right', - items : [ - { - id : 'DAS_IND_UID_' + indexTab, - xtype : 'textfield', - hidden : true - }, - { - fieldLabel : _('ID_INDICATOR_TITLE'), - id : 'IND_TITLE_'+ indexTab, - xtype : 'textfield', - anchor : '85%', - maskRe : /([a-zA-Z0-9\s]+)$/, - maxLength : 250, - allowBlank : false - }, - new Ext.form.ComboBox({ - anchor : '85%', - editable : false, - id : 'IND_TYPE_'+ indexTab, - fieldLabel : _('ID_INDICATOR_TYPE'), - displayField : 'CAT_LABEL_ID', - valueField : 'CAT_UID', - forceSelection : false, - emptyText : _('ID_SELECT'), - selectOnFocus : true, - typeAhead : true, - autocomplete : true, - triggerAction : 'all', - store : storeIndicatorType, - listeners:{ - scope: this, - select: function(combo, record, index) { - var value = combo.getValue(); - var field = ''; - var index = tabPanel.getActiveTab().id; - 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); + title : _('ID_INDICATOR')+ ' '+ (++indexTab), + id : indexTab, + iconCls : 'tabs', + width : "100%", + items : [ + new Ext.Panel({ + height : 230, + width : "100%", + border : true, + bodyStyle : 'padding:10px', + items : [ + new Ext.form.FieldSet({ + labelWidth : 150, + labelAlign :'right', + items : [ + { + id : 'DAS_IND_UID_' + indexTab, + xtype : 'textfield', + hidden : true + }, + { + fieldLabel : ' * ' + _('ID_INDICATOR_TITLE'), + id : 'IND_TITLE_'+ indexTab, + xtype : 'textfield', + anchor : '85%', + maskRe : /([a-zA-Z0-9_'\s]+)$/, + regex : /([a-zA-Z0-9_'\s]+)$/, + regexText : _('ID_INVALID_VALUE', _('ID_INDICATOR_TITLE')), + maxLength : 250, + allowBlank : false + }, + new Ext.form.ComboBox({ + anchor : '85%', + editable : false, + id : 'IND_TYPE_'+ indexTab, + fieldLabel : ' * ' + _('ID_INDICATOR_TYPE'), + displayField : 'CAT_LABEL_ID', + valueField : 'CAT_UID', + forceSelection : false, + emptyText : _('ID_SELECT'), + selectOnFocus : true, + typeAhead : true, + autocomplete : true, + triggerAction : 'all', + store : storeIndicatorType, + listeners:{ + scope: this, + select: function(combo, record, index) { + var value = combo.getValue(); + var field = ''; + var index = tabPanel.getActiveTab().id; + 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