BUG 10087 "PM functions y Web Services de ProcessMaker no..." SOLVED

- Problem with the variable $_SESSION
- The variable $_SESSION should not lose the default values ..set
- Added functions to save and restore the values ..of the variable $_SESSION
- Revised class.pmFunctions.php functions and class.wsBase.php
- The QA team should test this functions (most of these functions running
  triggers, try running triggers):
    PMFAddInputDocument
    PMFGenerateOutputDocument
    PMFDerivateCase, WSDerivateCase, wsBase::derivateCase
    PMFNewCase, WSNewCase, wsBase::newCase
    PMFRedirectToStep
    PMFDeleteCase, WSDeleteCase, wsBase::deleteCase
    PMFCancelCase, WSCancelCase, wsBase::cancelCase
    PMFPauseCase, WSPauseCase, wsBase::pauseCase
    PMFUnpauseCase, WSUnpauseCase, wsBase::unpauseCase
    wsBase::executeTrigger
    wsBase::reassignCase
* Available from version 2.0.46
This commit is contained in:
Victor Saisa Lopez
2012-11-29 17:04:31 -04:00
parent 4bd22eeafe
commit eb774203d5
3 changed files with 279 additions and 103 deletions

View File

@@ -1485,6 +1485,16 @@ function PMFAddInputDocument(
$file = "path_to_file/myfile.txt"
) {
G::LoadClass("case");
$g = new G();
$g->sessionVarSave();
$_SESSION["APPLICATION"] = $caseUid;
$_SESSION["INDEX"] = $delIndex;
$_SESSION["TASK"] = $taskUid;
$_SESSION["USER_LOGGED"] = $userUid;
$case = new Cases();
$appDocUid = $case->addInputDocument(
@@ -1502,6 +1512,8 @@ function PMFAddInputDocument(
$file
);
$g->sessionVarRestore();
return $appDocUid;
}
@@ -1518,14 +1530,26 @@ function PMFAddInputDocument(
*/
function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = null, $sUserLogged = null)
{
if (! $sApplication) {
$sApplication = $_SESSION['APPLICATION'];
$g = new G();
$g->sessionVarSave();
if ($sApplication) {
$_SESSION["APPLICATION"] = $sApplication;
} else {
$sApplication = $_SESSION["APPLICATION"];
}
if (! $index) {
$index = $_SESSION['INDEX'];
if ($index) {
$_SESSION["INDEX"] = $index;
} else {
$index = $_SESSION["INDEX"];
}
if (! $sUserLogged) {
$sUserLogged = $_SESSION['USER_LOGGED'];
if ($sUserLogged) {
$_SESSION["USER_LOGGED"] = $sUserLogged;
} else {
$sUserLogged = $_SESSION["USER_LOGGED"];
}
G::LoadClass( 'case' );
@@ -1688,6 +1712,8 @@ function PMFGenerateOutputDocument ($outputID, $sApplication = null, $index = nu
break;
}
}
$g->sessionVarRestore();
}
/**
@@ -2157,7 +2183,15 @@ function PMFgetLabelOption ($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTE
*/
function PMFRedirectToStep ($sApplicationUID, $iDelegation, $sStepType, $sStepUid)
{
$iDelegation = intval( $iDelegation );
$g = new G();
$g->sessionVarSave();
$iDelegation = intval($iDelegation);
$_SESSION["APPLICATION"] = $sApplicationUID;
$_SESSION["INDEX"] = $iDelegation;
require_once 'classes/model/AppDelegation.php';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( AppDelegationPeer::TAS_UID );
@@ -2206,10 +2240,15 @@ function PMFRedirectToStep ($sApplicationUID, $iDelegation, $sStepType, $sStepUi
$aFields['APP_DATA'] = $oPMScript->aFields;
$oCase->updateCase( $sApplicationUID, $aFields );
}
$g->sessionVarRestore();
G::header( 'Location: ' . 'cases_Step?TYPE=' . $sStepType . '&UID=' . $sStepUid . '&POSITION=' . $oTheStep->getStepPosition() . '&ACTION=' . $sAction );
die();
}
}
$g->sessionVarRestore();
}
/**