This commit is contained in:
dheeyi
2016-03-22 16:32:33 -04:00
parent aa5524c49d
commit b3fa77ef52
7 changed files with 49 additions and 23 deletions

View File

@@ -3925,7 +3925,7 @@ class Processes
* @param array $arrayData
* @throws Exception
*/
public function updateFilesManager(array $arrayData)
public function updateFilesManager($processUid, array $arrayData)
{
try {
$filesManager = new \ProcessMaker\BusinessModel\FilesManager();

View File

@@ -27,7 +27,12 @@ class AssignmentRulesMigrator implements Importable, Exportable
// TODO: Implement beforeImport() method.
}
public function import($data)
/**
* @param $data
* @param $replace
* @throws ImportException
*/
public function import($data, $replace)
{
try {
$this->processes->createTaskRows($data);

View File

@@ -29,13 +29,17 @@ class FilesMigrator implements Importable, Exportable
// TODO: Implement beforeImport() method.
}
public function import($data)
public function import($data, $replace)
{
try {
$aTable = $data['TABLE'];
foreach ($aTable as $value) {
if ($value['PRF_EDITABLE'] !== 1) {
if ($replace) {
$this->processes->createFilesManager($value['PRO_UID'], array($value));
} else {
$this->processes->updateFilesManager($value['PRO_UID'], array($value));
}
}
}
$aPath = $data['PATH'];

View File

@@ -27,14 +27,22 @@ class TemplatesMigrator implements Importable, Exportable
// TODO: Implement beforeImport() method.
}
public function import($data)
/**
* @param $data
* @param $replace
* @throws ImportException
*/
public function import($data, $replace)
{
try {
//TABLE
$aTable = $data['TABLE'];
foreach ($aTable as $value) {
if ($value['PRF_EDITABLE'] === 1) {
if ($replace) {
$this->processes->createFilesManager($value['PRO_UID'], array($value));
} else {
$this->processes->updateFilesManager($value['PRO_UID'], array($value));
}
}
}
$aPath = $data['PATH'];

View File

@@ -27,10 +27,18 @@ class TriggersMigrator implements Importable, Exportable
// TODO: Implement beforeImport() method.
}
public function import($data)
/**
* @param $data
* @param $replace
*/
public function import($data, $replace)
{
try {
if ($replace) {
$this->processes->createTriggerRows($data);
} else {
$this->processes->updateTriggerRows($data);
}
} catch (\Exception $e) {
\Logger::log($e->getMessage());
throwException(new ImportException($e->getMessage()));

View File

@@ -29,8 +29,9 @@ class VariablesMigrator implements Importable, Exportable
}
/**
* Imports the process variables
* @param $data
* @param $replace
* @throws ImportException
*/
public function import($data, $replace)
{