MT-12: solved conflicts
This commit is contained in:
@@ -24,16 +24,17 @@ class ExportObjects
|
||||
);
|
||||
|
||||
/**
|
||||
* @param string $pro_uid
|
||||
* @param string $objectsEnable
|
||||
* @return mixed|string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function objectList($pro_uid = '')
|
||||
public function objectList($objectsEnable = '')
|
||||
{
|
||||
try {
|
||||
$aObjectsEnable = explode('|', $objectsEnable);
|
||||
foreach ($this->objectsList as $key => $val) {
|
||||
$key++;
|
||||
$grid[] = array('OBJECT_ID' => $key, 'OBJECT_NAME' => $val, 'OBJECT_ACTION' => 0);
|
||||
$grid[] = array('OBJECT_ID' => $key, 'OBJECT_NAME' => $val, 'OBJECT_ENABLE' => in_array(strtoupper(str_replace(' ', '',$val)), $aObjectsEnable) );
|
||||
}
|
||||
|
||||
$r = new \stdclass();
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace ProcessMaker\Importer;
|
||||
use ProcessMaker\Util;
|
||||
use ProcessMaker\Project;
|
||||
use ProcessMaker\Project\Adapter;
|
||||
use ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
abstract class Importer
|
||||
{
|
||||
@@ -76,7 +77,7 @@ abstract class Importer
|
||||
}
|
||||
}
|
||||
|
||||
public function import($option = self::IMPORT_OPTION_CREATE_NEW, $optionGroup = self::GROUP_IMPORT_OPTION_CREATE_NEW, $generateUidFromJs = null)
|
||||
public function import($option = self::IMPORT_OPTION_CREATE_NEW, $optionGroup = self::GROUP_IMPORT_OPTION_CREATE_NEW, $generateUidFromJs = null, $granularImporter = 'NO', $granularOptions = '')
|
||||
{
|
||||
$this->prepare();
|
||||
|
||||
@@ -169,7 +170,13 @@ abstract class Importer
|
||||
break;
|
||||
case self::IMPORT_OPTION_OVERWRITE:
|
||||
//Shouldn't generate new UID for all objects
|
||||
$this->removeProject();
|
||||
if($granularImporter === 'NO'){
|
||||
$this->removeProject();
|
||||
} else {
|
||||
if(in_array('PROCESSDEFINITION', $granularOptions)){
|
||||
$this->removeProject();
|
||||
}
|
||||
}
|
||||
$name = $this->currentProcessTitle;
|
||||
$generateUid = false;
|
||||
break;
|
||||
@@ -204,6 +211,24 @@ abstract class Importer
|
||||
if(!empty($generateUidFromJs)) {
|
||||
$generateUid = $generateUidFromJs;
|
||||
}
|
||||
|
||||
//Granular Import
|
||||
switch ($granularImporter) {
|
||||
case '':
|
||||
throw new \Exception(\G::LoadTranslation("ID_GRANULAR"),self::IMPORTED_PROJECT_DOES_NOT_EXISTS);
|
||||
break;
|
||||
case 'YES':
|
||||
if($granularOptions === 'YES'){
|
||||
$granularObj = new \ProcessMaker\BusinessModel\Migrator\GranularImporter();
|
||||
$objectList = $granularObj->loadObjectsListSelected($this->importData, $granularOptions);
|
||||
if(sizeof($objectList)>0){
|
||||
$granularObj->import($objectList);
|
||||
}
|
||||
return $this->importData['tables']['bpmn']["project"][0]["prj_uid"];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$result = $this->doImport($generateUid);
|
||||
|
||||
//Return
|
||||
|
||||
@@ -8,7 +8,8 @@ class XmlImporter extends Importer
|
||||
*/
|
||||
protected $dom;
|
||||
protected $root;
|
||||
protected $version = "";
|
||||
protected $version = '';
|
||||
protected $objects = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -129,10 +130,14 @@ class XmlImporter extends Importer
|
||||
);
|
||||
}
|
||||
}
|
||||
//Get the ProcessObject
|
||||
$this->objects = (isset($this->metadata['processObject'])) ? $this->metadata['processObject'] : '';
|
||||
|
||||
return array(
|
||||
"tables" => $tables,
|
||||
"files" => array("workflow" => $wfFiles, "bpmn" => array())
|
||||
"tables" => $tables,
|
||||
"files" => array("workflow" => $wfFiles, "bpmn" => array()),
|
||||
"version" => $this->version,
|
||||
"objects" => $this->objects
|
||||
);
|
||||
}
|
||||
|
||||
@@ -144,5 +149,22 @@ class XmlImporter extends Importer
|
||||
return (string) simplexml_import_dom($node->parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the $version value
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
/**
|
||||
* Gets the $objects value
|
||||
* @return string
|
||||
*/
|
||||
public function getObjects()
|
||||
{
|
||||
return $this->objects;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user