IMPROVEMENT

This commit is contained in:
Roly Rudy Gutierrez Pinto
2015-03-06 18:22:46 -04:00
parent 7ba1b1233b
commit a1eaba6252
4 changed files with 6 additions and 15 deletions

View File

@@ -26,7 +26,6 @@ class Designer extends Controller
$proUid = isset($httpData->prj_uid) ? $httpData->prj_uid : '';
$appUid = isset($httpData->app_uid) ? $httpData->app_uid : '';
$proReadOnly = isset($httpData->prj_readonly) ? $httpData->prj_readonly : 'false';
$stringBpmn = isset($httpData->stringBpmn) ? '<textarea id="stringBpmn" style="display:none">' . base64_decode($httpData->stringBpmn) . '</textarea>' : '';
$client = $this->getClientCredentials();
$authCode = $this->getAuthorizationCode($client);
$debug = false; //System::isDebugMode();
@@ -57,7 +56,6 @@ class Designer extends Controller
$this->setVar('prj_uid', $proUid);
$this->setVar('app_uid', $appUid);
$this->setVar('stringBpmn', $stringBpmn);
$this->setVar('prj_readonly', $proReadOnly);
$this->setVar('credentials', base64_encode(json_encode($clientToken)));
$this->setVar('isDebugMode', $debug);

View File

@@ -15,7 +15,6 @@ if (isset($_FILES["PROCESS_FILENAME"]) &&
"PRO_CATEGORY" => "",
"PRO_CREATE_USER" => $_SESSION['USER_LOGGED']
);
$stringBpmn = base64_encode(file_get_contents($_FILES["PROCESS_FILENAME"]["tmp_name"]));
if ($createMode === "overwrite") {
$process = Process::getByProTitle($data["PRO_TITLE"]);
if ($process !== null) {
@@ -27,11 +26,11 @@ if (isset($_FILES["PROCESS_FILENAME"]) &&
$data["PRO_TITLE"] = Process::getNextTitle($data["PRO_TITLE"]);
}
$project = new \ProcessMaker\Project\Adapter\WorkflowBpmn($data);
copy($_FILES["PROCESS_FILENAME"]["tmp_name"], PATH_DOCUMENT . $project->getUid());
$result = array(
"success" => true,
"catchMessage" => "",
"prj_uid" => $project->getUid(),
"stringBpmn" => $stringBpmn,
"createMode" => $createMode
);
} catch (Exception $e) {

View File

@@ -1091,6 +1091,10 @@ class BpmnWorkflow extends Project\Bpmn
$diagram["participants"] = $bwp->getParticipants($configList);
$project["diagrams"][] = $diagram;
}
if (file_exists(PATH_DOCUMENT . $project["prj_uid"])) {
$project["prj_bpmn_file_upload"] = file_get_contents(PATH_DOCUMENT . $project["prj_uid"]);
unlink(PATH_DOCUMENT . $project["prj_uid"]);
}
return $project;
}

View File

@@ -1432,17 +1432,7 @@ importProcessBpmnSubmit = function () {
return;
}
Ext.getCmp('importProcessWindow').close();
var stringxml = document.createElement("input");
stringxml.type = "hidden";
stringxml.name = "stringBpmn";
stringxml.value = resp_.stringBpmn;
var form = document.createElement("form");
document.body.appendChild(form);
form.appendChild(stringxml);
form.style.display = "none";
form.action = "../designer?prj_uid=" + resp_.prj_uid;
form.method = "POST";
form.submit();
window.location.href = "../designer?prj_uid=" + resp_.prj_uid;
},
failure: function (o, resp) {
Ext.getCmp('importProcessWindow').close();