diff --git a/workflow/engine/bin/tasks/cliAddons.php b/workflow/engine/bin/tasks/cliAddons.php index 27af448db..1fdffd8cf 100644 --- a/workflow/engine/bin/tasks/cliAddons.php +++ b/workflow/engine/bin/tasks/cliAddons.php @@ -21,7 +21,7 @@ EOT /*----------------------------------********---------------------------------*/ CLI::taskName('change-password-hash-method'); CLI::taskDescription(<<db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) { switch ($pDbDriver) { @@ -323,7 +331,15 @@ class NET set_time_limit( 0 ); $stat = new Stat(); - $flagTns = (isset($arrayServerData["connectionType"]) && $arrayServerData["connectionType"] == "TNS")? 1 : 0; + if (array_key_exists("connectionType", $arrayServerData) || array_key_exists("DBS_TYPEORACLE", $arrayServerData)) { + if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") { + $flagTns=1; + }else{ + $flagTns=0; + } + }else{ + $flagTns=0; + } if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) { switch ($pDbDriver) { diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index f69f43390..78dd3f11f 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -885,7 +885,7 @@ function PMFSendMessage( if ($result->status_code == 0) { return 1; } else { - error_log($result->message); + error_log($result->message); return 0; } } @@ -1402,8 +1402,8 @@ function WSUnpauseCase ($caseUid, $delIndex, $userUid) * * Add a case note. * - * @name WSAddCaseNote - * @label WS Add case note + * @name WSAddACaseNote + * @label WS Add a case note * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#WSAddCaseNote.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. @@ -1539,8 +1539,8 @@ function PMFUserList () //its test was successfull * * Add an Input Document. * - * @name PMFAddInputDocument - * @label PMF Add a input document + * @name PMFAddAnInputDocument + * @label PMF Add an input document * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddInputDocument.28.29 * * @param string(32) | $inputDocumentUid | ID of the input document | The unique ID of the input document. @@ -2773,8 +2773,8 @@ function PMFUnpauseCase ($caseUid, $delIndex, $userUid) * * Add case note. * - * @name PMFAddCaseNote - * @label PMF Add case note + * @name PMFAddACaseNote + * @label PMF Add a case note * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFAddCaseNote.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/class.processes.php index 6725e8f66..3f0d72746 100755 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/class.processes.php @@ -2290,14 +2290,16 @@ class Processes try { $map = array(); - foreach ($data->messageType as $key => $value) { - $record = $value; + if (isset($data->messageType)) { + foreach ($data->messageType as $key => $value) { + $record = $value; - if (isset($record["MSGT_UID"])) { - $newUid = $this->getUnusedMessageTypeUid(); + if (isset($record["MSGT_UID"])) { + $newUid = $this->getUnusedMessageTypeUid(); - $map[$record["MSGT_UID"]] = $newUid; - $data->messageType[$key]["MSGT_UID"] = $newUid; + $map[$record["MSGT_UID"]] = $newUid; + $data->messageType[$key]["MSGT_UID"] = $newUid; + } } } @@ -2344,14 +2346,16 @@ class Processes try { $map = array(); - foreach ($data->messageTypeVariable as $key => $value) { - $record = $value; + if (isset($data->messageTypeVariable)) { + foreach ($data->messageTypeVariable as $key => $value) { + $record = $value; - if (isset($record["MSGTV_UID"])) { - $newUid = $this->getUnusedMessageTypeVariableUid(); + if (isset($record["MSGTV_UID"])) { + $newUid = $this->getUnusedMessageTypeVariableUid(); - $map[$record["MSGTV_UID"]] = $newUid; - $data->messageTypeVariable[$key]["MSGTV_UID"] = $newUid; + $map[$record["MSGTV_UID"]] = $newUid; + $data->messageTypeVariable[$key]["MSGTV_UID"] = $newUid; + } } } diff --git a/workflow/engine/methods/processes/processes_Ajax.php b/workflow/engine/methods/processes/processes_Ajax.php index bb3b3555a..01fe49f6e 100755 --- a/workflow/engine/methods/processes/processes_Ajax.php +++ b/workflow/engine/methods/processes/processes_Ajax.php @@ -462,6 +462,7 @@ try { break; case 5: $sType = 'SEC-JOIN'; + $oProcessNewPattern = new Process(); $taskProcess=$oProcessNewPattern->load($oData->pro_uid); $titleProcess=$taskProcess['PRO_TITLE']; $oTaskNewPattern = new Task(); @@ -478,6 +479,7 @@ try { break; case 8: $sType = 'DISCRIMINATOR'; + $oProcessNewPattern = new Process(); $taskProcess=$oProcessNewPattern->load($oData->pro_uid); $titleProcess=$taskProcess['PRO_TITLE']; $oTaskNewPattern = new Task(); diff --git a/workflow/engine/src/ProcessMaker/Importer/Importer.php b/workflow/engine/src/ProcessMaker/Importer/Importer.php index 1aef380dc..a240f90cd 100755 --- a/workflow/engine/src/ProcessMaker/Importer/Importer.php +++ b/workflow/engine/src/ProcessMaker/Importer/Importer.php @@ -73,8 +73,7 @@ abstract class Importer { $this->prepare(); - $name = $this->importData["tables"]["bpmn"]["project"][0]["prj_name"]; - + //Verify data switch ($option) { case self::IMPORT_OPTION_CREATE_NEW: if ($this->targetExists()) { @@ -94,23 +93,12 @@ abstract class Importer self::IMPORT_STAT_TARGET_ALREADY_EXISTS ); } - $generateUid = false; break; case self::IMPORT_OPTION_OVERWRITE: - $this->removeProject(); - // this option shouldn't generate new uid for all objects - $generateUid = false; break; 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; 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; } @@ -149,6 +137,36 @@ abstract class Importer 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"]["diagram"][0]["dia_name"] = $name; $this->importData["tables"]["bpmn"]["process"][0]["pro_name"] = $name;