Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-04-02 11:21:03 -04:00
2 changed files with 39 additions and 30 deletions

View File

@@ -136,7 +136,14 @@
</exec>
</target>
<target name="behat" description="Behaviour tests with Behat">
<target name="prepare-behat" description="Prepare Behat Env.">
<exec executable="${basedir}/../prepare_behat_env">
<arg value="--source-dir" />
<arg value="${basedir}/../" />
</exec>
</target>
<target name="behat" description="Behaviour tests with Behat" depends="prepare-behat">
<exec executable="vendor/behat/behat/bin/behat">
<arg value="--format" />
<arg value="junit,progress" />

View File

@@ -23,39 +23,41 @@
*/
ini_set( 'max_execution_time', '0' );
$ext = pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION);
if (isset($_FILES["PROCESS_FILENAME"])) {
$ext = pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION);
if ($ext == "pmx") {
$importer = new \ProcessMaker\Importer\XmlImporter();
$importer->setSourceFromGlobals("PROCESS_FILENAME");
$importer->setData("usr_uid", $_SESSION['USER_LOGGED']);
if ($ext == "pmx") {
$importer = new \ProcessMaker\Importer\XmlImporter();
$importer->setSourceFromGlobals("PROCESS_FILENAME");
$importer->setData("usr_uid", $_SESSION['USER_LOGGED']);
try {
$res = $importer->import();
try {
$res = $importer->import();
$result = array(
"success" => true,
"catchMessage" => "",
"ExistProcessInDatabase" => 0,
"ExistGroupsInDatabase" => 0,
"sNewProUid" => $res[0]["new_uid"],
"project_type" => "bpmn"
);
} catch (Exception $e) {
$result = array(
"success" => true,
"catchMessage" => "", //$e->getMessage(),
"ExistProcessInDatabase" => 1,
"ExistGroupsInDatabase" => 0,
"groupBeforeAccion" => "uploadFileNewProcess",
"sNewProUid" => "63626727053359dabb8fee8019503780",
"proFileName" => $_FILES['PROCESS_FILENAME']['name'],
"project_type" => "bpmn"
);
$result = array(
"success" => true,
"catchMessage" => "",
"ExistProcessInDatabase" => 0,
"ExistGroupsInDatabase" => 0,
"sNewProUid" => $res[0]["new_uid"],
"project_type" => "bpmn"
);
} catch (Exception $e) {
$result = array(
"success" => true,
"catchMessage" => "", //$e->getMessage(),
"ExistProcessInDatabase" => 1,
"ExistGroupsInDatabase" => 0,
"groupBeforeAccion" => "uploadFileNewProcess",
"sNewProUid" => "63626727053359dabb8fee8019503780",
"proFileName" => $_FILES['PROCESS_FILENAME']['name'],
"project_type" => "bpmn"
);
}
echo json_encode($result);
exit(0);
}
echo json_encode($result);
exit(0);
}
function reservedWordsSqlValidate ($data)