Merged in bugfix/PMCORE-1465 (pull request #8362)

PMCORE-1465

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Paula Quispe
2022-01-25 21:29:42 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -454,34 +454,34 @@ class InputDocument
/** /**
* Get data of Cases InputDocument * Get data of Cases InputDocument
* *
* @param string $applicationUid * @param string $appUid
* @param string $userUid * @param string $userUid
* @param string $inputDocumentUid * @param string $inputDocumentUid
* *
* @return array Return an array with data of an InputDocument * @return array Return an array with data of an InputDocument
* @throws Exception * @throws Exception
*/ */
public function getCasesInputDocument($applicationUid, $userUid, $inputDocumentUid) public function getCasesInputDocument($appUid, $userUid, $inputDocumentUid)
{ {
try { try {
$sApplicationUID = $applicationUid; $appUid = $applicationUid;
$sUserUID = $userUid;
$oCase = new Cases(); $case = new Cases();
$fields = $oCase->loadCase( $sApplicationUID ); $fields = $case->loadCase($appUid);
$sProcessUID = $fields['PRO_UID']; $proUid = $fields['PRO_UID'];
$sTaskUID = ''; $taskUid = '';
$oCaseRest = new BusinessModelCases(); $caseRest = new BusinessModelCases();
$oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID ); $caseRest->getAllUploadedDocumentsCriteria($proUid, $appUid, $taskUid, $userUid);
$result = array (); $result = [];
global $_DBArray; global $_DBArray;
$flagInputDocument = false; $flagInputDocument = false;
foreach ($_DBArray['inputDocuments'] as $key => $row) { foreach ($_DBArray['inputDocuments'] as $key => $row) {
if (isset( $row['DOC_VERSION'] )) { if (isset($row['DOC_VERSION'])) {
$docrow = array (); $docrow = [];
$docrow['app_doc_uid'] = $row['APP_DOC_UID']; $docrow['app_doc_uid'] = $row['APP_DOC_UID'];
$docrow['app_doc_filename'] = $row['APP_DOC_FILENAME']; $docrow['app_doc_filename'] = $row['APP_DOC_FILENAME'];
$docrow['app_doc_comment'] = $row['APP_DOC_COMMENT'];
$docrow['doc_uid'] = $row['DOC_UID']; $docrow['doc_uid'] = $row['DOC_UID'];
$docrow['app_doc_version'] = $row['DOC_VERSION']; $docrow['app_doc_version'] = $row['DOC_VERSION'];
$docrow['app_doc_create_date'] = $row['CREATE_DATE']; $docrow['app_doc_create_date'] = $row['CREATE_DATE'];
@@ -506,11 +506,10 @@ class InputDocument
} }
if (!$flagInputDocument) { if (!$flagInputDocument) {
throw new Exception(G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", array($inputDocumentUid))); throw new Exception(G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", [$inputDocumentUid]));
} }
$oResponse = json_decode(json_encode($result), false); return json_decode(json_encode($result), false);
return $oResponse;
} catch (Exception $e) { } catch (Exception $e) {
throw $e; throw $e;
} }