Merged in dheeyi/processmaker/MT-100 (pull request #4056)

MT-100
This commit is contained in:
Julio Cesar Laura Avendaño
2016-04-08 12:21:34 -04:00
4 changed files with 69 additions and 46 deletions

View File

@@ -31,7 +31,16 @@ $conf = new Configurations();
$pmVersion = (preg_match("/^([\d\.]+).*$/", System::getVersion(), $arrayMatch))? $arrayMatch[1] : ""; //Otherwise: Branch master
$arrayFlagImportFileExtension = array("pm", "pmx", "bpmn");
/*----------------------------------********---------------------------------*/
if (true) {
$arrayFlagImportFileExtension = array("pm", "pmx", "pmx2", "bpmn");
} else {
/*----------------------------------********---------------------------------*/
$arrayFlagImportFileExtension = array("pm", "pmx", "bpmn");
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
$arrayFlagMenuNewOption = array("pm" => true, "bpmn" => true);
if ($pmVersion != "") {

View File

@@ -33,7 +33,7 @@ $objectsToImport = '';
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") &&
isset($_FILES["PROCESS_FILENAME"]) &&
$_FILES["PROCESS_FILENAME"]["error"] == 0 &&
preg_match("/^(?:pm|pmx)$/", pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION))
preg_match("/^(?:pm|pmx|pmx2)$/", pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION))
) {
//Check disabled code
$response = array();
@@ -55,6 +55,7 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
}
break;
case "pmx":
case "pmx2":
$importer = new XmlImporter();
$data = $importer->load($_FILES["PROCESS_FILENAME"]["tmp_name"]);
if (isset($data["tables"]["workflow"]["triggers"]) && is_array($data["tables"]["workflow"]["triggers"]) && !empty($data["tables"]["workflow"]["triggers"])) {
@@ -109,8 +110,9 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
}
/*----------------------------------********---------------------------------*/
if (isset($_FILES["PROCESS_FILENAME"]) &&
pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION) == "pmx"
if (isset($_FILES["PROCESS_FILENAME"]) && (pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION) == "pmx"
|| pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION) == "pmx2")
) {
$importer = new XmlImporter();
$importer->setData("usr_uid", $_SESSION["USER_LOGGED"]);
@@ -219,8 +221,10 @@ if (isset($_FILES["PROCESS_FILENAME"]) &&
}
if (isset($_POST["PRO_FILENAME"]) &&
file_exists(PATH_DOCUMENT . "input" . PATH_SEP . $_POST["PRO_FILENAME"]) &&
pathinfo(PATH_DOCUMENT . "input" . PATH_SEP . $_POST["PRO_FILENAME"], PATHINFO_EXTENSION) == "pmx"
file_exists(PATH_DOCUMENT . "input" . PATH_SEP . $_POST["PRO_FILENAME"]) && (pathinfo(PATH_DOCUMENT . "input" .
PATH_SEP . $_POST["PRO_FILENAME"], PATHINFO_EXTENSION) == "pmx" || pathinfo(PATH_DOCUMENT . "input" .
PATH_SEP . $_POST["PRO_FILENAME"], PATHINFO_EXTENSION) == "pmx2")
) {
$option = XmlImporter::IMPORT_OPTION_CREATE_NEW;

View File

@@ -55,8 +55,8 @@ class GranularExporter
$projectData = $bpmnProject->getProject();
$getProjectName = $this->publisher->truncateName($projectData['PRJ_NAME'], false);
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$version = \ProcessMaker\Util\Common::getLastVersion($outputDir . $getProjectName . "-*.pmx") + 1;
$outputFilename = $outputDir . sprintf("%s-%s.%s", str_replace(" ", "_", $getProjectName), $version, "pmx");
$version = \ProcessMaker\Util\Common::getLastVersion($outputDir . $getProjectName . "-*.pmx2") + 1;
$outputFilename = $outputDir . sprintf("%s-%s.%s", str_replace(" ", "_", $getProjectName), $version, "pmx2");
$bpnmDefinition = array(
'ACTIVITY' => [],

View File

@@ -991,9 +991,11 @@ var deleteCases = function(){
function exportProcess() {
var record = processesGrid.getSelectionModel().getSelections();
if(record.length == 1) {
if(Ext.getCmp('exportProcessObjectsWindow')) {
if (record.length == 1) {
if (Ext.getCmp('exportProcessObjectsWindow')) {
Ext.getCmp('exportProcessObjectsWindow').close();
} else {
processObjectsArray = '';
}
var myMask = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_LOADING")});
var proUid = record[0].get("PRO_UID");
@@ -1014,7 +1016,12 @@ function exportProcess() {
if (result.success) {
window.location = "../processes/processes_DownloadFile?file_hash=" + result.file_hash;
} else {
Ext.Msg.show({title: "", msg: result.message, icon: Ext.MessageBox.ERROR, buttons: Ext.MessageBox.OK});
Ext.Msg.show({
title: "",
msg: result.message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK
});
}
},
@@ -1914,6 +1921,9 @@ importProcess = function()
switch (fileExtension) {
case "pm":
case "pmx":
/*----------------------------------********---------------------------------*/
case "pmx2":
/*----------------------------------********---------------------------------*/
var uploader = Ext.getCmp("uploader");
if (uploader.getForm().isValid()) {