Merged in gproly/processmaker/PM-4409 (pull request #3354)

PM-4409
This commit is contained in:
Julio Cesar Laura Avendaño
2015-12-10 11:05:30 -04:00
4 changed files with 15 additions and 22 deletions

View File

@@ -971,11 +971,6 @@ class Cases
public function updateCase($sAppUid, $Fields = array())
{
try {
$dynContentHistory = "";
if (isset($Fields["APP_DATA"]) && isset($Fields["APP_DATA"]["DYN_CONTENT_HISTORY"])) {
$dynContentHistory = $Fields["APP_DATA"]["DYN_CONTENT_HISTORY"];
unset($Fields["APP_DATA"]["DYN_CONTENT_HISTORY"]);
}
$oApplication = new Application;
if (!$oApplication->exists($sAppUid)) {
return false;
@@ -1012,11 +1007,13 @@ class Cases
}
}
if ((is_array($FieldsDifference)) && (count($FieldsDifference) > 0)) {
$oCurrentDynaform = new Dynaform();
$currentDynaform = $oCurrentDynaform->Load($Fields['CURRENT_DYNAFORM']);
//There are changes
$Fields['APP_STATUS'] = (isset($Fields['APP_STATUS'])) ? $Fields['APP_STATUS'] : $FieldsBefore['APP_STATUS'];
$appHistory = new AppHistory();
$aFieldsHistory = $Fields;
$FieldsDifference['DYN_CONTENT_HISTORY'] = $dynContentHistory;
$FieldsDifference['DYN_CONTENT_HISTORY'] = base64_encode($currentDynaform["DYN_CONTENT"]);
$aFieldsHistory['APP_DATA'] = serialize($FieldsDifference);
$appHistory->insertHistory($aFieldsHistory);
}