From e64ffca42fb064ba6c50ff4b4f083218bf6a9882 Mon Sep 17 00:00:00 2001 From: jennylee Date: Tue, 7 Oct 2014 10:51:37 -0400 Subject: [PATCH] PM-360 Unexpected alert in Review when adding a inputdoc. PROBLEM: The inputdoc data were not recovering well, so the allowed extentions were not validated. SOLUTION: Some lines of code where added to recover the inputdoc allowed extentions and other data, that is necesary for the validation. --- workflow/engine/methods/cases/cases_Ajax.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;