This commit is contained in:
Roly Rudy Gutierrez Pinto
2018-06-11 09:58:48 -04:00
parent 7052cae048
commit ea9c35c3d6
9 changed files with 67 additions and 32 deletions

View File

@@ -2,7 +2,9 @@
use ProcessMaker\BusinessModel\User as BusinessModelUser;
use ProcessMaker\BusinessModel\WebEntryEvent;
/*----------------------------------********---------------------------------*/
use ProcessMaker\ChangeLog\ChangeLog;
/*----------------------------------********---------------------------------*/
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
@@ -900,7 +902,7 @@ class Cases
$aFieldsHistory['APP_DATA'] = serialize($FieldsDifference);
$appHistory->insertHistory($aFieldsHistory);
/*----------------------------------********---------------------------------*/
$type = isset($Fields['OBJECT_TYPE']) ?
$Fields['OBJECT_TYPE'] : ChangeLog::getChangeLog()->getObjectNameById(ChangeLog::DYNAFORM);
ChangeLog::getChangeLog()
@@ -912,6 +914,7 @@ class Cases
->getTasIdByTasUid($Fields['TAS_UID'])
->getObjectIdByUidAndObjType($Fields['CURRENT_DYNAFORM'], $type)
->register();
/*----------------------------------********---------------------------------*/
}
}
//End Save History
@@ -3431,9 +3434,11 @@ class Cases
*/
public function executeTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType, $aFields = array())
{
/*----------------------------------********---------------------------------*/
ChangeLog::getChangeLog()
->setObjectUid($sStepUidObj)
->getExecutedAtIdByTriggerType($sTriggerType);
/*----------------------------------********---------------------------------*/
$aTriggers = $this->loadTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType);

View File

@@ -2,7 +2,9 @@
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\DB;
/*----------------------------------********---------------------------------*/
use ProcessMaker\ChangeLog\ChangeLog;
/*----------------------------------********---------------------------------*/
use ProcessMaker\Core\Installer;
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\Adapters\PluginAdapter;
@@ -341,12 +343,14 @@ class WorkspaceTools
$stop = microtime(true);
CLI::logging("<*> Migrating and populating plugin singleton data took " . ($stop - $start) . " seconds.\n");
/*----------------------------------********---------------------------------*/
$includeDynContent = isset($optionMigrateHistoryData['includeDynContent']) && $optionMigrateHistoryData['includeDynContent'] === true;
$start = microtime(true);
CLI::logging("> Migrating history data...\n");
$this->migrateAppHistoryToAppDataChangeLog(false, !$includeDynContent);
$stop = microtime(true);
CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n");
/*----------------------------------********---------------------------------*/
}
/**
@@ -2062,12 +2066,14 @@ class WorkspaceTools
//Updating generated class files for PM Tables
passthru(PHP_BINARY . ' processmaker regenerate-pmtable-classes ' . $workspace->name);
/*----------------------------------********---------------------------------*/
$includeDynContent = isset($optionMigrateHistoryData['includeDynContent']) && $optionMigrateHistoryData['includeDynContent'] === true;
$start = microtime(true);
CLI::logging("> Migrating history data...\n");
$workspace->migrateAppHistoryToAppDataChangeLog(false, !$includeDynContent);
$stop = microtime(true);
CLI::logging("<*> Migrating history data took " . ($stop - $start) . " seconds.\n");
/*----------------------------------********---------------------------------*/
}
CLI::logging("Removing temporary files\n");
@@ -4230,7 +4236,8 @@ class WorkspaceTools
$this->setLastContentMigrateTable(true);
}
}
/*----------------------------------********---------------------------------*/
/**
* Migrate the contents of table APP_HISTORY to table APP_DATA_CHANGE_LOG.
*
@@ -4389,4 +4396,5 @@ class WorkspaceTools
$conf->aConfig = ['updated' => true];
$conf->saveConfig('MIGRATED_APP_HISTORY', 'history');
}
/*----------------------------------********---------------------------------*/
}

View File

@@ -1,7 +1,9 @@
<?php
use ProcessMaker\BusinessModel\EmailServer;
/*----------------------------------********---------------------------------*/
use ProcessMaker\ChangeLog\ChangeLog;
/*----------------------------------********---------------------------------*/
use ProcessMaker\Core\System;
class WsBase
@@ -2257,6 +2259,7 @@ class WsBase
}
}
/*----------------------------------********---------------------------------*/
ChangeLog::getChangeLog()
->setDate('now')
->setAppNumber($appData['APP_NUMBER'])
@@ -2266,6 +2269,7 @@ class WsBase
->setData(serialize($appData))
->getExecutedAtIdByTriggerType($triggerType)
->getObjectIdByUidAndObjType($stepUidObj, $stepType);
/*----------------------------------********---------------------------------*/
return $varTriggers;
}