This commit is contained in:
dheeyi
2016-03-21 18:05:02 -04:00
parent 3f26b11f9a
commit b735ee25ad
3 changed files with 17 additions and 33 deletions

View File

@@ -52,31 +52,8 @@ class DynaformsMigrator implements Importable, Exportable
try {
$oData = new \StdClass();
$oData->dynaforms = $this->processes->getDynaformRows($prj_uid);
$workflowFile = array();
foreach ($oData->dynaforms as $dynaform) {
$dynFile = PATH_DYNAFORM . $dynaform['DYN_FILENAME'] . '.xml';
$workflowFile['DYNAFORMS'][] = array(
"filename" => $dynaform['DYN_TITLE'],
"filepath" => $dynaform['DYN_FILENAME'] . '.xml',
"file_content" => file_get_contents($dynFile)
);
$htmlFile = PATH_DYNAFORM . $dynaform['DYN_FILENAME'] . '.html';
if (file_exists($htmlFile)) {
$workflowFile['DYNAFORMS'][] = array(
"filename" => $dynaform['DYN_FILENAME'] . '.html',
"filepath" => $dynaform['DYN_FILENAME'] . '.html',
"file_content" => file_get_contents($htmlFile)
);
}
}
$result = array(
'workflow-definition' => (array)$oData,
'workflow-files' => $workflowFile
'workflow-definition' => (array)$oData
);
return $result;

View File

@@ -145,12 +145,11 @@ class Project extends Api
{
$objects = \G::json_decode($objects);
$granularExporter = new GranularExporter($prj_uid);
$outputFilename = $granularExporter->export($objects->objectList);
$outputFilename = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" .
$outputFilename = $granularExporter->export($objects);
$outputFilename = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'files' . PATH_SEP . 'output' .
PATH_SEP . $outputFilename;
$httpStream = new HttpStream();
$fileExtension = pathinfo($outputFilename, PATHINFO_EXTENSION);
$httpStream->loadFromFile($outputFilename);
$httpStream->setHeader("Content-Type", "application/xml; charset=UTF-8");
$httpStream->send();