Ajustes en validaciones de Cases Output documents
This commit is contained in:
@@ -56,10 +56,6 @@ class OutputDocument
|
|||||||
public function getCasesOutputDocument($applicationUid, $userUid, $applicationDocumentUid)
|
public function getCasesOutputDocument($applicationUid, $userUid, $applicationDocumentUid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oAppDocument = \AppDocumentPeer::retrieveByPK( $applicationDocumentUid, 1 );
|
|
||||||
if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') {
|
|
||||||
throw (new \Exception('This output document with id: '.$applicationDocumentUid.' doesn\'t exist!'));
|
|
||||||
}
|
|
||||||
$sApplicationUID = $applicationUid;
|
$sApplicationUID = $applicationUid;
|
||||||
$sUserUID = $userUid;
|
$sUserUID = $userUid;
|
||||||
\G::LoadClass('case');
|
\G::LoadClass('case');
|
||||||
@@ -84,6 +80,10 @@ class OutputDocument
|
|||||||
$docrow['app_doc_index'] = $row['APP_DOC_INDEX'];
|
$docrow['app_doc_index'] = $row['APP_DOC_INDEX'];
|
||||||
$docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK'];
|
$docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK'];
|
||||||
if ($docrow['app_doc_uid'] == $applicationDocumentUid) {
|
if ($docrow['app_doc_uid'] == $applicationDocumentUid) {
|
||||||
|
$oAppDocument = \AppDocumentPeer::retrieveByPK( $applicationDocumentUid, $row['DOC_VERSION'] );
|
||||||
|
if (is_null( $oAppDocument )) {
|
||||||
|
throw (new \Exception('This output document with id: '.$applicationDocumentUid.' doesn\'t exist!'));
|
||||||
|
}
|
||||||
$result = $docrow;
|
$result = $docrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -269,6 +269,11 @@ class OutputDocument
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$g->sessionVarRestore();
|
$g->sessionVarRestore();
|
||||||
|
$oAppDocument = \AppDocumentPeer::retrieveByPK( $aFields['APP_DOC_UID'], $lastDocVersion);
|
||||||
|
if ($oAppDocument->getAppDocStatus() == 'DELETED') {
|
||||||
|
$oAppDocument->setAppDocStatus('ACTIVE');
|
||||||
|
$oAppDocument->save();
|
||||||
|
}
|
||||||
$response = $this->getCasesOutputDocument($applicationUid, $userUid, $aFields['APP_DOC_UID']);
|
$response = $this->getCasesOutputDocument($applicationUid, $userUid, $aFields['APP_DOC_UID']);
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user