From f29dd2d83250f48bb27cdae6056cb793f369374c Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Thu, 25 Aug 2016 09:29:20 -0400 Subject: [PATCH] HOR-166 --- .../engine/src/ProcessMaker/BusinessModel/Light.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php index 9ba04b445..aee1b7a05 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php @@ -901,6 +901,13 @@ class Light $oCase = new \Cases(); $delIndex = $oCase->getCurrentDelegation($app_uid, $userUid); $docUid = !empty($file['docUid']) ? $file['docUid'] : -1; + $folderId = ''; + if($docUid !== -1){ + $inputDocument = new \InputDocument(); + $aInputDocumentData = $inputDocument->load($docUid); + $appFolder = new \AppFolder(); + $folderId = $appFolder->createFromPath($aInputDocumentData["INP_DOC_DESTINATION_PATH"], $app_uid); + } $appDocType = !empty($file['appDocType']) ? $file['appDocType'] : "ATTACHED"; $fieldName = !empty($file['fieldName']) ? $file['fieldName'] : null; $aFields = array( @@ -913,7 +920,8 @@ class Light "APP_DOC_COMMENT" => "", "APP_DOC_TITLE" => "", "APP_DOC_FILENAME" => $file['name'], - "APP_DOC_FIELDNAME" => $fieldName + "APP_DOC_FIELDNAME" => $fieldName, + "FOLDER_UID" => $folderId ); $oAppDocument = new \AppDocument(); $oAppDocument->create($aFields);