MT-26
This commit is contained in:
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class AssignmentRulesMigrator implements Importable
|
class AssignmentRulesMigrator implements Importable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AssignmentRulesMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +29,11 @@ class AssignmentRulesMigrator implements Importable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement import() method.
|
try {
|
||||||
|
$this->processes->createTaskRows($data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class DBConnectionMigrator implements Importable, Exportable
|
class DBConnectionMigrator implements Importable, Exportable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DBConnectionMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +29,11 @@ class DBConnectionMigrator implements Importable, Exportable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
$this->processes->createDBConnectionsRows($data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class DynaformsMigrator implements Importable, Exportable
|
class DynaformsMigrator implements Importable, Exportable
|
||||||
|
|||||||
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class FilesMigrator implements Importable
|
class FilesMigrator implements Importable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FilesMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +29,11 @@ class FilesMigrator implements Importable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
$this->processes->createFilesManager($data[0]['PRO_UID'],$data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class InputDocumentsMigrator implements Importable, Exportable
|
|||||||
protected $processes;
|
protected $processes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DynaformsMigrator constructor.
|
* InputDocumentsMigrator constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class OutputDocumentsMigrator implements Importable, Exportable
|
|||||||
protected $processes;
|
protected $processes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DynaformsMigrator constructor.
|
* OutputDocumentsMigrator constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ProcessDefinitionMigrator implements Importable, Exportable
|
|||||||
protected $bpmn;
|
protected $bpmn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DynaformsMigrator constructor.
|
* ProcessDefinitionMigrator constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -32,8 +32,9 @@ class ProcessDefinitionMigrator implements Importable, Exportable
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->bpmn->createFromStruct($data);
|
$this->bpmn->createFromStruct($data);
|
||||||
|
return $result;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Logger::log($e);
|
return $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class TemplatesMigrator implements Importable
|
class TemplatesMigrator implements Importable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TemplatesMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,6 +29,41 @@ class TemplatesMigrator implements Importable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
foreach ($data as $target => $files) {
|
||||||
|
switch (strtoupper($target)) {
|
||||||
|
case 'DYNAFORMS':
|
||||||
|
$basePath = PATH_DYNAFORM;
|
||||||
|
break;
|
||||||
|
case 'PUBLIC':
|
||||||
|
$basePath = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
|
||||||
|
break;
|
||||||
|
case 'TEMPLATES':
|
||||||
|
$basePath = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'mailTemplates' . PATH_SEP;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$basePath = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($basePath)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$filename = $basePath . ((isset($file["file_path"]))? $file["file_path"] : $file["filepath"]);
|
||||||
|
$path = dirname($filename);
|
||||||
|
|
||||||
|
if (!is_dir($path)) {
|
||||||
|
Util\Common::mk_dir($path, 0775);
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents($filename, $file["file_content"]);
|
||||||
|
chmod($filename, 0775);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class TriggersMigrator implements Importable, Exportable
|
class TriggersMigrator implements Importable, Exportable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TriggersMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +29,11 @@ class TriggersMigrator implements Importable, Exportable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
$this->processes->createTriggerRows($data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class VariablesMigrator implements Importable
|
class VariablesMigrator implements Importable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VariablesMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +29,11 @@ class VariablesMigrator implements Importable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
$this->processes->createProcessVariables($data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
Reference in New Issue
Block a user