Merge branch 'master' of bitbucket.org:colosa/processmaker into BUG-12021
This commit is contained in:
@@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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) *********************************
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -360,12 +358,12 @@
|
|||||||
icon: Ext.MessageBox.ERROR,
|
icon: Ext.MessageBox.ERROR,
|
||||||
buttons: Ext.MessageBox.OK,
|
buttons: Ext.MessageBox.OK,
|
||||||
fn : function(btn) {
|
fn : function(btn) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
prnt = parent.parent;
|
prnt = parent.parent;
|
||||||
top.location = top.location;
|
top.location = top.location;
|
||||||
}
|
}
|
||||||
catch (err)
|
catch (err)
|
||||||
{
|
{
|
||||||
parent.location = parent.location;
|
parent.location = parent.location;
|
||||||
}
|
}
|
||||||
@@ -434,12 +432,12 @@
|
|||||||
icon: Ext.MessageBox.ERROR,
|
icon: Ext.MessageBox.ERROR,
|
||||||
buttons: Ext.MessageBox.OK,
|
buttons: Ext.MessageBox.OK,
|
||||||
fn : function(btn) {
|
fn : function(btn) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
prnt = parent.parent;
|
prnt = parent.parent;
|
||||||
top.location = top.location;
|
top.location = top.location;
|
||||||
}
|
}
|
||||||
catch (err)
|
catch (err)
|
||||||
{
|
{
|
||||||
parent.location = parent.location;
|
parent.location = parent.location;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,11 +71,14 @@ 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');
|
||||||
hideRowById('subtitle2');
|
hideRowById('subtitle2');
|
||||||
|
|
||||||
}hideRowById('WS_ROUNDROBIN');
|
}hideRowById('WS_ROUNDROBIN');
|
||||||
}.extend(getField('WE_TYPE')));
|
}.extend(getField('WE_TYPE')));
|
||||||
|
|
||||||
@@ -82,7 +89,7 @@ leimnud.event.add(getField('WE_TYPE'), 'change', function() {
|
|||||||
* @makes a rpc to processes_webEntryValidate in order to validate if the
|
* @makes a rpc to processes_webEntryValidate in order to validate if the
|
||||||
* process user has the permissions to create and use a webentry
|
* process user has the permissions to create and use a webentry
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var webEntry_validate = function(PRO_UID, TASKS, DYNAFORM) {
|
var webEntry_validate = function(PRO_UID, TASKS, DYNAFORM) {
|
||||||
//G.alert(PRO_UID);
|
//G.alert(PRO_UID);
|
||||||
// G.alert(getField('WE_TYPE').value);
|
// G.alert(getField('WE_TYPE').value);
|
||||||
@@ -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 {
|
||||||
@@ -129,7 +138,7 @@ var tasksName = getField('TASKS')[getField('TASKS').selectedIndex].innerHTML;
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) {
|
var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) {
|
||||||
@@ -144,7 +153,7 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ if(odynaform.value=='')
|
{ if(odynaform.value=='')
|
||||||
{ alert('This process does not have an assigned dynaform');
|
{ alert('This process does not have an assigned dynaform');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ sw=1;
|
{ sw=1;
|
||||||
@@ -180,7 +189,7 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) {
|
|||||||
scs.evalScript();
|
scs.evalScript();
|
||||||
}.extend(this);
|
}.extend(this);
|
||||||
oRPC.make();
|
oRPC.make();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var k = new leimnud.module.rpc.xmlhttp({
|
var k = new leimnud.module.rpc.xmlhttp({
|
||||||
@@ -188,28 +197,28 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) {
|
|||||||
async : true,
|
async : true,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
args : "action=webEntry_Val_Assig&data="+{
|
args : "action=webEntry_Val_Assig&data="+{
|
||||||
PRO_UID:PRO_UID,
|
PRO_UID:PRO_UID,
|
||||||
TASKS:getField('TASKS').value,
|
TASKS:getField('TASKS').value,
|
||||||
DYNAFORM:getField('DYNAFORM').value
|
DYNAFORM:getField('DYNAFORM').value
|
||||||
}.toJSONString()
|
}.toJSONString()
|
||||||
});
|
});
|
||||||
|
|
||||||
k.callback = function(rpc){
|
k.callback = function(rpc){
|
||||||
if(rpc.xmlhttp.responseText!=1){
|
if(rpc.xmlhttp.responseText!=1){
|
||||||
msgBox(G_STRINGS.WEBEN_ONLY_BALANCEDJS,"alert");
|
msgBox(G_STRINGS.WEBEN_ONLY_BALANCEDJS,"alert");
|
||||||
}
|
}
|
||||||
}.extend(this);
|
}.extend(this);
|
||||||
k.make();
|
k.make();
|
||||||
|
|
||||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||||
url : '../processes/processes_Ajax',
|
url : '../processes/processes_Ajax',
|
||||||
async : true,
|
async : true,
|
||||||
method: 'POST',
|
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()
|
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();
|
oRPC.make();
|
||||||
oPanel.remove();
|
oPanel.remove();
|
||||||
Pm.tmp.editProcessPanel.clearContent();
|
Pm.tmp.editProcessPanel.clearContent();
|
||||||
Pm.tmp.editProcessPanel.loader.show();
|
Pm.tmp.editProcessPanel.loader.show();
|
||||||
var r = new leimnud.module.rpc.xmlhttp({
|
var r = new leimnud.module.rpc.xmlhttp({
|
||||||
url:'../processes/processes_Ajax',
|
url:'../processes/processes_Ajax',
|
||||||
@@ -222,7 +231,7 @@ var webEntry_generate = function(PRO_UID, TASKS, DYNAFORM) {
|
|||||||
Pm.tmp.editProcessPanel.loader.hide();
|
Pm.tmp.editProcessPanel.loader.hide();
|
||||||
var scs = rpc.xmlhttp.responseText.extractScript();
|
var scs = rpc.xmlhttp.responseText.extractScript();
|
||||||
Pm.tmp.editProcessPanel.addContent(rpc.xmlhttp.responseText);
|
Pm.tmp.editProcessPanel.addContent(rpc.xmlhttp.responseText);
|
||||||
scs.evalScript();
|
scs.evalScript();
|
||||||
}.extend(this,panel);
|
}.extend(this,panel);
|
||||||
r.make();
|
r.make();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user