adding validations while importing pm file
This commit is contained in:
@@ -23,39 +23,41 @@
|
|||||||
*/
|
*/
|
||||||
ini_set( 'max_execution_time', '0' );
|
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") {
|
if ($ext == "pmx") {
|
||||||
$importer = new \ProcessMaker\Importer\XmlImporter();
|
$importer = new \ProcessMaker\Importer\XmlImporter();
|
||||||
$importer->setSourceFromGlobals("PROCESS_FILENAME");
|
$importer->setSourceFromGlobals("PROCESS_FILENAME");
|
||||||
$importer->setData("usr_uid", $_SESSION['USER_LOGGED']);
|
$importer->setData("usr_uid", $_SESSION['USER_LOGGED']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$res = $importer->import();
|
$res = $importer->import();
|
||||||
|
|
||||||
$result = array(
|
$result = array(
|
||||||
"success" => true,
|
"success" => true,
|
||||||
"catchMessage" => "",
|
"catchMessage" => "",
|
||||||
"ExistProcessInDatabase" => 0,
|
"ExistProcessInDatabase" => 0,
|
||||||
"ExistGroupsInDatabase" => 0,
|
"ExistGroupsInDatabase" => 0,
|
||||||
"sNewProUid" => $res[0]["new_uid"],
|
"sNewProUid" => $res[0]["new_uid"],
|
||||||
"project_type" => "bpmn"
|
"project_type" => "bpmn"
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$result = array(
|
$result = array(
|
||||||
"success" => true,
|
"success" => true,
|
||||||
"catchMessage" => "", //$e->getMessage(),
|
"catchMessage" => "", //$e->getMessage(),
|
||||||
"ExistProcessInDatabase" => 1,
|
"ExistProcessInDatabase" => 1,
|
||||||
"ExistGroupsInDatabase" => 0,
|
"ExistGroupsInDatabase" => 0,
|
||||||
"groupBeforeAccion" => "uploadFileNewProcess",
|
"groupBeforeAccion" => "uploadFileNewProcess",
|
||||||
"sNewProUid" => "63626727053359dabb8fee8019503780",
|
"sNewProUid" => "63626727053359dabb8fee8019503780",
|
||||||
"proFileName" => $_FILES['PROCESS_FILENAME']['name'],
|
"proFileName" => $_FILES['PROCESS_FILENAME']['name'],
|
||||||
"project_type" => "bpmn"
|
"project_type" => "bpmn"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($result);
|
||||||
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($result);
|
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function reservedWordsSqlValidate ($data)
|
function reservedWordsSqlValidate ($data)
|
||||||
|
|||||||
Reference in New Issue
Block a user