Merged in caleeli/processmaker/HOR-477 (pull request #3880)

HOR-477
This commit is contained in:
Julio Cesar Laura Avendaño
2016-03-21 08:52:30 -04:00

View File

@@ -12,6 +12,11 @@ abstract class Importer
protected $filename = "";
protected $saveDir = "";
protected $metadata = array();
/**
* Title of the process before being updated/deleted.
* @var string
*/
protected $currentProcessTitle = "";
public static $affectedGroups = array();
const IMPORT_OPTION_OVERWRITE = "project.import.override";
@@ -165,7 +170,7 @@ abstract class Importer
case self::IMPORT_OPTION_OVERWRITE:
//Shouldn't generate new UID for all objects
$this->removeProject();
$name = $this->currentProcessTitle;
$generateUid = false;
break;
case self::IMPORT_OPTION_DISABLE_AND_CREATE_NEW:
@@ -278,6 +283,10 @@ abstract class Importer
public function removeProject()
{
/* @var $process \Process */
$process = new \Process();
$process->load($this->metadata["uid"]);
$this->currentProcessTitle = $process->getProTitle();
$project = \ProcessMaker\Project\Adapter\BpmnWorkflow::load($this->metadata["uid"]);
$project->remove(true, false);
}