From 78877e91c559cb475053dbc7374663820a367814 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Fri, 24 Apr 2015 15:50:10 -0400 Subject: [PATCH 01/22] NDD-47 Utilizar flag activo/desactivo - se cambio el metodo getDashboardDataByUser para utilizar el flag. --- .../ProcessMaker/BusinessModel/Dashboard.php | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php b/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php index 318f32c5e..8e92f4fcf 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php @@ -40,27 +40,32 @@ class Dashboard { { $resp = array(); $dashboards = $this->getDashboardsUidByUser($usr_uid); - $existFavorite = false; - foreach($dashboards as $i=>$x) { - $resp[$i] = $this->getDashboard($x['DAS_UID']); - $Dashboard = new \ProcessMaker\BusinessModel\Dashboard(); - $dashConfig = $Dashboard->getConfig($usr_uid); - $resp[$i]['DAS_FAVORITE'] = 0; - foreach ($dashConfig as $dashId=>$dashData) { - if($dashId == $x['DAS_UID'] ) { - $resp[$i]['DAS_FAVORITE'] = $dashData['dashFavorite']; - if ($dashData['dashFavorite']==1) { - $existFavorite = true; - } + $existFavorite = false; + foreach($dashboards as $i=>$x) { + //$resp[$i] = $this->getDashboard($x['DAS_UID']); + $dashboardUser = $this->getDashboard($x['DAS_UID']); + if ($dashboardUser['DAS_STATUS'] == 0) { + continue; + } + $resp[$i] = $dashboardUser; + $Dashboard = new \ProcessMaker\BusinessModel\Dashboard(); + $dashConfig = $Dashboard->getConfig($usr_uid); + $resp[$i]['DAS_FAVORITE'] = 0; + foreach ($dashConfig as $dashId=>$dashData) { + if($dashId == $x['DAS_UID'] ) { + $resp[$i]['DAS_FAVORITE'] = $dashData['dashFavorite']; + if ($dashData['dashFavorite']==1) { + $existFavorite = true; } } - } - - //if no favorite is set, the default vavorite is the first one - if ($existFavorite == false && $dashboards != null && sizeof($dashboards)>0) { - $resp[0]['DAS_FAVORITE'] = 1; + } } - return $resp; + + //if no favorite is set, the default favorite is the first one + if ($existFavorite == false && $resp != null && sizeof($resp)>0) { + $resp[0]['DAS_FAVORITE'] = 1; + } + return $resp; } /** From c540789fbbde668c86a998c95ea83e9bbdf743c6 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Mon, 27 Apr 2015 11:39:16 -0400 Subject: [PATCH 02/22] Add validation check group user --- .../engine/classes/model/DashboardDasInd.php | 36 +++++++++++++++++-- .../ProcessMaker/BusinessModel/Dashboard.php | 2 +- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/workflow/engine/classes/model/DashboardDasInd.php b/workflow/engine/classes/model/DashboardDasInd.php index d6796bfa0..002555fd8 100644 --- a/workflow/engine/classes/model/DashboardDasInd.php +++ b/workflow/engine/classes/model/DashboardDasInd.php @@ -108,10 +108,40 @@ class DashboardDasInd extends BaseDashboardDasInd } } - public function getOwnerByDashboard ($dasUid) + public function loadOwnerByUserId ($usrId) { - - } + try { + $criteria = new Criteria('workflow'); + $criteria->add(DashboardDasIndPeer::OWNER_UID, $usrId); + $criteria->add(DashboardDasIndPeer::OWNER_TYPE, "USER"); + + $dataset = DashboardDasIndPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $fields = array(); + + while ($dataset->next()) { + $auxField = $dataset->getRow(); + $fields[] = $auxField; + } + + $criteria = new Criteria('workflow'); + $criteria->add(DashboardDasIndPeer::OWNER_TYPE, "GROUP"); + $criteria->add(GroupUserPeer::USR_UID, $usrId); + $criteria->addJoin(GroupUserPeer::GRP_UID, DashboardDasIndPeer::OWNER_UID); + + $dataset = DashboardDasIndPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + + while ($dataset->next()) { + $auxField = $dataset->getRow(); + $fields[] = $auxField; + } + + return $fields; + } catch (Exception $error) { + throw $error; + } + } } diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php b/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php index 8e92f4fcf..741af63e9 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php @@ -23,7 +23,7 @@ class Dashboard { require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardDasInd.php"); $oDashboardDasInd = new \DashboardDasInd(); - $response = $oDashboardDasInd->loadByOwner($usr_uid); + $response = $oDashboardDasInd->loadOwnerByUserId($usr_uid); return $response; } From fb01724ae02197c98bc0a3f01f080b2a6a85833f Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Mon, 27 Apr 2015 15:32:55 -0400 Subject: [PATCH 03/22] Change field required and label dashboard --- .../strategicDashboard/dashboardList.js | 18 ++++++++++-------- .../strategicDashboard/formDashboard.js | 17 ++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/workflow/engine/templates/strategicDashboard/dashboardList.js b/workflow/engine/templates/strategicDashboard/dashboardList.js index 0489446ce..8f6d51292 100644 --- a/workflow/engine/templates/strategicDashboard/dashboardList.js +++ b/workflow/engine/templates/strategicDashboard/dashboardList.js @@ -76,6 +76,8 @@ Ext.onReady(function() { statusButton = new Ext.Action({ text: _('ID_STATUS'), + icon : '', + id : 'activator', iconCls: 'silk-add', handler: statusDashboard, disabled: true @@ -105,19 +107,19 @@ Ext.onReady(function() { } } + var activator = Ext.getCmp('activator'); + if( record.data.DAS_STATUS == 1 ){ - statusButton.setIconClass('icon-activate'); - statusButton.setText( _('ID_DEACTIVATE') ); + activator.setIcon('/images/deactivate.png'); + activator.setText( _('ID_DEACTIVATE') ); editButton.enable(); deleteButton.enable(); - //statusButton.enable(); } else { - statusButton.setIconClass('icon-deactivate'); - statusButton.setText( _('ID_ACTIVATE') ); + activator.setIcon('/images/activate.png'); + activator.setText( _('ID_ACTIVATE') ); editButton.disable(); deleteButton.disable(); - //statusButton.disable(); - } + } }, rowdeselect: function(sm, index, record){ editButton.disable(); @@ -237,7 +239,7 @@ Ext.onReady(function() { viewConfig: { forceFit:true }, - title : _('ID_DASHBOARD'), + title : _('ID_STRATEGIC_DASHBOARD'), store: store, cm: cmodel, sm: smodel, diff --git a/workflow/engine/templates/strategicDashboard/formDashboard.js b/workflow/engine/templates/strategicDashboard/formDashboard.js index 8893a9f56..4133255cb 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; @@ -79,7 +78,7 @@ Ext.onReady( function() { items : [ { id : 'DAS_TITLE', - fieldLabel : _('ID_DASHBOARD_TITLE')+ ' *', + fieldLabel : ' * ' + _('ID_DASHBOARD_TITLE'), xtype : 'textfield', anchor : '85%', maxLength : 250, @@ -297,7 +296,7 @@ Ext.onReady( function() { } }); - storeFrecuency = new Ext.data.GroupingStore( { + storeFrequency = new Ext.data.GroupingStore( { proxy : new Ext.data.HttpProxy({ api: { read : urlProxy + 'catalog/periodicity' @@ -754,7 +753,7 @@ var addTab = function (flag) { hidden : true }, { - fieldLabel : _('ID_INDICATOR_TITLE')+ ' *', + fieldLabel : ' * ' + _('ID_INDICATOR_TITLE'), id : 'IND_TITLE_'+ indexTab, xtype : 'textfield', anchor : '85%', @@ -768,7 +767,7 @@ var addTab = function (flag) { anchor : '85%', editable : false, id : 'IND_TYPE_'+ indexTab, - fieldLabel : _('ID_INDICATOR_TYPE')+ ' *', + fieldLabel : ' * ' + _('ID_INDICATOR_TYPE'), displayField : 'CAT_LABEL_ID', valueField : 'CAT_UID', forceSelection : false, @@ -880,7 +879,7 @@ var addTab = function (flag) { new Ext.form.ComboBox({ anchor : '85%', editable : false, - fieldLabel : _('ID_PROCESS')+ ' *', + fieldLabel : ' * ' + _('ID_PROCESS'), id : 'IND_PROCESS_'+ indexTab, displayField : 'prj_name', valueField : 'prj_uid', @@ -923,7 +922,7 @@ var addTab = function (flag) { typeAhead : true, autocomplete : true, triggerAction : 'all', - store : storeFrecuency + store : storeFrequency }), new Ext.form.ComboBox({ anchor : '85%', @@ -955,7 +954,7 @@ var addTab = function (flag) { typeAhead : true, autocomplete : true, triggerAction : 'all', - store : storeFrecuency + store : storeFrequency }) ] }) From 7705a9852a3bad357cc1bf53a403490e2ee682bc Mon Sep 17 00:00:00 2001 From: Dante Date: Mon, 27 Apr 2015 16:15:06 -0400 Subject: [PATCH 04/22] NDD-54, NDD-46, NDD-53 --- gulliver/js/pmchart/pmCharts.js | 7 +- .../viewDashboardPresenter.js | 133 +++++++----------- .../strategicDashboard/viewDashboardView.js | 56 ++++++-- .../strategicDashboard/formDashboard.js | 68 ++++----- .../strategicDashboard/viewDashboard.html | 60 ++++++-- 5 files changed, 175 insertions(+), 149 deletions(-) diff --git a/gulliver/js/pmchart/pmCharts.js b/gulliver/js/pmchart/pmCharts.js index 434174dfc..e0be418c8 100644 --- a/gulliver/js/pmchart/pmCharts.js +++ b/gulliver/js/pmchart/pmCharts.js @@ -109,7 +109,6 @@ BarChart.prototype.drawBars = function(data, canvas, param) { var currObj = this; if (data == null || data.length == 0) { - console.log(graphDim); canvas.append("text") .attr('class','pm-charts-no-draw') .attr("y", graphDim.height/2) @@ -1204,7 +1203,7 @@ PieChart.prototype.drawPie2D = function (dataset, canvas, param) { }); gradients.enter().append("svg:radialGradient") .attr("id", function (d, i) { - return "gradient" + d.datalabel; + return "gradient" + i; }) .attr("class", "gradient") .attr("xlink:href", "#master"); @@ -1245,7 +1244,7 @@ PieChart.prototype.drawPie2D = function (dataset, canvas, param) { // Each sector will refer to its gradient fill paths.attr("fill", function (d, i) { - return "url(#gradient" + d.data.datalabel + ")"; + return "url(#gradient" + i + ")"; }) .transition().duration(1000).attrTween("d", tweenIn).each("end", function () { this._listenToEvents = true; @@ -1549,7 +1548,7 @@ Pie3DChart.prototype.drawPie3D = function (data, canvas, param) { .enter() .append("text") .attr("x", w + 30) - .attr("class", "pie-label") + .attr("class", "legend") //.attr("y",i*10+50) .text(function (d, i) { return d.datalabel + " - " + getPercent(d.value * 1) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js index 435c4f8ba..a9400dbd1 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js @@ -164,24 +164,7 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) { "inefficiencyCost" : "value" }; var newObject = that.helper.merge(originalObject, {}, map); - var shortLabel = (newObject.datalabel == null) - ? "" - : newObject.datalabel.substring(0,15); - - newObject.datalabel = shortLabel; - - //use positive values for drawing; - if (newObject.value > 0) { - newObject.value = 0; - } - if (newObject.value < 0) { - newObject.value = Math.abs(newObject.value); - } - - if (newObject.value > 0) { - graphData.push(newObject); - } - + graphData.push(newObject); originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; originalObject.indicatorId = data.id; @@ -190,13 +173,9 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) { var retval = {}; retval = data; - graphData.sort(function(a,b) { - var retval = 0; - retval = ((a.value*1.0 <= b.value*1.0) ? -1 : 1); - return retval; - }) - retval.dataToDraw = graphData.splice(0,7); + this.makeShortLabel(graphData, 12); + retval.dataToDraw = this.adaptGraphData(graphData); //TODO aumentar el símbolo de moneda $ retval.inefficiencyCostToShow = "$ " +Math.round(retval.inefficiencyCost); @@ -216,22 +195,7 @@ ViewDashboardPresenter.prototype.ueiViewModel = function(data) { "deviationTime" : "dispersion" }; var newObject = that.helper.merge(originalObject, {}, map); - var shortLabel = (newObject.datalabel == null) - ? "" - : newObject.datalabel.substring(0,7); - - newObject.datalabel = shortLabel; - //use positive values for drawing; - if (newObject.value > 0) { - newObject.value = 0; - } - if (newObject.value < 0) { - newObject.value = Math.abs(newObject.value); - } - - if (newObject.value > 0) { - graphData.push(newObject); - } + graphData.push(newObject); originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; originalObject.indicatorId = data.id; @@ -240,12 +204,8 @@ ViewDashboardPresenter.prototype.ueiViewModel = function(data) { var retval = {}; retval = data; - graphData.sort(function(a,b) { - var retval = 0; - retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1); - return retval; - }) - retval.dataToDraw = graphData.splice(0,7); + this.makeShortLabel(graphData, 10); + retval.dataToDraw = this.adaptGraphData(graphData); //TODO aumentar el símbolo de moneda $ retval.inefficiencyCostToShow = "$ " + Math.round(retval.inefficiencyCost); @@ -268,15 +228,15 @@ ViewDashboardPresenter.prototype.statusViewModel = function(indicatorId, data) { //TODO Do not use the str. replace when color and lable in pie 2D is solved. var newObject1 = { - datalabel : title.trim().replace(" ", "_"), + datalabel : title, value : originalObject.percentageTotalOverdue }; var newObject2 = { - datalabel : title.trim().replace(" ", "_"), + datalabel : title, value : originalObject.percentageTotalAtRisk }; var newObject3 = { - datalabel : title.trim().replace(" ", "_"), + datalabel : title, value : originalObject.percentageTotalOnTime }; @@ -299,7 +259,6 @@ ViewDashboardPresenter.prototype.statusViewModel = function(indicatorId, data) { retval.graph2Data = this.orderGraphData(graph2Data, "down").splice(0,7) retval.graph3Data = this.orderGraphData(graph3Data, "down").splice(0,7) //TODO correct 2D Pie so we don't depend on label name - $.each(retval.graph1Data, function(index, item) { item.datalabel = (index + 1) + "." + item.datalabel; }); $.each(retval.graph2Data, function(index, item) { item.datalabel = (index + 1) + "." + item.datalabel; }); $.each(retval.graph3Data, function(index, item) { item.datalabel = (index + 1) + "." + item.datalabel; }); @@ -370,29 +329,15 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelPei = function(modelD "deviationTime" : "dispersion" }; var newObject = that.helper.merge(originalObject, {}, map); - newObject.datalabel = ((newObject.datalabel == null) ? "" : newObject.datalabel.substring(0, 7)); originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime); - //use positive values for drawing; - if (newObject.value > 0) { - newObject.value = 0; - } - if (newObject.value < 0) { - newObject.value = Math.abs(newObject.value); - } - - if (newObject.value > 0) { - graphData.push(newObject); - } + originalObject.rankToShow = originalObject.rank + "/" + modelData.length; + graphData.push(newObject); }); var retval = {}; - graphData.sort(function(a,b) { - var retval = 0; - retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1); - return retval; - }) - retval.dataToDraw = graphData.splice(0,7); + this.makeShortLabel(graphData, 10); + retval.dataToDraw = this.adaptGraphData(graphData); retval.entityData = modelData; return retval; }; @@ -411,30 +356,16 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelUei = function(modelD "deviationTime" : "dispersion" }; var newObject = that.helper.merge(originalObject, {}, map); - newObject.datalabel = ((newObject.datalabel == null) ? "" : newObject.datalabel.substring(0, 7)); originalObject.inefficiencyCostToShow = "$ " +Math.round(originalObject.inefficiencyCost); originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100; originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime); - //use positive values for drawing; - if (newObject.value > 0) { - newObject.value = 0; - } - if (newObject.value < 0) { - newObject.value = Math.abs(newObject.value); - } - - if (newObject.value > 0) { - graphData.push(newObject); - } + originalObject.rankToShow = originalObject.rank + "/" + modelData.length; + graphData.push(newObject); }); var retval = {}; - graphData.sort(function(a,b) { - var retval = 0; - retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1); - return retval; - }) - retval.dataToDraw = graphData.splice(0,7); + this.makeShortLabel(graphData, 10); + retval.dataToDraw = this.adaptGraphData(graphData); retval.entityData = modelData; return retval; }; @@ -479,3 +410,33 @@ ViewDashboardPresenter.prototype.orderGraphData = function(listData, orderDirect } return listData.sort(orderToUse); } + +ViewDashboardPresenter.prototype.adaptGraphData = function(listData) { + var workList = this.orderGraphData(listData, "up"); + var newList = []; + $.each(workList, function(index, item) { + item.datalabel = (index + 1) + "." + item.datalabel; + //use positive values for drawing; + if (item.value > 0) { + item.value = 0; + } + if (item.value < 0) { + item.value = Math.abs(item.value); + } + + if (item.value > 0) { + newList.push(item); + } + }); + return newList.splice(0,7); +} + +ViewDashboardPresenter.prototype.makeShortLabel = function(listData, labelLength) { + $.each(listData, function(index, item) { + var shortLabel = (item.datalabel == null) + ? "" + : item.datalabel.substring(0,labelLength); + item.datalabel = shortLabel; + item.datalabel = shortLabel; + }); +} diff --git a/workflow/engine/js/strategicDashboard/viewDashboardView.js b/workflow/engine/js/strategicDashboard/viewDashboardView.js index 0cec9c51e..3c919494f 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardView.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardView.js @@ -141,13 +141,41 @@ WidgetBuilder.prototype.buildSpecialIndicatorSecondView = function (secondViewDa return $retval; }; -WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetail = function (oneItemDetail) { +WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetailPei = function (oneItemDetail) { if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} _.templateSettings.variable = "detailData"; - var template = _.template ($("script.specialIndicatorSencondViewDetail").html()); + var template = _.template ($("script.specialIndicatorSecondViewDetailPei").html()); + var $retval = $(template(oneItemDetail)); + $retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail); + return $retval; +} + +WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetailUei = function (oneItemDetail) { + if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} + if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} + if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} + + _.templateSettings.variable = "detailData"; + var template = _.template ($("script.specialIndicatorSecondViewDetailUei").html()); + var $retval = $(template(oneItemDetail)); + $retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX); + $retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); + this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail); + return $retval; +} + +WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetaiUei = function (oneItemDetail) { + if (oneItemDetail == null){throw new Error("oneItemDetail is null ");} + if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);} + if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);} + + _.templateSettings.variable = "detailData"; + var template = _.template ($("script.specialIndicatorSencondViewDetailUei").html()); var $retval = $(template(oneItemDetail)); $retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX); $retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST); @@ -281,6 +309,7 @@ $(document).ready(function() { 'height': item.height <= 1 ? 2 : item.height } widgets.push(widgetsObj); + console.log(widgetsObj); } }); @@ -587,8 +616,8 @@ var fillSpecialIndicatorFirstView = function(presenterData) { graph: { allowDrillDown:false, allowTransition:true, - axisX:{ showAxis: true, label: G_STRING.ID_GROUPS}, - axisY:{ showAxis: true, label: G_STRING.ID_COSTS}, + axisX:{ showAxis: true, label: "Group" }, + axisY:{ showAxis: true, label: "Cost" }, gridLinesX:false, gridLinesY:true, showTip: true, @@ -669,8 +698,8 @@ var fillSpecialIndicatorSecondView = function(presenterData) { gridLinesX: true, gridLinesY: true, area: {visible: false, css:"area"}, - axisX:{ showAxis: true, label: G_STRING.ID_USER }, - axisY:{ showAxis: true, label: G_STRING.ID_COSTS }, + axisX:{ showAxis: true, label: "User" }, + axisY:{ showAxis: true, label: "Cost" }, showErrorBars: true } @@ -679,7 +708,7 @@ var fillSpecialIndicatorSecondView = function(presenterData) { var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(window.currentEntityData.indicatorId); if (window.currentIndicator.type == "1010") { - detailParams.graph.axisX.label = G_STRING.ID_TASK; + detailParams.graph.axisX.label = "Task"; var graph = new BarChart(presenterData.dataToDraw, detailParams, null, null); graph.drawChart(); } @@ -704,7 +733,14 @@ var fillSpecialIndicatorSecondViewDetail = function (list) { window.currentDetailFunction = fillSpecialIndicatorSecondViewDetail; $.each(list, function(index, dataItem) { - var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetail(dataItem); + if (window.currentIndicator.type == "1010") { + var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetailPei(dataItem); + } + + if (window.currentIndicator.type == "1030") { + var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetailUei(dataItem); + } + var x = (index % 2 == 0) ? 6 : 0; //the first 2 elements are not hidden if (index < 2) { @@ -788,7 +824,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) { allowDrillDown:false, allowTransition:true, axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, - axisY:{ showAxis: true, label: G_STRING.ID_COSTS}, + axisY:{ showAxis: true, label: "Q" }, gridLinesX:false, gridLinesY:true, showTip: true, @@ -810,7 +846,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) { allowDrillDown:false, allowTransition:true, axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, - axisY:{ showAxis: true, label: G_STRING.ID_COSTS }, + axisY:{ showAxis: true, label: "Q" }, gridLinesX:false, gridLinesY:true, showTip: true, diff --git a/workflow/engine/templates/strategicDashboard/formDashboard.js b/workflow/engine/templates/strategicDashboard/formDashboard.js index 8893a9f56..ab4025611 100644 --- a/workflow/engine/templates/strategicDashboard/formDashboard.js +++ b/workflow/engine/templates/strategicDashboard/formDashboard.js @@ -79,13 +79,11 @@ 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]+)$/, - regex : /([a-zA-Z0-9_'\s]+)$/, - regexText : _('ID_INVALID_VALUE', _('ID_DASHBOARD_TITLE')), + maskRe : /([a-zA-Z0-9\s]+)$/, allowBlank : false }, { @@ -94,7 +92,7 @@ Ext.onReady( function() { fieldLabel : _('ID_DESCRIPTION'), labelSeparator : '', anchor : '85%', - maskRe : /([a-zA-Z0-9_'\s]+)$/, + maskRe : /([a-zA-Z0-9\s]+)$/, height : 50, } ] @@ -530,14 +528,13 @@ 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, true); + tabPanel.remove(component); break; } }, @@ -674,6 +671,7 @@ Ext.onReady( function() { ] }); + ownerInfoGrid.store.load(); ownerInfoGrid.on("afterrender", function(component) { component.getBottomToolbar().refresh.hideParent = true; component.getBottomToolbar().refresh.hide(); @@ -700,7 +698,6 @@ 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 = []; @@ -754,13 +751,11 @@ var addTab = function (flag) { hidden : true }, { - fieldLabel : _('ID_INDICATOR_TITLE')+ ' *', + 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')), + maskRe : /([a-zA-Z0-9\s]+)$/, maxLength : 250, allowBlank : false }, @@ -768,7 +763,7 @@ var addTab = function (flag) { anchor : '85%', editable : false, id : 'IND_TYPE_'+ indexTab, - fieldLabel : _('ID_INDICATOR_TYPE')+ ' *', + fieldLabel : _('ID_INDICATOR_TYPE'), displayField : 'CAT_LABEL_ID', valueField : 'CAT_UID', forceSelection : false, @@ -787,7 +782,6 @@ var addTab = function (flag) { 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 { @@ -880,17 +874,18 @@ var addTab = function (flag) { new Ext.form.ComboBox({ anchor : '85%', editable : false, - fieldLabel : _('ID_PROCESS')+ ' *', + fieldLabel : _('ID_PROCESS'), id : 'IND_PROCESS_'+ indexTab, displayField : 'prj_name', valueField : 'prj_uid', - forceSelection : true, + forceSelection : false, emptyText : _('ID_EMPTY_PROCESSES'), selectOnFocus : true, hidden : true, typeAhead : true, autocomplete : true, triggerAction : 'all', + value : '0', store : storeProject }), new Ext.form.ComboBox({ @@ -1091,6 +1086,7 @@ var saveDashboard = function () { }, data: JSON.stringify(data), success: function (response) { + var jsonResp = Ext.util.JSON.decode(response.responseText); saveAllDashboardOwner(DAS_UID); saveAllIndicators(DAS_UID); myMask.hide(); @@ -1113,25 +1109,11 @@ var saveAllIndicators = function (DAS_UID) { tabPanel.getItem(tabActivate[tab]).show(); 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]; fieldsTab.push(goal.items.items[0]); fieldsTab.push(goal.items.items[1]); - var data = []; + data = []; data['DAS_UID'] = DAS_UID; for (var index in fieldsTab) { @@ -1140,12 +1122,12 @@ var saveAllIndicators = function (DAS_UID) { continue; } - var id = node.id; + id = node.id; if (typeof id == 'undefined' || id.indexOf('fieldSet_') != -1 ) { continue; } id = id.split('_'); - var field = ''; + field = ''; for (var part = 0; part + + - + + + - +
@@ -418,7 +449,6 @@
- From eda9767c0657ff6ee8cc85fb145893fbd8cb1762 Mon Sep 17 00:00:00 2001 From: Dante Date: Mon, 27 Apr 2015 16:53:49 -0400 Subject: [PATCH 05/22] NDD-60 --- .../engine/js/strategicDashboard/viewDashboardPresenter.js | 4 ++-- workflow/public_html/css/general.css | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js index a9400dbd1..9e1215129 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardPresenter.js @@ -100,7 +100,7 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) { //to be sure that percentages sum up to 100 (the rounding will lost decimals)% newObject.percentageOnTime = 100 - newObject.percentageOverdue - newObject.percentageAtRisk; newObject.overdueVisibility = (newObject.percentageOverdue > 0)? "visible" : "hidden"; - newObject.atRiskVisiblity = (newObject.percentageAtRisk > 0)? "visible" : "hidden"; + newObject.atRiskVisibility = (newObject.percentageAtRisk > 0)? "visible" : "hidden"; newObject.onTimeVisibility = (newObject.percentageOnTime > 0)? "visible" : "hidden"; returnList.push(newObject); i++; @@ -174,7 +174,7 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) { var retval = {}; retval = data; - this.makeShortLabel(graphData, 12); + this.makeShortLabel(graphData, 10); retval.dataToDraw = this.adaptGraphData(graphData); //TODO aumentar el símbolo de moneda $ diff --git a/workflow/public_html/css/general.css b/workflow/public_html/css/general.css index 620198892..fe3b6f558 100644 --- a/workflow/public_html/css/general.css +++ b/workflow/public_html/css/general.css @@ -39,8 +39,7 @@ .status-indicator-low, .status-indicator-medium, .status-indicator-high { - padding:0px; - padding-top:30px; + padding:30px 0px 0px 0; color:#444; float:left; } From 1622060e24ea2031690ab798b4a4449f4e275eda Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Mon, 27 Apr 2015 17:05:44 -0400 Subject: [PATCH 06/22] =?UTF-8?q?NDD-51=20C=C3=A1lculo=20del=20DEL=5FRISK?= =?UTF-8?q?=20es=20erroneo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - cambio de tiempo de duracion para el calculo correcto. --- .../engine/classes/model/AppDelegation.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/workflow/engine/classes/model/AppDelegation.php b/workflow/engine/classes/model/AppDelegation.php index 388d48542..91b444eef 100755 --- a/workflow/engine/classes/model/AppDelegation.php +++ b/workflow/engine/classes/model/AppDelegation.php @@ -133,7 +133,7 @@ class AppDelegation extends BaseAppDelegation //The function return an array now. By JHL $delTaskDueDate = $this->calculateDueDate($sNextTasParam); - $delRiskDate = $this->calculateRiskDate($delTaskDueDate, $this->getRisk()); + $delRiskDate = $this->calculateRiskDate($sNextTasParam, $this->getRisk()); //$this->setDelTaskDueDate( $delTaskDueDate['DUE_DATE'] ); // Due date formatted $this->setDelTaskDueDate($delTaskDueDate); @@ -379,8 +379,18 @@ class AppDelegation extends BaseAppDelegation public function calculateRiskDate($dueDate, $risk) { try { - $riskTime = strtotime($dueDate) - strtotime($this->getDelDelegateDate()); //Seconds - $riskTime = $riskTime - ($riskTime * $risk); + + $data = array(); + if (isset( $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] ) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') { + $data['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION']; + $data['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT']; + } else { + $task = TaskPeer::retrieveByPK( $this->getTasUid() ); + $data['TAS_DURATION'] = $task->getTasDuration(); + $data['TAS_TIMEUNIT'] = $task->getTasTimeUnit(); + } + + $riskTime = $data['TAS_DURATION'] - ($data['TAS_DURATION'] * $risk); //Calendar - Use the dates class to calculate dates $calendar = new calendar(); @@ -394,9 +404,8 @@ class AppDelegation extends BaseAppDelegation } //Risk date - $riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), round($riskTime / (60 * 60)), "HOURS", $arrayCalendarData); + $riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), round($riskTime), $data['TAS_TIMEUNIT'], $arrayCalendarData); - //Return return $riskDate; } catch (Exception $e) { throw $e; From 69c0acbf3be17e09f19d2e945fbe86a0c54156cc Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Mon, 27 Apr 2015 17:21:37 -0400 Subject: [PATCH 07/22] =?UTF-8?q?PM-2493=20"Home>New=20Case:=20El=20mensaj?= =?UTF-8?q?e=20The=20case=20will=20be..."=20SOLVED=20>=20Code=20Isuue:=20?= =?UTF-8?q?=20=20Home=20>=20New=20Case:=20El=20mensaje=20"The=20case=20wil?= =?UTF-8?q?l=20be=20paused=20until=20you=20receive=20the=20corresponding?= =?UTF-8?q?=20message"=20deber=C3=A1eflejarse=20al=20medio=20del=20contene?= =?UTF-8?q?dor=20>=20Solution:=20=20=20Se=20corrige=20el=20posicionamiento?= =?UTF-8?q?=20del=20mensaje=20con=20alineacion=20centrada.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workflow/engine/templates/cases/cases_ScreenDerivation.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/workflow/engine/templates/cases/cases_ScreenDerivation.html b/workflow/engine/templates/cases/cases_ScreenDerivation.html index 6cb5122e2..4ad2fe413 100755 --- a/workflow/engine/templates/cases/cases_ScreenDerivation.html +++ b/workflow/engine/templates/cases/cases_ScreenDerivation.html @@ -68,8 +68,7 @@ {else} - - {$data.NEXT_TASK.TAS_TITLE}{$data.NEXT_TASK.TAS_HIDDEN_FIELD} + {$data.NEXT_TASK.TAS_TITLE}{$data.NEXT_TASK.TAS_HIDDEN_FIELD} {/if} {/if} @@ -93,8 +92,7 @@ {else} - - {$data.NEXT_TASK.USR_HIDDEN_FIELD} + {$data.NEXT_TASK.USR_HIDDEN_FIELD} {/if} {/if} From f60ed87fcd8f3c922dbacdff6a455eec76d704cb Mon Sep 17 00:00:00 2001 From: Dante Date: Mon, 27 Apr 2015 17:26:14 -0400 Subject: [PATCH 08/22] hide scroll --- .../strategicDashboard/viewDashboardView.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardView.js b/workflow/engine/js/strategicDashboard/viewDashboardView.js index 3c919494f..6aebaab0d 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardView.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardView.js @@ -395,10 +395,27 @@ var hideScrollIfAllDivsAreVisible = function(){ $('#scrollImg').hide(); } else { + $('#scrollImg').css('visibility', 'visible'); $('#scrollImg').show(); } } +var hideTitleAndSortDiv = function(){ + if (window.currentIndicator == null) { + $('#relatedLabel').hide(); + } + switch (window.currentIndicator.type) { + case "1010": + case "1030": + $('#relatedLabel').css('visibility', 'visible'); + $('#relatedLabel').show(); + break; + default: + $('#relatedLabel').hide(); + break; + } +} + var selectedOrderOfDetailList = function () { return ($('#sortListButton').hasClass('fa-chevron-up') ? "up" : "down"); } @@ -436,6 +453,8 @@ var loadIndicator = function (indicatorId, initDate, endDate) { break; } }); + hideScrollIfAllDivsAreVisible(); + hideTitleAndSortDiv(); } var setIndicatorActiveMarker = function () { @@ -555,7 +574,6 @@ var fillStatusIndicatorFirstView = function (presenterData) { var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id) setIndicatorActiveMarker(); - $('#relatedLabel').hide(); } var fillStatusIndicatorFirstViewDetail = function(presenterData) { @@ -579,7 +597,6 @@ var fillStatusIndicatorFirstViewDetail = function(presenterData) { } var fillSpecialIndicatorFirstView = function(presenterData) { - $('#relatedLabel').show(); var widgetBuilder = new WidgetBuilder(); var panel = $('#indicatorsDataGridStack').data('gridstack'); panel.remove_all(); From 63499fc3e7883edfc19cd993b3d649939e1934f9 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Tue, 28 Apr 2015 10:13:10 -0400 Subject: [PATCH 09/22] NDD-64 utiliza simbolo de moneda configurado - Se agrego al controller el valor de la configuracion del cost by hour del usuario actual. --- .../engine/controllers/strategicDashboard.php | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/workflow/engine/controllers/strategicDashboard.php b/workflow/engine/controllers/strategicDashboard.php index f8ea0b7db..297cf9200 100644 --- a/workflow/engine/controllers/strategicDashboard.php +++ b/workflow/engine/controllers/strategicDashboard.php @@ -14,6 +14,7 @@ class StrategicDashboard extends Controller private $urlProxy; private $clientToken; private $usrId; + private $usrUnitCost; // Class constructor public function __construct () @@ -32,6 +33,13 @@ class StrategicDashboard extends Controller die; } $this->usrId = $RBAC->aUserInfo['USER_INFO']['USR_UID']; + $user = new Users(); + $user = $user->load($RBAC->aUserInfo['USER_INFO']['USR_UID']); + $this->usrUnitCost = '$'; + if (isset($user['USR_UNIT_COST'])) { + $this->usrUnitCost = $user['USR_UNIT_COST']; + } + $this->urlProxy = '/api/1.0/' . SYS_SYS . '/'; //change $clientId = 'x-pm-local-client'; @@ -170,13 +178,12 @@ class StrategicDashboard extends Controller } $this->setView( 'strategicDashboard/viewDashboard' ); - $this->setVar('urlProxy',$this->urlProxy); - $this->setVar('usrId',$this->usrId); - $this->setVar('credentials',$this->clientToken); + $this->setVar('urlProxy', $this->urlProxy); + $this->setVar('usrId', $this->usrId); + $this->setVar('credentials', $this->clientToken); + $this->setVar('unitCost', $this->usrUnitCost); $translation = array(); - - $translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation( 'ID_MANAGERS_DASHBOARDS'); $translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_PRO_EFFICIENCY_INDEX'); $translation['ID_EFFICIENCY_USER'] = G::LoadTranslation( 'ID_EFFICIENCY_USER'); @@ -215,12 +222,12 @@ class StrategicDashboard extends Controller { try { $this->setView( 'strategicDashboard/viewDashboardIE' ); - $this->setVar('urlProxy',$this->urlProxy); - $this->setVar('usrId',$this->usrId); - $this->setVar('credentials',$this->clientToken); + $this->setVar('urlProxy', $this->urlProxy); + $this->setVar('usrId', $this->usrId); + $this->setVar('credentials', $this->clientToken); + $this->setVar('unitCost', $this->usrUnitCost); $translation = array(); - $translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation( 'ID_MANAGERS_DASHBOARDS'); $translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_PRO_EFFICIENCY_INDEX'); $translation['ID_EFFICIENCY_USER'] = G::LoadTranslation( 'ID_EFFICIENCY_USER'); From c974a548d656158ace300e7e008a26930ac3ef42 Mon Sep 17 00:00:00 2001 From: Brayan Pereyra Date: Tue, 28 Apr 2015 10:13:20 -0400 Subject: [PATCH 10/22] PM-1339 No se puede ordenar las condiciones de enrutamiento del gateway Exclusive --- .../engine/src/ProcessMaker/Project/Bpmn.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/Project/Bpmn.php b/workflow/engine/src/ProcessMaker/Project/Bpmn.php index 8cb27df25..cefce6f69 100755 --- a/workflow/engine/src/ProcessMaker/Project/Bpmn.php +++ b/workflow/engine/src/ProcessMaker/Project/Bpmn.php @@ -1348,13 +1348,15 @@ class Bpmn extends Handler $oCriteria->add( \BpmnFlowPeer::FLO_POSITION, $iPosition, '>' ); $oDataset = \BpmnFlowPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); - $oDataset->next(); - $aRow = $oDataset->getRow(); - $oCriteria2 = new Criteria('workflow'); - $oCriteria2->add( \BpmnFlowPeer::FLO_POSITION, $aRow['FLO_POSITION'] - 1); - BasePeer::doUpdate($oCriteria, $oCriteria2, $con); - $oDataset->next(); - + while ($oDataset->next()) { + $aRow = $oDataset->getRow(); + $newPosition = ((int)$aRow['FLO_POSITION'])-1; + $oCriteriaTemp = new Criteria( 'workflow' ); + $oCriteriaTemp->add( \BpmnFlowPeer::FLO_UID, $aRow['FLO_UID'] ); + $oCriteria2 = new Criteria('workflow'); + $oCriteria2->add(\BpmnFlowPeer::FLO_POSITION, $newPosition); + BasePeer::doUpdate($oCriteriaTemp, $oCriteria2, $con); + } } catch (Exception $oException) { throw $oException; } From 4f06ad861186af84f8f9d5563fe0cb6a88da0e11 Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 28 Apr 2015 11:06:20 -0400 Subject: [PATCH 11/22] NDD-48, NDD-62, NDD-63 --- .../templates/strategicDashboard/viewDashboard.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/workflow/engine/templates/strategicDashboard/viewDashboard.html b/workflow/engine/templates/strategicDashboard/viewDashboard.html index f0cc30046..4ce4af3ff 100644 --- a/workflow/engine/templates/strategicDashboard/viewDashboard.html +++ b/workflow/engine/templates/strategicDashboard/viewDashboard.html @@ -106,7 +106,7 @@ - @@ -250,7 +251,7 @@
-
<%- detailData.inefficiencyCostToShow%>
+
{$unitCost}<%- detailData.inefficiencyCostToShow%>
From ca215a733293f880c03c7aaae9db59887c55eb29 Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 28 Apr 2015 11:49:58 -0400 Subject: [PATCH 13/22] NDD-65 --- .../engine/controllers/strategicDashboard.php | 1 + .../strategicDashboard/viewDashboard.html | 2 +- .../strategicDashboard/viewDashboardIE.html | 16 ++++++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/workflow/engine/controllers/strategicDashboard.php b/workflow/engine/controllers/strategicDashboard.php index 297cf9200..25abf3a44 100644 --- a/workflow/engine/controllers/strategicDashboard.php +++ b/workflow/engine/controllers/strategicDashboard.php @@ -210,6 +210,7 @@ class StrategicDashboard extends Controller $translation['ID_OVERDUE'] = G::LoadTranslation( 'ID_OVERDUE'); $translation['ID_AT_RISK'] = G::LoadTranslation( 'ID_AT_RISK'); $translation['ID_ON_TIME'] = G::LoadTranslation( 'ID_ON_TIME'); + $this->setVar('translation', $translation); $this->render(); } catch (Exception $error) { diff --git a/workflow/engine/templates/strategicDashboard/viewDashboard.html b/workflow/engine/templates/strategicDashboard/viewDashboard.html index 77056f68f..30af215f1 100644 --- a/workflow/engine/templates/strategicDashboard/viewDashboard.html +++ b/workflow/engine/templates/strategicDashboard/viewDashboard.html @@ -437,7 +437,7 @@

- Sort by Cost:   + {translate label="ID_SORT_BY"} {translate label="ID_COSTS"} :  
diff --git a/workflow/engine/templates/strategicDashboard/viewDashboardIE.html b/workflow/engine/templates/strategicDashboard/viewDashboardIE.html index 469c58ade..b900066b6 100644 --- a/workflow/engine/templates/strategicDashboard/viewDashboardIE.html +++ b/workflow/engine/templates/strategicDashboard/viewDashboardIE.html @@ -343,7 +343,7 @@
This is just a basic view of your indexes. For better compatibility with Internet Explorer, a new tab with the KPIs has been opened. Please select this new tab on the tab list above to see all our KPIs functionality.
- + + [> Split button <]

@@ -411,19 +411,19 @@ - + [> /.col-lg-12 <] - + [> Indicators <]
- + [>Here are added dynamically the Indicators<]
- + [> Details by Indicator <]
- + [>Here are added dynamically the Dat by indicator<]
@@ -441,7 +441,7 @@ data-gs-animate="no" style="clear:both;">
- + --> From b7ec10b4b73fd46fa6a9d4b44a92a441f951f5aa Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 28 Apr 2015 12:04:08 -0400 Subject: [PATCH 14/22] label in pies 2D hidden --- workflow/engine/js/strategicDashboard/viewDashboardView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardView.js b/workflow/engine/js/strategicDashboard/viewDashboardView.js index 6aebaab0d..ffd00719b 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardView.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardView.js @@ -555,7 +555,7 @@ var fillStatusIndicatorFirstView = function (presenterData) { allowDrillDown:true, allowTransition:true, - showTip: true, + showTip: false, allowZoom: false, showLabels: true } From 2d221e5c78cf7f531b54406d2526df2c455b7af5 Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 28 Apr 2015 12:18:38 -0400 Subject: [PATCH 15/22] console log deletion --- workflow/engine/js/strategicDashboard/viewDashboardView.js | 1 - 1 file changed, 1 deletion(-) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardView.js b/workflow/engine/js/strategicDashboard/viewDashboardView.js index ffd00719b..51a72a94c 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardView.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardView.js @@ -309,7 +309,6 @@ $(document).ready(function() { 'height': item.height <= 1 ? 2 : item.height } widgets.push(widgetsObj); - console.log(widgetsObj); } }); From 645be2e47171bd841faaf3ce94a2e5e47756d321 Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 28 Apr 2015 12:32:42 -0400 Subject: [PATCH 16/22] At risk, overdue labels not hardcoded --- .../engine/templates/strategicDashboard/viewDashboard.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow/engine/templates/strategicDashboard/viewDashboard.html b/workflow/engine/templates/strategicDashboard/viewDashboard.html index 30af215f1..de456882e 100644 --- a/workflow/engine/templates/strategicDashboard/viewDashboard.html +++ b/workflow/engine/templates/strategicDashboard/viewDashboard.html @@ -273,15 +273,15 @@
<%- detailData.percentageOverdue%> %
-
Overdue
+
{translate label="ID_OVERDUE"}
<%- detailData.percentageAtRisk%> %
-
At Risk
+
{translate label="ID_AT_RISK"}
<%- detailData.percentageOnTime%> %
-
On Time
+
{translate label="ID_ON_TIME"}
From 925aa82016f399141a1ac8be9048d5bc918c0fc9 Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 28 Apr 2015 14:55:51 -0400 Subject: [PATCH 17/22] hardcoded strings in view --- .../js/strategicDashboard/viewDashboardView.js | 14 +++++++------- .../strategicDashboard/viewDashboard.html | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/workflow/engine/js/strategicDashboard/viewDashboardView.js b/workflow/engine/js/strategicDashboard/viewDashboardView.js index 51a72a94c..d62c6fc20 100644 --- a/workflow/engine/js/strategicDashboard/viewDashboardView.js +++ b/workflow/engine/js/strategicDashboard/viewDashboardView.js @@ -632,8 +632,8 @@ var fillSpecialIndicatorFirstView = function(presenterData) { graph: { allowDrillDown:false, allowTransition:true, - axisX:{ showAxis: true, label: "Group" }, - axisY:{ showAxis: true, label: "Cost" }, + axisX:{ showAxis: true, label: G_STRING['ID_GROUPS']}, + axisY:{ showAxis: true, label: G_STRING['ID_COSTS']}, gridLinesX:false, gridLinesY:true, showTip: true, @@ -714,8 +714,8 @@ var fillSpecialIndicatorSecondView = function(presenterData) { gridLinesX: true, gridLinesY: true, area: {visible: false, css:"area"}, - axisX:{ showAxis: true, label: "User" }, - axisY:{ showAxis: true, label: "Cost" }, + axisX:{ showAxis: true, label: G_STRING['ID_USER'] }, + axisY:{ showAxis: true, label: G_STRING['ID_COSTS'] }, showErrorBars: true } @@ -724,7 +724,7 @@ var fillSpecialIndicatorSecondView = function(presenterData) { var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(window.currentEntityData.indicatorId); if (window.currentIndicator.type == "1010") { - detailParams.graph.axisX.label = "Task"; + detailParams.graph.axisX.label = G_STRING['ID_TASK'] ; var graph = new BarChart(presenterData.dataToDraw, detailParams, null, null); graph.drawChart(); } @@ -840,7 +840,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) { allowDrillDown:false, allowTransition:true, axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, - axisY:{ showAxis: true, label: "Q" }, + axisY:{ showAxis: true, label: G_STRING.ID_TIME_HOURS }, gridLinesX:false, gridLinesY:true, showTip: true, @@ -862,7 +862,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) { allowDrillDown:false, allowTransition:true, axisX:{ showAxis: true, label: G_STRING.ID_YEAR }, - axisY:{ showAxis: true, label: "Q" }, + axisY:{ showAxis: true, label: G_STRING.ID_TIME_HOURS }, gridLinesX:false, gridLinesY:true, showTip: true, diff --git a/workflow/engine/templates/strategicDashboard/viewDashboard.html b/workflow/engine/templates/strategicDashboard/viewDashboard.html index de456882e..fcc046823 100644 --- a/workflow/engine/templates/strategicDashboard/viewDashboard.html +++ b/workflow/engine/templates/strategicDashboard/viewDashboard.html @@ -325,15 +325,15 @@
-
Overdue:
+
{translate label="ID_OVERDUE"}:
-
At Risk:
+
{translate label="ID_AT_RISK"}:
-
On Time:
+
{translate label="ID_ON_TIME"}:
From 3dd0a86903071630802d8b185a9df6e77da150a2 Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Tue, 28 Apr 2015 15:48:30 -0400 Subject: [PATCH 18/22] correcciones incidencias veracode --- gulliver/system/class.bootstrap.php | 12 +- gulliver/system/class.g.php | 25 +-- .../DefinitionCache/Serializer.php | 29 +++ gulliver/thirdparty/pear/Archive/Zip.php | 11 +- gulliver/thirdparty/pear/Log/syslog.php | 11 +- gulliver/thirdparty/pear/Log/win.php | 11 +- gulliver/thirdparty/pear/PEAR/Builder.php | 29 ++- .../thirdparty/pear/PEAR/Command/Package.php | 15 ++ gulliver/thirdparty/pear/PEAR/Common.php | 28 +++ gulliver/thirdparty/pear/PEAR/Installer.php | 37 ++-- gulliver/thirdparty/pear/PEAR/Registry.php | 27 +++ gulliver/thirdparty/pear/SOAP/Value.php | 11 +- gulliver/thirdparty/pear/SOAP/WSDL.php | 11 +- gulliver/thirdparty/phing/lib/Capsule.php | 12 +- gulliver/thirdparty/phing/lib/Zip.php | 11 +- gulliver/thirdparty/tcpdf/tcpdf.php | 11 +- workflow/engine/bin/cron.php | 6 + workflow/engine/bin/cron_single.php | 200 +++++++++--------- workflow/engine/bin/messageeventcron.php | 6 +- .../engine/bin/messageeventcron_single.php | 5 + workflow/engine/bin/reindex_solr.php | 13 +- workflow/engine/bin/verify_solr.php | 13 +- workflow/engine/controllers/installer.php | 12 ++ workflow/engine/methods/setup/setup.php | 5 +- workflow/engine/methods/setup/skin_Ajax.php | 13 +- .../BusinessModel/Consolidated.php | 6 +- workflow/engine/test/bootstrap/unit.php | 5 +- workflow/public_html/bootstrap.php | 7 + workflow/public_html/sysGeneric.php | 22 +- 29 files changed, 442 insertions(+), 162 deletions(-) diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 0edcae85b..d09defa5d 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -670,10 +670,18 @@ class Bootstrap */ public static function LoadClass($strClass) { + Bootstrap::LoadSystem('inputfilter'); + $filter = new InputFilter(); + + $path = PATH_GULLIVER . 'class.' . $strClass . '.php'; + $path = $filter->validateInput($path, "path"); + $classfile = Bootstrap::ExpandPath("classes") . 'class.' . $strClass . '.php'; + $classfile = $filter->validateInput($classfile, "path"); + if (!file_exists($classfile)) { - if (file_exists(PATH_GULLIVER . 'class.' . $strClass . '.php')) { - return require_once (PATH_GULLIVER . 'class.' . $strClass . '.php'); + if (file_exists($path)) { + return require_once ($path); } else { return false; } diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index ca57a81f0..d0d63551d 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -245,7 +245,7 @@ class G } $result = base64_encode( $result ); - $result = str_replace( '/', '°', $result ); + $result = str_replace( '/', '°', $result ); $result = str_replace( '=', '', $result ); return $result; } @@ -264,7 +264,7 @@ class G // if ( defined ( 'ENABLE_ENCRYPT' ) && ENABLE_ENCRYPT == 'yes' ) { //if (strpos($string, '|', 0) !== false) return $string; $result = ''; - $string = str_replace( '°', '/', $string ); + $string = str_replace( '°', '/', $string ); $string_jhl = explode( "?", $string ); $string = base64_decode( $string ); $string = base64_decode( $string_jhl[0] ); @@ -784,7 +784,7 @@ class G for ($i = 2; $i < count( $aRequestUri ); $i ++) { $decoded = G::decrypt( urldecode( $aRequestUri[$i] ), URL_KEY ); - if ($decoded == 'sWì›') { + if ($decoded == 'sWì›') { $decoded = $VARS[$i]; //this is for the string "../" } $plain .= '/' . $decoded; @@ -1349,7 +1349,7 @@ class G $lang = defined( SYS_LANG ) ? SYS_LANG : 'en'; } $aux = explode( ' ', $datetime ); //para dividir la fecha del dia - $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. + $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. $time = explode( ':', isset( $aux[1] ) ? $aux[1] : '00:00:00' ); //para obtener las horas, minutos, segundos. $date[0] = (int) ((isset( $date[0] )) ? $date[0] : '0'); $date[1] = (int) ((isset( $date[1] )) ? $date[1] : '0'); @@ -1365,7 +1365,7 @@ class G ); // Spanish days - $ARR_WEEKDAYS['es'] = array ("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado" + $ARR_WEEKDAYS['es'] = array ("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado" ); // English days $ARR_WEEKDAYS['en'] = array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" @@ -1461,7 +1461,7 @@ class G } $aux = explode( ' ', $date ); //para dividir la fecha del dia - $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. + $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. $time = explode( ':', isset( $aux[1] ) ? $aux[1] : '00:00:00' ); //para obtener las horas, minutos, segundos. $year = (int) ((isset( $date[0] )) ? $date[0] : '0'); //year @@ -2438,12 +2438,12 @@ class G $loginhtml = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( $aux[1] ), URL_KEY ) : $aux[1]); //header ("location: /$sys/$lang/$skin/$login/$loginhtml"); - header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); + header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); die(); } if ($sw == 0) { - header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); + header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); die(); } } @@ -2653,6 +2653,7 @@ class G G::LoadSystem('inputfilter'); $filter = new InputFilter(); $file = $filter->validateInput($file, "path"); + $path = $filter->validateInput($path, "path"); move_uploaded_file( $file, $path . "/" . $nameToSave ); @chmod( $path . "/" . $nameToSave, $permission ); @@ -2791,7 +2792,7 @@ class G /** * Generate a numeric or alphanumeric code * - * @author Julio Cesar Laura Avendaힼjuliocesar@colosa.com> + * @author Julio Cesar Laura Avendaíž¼juliocesar@colosa.com> * @access public * @return string */ @@ -3157,7 +3158,7 @@ class G $quotedReplacement = preg_quote( $replacement, '/' ); - $default = array ('/à|á|å|â/' => 'a','/è|é|ê|ẽ|ë/' => 'e','/ì|í|î/' => 'i','/ò|ó|ô|ø/' => 'o','/ù|ú|ů|û/' => 'u','/ç/' => 'c','/ñ/' => 'n','/ä|æ/' => 'ae','/ö/' => 'oe','/ü/' => 'ue','/Ä/' => 'Ae','/Ü/' => 'Ue','/Ö/' => 'Oe','/ß/' => 'ss','/\.|\,|\:|\-|\\|\//' => " ",'/\\s+/' => $replacement + $default = array ('/à |á|Ã¥|â/' => 'a','/è|é|ê|ẽ|ë/' => 'e','/ì|í|î/' => 'i','/ò|ó|ô|ø/' => 'o','/ù|ú|ů|û/' => 'u','/ç/' => 'c','/ñ/' => 'n','/ä|æ/' => 'ae','/ö/' => 'oe','/ü/' => 'ue','/Ä/' => 'Ae','/Ü/' => 'Ue','/Ö/' => 'Oe','/ß/' => 'ss','/\.|\,|\:|\-|\\|\//' => " ",'/\\s+/' => $replacement ); $map = array_merge( $default, $map ); @@ -5584,7 +5585,7 @@ class G { $strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]", "}", "\\", "|", ";", ":", "\"", "'", "‘", "’", "“", "”", "–", "—", - "—", "–", ",", "<", ".", ">", "/", "?"); + "—", "–", ",", "<", ".", ">", "/", "?"); $clean = trim(str_replace($strip, "", strip_tags($string))); $clean = preg_replace('/\s+/', "-", $clean); $clean = ($alpha) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ; @@ -5718,4 +5719,4 @@ function eprintln ($s = "", $c = null) function __ ($msgID, $lang = SYS_LANG, $data = null) { return G::LoadTranslation( $msgID, $lang, $data ); -} +} \ No newline at end of file diff --git a/gulliver/thirdparty/HTMLPurifier/HTMLPurifier/DefinitionCache/Serializer.php b/gulliver/thirdparty/HTMLPurifier/HTMLPurifier/DefinitionCache/Serializer.php index 2d52acfaa..e1f40e701 100644 --- a/gulliver/thirdparty/HTMLPurifier/HTMLPurifier/DefinitionCache/Serializer.php +++ b/gulliver/thirdparty/HTMLPurifier/HTMLPurifier/DefinitionCache/Serializer.php @@ -83,6 +83,21 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac if (!file_exists($file)) { return false; } + + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $file = $filter->validateInput($file,"path"); + return unlink($file); } @@ -182,6 +197,20 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac */ private function _write($file, $data, $config) { + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $file = $filter->validateInput($file,"path"); + if(is_file($file)) { $result = file_put_contents($file, $data); } else { diff --git a/gulliver/thirdparty/pear/Archive/Zip.php b/gulliver/thirdparty/pear/Archive/Zip.php index 631b7d070..e96111080 100755 --- a/gulliver/thirdparty/pear/Archive/Zip.php +++ b/gulliver/thirdparty/pear/Archive/Zip.php @@ -3602,7 +3602,16 @@ class Archive_Zip public function encryptCrc32($string) { - return crc32($string); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return G::encryptCrc32($string); } } diff --git a/gulliver/thirdparty/pear/Log/syslog.php b/gulliver/thirdparty/pear/Log/syslog.php index 0bc5a3466..93ce84efc 100755 --- a/gulliver/thirdparty/pear/Log/syslog.php +++ b/gulliver/thirdparty/pear/Log/syslog.php @@ -178,7 +178,16 @@ class Log_syslog extends Log public function encryptOld($string) { - return md5($string); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return G::encryptOld($string); } } diff --git a/gulliver/thirdparty/pear/Log/win.php b/gulliver/thirdparty/pear/Log/win.php index e267d3788..1f7d1ae62 100755 --- a/gulliver/thirdparty/pear/Log/win.php +++ b/gulliver/thirdparty/pear/Log/win.php @@ -268,7 +268,16 @@ EOT; public function encryptOld($string) { - return md5($string); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return G::encryptOld($string); } } diff --git a/gulliver/thirdparty/pear/PEAR/Builder.php b/gulliver/thirdparty/pear/PEAR/Builder.php index 9e3ab3411..cbd443d50 100755 --- a/gulliver/thirdparty/pear/PEAR/Builder.php +++ b/gulliver/thirdparty/pear/PEAR/Builder.php @@ -107,7 +107,20 @@ class PEAR_Builder extends PEAR_Common } else { return $this->raiseError("Did not understand the completion status returned from msdev.exe."); } - + + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $dsp = $filter->validateInput($dsp,"path"); // msdev doesn't tell us the output directory :/ // open the dsp, find /out and use that directory $dsptext = join(file($dsp),''); @@ -347,6 +360,20 @@ class PEAR_Builder extends PEAR_Common */ function _runCommand($command, $callback = null) { + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $command = $filter->validateInput($command); + $this->log(1, "running: $command"); $pp = @popen("$command 2>&1", "r"); if (!$pp) { diff --git a/gulliver/thirdparty/pear/PEAR/Command/Package.php b/gulliver/thirdparty/pear/PEAR/Command/Package.php index f7b24490f..fe1fe03ff 100755 --- a/gulliver/thirdparty/pear/PEAR/Command/Package.php +++ b/gulliver/thirdparty/pear/PEAR/Command/Package.php @@ -358,6 +358,21 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm $this->output .= "+ $command\n"; } $this->output .= "+ $command\n"; + + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $command = $filter->validateInput($command); + if (empty($options['dry-run'])) { $fp = popen($command, "r"); while ($line = fgets($fp, 1024)) { diff --git a/gulliver/thirdparty/pear/PEAR/Common.php b/gulliver/thirdparty/pear/PEAR/Common.php index 8c49511b3..88a4f6049 100755 --- a/gulliver/thirdparty/pear/PEAR/Common.php +++ b/gulliver/thirdparty/pear/PEAR/Common.php @@ -1218,6 +1218,20 @@ class PEAR_Common extends PEAR */ function analyzeSourceCode($file) { + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $file = $filter->validateInput($file,"path"); + if (!function_exists("token_get_all")) { return false; } @@ -1631,6 +1645,20 @@ class PEAR_Common extends PEAR } } $dest_file = $save_dir . DIRECTORY_SEPARATOR . $save_as; + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $dest_file = $filter->validateInput($dest_file,"path"); + if (!$wp = @fopen($dest_file, 'wb')) { fclose($fp); if ($callback) { diff --git a/gulliver/thirdparty/pear/PEAR/Installer.php b/gulliver/thirdparty/pear/PEAR/Installer.php index 9c8e15c95..0e7f9d7fa 100755 --- a/gulliver/thirdparty/pear/PEAR/Installer.php +++ b/gulliver/thirdparty/pear/PEAR/Installer.php @@ -232,23 +232,28 @@ class PEAR_Installer extends PEAR_Common $fp = fopen($orig_file, "r"); $contents = fread($fp, filesize($orig_file)); fclose($fp); - if(!class_exists('G')){ - $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); - $docuroot = explode( '/', $realdocuroot ); - array_pop( $docuroot ); - $pathhome = implode( '/', $docuroot ) . '/'; - array_pop( $docuroot ); - $pathTrunk = implode( '/', $docuroot ) . '/'; - require_once($pathTrunk.'gulliver/system/class.g.php'); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); } if (isset($atts['md5sum'])) { $md5sum = G::encryptOld($contents); } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $subst_from = $subst_to = array(); foreach ($atts['replacements'] as $a) { $to = ''; if ($a['type'] == 'php-const') { if (preg_match('/^[a-z0-9_]+$/i', $a['to'])) { + $a['to'] = $filter->validateInput($a['to']); eval("\$to = $a[to];"); } else { $this->log(0, "invalid php-const replacement: $a[to]"); @@ -872,14 +877,14 @@ class PEAR_Installer extends PEAR_Common if (!function_exists("md5_file")) { function md5_file($filename) { - if(!class_exists('G')){ - $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); - $docuroot = explode( '/', $realdocuroot ); - array_pop( $docuroot ); - $pathhome = implode( '/', $docuroot ) . '/'; - array_pop( $docuroot ); - $pathTrunk = implode( '/', $docuroot ) . '/'; - require_once($pathTrunk.'gulliver/system/class.g.php'); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); } $fp = fopen($filename, "r"); if (!$fp) return null; diff --git a/gulliver/thirdparty/pear/PEAR/Registry.php b/gulliver/thirdparty/pear/PEAR/Registry.php index 0e7849327..84d57292c 100755 --- a/gulliver/thirdparty/pear/PEAR/Registry.php +++ b/gulliver/thirdparty/pear/PEAR/Registry.php @@ -165,6 +165,19 @@ class PEAR_Registry extends PEAR { $this->_assertStateDir(); $file = $this->_packageFileName($package); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $file = $filter->validateInput($file,"path"); + $fp = @fopen($file, $mode); if (!$fp) { return null; @@ -425,6 +438,20 @@ class PEAR_Registry extends PEAR return $e; } $file = $this->_packageFileName($package); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $file = $filter->validateInput($file,"path"); + $ret = @unlink($file); $this->rebuildFileMap(); $this->_unlock(); diff --git a/gulliver/thirdparty/pear/SOAP/Value.php b/gulliver/thirdparty/pear/SOAP/Value.php index fd2d7b624..aafb53b7c 100755 --- a/gulliver/thirdparty/pear/SOAP/Value.php +++ b/gulliver/thirdparty/pear/SOAP/Value.php @@ -237,7 +237,16 @@ class SOAP_Attachment extends SOAP_Value public function encryptOld($string) { - return md5($string); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return G::encryptOld($string); } } diff --git a/gulliver/thirdparty/pear/SOAP/WSDL.php b/gulliver/thirdparty/pear/SOAP/WSDL.php index e3ee87265..9e760f519 100755 --- a/gulliver/thirdparty/pear/SOAP/WSDL.php +++ b/gulliver/thirdparty/pear/SOAP/WSDL.php @@ -1106,7 +1106,16 @@ class SOAP_WSDL_Cache extends SOAP_Base public function encryptOld($string) { - return md5($string); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return G::encryptOld($string); } } diff --git a/gulliver/thirdparty/phing/lib/Capsule.php b/gulliver/thirdparty/phing/lib/Capsule.php index be8fe46a7..693649177 100755 --- a/gulliver/thirdparty/phing/lib/Capsule.php +++ b/gulliver/thirdparty/phing/lib/Capsule.php @@ -122,8 +122,16 @@ class Capsule { // so that include "path/relative/to/templates"; can be used within templates $__old_inc_path = ini_get('include_path'); - if(is_dir($this->templatePath . PATH_SEPARATOR . $__old_inc_path)) { - ini_set('include_path', $this->templatePath . PATH_SEPARATOR . $__old_inc_path); + $path = $this->templatePath . PATH_SEPARATOR . $__old_inc_path; + if(strpos($path,":")>0){ + $firstPath = explode(":", $this->templatePath . PATH_SEPARATOR . $__old_inc_path); + if (is_dir($firstPath[0])) { + ini_set('include_path', $this->templatePath . PATH_SEPARATOR . $__old_inc_path); + } + } else { + if(is_dir($this->templatePath . PATH_SEPARATOR . $__old_inc_path)) { + ini_set('include_path', $this->templatePath . PATH_SEPARATOR . $__old_inc_path); + } } @ini_set('track_errors', true); diff --git a/gulliver/thirdparty/phing/lib/Zip.php b/gulliver/thirdparty/phing/lib/Zip.php index 16b1222ff..40dfe5959 100755 --- a/gulliver/thirdparty/phing/lib/Zip.php +++ b/gulliver/thirdparty/phing/lib/Zip.php @@ -3584,7 +3584,16 @@ class Archive_Zip public function encryptCrc32($string) { - return crc32($string); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return G::encryptCrc32($string); } } diff --git a/gulliver/thirdparty/tcpdf/tcpdf.php b/gulliver/thirdparty/tcpdf/tcpdf.php index 7a3594c2e..5e96dd903 100644 --- a/gulliver/thirdparty/tcpdf/tcpdf.php +++ b/gulliver/thirdparty/tcpdf/tcpdf.php @@ -29708,7 +29708,16 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: public function encryptOld($string) { - return md5($string); + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return G::encryptOld($string); } } // END OF TCPDF CLASS diff --git a/workflow/engine/bin/cron.php b/workflow/engine/bin/cron.php index 9ab67a4ad..b3d4774f5 100755 --- a/workflow/engine/bin/cron.php +++ b/workflow/engine/bin/cron.php @@ -33,6 +33,12 @@ $e_all = defined('E_DEPRECATED') ? E_ALL & ~E_DEPRECATED : E_ALL; $e_all = defined('E_STRICT') ? $e_all & ~E_STRICT : $e_all; $e_all = $config['debug'] ? $e_all : $e_all & ~E_NOTICE; +G::LoadSystem('inputfilter'); +$filter = new InputFilter(); +$config['debug'] = $filter->validateInput($config['debug']); +$config['memory_limit'] = $filter->validateInput($config['memory_limit']); +$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int'); +$config['time_zone'] = $filter->validateInput($config['time_zone']); // Do not change any of these settings directly, use env.ini instead ini_set('display_errors', $config['debug']); ini_set('error_reporting', $e_all); diff --git a/workflow/engine/bin/cron_single.php b/workflow/engine/bin/cron_single.php index 4d7b59945..205e981b3 100755 --- a/workflow/engine/bin/cron_single.php +++ b/workflow/engine/bin/cron_single.php @@ -90,6 +90,12 @@ if (!defined('PATH_HOME')) { $e_all = defined('E_STRICT') ? $e_all & ~E_STRICT : $e_all; $e_all = $config['debug'] ? $e_all : $e_all & ~E_NOTICE; + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $config['debug'] = $filter->validateInput($config['debug']); + $config['memory_limit'] = $filter->validateInput($config['memory_limit']); + $config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int'); + $config['time_zone'] = $filter->validateInput($config['time_zone']); // Do not change any of these settings directly, use env.ini instead ini_set('display_errors', $config['debug']); ini_set('error_reporting', $e_all); @@ -355,8 +361,8 @@ Bootstrap::registerClass('wsResponse', PATH_HOME . "engine/classes/clas Bootstrap::registerClass("PMLicensedFeatures", PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.licensedFeatures.php"); Bootstrap::registerClass("AddonsManagerPeer", PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "AddonsManagerPeer.php"); -/*----------------------------------********---------------------------------*/ -Bootstrap::registerClass('dashboards', PATH_HOME . "engine/classes/class.dashboards.php"); +/*----------------------------------********---------------------------------*/ +Bootstrap::registerClass('dashboards', PATH_HOME . "engine/classes/class.dashboards.php"); /*----------------------------------********---------------------------------*/ $arrayClass = array("Configuration", "EmailServer", "ListInbox", "ListParticipatedHistory"); @@ -371,18 +377,18 @@ foreach ($arrayClass as $value) { G::LoadClass("serverConfiguration"); G::LoadClass("dates"); //Load Criteria -/*----------------------------------********---------------------------------*/ -global $dateInit; -global $dateFinish; +/*----------------------------------********---------------------------------*/ +global $dateInit; +global $dateFinish; /*----------------------------------********---------------------------------*/ if (!defined('SYS_SYS')) { $sObject = $argv[1]; $sNow = $argv[2]; $dateSystem = $argv[3]; - /*----------------------------------********---------------------------------*/ - $dateInit = null; - $dateFinish = null; + /*----------------------------------********---------------------------------*/ + $dateInit = null; + $dateFinish = null; /*----------------------------------********---------------------------------*/ $sFilter = ''; @@ -527,17 +533,17 @@ function processWorkspace() resendEmails(); unpauseApplications(); calculateDuration(); - /*----------------------------------********---------------------------------*/ - calculateAppDuration(); + /*----------------------------------********---------------------------------*/ + calculateAppDuration(); /*----------------------------------********---------------------------------*/ executeEvents($sLastExecution); executeScheduledCases(); executeUpdateAppTitle(); executeCaseSelfService(); executePlugins(); - /*----------------------------------********---------------------------------*/ - fillReportByUser(); - fillReportByProcess(); + /*----------------------------------********---------------------------------*/ + fillReportByUser(); + fillReportByProcess(); /*----------------------------------********---------------------------------*/ } catch (Exception $oError) { saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n"); @@ -728,29 +734,29 @@ function calculateDuration() } } -/*----------------------------------********---------------------------------*/ -function calculateAppDuration() -{ - global $sFilter; - - if ($sFilter != '' && strpos($sFilter, 'calculateapp') === false) { - return false; - } - - setExecutionMessage("Calculating Duration by Application"); - - try { - $oApplication = new Application(); - $oApplication->calculateAppDuration(1); - - setExecutionResultMessage('DONE'); - saveLog('calculateDurationByApp', 'action', 'Calculating Duration by Application'); - } catch (Exception $oError) { - setExecutionResultMessage('WITH ERRORS', 'error'); - eprintln(" '-".$oError->getMessage(), 'red'); - saveLog('calculateDurationByApp', 'error', 'Error Calculating Duration: ' . $oError->getMessage()); - } -} +/*----------------------------------********---------------------------------*/ +function calculateAppDuration() +{ + global $sFilter; + + if ($sFilter != '' && strpos($sFilter, 'calculateapp') === false) { + return false; + } + + setExecutionMessage("Calculating Duration by Application"); + + try { + $oApplication = new Application(); + $oApplication->calculateAppDuration(1); + + setExecutionResultMessage('DONE'); + saveLog('calculateDurationByApp', 'action', 'Calculating Duration by Application'); + } catch (Exception $oError) { + setExecutionResultMessage('WITH ERRORS', 'error'); + eprintln(" '-".$oError->getMessage(), 'red'); + saveLog('calculateDurationByApp', 'error', 'Error Calculating Duration: ' . $oError->getMessage()); + } +} /*----------------------------------********---------------------------------*/ function executeEvents($sLastExecution, $sNow=null) @@ -1095,66 +1101,66 @@ function setExecutionResultMessage($m, $t='') eprintln("[$m]", $c); } -/*----------------------------------********---------------------------------*/ -function fillReportByUser () -{ - try { - global $sFilter; - global $dateInit; - global $dateFinish; - - if (strpos($sFilter, 'report_by_user') === false) { - return false; - } - if ($dateInit == null) { - eprintln("You must enter the starting date.", "red"); - eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red"); - return false; - } - - $dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s"); - - $appcv = new AppCacheView(); - $appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP ); - setExecutionMessage("Calculating data to fill the 'User Reporting'..."); - $appcv->fillReportByUser($dateInit, $dateFinish); - setExecutionResultMessage("DONE"); - } catch (Exception $e) { - setExecutionResultMessage("WITH ERRORS", "error"); - eprintln(" '-" . $e->getMessage(), "red"); - saveLog("fillReportByUser", "error", "Error in fill report by user: " . $e->getMessage()); - } -} - -function fillReportByProcess () -{ - try { - global $sFilter; - global $dateInit; - global $dateFinish; - - if (strpos($sFilter, 'report_by_process') === false) { - return false; - } - - if ($dateInit == null) { - eprintln("You must enter the starting date.", "red"); - eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red"); - return false; - } - - $dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s"); - $appcv = new AppCacheView(); - $appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP ); - - setExecutionMessage("Calculating data to fill the 'Process Reporting'..."); - $appcv->fillReportByProcess($dateInit, $dateFinish); - setExecutionResultMessage("DONE"); - } catch (Exception $e) { - setExecutionResultMessage("WITH ERRORS", "error"); - eprintln(" '-" . $e->getMessage(), "red"); - saveLog("fillReportByProcess", "error", "Error in fill report by process: " . $e->getMessage()); - } -} +/*----------------------------------********---------------------------------*/ +function fillReportByUser () +{ + try { + global $sFilter; + global $dateInit; + global $dateFinish; + + if (strpos($sFilter, 'report_by_user') === false) { + return false; + } + if ($dateInit == null) { + eprintln("You must enter the starting date.", "red"); + eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red"); + return false; + } + + $dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s"); + + $appcv = new AppCacheView(); + $appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP ); + setExecutionMessage("Calculating data to fill the 'User Reporting'..."); + $appcv->fillReportByUser($dateInit, $dateFinish); + setExecutionResultMessage("DONE"); + } catch (Exception $e) { + setExecutionResultMessage("WITH ERRORS", "error"); + eprintln(" '-" . $e->getMessage(), "red"); + saveLog("fillReportByUser", "error", "Error in fill report by user: " . $e->getMessage()); + } +} + +function fillReportByProcess () +{ + try { + global $sFilter; + global $dateInit; + global $dateFinish; + + if (strpos($sFilter, 'report_by_process') === false) { + return false; + } + + if ($dateInit == null) { + eprintln("You must enter the starting date.", "red"); + eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red"); + return false; + } + + $dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s"); + $appcv = new AppCacheView(); + $appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP ); + + setExecutionMessage("Calculating data to fill the 'Process Reporting'..."); + $appcv->fillReportByProcess($dateInit, $dateFinish); + setExecutionResultMessage("DONE"); + } catch (Exception $e) { + setExecutionResultMessage("WITH ERRORS", "error"); + eprintln(" '-" . $e->getMessage(), "red"); + saveLog("fillReportByProcess", "error", "Error in fill report by process: " . $e->getMessage()); + } +} /*----------------------------------********---------------------------------*/ diff --git a/workflow/engine/bin/messageeventcron.php b/workflow/engine/bin/messageeventcron.php index 4d884768d..60d79ee13 100644 --- a/workflow/engine/bin/messageeventcron.php +++ b/workflow/engine/bin/messageeventcron.php @@ -43,7 +43,11 @@ try { G::LoadClass("system"); $config = System::getSystemConfiguration(); - + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $config['time_zone'] = $filter->validateInput($config['time_zone']); + ini_set("date.timezone", $config["time_zone"]); //CRON command options diff --git a/workflow/engine/bin/messageeventcron_single.php b/workflow/engine/bin/messageeventcron_single.php index b64d86f7c..f92ccca8e 100644 --- a/workflow/engine/bin/messageeventcron_single.php +++ b/workflow/engine/bin/messageeventcron_single.php @@ -91,6 +91,11 @@ try { $e_all = (defined("E_STRICT"))? $e_all & ~E_STRICT : $e_all; $e_all = ($config["debug"])? $e_all : $e_all & ~E_NOTICE; + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $config['debug'] = $filter->validateInput($config['debug']); + $config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int'); + $config['time_zone'] = $filter->validateInput($config['time_zone']); //Do not change any of these settings directly, use env.ini instead ini_set("display_errors", $config["debug"]); ini_set("error_reporting", $e_all); diff --git a/workflow/engine/bin/reindex_solr.php b/workflow/engine/bin/reindex_solr.php index 0c4795091..97206b169 100644 --- a/workflow/engine/bin/reindex_solr.php +++ b/workflow/engine/bin/reindex_solr.php @@ -207,9 +207,16 @@ if (! defined ('SYS_SYS')) { define ('TIME_ZONE', $config ['time_zone']); date_default_timezone_set (TIME_ZONE); - print "TIME_ZONE: " . TIME_ZONE . "\n"; - print "MEMCACHED_ENABLED: " . MEMCACHED_ENABLED . "\n"; - print "MEMCACHED_SERVER: " . MEMCACHED_SERVER . "\n"; + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $TIME_ZONE = $filter->xssFilterHard(TIME_ZONE); + $MEMCACHED_ENABLED = $filter->xssFilterHard(MEMCACHED_ENABLED); + $MEMCACHED_SERVER = $filter->xssFilterHard(MEMCACHED_SERVER); + + print "TIME_ZONE: " . $TIME_ZONE . "\n"; + print "MEMCACHED_ENABLED: " . $MEMCACHED_ENABLED . "\n"; + print "MEMCACHED_SERVER: " . $MEMCACHED_SERVER . "\n"; // **************************************** include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php'); diff --git a/workflow/engine/bin/verify_solr.php b/workflow/engine/bin/verify_solr.php index 5466c7362..0139902ba 100644 --- a/workflow/engine/bin/verify_solr.php +++ b/workflow/engine/bin/verify_solr.php @@ -139,9 +139,16 @@ if (! defined ('SYS_SYS')) { define ('TIME_ZONE', $config ['time_zone']); date_default_timezone_set (TIME_ZONE); - print "TIME_ZONE: " . TIME_ZONE . "\n"; - print "MEMCACHED_ENABLED: " . MEMCACHED_ENABLED . "\n"; - print "MEMCACHED_SERVER: " . MEMCACHED_SERVER . "\n"; + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $TIME_ZONE = $filter->xssFilterHard(TIME_ZONE); + $MEMCACHED_ENABLED = $filter->xssFilterHard(MEMCACHED_ENABLED); + $MEMCACHED_SERVER = $filter->xssFilterHard(MEMCACHED_SERVER); + + print "TIME_ZONE: " . $TIME_ZONE . "\n"; + print "MEMCACHED_ENABLED: " . $MEMCACHED_ENABLED . "\n"; + print "MEMCACHED_SERVER: " . $MEMCACHED_SERVER . "\n"; // **************************************** include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php'); diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index 737653c5a..e0248996e 100755 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -699,6 +699,9 @@ class Installer extends Controller try { $db_host = ($db_port != '' && $db_port != 3306) ? $db_hostname . ':' . $db_port : $db_hostname; + $db_host = $filter->validateInput($db_host); + $db_username = $filter->validateInput($db_username); + $db_password = $filter->validateInput($db_password); $this->link = @mysql_connect( $db_host, $db_username, $db_password ); $this->installLog( G::LoadTranslation('ID_CONNECT_TO_SERVER', SYS_LANG, Array($db_hostname, $db_port, $db_username ) )); @@ -1032,6 +1035,9 @@ class Installer extends Controller try { $db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname; + $db_host = $filter->validateInput($db_host); + $db_username = $filter->validateInput($db_username); + $db_password = $filter->validateInput($db_password); $this->link = @mssql_connect( $db_host, $db_username, $db_password ); $this->installLog( G::LoadTranslation('ID_CONNECT_TO_SERVER', SYS_LANG, Array( $db_hostname, $db_port, $db_username )) ); @@ -1231,6 +1237,9 @@ class Installer extends Controller $info = new stdclass(); if ($_REQUEST['db_engine'] == 'mysql') { + $_REQUEST['db_hostname'] = $filter->validateInput($_REQUEST['db_hostname']); + $_REQUEST['db_username'] = $filter->validateInput($_REQUEST['db_username']); + $_REQUEST['db_password'] = $filter->validateInput($_REQUEST['db_password']); $link = @mysql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] ); $_REQUEST['wfDatabase'] = $filter->validateInput($_REQUEST['wfDatabase'], 'nosql'); $query = "show databases like '%s' "; @@ -1296,6 +1305,7 @@ class Installer extends Controller } $db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname; + $link = @mysql_connect( $db_host, $db_username, $db_password ); if (! $link) { $info->message .= G::LoadTranslation('ID_MYSQL_CREDENTIALS_WRONG'); @@ -1348,6 +1358,7 @@ class Installer extends Controller } $db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname; + $link = @mssql_connect( $db_host, $db_username, $db_password ); if (! $link) { $info->message .= G::LoadTranslation('ID_MYSQL_CREDENTIALS_WRONG'); @@ -1661,6 +1672,7 @@ class Installer extends Controller $wf = trim( $_REQUEST['wfDatabase'] ); $db_host = ($db_port != '' && $db_port != 3306) ? $db_hostname . ':' . $db_port : $db_hostname; + $link = @mysql_connect( $db_host, $db_username, $db_password ); @mysql_select_db($wf, $link); $res = mysql_query( "SELECT STORE_ID FROM ADDONS_MANAGER WHERE ADDON_NAME = '" . $namePlugin . "'", $link ); diff --git a/workflow/engine/methods/setup/setup.php b/workflow/engine/methods/setup/setup.php index 022c36cff..978cddd1c 100755 --- a/workflow/engine/methods/setup/setup.php +++ b/workflow/engine/methods/setup/setup.php @@ -33,7 +33,6 @@ G::LoadSystem('inputfilter'); $filter = new InputFilter(); $_GET['i18'] = $filter->xssFilterHard($_GET['i18']); $_GET['newSite'] = $filter->xssFilterHard($_GET['newSite']); -$_GET['module'] = $filter->xssFilterHard($_GET['module']); if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1) return $RBAC_Response; @@ -78,10 +77,10 @@ foreach ($toolItems as $item) { $G_PUBLISH->AddContent( 'template', '', '', '', $template ); G::RenderPage( 'publish' ); if (isset( $_GET['module'] )) { - + $module = $filter->xssFilterHard($_GET['module']); print " "; } diff --git a/workflow/engine/methods/setup/skin_Ajax.php b/workflow/engine/methods/setup/skin_Ajax.php index b6578b3e3..e81f79ccd 100755 --- a/workflow/engine/methods/setup/skin_Ajax.php +++ b/workflow/engine/methods/setup/skin_Ajax.php @@ -319,9 +319,9 @@ function importSkin () function exportSkin ($skinToExport = "") { + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); try { - G::LoadSystem('inputfilter'); - $filter = new InputFilter(); if (! isset( $_REQUEST['SKIN_FOLDER_ID'] )) { throw (new Exception( G::LoadTranslation( 'ID_SKIN_NAME_REQUIRED' ) )); } @@ -356,19 +356,23 @@ function exportSkin ($skinToExport = "") $response['success'] = true; $response['message'] = $skinTar; G::auditLog("ExportSkin", "Skin Name: ".$skinName); + + $response = $filter->xssFilterHard($response); + print_r( G::json_encode( $response ) ); } catch (Exception $e) { $response['success'] = false; $response['message'] = $e->getMessage(); + $response = $filter->xssFilterHard($response); print_r( G::json_encode( $response ) ); } } function deleteSkin () { + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); try { - G::LoadSystem('inputfilter'); - $filter = new InputFilter(); $_REQUEST['SKIN_FOLDER_ID'] = $filter->xssFilterHard($_REQUEST['SKIN_FOLDER_ID']); if (! (isset( $_REQUEST['SKIN_FOLDER_ID'] ))) { @@ -389,6 +393,7 @@ function deleteSkin () } catch (Exception $e) { $response['success'] = false; $response['error'] = $response['message'] = $e->getMessage(); + $response = $filter->xssFilterHard($response); print_r( G::json_encode( $response ) ); } } diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php b/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php index 981562d4e..9797e571c 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php @@ -323,11 +323,15 @@ class Consolidated $oCriteria->add($oCriteria->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::LIKE)); } } + + G::LoadSystem('inputfilter'); + $filter = new \InputFilter(); if ($sort != "") { $reportTable = new ReportTables(); $arrayReportTableVar = $reportTable->getTableVars($tableUid); - + $tableName = $filter->validateInput($tableName); + $sort = $filter->validateInput($sort); if (in_array($sort, $arrayReportTableVar)) { $sort = strtoupper($sort); eval("\$field = " . $tableName . "Peer::" . $sort . ";"); diff --git a/workflow/engine/test/bootstrap/unit.php b/workflow/engine/test/bootstrap/unit.php index bf534e841..df960121d 100755 --- a/workflow/engine/test/bootstrap/unit.php +++ b/workflow/engine/test/bootstrap/unit.php @@ -61,8 +61,9 @@ //$_test_dir = realpath(dirname(__FILE__).'/..'); //require_once( 'lime/lime.php'); - - require_once (PATH_GULLIVER . "class.bootstrap.php"); + if(file_exists(PATH_GULLIVER . "class.bootstrap.php")) { + require_once (PATH_GULLIVER . "class.bootstrap.php"); + } spl_autoload_register(array('Bootstrap', 'autoloadClass')); Bootstrap::registerClass('G', PATH_GULLIVER . "class.g.php"); Bootstrap::registerClass('System', PATH_HOME . "engine/classes/class.system.php"); diff --git a/workflow/public_html/bootstrap.php b/workflow/public_html/bootstrap.php index 276713bcf..b9f385999 100755 --- a/workflow/public_html/bootstrap.php +++ b/workflow/public_html/bootstrap.php @@ -69,6 +69,13 @@ //$e_all = $config['debug'] ? $e_all : $e_all & ~E_NOTICE; //$e_all = E_ALL & ~ E_DEPRECATED & ~ E_STRICT & ~ E_NOTICE & ~E_WARNING; + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $config['display_errors'] = $filter->validateInput($config['display_errors']); + $config['error_reporting'] = $filter->validateInput($config['error_reporting']); + $config['memory_limit'] = $filter->validateInput($config['memory_limit']); + $config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int'); + $config['time_zone'] = $filter->validateInput($config['time_zone']); // Do not change any of these settings directly, use env.ini instead ini_set( 'display_errors', $config['display_errors']); ini_set( 'error_reporting', $config['error_reporting']); diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index c4af872b7..d6714eec3 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -303,6 +303,20 @@ session_start(); //$e_all = $config['debug'] ? $e_all : $e_all & ~ E_NOTICE; //$e_all = E_ALL & ~ E_DEPRECATED & ~ E_STRICT & ~ E_NOTICE & ~E_WARNING; +//Call Gulliver Classes +Bootstrap::LoadThirdParty("smarty/libs", "Smarty.class"); + +//Loading the autoloader libraries feature +Bootstrap::registerSystemClasses(); + +G::LoadSystem('inputfilter'); +$filter = new InputFilter(); +$config['display_errors'] = $filter->validateInput($config['display_errors']); +$config['error_reporting'] = $filter->validateInput($config['error_reporting']); +$config['memory_limit'] = $filter->validateInput($config['memory_limit']); +$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int'); +$config['time_zone'] = $filter->validateInput($config['time_zone']); + // Do not change any of these settings directly, use env.ini instead ini_set( 'display_errors', $config['display_errors']); ini_set( 'error_reporting', $config['error_reporting']); @@ -334,15 +348,7 @@ define( 'PATH_C', (rtrim( Bootstrap::sys_get_temp_dir(), PATH_SEP ) . PATH_SEP) define( 'PATH_LANGUAGECONT', PATH_HOME . 'engine/content/languages/' ); } -//Call Gulliver Classes -Bootstrap::LoadThirdParty("smarty/libs", "Smarty.class"); - -//Loading the autoloader libraries feature -Bootstrap::registerSystemClasses(); - //Load filter class -G::LoadSystem('inputfilter'); -$filter = new InputFilter(); $skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config); $skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config); From 4d206830f45bd1af9e5861a621486c9d1109f50e Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Tue, 28 Apr 2015 15:54:28 -0400 Subject: [PATCH 19/22] correcciones incidencias veracode --- gulliver/system/class.g.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index d0d63551d..3366d5e23 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -2652,8 +2652,8 @@ class G G::LoadSystem('inputfilter'); $filter = new InputFilter(); - $file = $filter->validateInput($file, "path"); - $path = $filter->validateInput($path, "path"); + $file = $filter->validateInput($file,"path"); + $path = $filter->validateInput($path,"path"); move_uploaded_file( $file, $path . "/" . $nameToSave ); @chmod( $path . "/" . $nameToSave, $permission ); From f7e575e2680a52391676021a7afc8d15bd077acf Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Tue, 28 Apr 2015 16:10:10 -0400 Subject: [PATCH 20/22] correcciones incidencias veracode --- gulliver/system/class.g.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 3366d5e23..85dd96ca4 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -245,7 +245,7 @@ class G } $result = base64_encode( $result ); - $result = str_replace( '/', '°', $result ); + $result = str_replace( '/', '°', $result ); $result = str_replace( '=', '', $result ); return $result; } @@ -264,7 +264,7 @@ class G // if ( defined ( 'ENABLE_ENCRYPT' ) && ENABLE_ENCRYPT == 'yes' ) { //if (strpos($string, '|', 0) !== false) return $string; $result = ''; - $string = str_replace( '°', '/', $string ); + $string = str_replace( '°', '/', $string ); $string_jhl = explode( "?", $string ); $string = base64_decode( $string ); $string = base64_decode( $string_jhl[0] ); @@ -784,7 +784,7 @@ class G for ($i = 2; $i < count( $aRequestUri ); $i ++) { $decoded = G::decrypt( urldecode( $aRequestUri[$i] ), URL_KEY ); - if ($decoded == 'sWì›') { + if ($decoded == 'sWì›') { $decoded = $VARS[$i]; //this is for the string "../" } $plain .= '/' . $decoded; @@ -1349,7 +1349,7 @@ class G $lang = defined( SYS_LANG ) ? SYS_LANG : 'en'; } $aux = explode( ' ', $datetime ); //para dividir la fecha del dia - $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. + $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. $time = explode( ':', isset( $aux[1] ) ? $aux[1] : '00:00:00' ); //para obtener las horas, minutos, segundos. $date[0] = (int) ((isset( $date[0] )) ? $date[0] : '0'); $date[1] = (int) ((isset( $date[1] )) ? $date[1] : '0'); @@ -1365,7 +1365,7 @@ class G ); // Spanish days - $ARR_WEEKDAYS['es'] = array ("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado" + $ARR_WEEKDAYS['es'] = array ("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado" ); // English days $ARR_WEEKDAYS['en'] = array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" @@ -1461,7 +1461,7 @@ class G } $aux = explode( ' ', $date ); //para dividir la fecha del dia - $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. + $date = explode( '-', isset( $aux[0] ) ? $aux[0] : '00-00-00' ); //para obtener los dias, el mes, y el año. $time = explode( ':', isset( $aux[1] ) ? $aux[1] : '00:00:00' ); //para obtener las horas, minutos, segundos. $year = (int) ((isset( $date[0] )) ? $date[0] : '0'); //year @@ -2438,12 +2438,12 @@ class G $loginhtml = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( $aux[1] ), URL_KEY ) : $aux[1]); //header ("location: /$sys/$lang/$skin/$login/$loginhtml"); - header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); + header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); die(); } if ($sw == 0) { - header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); + header( "location: /fluid/mNE/o9A/mNGm1aLiop3V4qU/dtij4J°gmaLPwKDU3qNn2qXanw" ); die(); } } @@ -2652,8 +2652,8 @@ class G G::LoadSystem('inputfilter'); $filter = new InputFilter(); - $file = $filter->validateInput($file,"path"); - $path = $filter->validateInput($path,"path"); + $file = $filter->validateInput($file, "path"); + $path = $filter->validateInput($path, "path"); move_uploaded_file( $file, $path . "/" . $nameToSave ); @chmod( $path . "/" . $nameToSave, $permission ); @@ -2792,7 +2792,7 @@ class G /** * Generate a numeric or alphanumeric code * - * @author Julio Cesar Laura Avendaíž¼juliocesar@colosa.com> + * @author Julio Cesar Laura Avendaힼjuliocesar@colosa.com> * @access public * @return string */ @@ -3158,7 +3158,7 @@ class G $quotedReplacement = preg_quote( $replacement, '/' ); - $default = array ('/à |á|Ã¥|â/' => 'a','/è|é|ê|ẽ|ë/' => 'e','/ì|í|î/' => 'i','/ò|ó|ô|ø/' => 'o','/ù|ú|ů|û/' => 'u','/ç/' => 'c','/ñ/' => 'n','/ä|æ/' => 'ae','/ö/' => 'oe','/ü/' => 'ue','/Ä/' => 'Ae','/Ü/' => 'Ue','/Ö/' => 'Oe','/ß/' => 'ss','/\.|\,|\:|\-|\\|\//' => " ",'/\\s+/' => $replacement + $default = array ('/à|á|å|â/' => 'a','/è|é|ê|ẽ|ë/' => 'e','/ì|í|î/' => 'i','/ò|ó|ô|ø/' => 'o','/ù|ú|ů|û/' => 'u','/ç/' => 'c','/ñ/' => 'n','/ä|æ/' => 'ae','/ö/' => 'oe','/ü/' => 'ue','/Ä/' => 'Ae','/Ü/' => 'Ue','/Ö/' => 'Oe','/ß/' => 'ss','/\.|\,|\:|\-|\\|\//' => " ",'/\\s+/' => $replacement ); $map = array_merge( $default, $map ); @@ -5585,7 +5585,7 @@ class G { $strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]", "}", "\\", "|", ";", ":", "\"", "'", "‘", "’", "“", "”", "–", "—", - "—", "–", ",", "<", ".", ">", "/", "?"); + "—", "–", ",", "<", ".", ">", "/", "?"); $clean = trim(str_replace($strip, "", strip_tags($string))); $clean = preg_replace('/\s+/', "-", $clean); $clean = ($alpha) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ; @@ -5719,4 +5719,4 @@ function eprintln ($s = "", $c = null) function __ ($msgID, $lang = SYS_LANG, $data = null) { return G::LoadTranslation( $msgID, $lang, $data ); -} \ No newline at end of file +} From 3f13c0b0d16b1d422751ca19a6c401601e876141 Mon Sep 17 00:00:00 2001 From: Brayan Pereyra Date: Wed, 29 Apr 2015 09:57:14 -0400 Subject: [PATCH 21/22] PM-1944 Correccion de Duplicacidad en Completed --- .../engine/classes/model/ListCompleted.php | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/model/ListCompleted.php b/workflow/engine/classes/model/ListCompleted.php index b7507c36e..5b5925fa1 100644 --- a/workflow/engine/classes/model/ListCompleted.php +++ b/workflow/engine/classes/model/ListCompleted.php @@ -25,6 +25,15 @@ class ListCompleted extends BaseListCompleted */ public function create($data) { + $criteria = new Criteria(); + $criteria->addSelectColumn(ListCompletedPeer::APP_UID); + $criteria->add( ListCompletedPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL ); + $dataset = ListCompletedPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + if ($dataset->next()) { + return 1; + } + $criteria = new Criteria(); $criteria->addSelectColumn(ContentPeer::CON_VALUE); $criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL ); @@ -97,9 +106,27 @@ class ListCompleted extends BaseListCompleted $users = new Users(); $users->refreshTotal($data['USR_UID'], 'add', 'completed'); if ($data['DEL_PREVIOUS'] != 0) { - $users->refreshTotal($data['USR_UID'], 'remove', 'inbox'); + $criteria = new Criteria(); + $criteria->addSelectColumn(TaskPeer::TAS_TYPE); + $criteria->add( TaskPeer::TAS_UID, $data['TAS_UID'], Criteria::EQUAL ); + $dataset = TaskPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + if ($aRow['TAS_TYPE'] != 'SUBPROCESS') { + $users->refreshTotal($data['USR_UID'], 'remove', 'inbox'); + } } else { - $users->refreshTotal($data['USR_UID'], 'remove', 'draft'); + $criteria = new Criteria(); + $criteria->addSelectColumn(SubApplicationPeer::APP_UID); + $criteria->add( SubApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL ); + $dataset = SubApplicationPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + if ($dataset->next()) { + $users->refreshTotal($data['USR_UID'], 'remove', 'inbox'); + } else { + $users->refreshTotal($data['USR_UID'], 'remove', 'draft'); + } } $con = Propel::getConnection( ListCompletedPeer::DATABASE_NAME ); From ffdddddcd7d3ed53eab5084cabaa8095ee373205 Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Wed, 29 Apr 2015 13:02:32 -0400 Subject: [PATCH 22/22] correcciones incidencias veracode --- workflow/engine/bin/verify_solr.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/workflow/engine/bin/verify_solr.php b/workflow/engine/bin/verify_solr.php index 0139902ba..1c5c872a7 100644 --- a/workflow/engine/bin/verify_solr.php +++ b/workflow/engine/bin/verify_solr.php @@ -140,6 +140,11 @@ if (! defined ('SYS_SYS')) { date_default_timezone_set (TIME_ZONE); + // **************************************** + + include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php'); + include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php'); + G::LoadSystem('inputfilter'); $filter = new InputFilter(); $TIME_ZONE = $filter->xssFilterHard(TIME_ZONE); @@ -149,10 +154,6 @@ if (! defined ('SYS_SYS')) { print "TIME_ZONE: " . $TIME_ZONE . "\n"; print "MEMCACHED_ENABLED: " . $MEMCACHED_ENABLED . "\n"; print "MEMCACHED_SERVER: " . $MEMCACHED_SERVER . "\n"; - // **************************************** - - include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php'); - include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php'); // ***************** PM Paths DATA ************************** define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');