diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index d72b62d15..b5a985049 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -358,6 +358,7 @@ class WebApplication // } } + Services\OAuth2\Server::setWorkspace(SYS_SYS); $this->rest->addAPIClass('\ProcessMaker\\Services\\OAuth2\\Server', 'oauth2'); } diff --git a/workflow/engine/methods/cases/cases_Ajax.php b/workflow/engine/methods/cases/cases_Ajax.php index 3f8aa3bc3..20a25b77e 100755 --- a/workflow/engine/methods/cases/cases_Ajax.php +++ b/workflow/engine/methods/cases/cases_Ajax.php @@ -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; diff --git a/workflow/engine/methods/processes/processes_Export.php b/workflow/engine/methods/processes/processes_Export.php index 5c5993eaf..023f1a82f 100755 --- a/workflow/engine/methods/processes/processes_Export.php +++ b/workflow/engine/methods/processes/processes_Export.php @@ -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) ********************************* diff --git a/workflow/engine/templates/cases/casesGenerateDocumentPage.js b/workflow/engine/templates/cases/casesGenerateDocumentPage.js index 6376c191d..2c0924bcd 100644 --- a/workflow/engine/templates/cases/casesGenerateDocumentPage.js +++ b/workflow/engine/templates/cases/casesGenerateDocumentPage.js @@ -289,9 +289,9 @@ function renderDeleteFile(val,p,r) { if (r.data.DELETE_FILE) { - return ''; + return ""; } else { - return ''; + return "-"; } } @@ -316,8 +316,7 @@ }, cm: new Ext.grid.ColumnModel({ defaults: { - width: 200, - sortable: true + width: 200 }, columns: [ @@ -326,13 +325,12 @@ {id:'FILEPDFEXIST', dataIndex: 'FILEPDFEXIST', hidden:true, hideable:false}, {id:'FILEDOC', dataIndex: 'FILEDOC', hidden:true, hideable:false}, {id:'FILEPDF', dataIndex: 'FILEPDF', hidden:true, hideable:false}, - {header: _("ID_TITLE_FIELD"), dataIndex: 'TITLE', width: 70}, - {header: _("ID_OUTPUT_DOCUMENT"), dataIndex: 'OUTDOCTITLE', width: 70}, - {header: _("ID_ORIGIN_TASK"), dataIndex: 'ORIGIN', width: 70}, - {header: _("ID_CREATED_BY"), dataIndex: 'CREATED_BY', width: 70}, - {header: _("ID_CREATE_DATE"), dataIndex: 'CREATE_DATE', width: 70,renderer:startDateRender}, - {header: '', dataIndex: 'DELETE_FILE', width: 30,renderer:renderDeleteFile} - + {dataIndex: "TITLE", header: _("ID_TITLE_FIELD"), sortable: true, width: 70}, + {dataIndex: "OUTDOCTITLE", header: _("ID_OUTPUT_DOCUMENT"), sortable: true, width: 70}, + {dataIndex: "ORIGIN", header: _("ID_ORIGIN_TASK"), sortable: true, width: 70}, + {dataIndex: "CREATED_BY", header: _("ID_CREATED_BY"), sortable: true, width: 70}, + {dataIndex: "CREATE_DATE", header: _("ID_CREATE_DATE"), sortable: true, width: 70, renderer: startDateRender}, + {dataIndex: "DELETE_FILE", header: _("ID_ACTIONS"), sortable: false, menuDisabled: true, hideable: false, width: 30, align: "center", renderer: renderDeleteFile} ] }), store: store, @@ -360,12 +358,12 @@ icon: Ext.MessageBox.ERROR, buttons: Ext.MessageBox.OK, fn : function(btn) { - try + try { prnt = parent.parent; top.location = top.location; } - catch (err) + catch (err) { parent.location = parent.location; } @@ -434,12 +432,12 @@ icon: Ext.MessageBox.ERROR, buttons: Ext.MessageBox.OK, fn : function(btn) { - try + try { prnt = parent.parent; top.location = top.location; } - catch (err) + catch (err) { parent.location = parent.location; } diff --git a/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml b/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml index 289f9dab5..f84484b46 100755 --- a/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml +++ b/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml @@ -45,6 +45,7 @@ =1){ + showRowById("SEARCH"); + getField('SEARCH').disabled = false; //webEntry_generate(PRO_UID); } else { @@ -129,7 +138,7 @@ var tasksName = getField('TASKS')[getField('TASKS').selectedIndex].innerHTML; } - + } var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) { @@ -144,7 +153,7 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) { } else { if(odynaform.value=='') - { alert('This process does not have an assigned dynaform'); + { alert('This process does not have an assigned dynaform'); } else { sw=1; @@ -180,7 +189,7 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) { scs.evalScript(); }.extend(this); oRPC.make(); - } + } else { var k = new leimnud.module.rpc.xmlhttp({ @@ -188,28 +197,28 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) { async : true, method: 'POST', args : "action=webEntry_Val_Assig&data="+{ - PRO_UID:PRO_UID, - TASKS:getField('TASKS').value, + PRO_UID:PRO_UID, + TASKS:getField('TASKS').value, DYNAFORM:getField('DYNAFORM').value }.toJSONString() }); - + k.callback = function(rpc){ if(rpc.xmlhttp.responseText!=1){ msgBox(G_STRINGS.WEBEN_ONLY_BALANCEDJS,"alert"); - } + } }.extend(this); - k.make(); - + k.make(); + var oRPC = new leimnud.module.rpc.xmlhttp({ url : '../processes/processes_Ajax', async : true, method: 'POST', args : "action=webEntry_generate&data="+{PRO_UID:PRO_UID, TASKS:getField('TASKS').value, DYNAFORM:getField('DYNAFORM').value, WE_TYPE:getField('WE_TYPE').value, WS_USER:getField('WS_USER').value, WS_PASS:getField('WS_PASS').value, WS_ROUNDROBIN:getField('WS_ROUNDROBIN').value, WE_USR:getField('WE_USR').value }.toJSONString() - }); + }); oRPC.make(); - oPanel.remove(); - Pm.tmp.editProcessPanel.clearContent(); + oPanel.remove(); + Pm.tmp.editProcessPanel.clearContent(); Pm.tmp.editProcessPanel.loader.show(); var r = new leimnud.module.rpc.xmlhttp({ url:'../processes/processes_Ajax', @@ -222,7 +231,7 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) { Pm.tmp.editProcessPanel.loader.hide(); var scs = rpc.xmlhttp.responseText.extractScript(); Pm.tmp.editProcessPanel.addContent(rpc.xmlhttp.responseText); - scs.evalScript(); + scs.evalScript(); }.extend(this,panel); r.make(); }