BUG 11726 "Contador de triggers para asignacion no se..." SOLVED
- Contador de triggers para asignacion no se restablece a su valor original cuando se eliminan triggers. - Problema resuelto, Assign Task, el contador de triggers muestra el valor actual, cuando se adicionan o eliminan triggers. * Available from version ProcessMaker-2.0.47 (2.5.1)
This commit is contained in:
@@ -289,33 +289,38 @@ var saveTaskData = function(oForm, iForm, iType)
|
||||
|
||||
var showTriggers = function(sStep, sType)
|
||||
{
|
||||
var idAux = "";
|
||||
var sStepAux = sStep;
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../steps/steps_Ajax',
|
||||
url : "../steps/steps_Ajax",
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'action=showTriggers&sProcess=' + Pm.options.uid + '&sStep=' + sStep + '&sType=' + sType
|
||||
method: "POST",
|
||||
args : "action=showTriggers&sProcess=" + Pm.options.uid + "&sStep=" + sStep + "&sType=" + sType
|
||||
});
|
||||
|
||||
oRPC.make();
|
||||
|
||||
document.getElementById('triggersSpan_' + sStep + '_' + sType).innerHTML = oRPC.xmlhttp.responseText;
|
||||
document.getElementById("triggersSpan_" + sStep + "_" + sType).innerHTML = oRPC.xmlhttp.responseText;
|
||||
scs = oRPC.xmlhttp.responseText.extractScript();
|
||||
scs.evalScript();
|
||||
var tri = document.getElementById("TRIG_"+sStep+"_" + sType);
|
||||
|
||||
var tri = document.getElementById('TRIG_'+sStep+'_'+sType);
|
||||
if (tri) {
|
||||
oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../steps/steps_Ajax',
|
||||
url : "../steps/steps_Ajax",
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'action=counterTriggers&sStep='+sStep+'&sType='+sType
|
||||
method: "POST",
|
||||
args : "action=counterTriggers&sStep="+sStep+"&sType="+sType
|
||||
});
|
||||
|
||||
oRPC.make();
|
||||
aAux = oRPC.xmlhttp.responseText.split('|');
|
||||
tri.innerHTML=aAux[1];
|
||||
var tri = document.getElementById('TRIG_'+sStep);
|
||||
aAux = oRPC.xmlhttp.responseText.split("|");
|
||||
tri.innerHTML = aAux[1];
|
||||
idAux = (sStepAux.charAt(0) != "-")? "TRIG_" + sStepAux : "TRIG_";
|
||||
var tri = document.getElementById(idAux);
|
||||
|
||||
if (tri) {
|
||||
tri.innerHTML=aAux[0];
|
||||
tri.innerHTML = aAux[0];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -165,17 +165,33 @@ try {
|
||||
$oStepTrigger->remove( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'] );
|
||||
break;
|
||||
case 'counterTriggers':
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oCriteria1 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] );
|
||||
if ($aData['sType'] == 'BEFORE') {
|
||||
$oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'AFTER' );
|
||||
G::LoadClass("processMap");
|
||||
|
||||
$processMap = new ProcessMap();
|
||||
|
||||
$criteria1 = $processMap->getStepTriggersCriteria($aData["sStep"], $_SESSION["TASK"], $aData["sType"]);
|
||||
$cantity = StepTriggerPeer::doCount($criteria1);
|
||||
|
||||
if ($aData["sStep"][0] != "-") {
|
||||
if ($aData["sType"] == "BEFORE") {
|
||||
$criteria2 = $processMap->getStepTriggersCriteria($aData["sStep"], $_SESSION["TASK"], "AFTER");
|
||||
} else {
|
||||
$criteria2 = $processMap->getStepTriggersCriteria($aData["sStep"], $_SESSION["TASK"], "BEFORE");
|
||||
}
|
||||
|
||||
$total = $cantity + StepTriggerPeer::doCount($criteria2);
|
||||
} else {
|
||||
$oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'BEFORE' );
|
||||
$criteria = $processMap->getStepTriggersCriteria(-1, $_SESSION["TASK"], "BEFORE");
|
||||
$cantity1 = StepTriggerPeer::doCount($criteria);
|
||||
$criteria = $processMap->getStepTriggersCriteria(-2, $_SESSION["TASK"], "BEFORE");
|
||||
$cantity2 = StepTriggerPeer::doCount($criteria);
|
||||
$criteria = $processMap->getStepTriggersCriteria(-2, $_SESSION["TASK"], "AFTER");
|
||||
$cantity3 = StepTriggerPeer::doCount($criteria);
|
||||
|
||||
$total = $cantity1 + $cantity2 + $cantity3;
|
||||
}
|
||||
$iCantity = StepTriggerPeer::doCount( $oCriteria1 );
|
||||
$iTotal = $iCantity + StepTriggerPeer::doCount( $oCriteria2 );
|
||||
echo $iTotal . '|' . $iCantity;
|
||||
|
||||
echo $total . "|" . $cantity;
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
|
||||
Reference in New Issue
Block a user