Merge branch 'master' of bitbucket.org:colosa/processmaker into BUG-12021

This commit is contained in:
norahmollo
2014-10-07 16:19:19 -04:00
5 changed files with 66 additions and 33 deletions

View File

@@ -929,6 +929,17 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
$Fields['APP_DOC_UID'] = $_POST['appDocId'];
$Fields['actionType'] = $_POST['actionType'];
$Fields['docVersion'] = $_POST['docVersion'];
$oInputDocument = new InputDocument();
$InpDocData = $oInputDocument->load( $Fields['DOC_UID'] );
$inpDocMaxFilesize = $InpDocData["INP_DOC_MAX_FILESIZE"];
$inpDocMaxFilesizeUnit = $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"];
$inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes
$Fields["INP_DOC_MAX_FILESIZE"] = $inpDocMaxFilesize;
$Fields["INP_DOC_MAX_FILESIZE_LABEL"] = ($inpDocMaxFilesize > 0)? "[" . $InpDocData["INP_DOC_MAX_FILESIZE"] . " " . $InpDocData["INP_DOC_MAX_FILESIZE_UNIT"] . "]" : "";
$Fields['fileTypes'] = $InpDocData['INP_DOC_TYPE_FILE'];
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SupervisorSaveDocument?UID=' . $_POST['docID'] . '&APP_UID=' . $_POST['appDocId'] );
G::RenderPage( 'publish', 'raw' );
break;

View File

@@ -26,6 +26,10 @@ $response = new StdClass();
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
try {
if(empty($_GET)){
$proUid = Bootstrap::json_decode( $_POST['data']);
$_GET["pro_uid"] = $proUid->pro_uid;
}
if (\BpmnProject::exists($_GET["pro_uid"])) {
$exporter = new ProcessMaker\Exporter\XmlExporter($_GET["pro_uid"]);
@@ -40,16 +44,26 @@ try {
rename($outputDir . $outputFilename . "tpm", $outputDir . $outputFilename);
}
$response->file_hash = base64_encode($outputFilename);
$response->success = true;
/* Render page */
if (isset( $_REQUEST["processMap"] ) && $_REQUEST["processMap"] == 1) {
$link = parse_url($result['FILENAME_LINK']);
$result['FILENAME_LINK'] = $link['path'] . '?file_hash=' . $response->file_hash;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( "xmlform", "xmlform", "processes/processes_Export", "", $result );
G::RenderPage( "publish", "raw" );
} else{
echo json_encode($response);
}
} catch (Exception $e) {
$response->message = $e->getMessage();
$response->success = false;
}
echo json_encode($response);
// ************* DEPRECATED (it will be removed soon) *********************************