HOR-2809
Preserve PRO_ID and TAS_ID in granular process import.
This commit is contained in:
@@ -5605,26 +5605,26 @@ class Processes
|
||||
public function loadIdsFromData($oData)
|
||||
{
|
||||
if (is_array($oData)) {
|
||||
$this->loadIdsFor(
|
||||
$oData['process'] = $this->loadIdsFor(
|
||||
Process::class,
|
||||
ProcessPeer::PRO_UID,
|
||||
ProcessPeer::PRO_ID,
|
||||
$oData['process']
|
||||
);
|
||||
$this->loadIdsFor(
|
||||
$oData['tasks'] = $this->loadIdsFor(
|
||||
Task::class,
|
||||
TaskPeer::TAS_UID,
|
||||
TaskPeer::TAS_ID,
|
||||
$oData['tasks']
|
||||
);
|
||||
} else {
|
||||
$this->loadIdsFor(
|
||||
$oData->process = $this->loadIdsFor(
|
||||
Process::class,
|
||||
ProcessPeer::PRO_UID,
|
||||
ProcessPeer::PRO_ID,
|
||||
$oData->process
|
||||
);
|
||||
$this->loadIdsFor(
|
||||
$oData->tasks = $this->loadIdsFor(
|
||||
Task::class,
|
||||
TaskPeer::TAS_UID,
|
||||
TaskPeer::TAS_ID,
|
||||
@@ -5701,10 +5701,10 @@ class Processes
|
||||
BasePeer::TYPE_COLNAME);
|
||||
} else {
|
||||
//$data is an array of row
|
||||
foreach ($data as &$dataRow) {
|
||||
foreach ($data as $i => $dataRow) {
|
||||
$model = new $modelClass();
|
||||
$row = $model->load($dataRow[$uidField]);
|
||||
$dataRow[$idField] = $model->getByName($idTableField,
|
||||
$data[$i][$idField] = $model->getByName($idTableField,
|
||||
BasePeer::TYPE_COLNAME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,9 @@ class Process extends BaseProcess
|
||||
} while ($this->processExists( $sNewProUid ));
|
||||
} else {
|
||||
$sNewProUid = $aData['PRO_UID'];
|
||||
if (!empty($aData['PRO_ID'])) {
|
||||
$this->setProId($aData['PRO_ID']);
|
||||
}
|
||||
}
|
||||
|
||||
$this->setProUid( $sNewProUid );
|
||||
|
||||
@@ -410,6 +410,9 @@ class Task extends BaseTask
|
||||
$this->setTasPosy("");
|
||||
$this->setTasColor("");
|
||||
$this->setTasGroupVariable("");
|
||||
if (!$generateUid && !empty($aData['TAS_ID'])) {
|
||||
$this->setTasId($aData['TAS_ID']);
|
||||
}
|
||||
$this->fromArray($aData,BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
if ($this->validate()) {
|
||||
|
||||
Reference in New Issue
Block a user