By zeiscas - Sat Nov 17, 2018 2:19 pm
- Sat Nov 17, 2018 2:19 pm
#817844
Hello,
I want to allow the users of a task to access the Signed Contract Document to validate its content in every new Order. So, I created a Link field where I have the URL for the Input document creted in another process case. But I'm getting an "Access denied" message page.
The trigger code is the following:
if ($caseId != null){
$query = "SELECT C.CON_ID AS fileId, C.CON_VALUE AS filename
FROM APP_DOCUMENT AD, CONTENT C
WHERE AD.APP_UID='$caseId' AND AD.APP_DOC_TYPE='INPUT' AND AD.APP_DOC_STATUS='ACTIVE' AND
AD.APP_DOC_UID=C.CON_ID AND C.CON_CATEGORY='APP_DOC_FILENAME' AND C.CON_VALUE<>''
ORDER BY AD.APP_DOC_CREATE_DATE DESC";
$result = executeQuery($query);
if (is_array($result) and count($result) > 0) {
//Relative URL to download Input Document file inside ProcesMaker:
$host= gethostname();
$ip = gethostbyname($host);
@@lnkContractFile = $ip . ':' . $_SERVER['SERVER_PORT'] . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a=' . $result[1]['fileId'];
@@lnkContractFile_label = $result[1]['filename'];
}
}
NOTE: On the documentation it is suggested to put only: '../cases/cases_ShowDocument?a=' . $result[1]['fileId']; for the @@lnkContractFile variable but I never could make it work. That's why I'm building the whole string.
I want to allow the users of a task to access the Signed Contract Document to validate its content in every new Order. So, I created a Link field where I have the URL for the Input document creted in another process case. But I'm getting an "Access denied" message page.
The trigger code is the following:
if ($caseId != null){
$query = "SELECT C.CON_ID AS fileId, C.CON_VALUE AS filename
FROM APP_DOCUMENT AD, CONTENT C
WHERE AD.APP_UID='$caseId' AND AD.APP_DOC_TYPE='INPUT' AND AD.APP_DOC_STATUS='ACTIVE' AND
AD.APP_DOC_UID=C.CON_ID AND C.CON_CATEGORY='APP_DOC_FILENAME' AND C.CON_VALUE<>''
ORDER BY AD.APP_DOC_CREATE_DATE DESC";
$result = executeQuery($query);
if (is_array($result) and count($result) > 0) {
//Relative URL to download Input Document file inside ProcesMaker:
$host= gethostname();
$ip = gethostbyname($host);
@@lnkContractFile = $ip . ':' . $_SERVER['SERVER_PORT'] . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a=' . $result[1]['fileId'];
@@lnkContractFile_label = $result[1]['filename'];
}
}
NOTE: On the documentation it is suggested to put only: '../cases/cases_ShowDocument?a=' . $result[1]['fileId']; for the @@lnkContractFile variable but I never could make it work. That's why I'm building the whole string.
Attachments
Capturar.PNG (30.22 KiB) Viewed 2199 times