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 showTriggers = function(sStep, sType)
|
||||||
{
|
{
|
||||||
|
var idAux = "";
|
||||||
|
var sStepAux = sStep;
|
||||||
|
|
||||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||||
url : '../steps/steps_Ajax',
|
url : "../steps/steps_Ajax",
|
||||||
async : false,
|
async : false,
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
args : 'action=showTriggers&sProcess=' + Pm.options.uid + '&sStep=' + sStep + '&sType=' + sType
|
args : "action=showTriggers&sProcess=" + Pm.options.uid + "&sStep=" + sStep + "&sType=" + sType
|
||||||
});
|
});
|
||||||
|
|
||||||
oRPC.make();
|
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 = oRPC.xmlhttp.responseText.extractScript();
|
||||||
scs.evalScript();
|
scs.evalScript();
|
||||||
|
var tri = document.getElementById("TRIG_"+sStep+"_" + sType);
|
||||||
|
|
||||||
var tri = document.getElementById('TRIG_'+sStep+'_'+sType);
|
|
||||||
if (tri) {
|
if (tri) {
|
||||||
oRPC = new leimnud.module.rpc.xmlhttp({
|
oRPC = new leimnud.module.rpc.xmlhttp({
|
||||||
url : '../steps/steps_Ajax',
|
url : "../steps/steps_Ajax",
|
||||||
async : false,
|
async : false,
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
args : 'action=counterTriggers&sStep='+sStep+'&sType='+sType
|
args : "action=counterTriggers&sStep="+sStep+"&sType="+sType
|
||||||
});
|
});
|
||||||
|
|
||||||
oRPC.make();
|
oRPC.make();
|
||||||
aAux = oRPC.xmlhttp.responseText.split('|');
|
aAux = oRPC.xmlhttp.responseText.split("|");
|
||||||
tri.innerHTML=aAux[1];
|
tri.innerHTML = aAux[1];
|
||||||
var tri = document.getElementById('TRIG_'+sStep);
|
idAux = (sStepAux.charAt(0) != "-")? "TRIG_" + sStepAux : "TRIG_";
|
||||||
|
var tri = document.getElementById(idAux);
|
||||||
|
|
||||||
if (tri) {
|
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'] );
|
$oStepTrigger->remove( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'] );
|
||||||
break;
|
break;
|
||||||
case 'counterTriggers':
|
case 'counterTriggers':
|
||||||
G::LoadClass( 'processMap' );
|
G::LoadClass("processMap");
|
||||||
$oProcessMap = new ProcessMap();
|
|
||||||
$oCriteria1 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] );
|
$processMap = new ProcessMap();
|
||||||
if ($aData['sType'] == 'BEFORE') {
|
|
||||||
$oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'AFTER' );
|
$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 {
|
} 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 $total . "|" . $cantity;
|
||||||
echo $iTotal . '|' . $iCantity;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
|
|||||||
Reference in New Issue
Block a user