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

@@ -358,6 +358,7 @@ class WebApplication
// } // }
} }
Services\OAuth2\Server::setWorkspace(SYS_SYS);
$this->rest->addAPIClass('\ProcessMaker\\Services\\OAuth2\\Server', 'oauth2'); $this->rest->addAPIClass('\ProcessMaker\\Services\\OAuth2\\Server', 'oauth2');
} }

View File

@@ -929,6 +929,17 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
$Fields['APP_DOC_UID'] = $_POST['appDocId']; $Fields['APP_DOC_UID'] = $_POST['appDocId'];
$Fields['actionType'] = $_POST['actionType']; $Fields['actionType'] = $_POST['actionType'];
$Fields['docVersion'] = $_POST['docVersion']; $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_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SupervisorSaveDocument?UID=' . $_POST['docID'] . '&APP_UID=' . $_POST['appDocId'] );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
break; 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; $outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
try { try {
if(empty($_GET)){
$proUid = Bootstrap::json_decode( $_POST['data']);
$_GET["pro_uid"] = $proUid->pro_uid;
}
if (\BpmnProject::exists($_GET["pro_uid"])) { if (\BpmnProject::exists($_GET["pro_uid"])) {
$exporter = new ProcessMaker\Exporter\XmlExporter($_GET["pro_uid"]); $exporter = new ProcessMaker\Exporter\XmlExporter($_GET["pro_uid"]);
@@ -40,16 +44,26 @@ try {
rename($outputDir . $outputFilename . "tpm", $outputDir . $outputFilename); rename($outputDir . $outputFilename . "tpm", $outputDir . $outputFilename);
} }
$response->file_hash = base64_encode($outputFilename); $response->file_hash = base64_encode($outputFilename);
$response->success = true; $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) { } catch (Exception $e) {
$response->message = $e->getMessage(); $response->message = $e->getMessage();
$response->success = false; $response->success = false;
} }
echo json_encode($response);
// ************* DEPRECATED (it will be removed soon) ********************************* // ************* DEPRECATED (it will be removed soon) *********************************

View File

@@ -289,9 +289,9 @@
function renderDeleteFile(val,p,r) { function renderDeleteFile(val,p,r) {
if (r.data.DELETE_FILE) { if (r.data.DELETE_FILE) {
return '<img src="/images/delete-16x16.gif" unselectable="off" onClick="deleteFiles(\'' + r.data.APP_DOC_UID + '\', \'' + r.data.DOC_VERSION + '\');">'; return "<img src=\"/images/delete.png\" onclick=\"deleteFiles(\'" + r.data.APP_DOC_UID + "\', \'" + r.data.DOC_VERSION + "\');\" />";
} else { } else {
return ''; return "-";
} }
} }
@@ -316,8 +316,7 @@
}, },
cm: new Ext.grid.ColumnModel({ cm: new Ext.grid.ColumnModel({
defaults: { defaults: {
width: 200, width: 200
sortable: true
}, },
columns: columns:
[ [
@@ -326,13 +325,12 @@
{id:'FILEPDFEXIST', dataIndex: 'FILEPDFEXIST', hidden:true, hideable:false}, {id:'FILEPDFEXIST', dataIndex: 'FILEPDFEXIST', hidden:true, hideable:false},
{id:'FILEDOC', dataIndex: 'FILEDOC', hidden:true, hideable:false}, {id:'FILEDOC', dataIndex: 'FILEDOC', hidden:true, hideable:false},
{id:'FILEPDF', dataIndex: 'FILEPDF', hidden:true, hideable:false}, {id:'FILEPDF', dataIndex: 'FILEPDF', hidden:true, hideable:false},
{header: _("ID_TITLE_FIELD"), dataIndex: 'TITLE', width: 70}, {dataIndex: "TITLE", header: _("ID_TITLE_FIELD"), sortable: true, width: 70},
{header: _("ID_OUTPUT_DOCUMENT"), dataIndex: 'OUTDOCTITLE', width: 70}, {dataIndex: "OUTDOCTITLE", header: _("ID_OUTPUT_DOCUMENT"), sortable: true, width: 70},
{header: _("ID_ORIGIN_TASK"), dataIndex: 'ORIGIN', width: 70}, {dataIndex: "ORIGIN", header: _("ID_ORIGIN_TASK"), sortable: true, width: 70},
{header: _("ID_CREATED_BY"), dataIndex: 'CREATED_BY', width: 70}, {dataIndex: "CREATED_BY", header: _("ID_CREATED_BY"), sortable: true, width: 70},
{header: _("ID_CREATE_DATE"), dataIndex: 'CREATE_DATE', width: 70,renderer:startDateRender}, {dataIndex: "CREATE_DATE", header: _("ID_CREATE_DATE"), sortable: true, width: 70, renderer: startDateRender},
{header: '', dataIndex: 'DELETE_FILE', width: 30,renderer:renderDeleteFile} {dataIndex: "DELETE_FILE", header: _("ID_ACTIONS"), sortable: false, menuDisabled: true, hideable: false, width: 30, align: "center", renderer: renderDeleteFile}
] ]
}), }),
store: store, store: store,

View File

@@ -45,6 +45,7 @@
<js type="javascript"><![CDATA[ <js type="javascript"><![CDATA[
var oPanel1; var oPanel1;
getField('SEARCH').disabled = true; getField('SEARCH').disabled = true;
hideRowById("SEARCH");
//hideRowById('WS_USER'); //hideRowById('WS_USER');
//hideRowById('WS_PASS'); //hideRowById('WS_PASS');
@@ -60,6 +61,9 @@ leimnud.event.add(getField('TASKS'), 'change', function() {
/**/ /**/
leimnud.event.add(getField('WE_TYPE'), 'change', function() { leimnud.event.add(getField('WE_TYPE'), 'change', function() {
if (getField('WE_TYPE').value=='WS') { if (getField('WE_TYPE').value=='WS') {
hideRowById("SEARCH");
showRowById("TEST");
showRowById('WE_USR'); showRowById('WE_USR');
showRowById('WS_USER'); showRowById('WS_USER');
showRowById('WS_PASS'); showRowById('WS_PASS');
@@ -67,6 +71,9 @@ leimnud.event.add(getField('WE_TYPE'), 'change', function() {
showRowById('subtitle2'); showRowById('subtitle2');
} }
else { else {
hideRowById("TEST");
showRowById("SEARCH");
hideRowById('WS_USER'); hideRowById('WS_USER');
hideRowById('WS_PASS'); hideRowById('WS_PASS');
hideRowById('WS_ROUNDROBIN'); hideRowById('WS_ROUNDROBIN');
@@ -118,6 +125,8 @@ var tasksName = getField('TASKS')[getField('TASKS').selectedIndex].innerHTML;
//var scs=rpc.xmlhttp.responseText.extractScript(); //var scs=rpc.xmlhttp.responseText.extractScript();
//scs.evalScript(); //scs.evalScript();
if(rpc.xmlhttp.responseText>=1){ if(rpc.xmlhttp.responseText>=1){
showRowById("SEARCH");
getField('SEARCH').disabled = false; getField('SEARCH').disabled = false;
//webEntry_generate(PRO_UID); //webEntry_generate(PRO_UID);
} else { } else {