Merged in victorsl/processmaker/PM-1700 (pull request #1586)
PM-1700 "Ocurre un error al importar y actualizar un proceso..." SOLVED
This commit is contained in:
@@ -2290,6 +2290,7 @@ class Processes
|
|||||||
try {
|
try {
|
||||||
$map = array();
|
$map = array();
|
||||||
|
|
||||||
|
if (isset($data->messageType)) {
|
||||||
foreach ($data->messageType as $key => $value) {
|
foreach ($data->messageType as $key => $value) {
|
||||||
$record = $value;
|
$record = $value;
|
||||||
|
|
||||||
@@ -2300,6 +2301,7 @@ class Processes
|
|||||||
$data->messageType[$key]["MSGT_UID"] = $newUid;
|
$data->messageType[$key]["MSGT_UID"] = $newUid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data->uid["MESSAGE_TYPE"] = $map;
|
$data->uid["MESSAGE_TYPE"] = $map;
|
||||||
|
|
||||||
@@ -2344,6 +2346,7 @@ class Processes
|
|||||||
try {
|
try {
|
||||||
$map = array();
|
$map = array();
|
||||||
|
|
||||||
|
if (isset($data->messageTypeVariable)) {
|
||||||
foreach ($data->messageTypeVariable as $key => $value) {
|
foreach ($data->messageTypeVariable as $key => $value) {
|
||||||
$record = $value;
|
$record = $value;
|
||||||
|
|
||||||
@@ -2354,6 +2357,7 @@ class Processes
|
|||||||
$data->messageTypeVariable[$key]["MSGTV_UID"] = $newUid;
|
$data->messageTypeVariable[$key]["MSGTV_UID"] = $newUid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data->uid["MESSAGE_TYPE_VARIABLE"] = $map;
|
$data->uid["MESSAGE_TYPE_VARIABLE"] = $map;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ abstract class Importer
|
|||||||
{
|
{
|
||||||
$this->prepare();
|
$this->prepare();
|
||||||
|
|
||||||
$name = $this->importData["tables"]["bpmn"]["project"][0]["prj_name"];
|
//Verify data
|
||||||
|
|
||||||
switch ($option) {
|
switch ($option) {
|
||||||
case self::IMPORT_OPTION_CREATE_NEW:
|
case self::IMPORT_OPTION_CREATE_NEW:
|
||||||
if ($this->targetExists()) {
|
if ($this->targetExists()) {
|
||||||
@@ -94,23 +93,12 @@ abstract class Importer
|
|||||||
self::IMPORT_STAT_TARGET_ALREADY_EXISTS
|
self::IMPORT_STAT_TARGET_ALREADY_EXISTS
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$generateUid = false;
|
|
||||||
break;
|
break;
|
||||||
case self::IMPORT_OPTION_OVERWRITE:
|
case self::IMPORT_OPTION_OVERWRITE:
|
||||||
$this->removeProject();
|
|
||||||
// this option shouldn't generate new uid for all objects
|
|
||||||
$generateUid = false;
|
|
||||||
break;
|
break;
|
||||||
case self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW:
|
case self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW:
|
||||||
$this->disableProject();
|
|
||||||
// this option should generate new uid for all objects
|
|
||||||
$generateUid = true;
|
|
||||||
$name = "New - " . $name . " - " . date("M d, H:i");
|
|
||||||
break;
|
break;
|
||||||
case self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW:
|
case self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW:
|
||||||
// this option should generate new uid for all objects
|
|
||||||
$generateUid = true;
|
|
||||||
$name = \G::LoadTranslation("ID_COPY_OF") . " - " . $name . " - " . date("M d, H:i");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,6 +137,36 @@ abstract class Importer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Import
|
||||||
|
$name = $this->importData["tables"]["bpmn"]["project"][0]["prj_name"];
|
||||||
|
|
||||||
|
switch ($option) {
|
||||||
|
case self::IMPORT_OPTION_CREATE_NEW:
|
||||||
|
//Shouldn't generate new UID for all objects
|
||||||
|
$generateUid = false;
|
||||||
|
break;
|
||||||
|
case self::IMPORT_OPTION_OVERWRITE:
|
||||||
|
//Shouldn't generate new UID for all objects
|
||||||
|
$this->removeProject();
|
||||||
|
|
||||||
|
$generateUid = false;
|
||||||
|
break;
|
||||||
|
case self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW:
|
||||||
|
//Should generate new UID for all objects
|
||||||
|
$this->disableProject();
|
||||||
|
|
||||||
|
$name = "New - " . $name . " - " . date("M d, H:i");
|
||||||
|
|
||||||
|
$generateUid = true;
|
||||||
|
break;
|
||||||
|
case self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW:
|
||||||
|
//Should generate new UID for all objects
|
||||||
|
$name = \G::LoadTranslation("ID_COPY_OF") . " - " . $name . " - " . date("M d, H:i");
|
||||||
|
|
||||||
|
$generateUid = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$this->importData["tables"]["bpmn"]["project"][0]["prj_name"] = $name;
|
$this->importData["tables"]["bpmn"]["project"][0]["prj_name"] = $name;
|
||||||
$this->importData["tables"]["bpmn"]["diagram"][0]["dia_name"] = $name;
|
$this->importData["tables"]["bpmn"]["diagram"][0]["dia_name"] = $name;
|
||||||
$this->importData["tables"]["bpmn"]["process"][0]["pro_name"] = $name;
|
$this->importData["tables"]["bpmn"]["process"][0]["pro_name"] = $name;
|
||||||
|
|||||||
Reference in New Issue
Block a user