HOR-517 Permitir que el endpoint de creación del uid del file soporte definir APP_DOC_TYPE y DOC_UID
This commit is contained in:
@@ -902,28 +902,27 @@ class Light
|
|||||||
public function postUidUploadFiles($userUid, $app_uid, $request_data)
|
public function postUidUploadFiles($userUid, $app_uid, $request_data)
|
||||||
{
|
{
|
||||||
$response = array();
|
$response = array();
|
||||||
if (count( $request_data ) > 0) {
|
if (is_array($request_data)) {
|
||||||
foreach ($request_data as $k => $file) {
|
foreach ($request_data as $k => $file) {
|
||||||
$indocUid = null;
|
|
||||||
$fieldName = null;
|
|
||||||
$oCase = new \Cases();
|
$oCase = new \Cases();
|
||||||
$DEL_INDEX = $oCase->getCurrentDelegation( $app_uid, $userUid );
|
$delIndex = $oCase->getCurrentDelegation($app_uid, $userUid);
|
||||||
|
$docUid = !empty($file['docUid']) ? $file['docUid'] : -1;
|
||||||
$aFields = array (
|
$appDocType = !empty($file['appDocType']) ? $file['appDocType'] : "ATTACHED";
|
||||||
|
$fieldName = !empty($file['fieldName']) ? $file['fieldName'] : null;
|
||||||
|
$aFields = array(
|
||||||
"APP_UID" => $app_uid,
|
"APP_UID" => $app_uid,
|
||||||
"DEL_INDEX" => $DEL_INDEX,
|
"DEL_INDEX" => $delIndex,
|
||||||
"USR_UID" => $userUid,
|
"USR_UID" => $userUid,
|
||||||
"DOC_UID" => - 1,
|
"DOC_UID" => $docUid,
|
||||||
"APP_DOC_TYPE" => "ATTACHED",
|
"APP_DOC_TYPE" => $appDocType,
|
||||||
"APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),
|
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
|
||||||
"APP_DOC_COMMENT" => "",
|
"APP_DOC_COMMENT" => "",
|
||||||
"APP_DOC_TITLE" => "",
|
"APP_DOC_TITLE" => "",
|
||||||
"APP_DOC_FILENAME" => $file['name'],
|
"APP_DOC_FILENAME" => $file['name'],
|
||||||
"APP_DOC_FIELDNAME" => $fieldName
|
"APP_DOC_FIELDNAME" => $fieldName
|
||||||
);
|
);
|
||||||
|
|
||||||
$oAppDocument = new \AppDocument();
|
$oAppDocument = new \AppDocument();
|
||||||
$oAppDocument->create( $aFields );
|
$oAppDocument->create($aFields);
|
||||||
$response[$k]['docVersion'] = $iDocVersion = $oAppDocument->getDocVersion();
|
$response[$k]['docVersion'] = $iDocVersion = $oAppDocument->getDocVersion();
|
||||||
$response[$k]['appDocUid'] = $sAppDocUid = $oAppDocument->getAppDocUid();
|
$response[$k]['appDocUid'] = $sAppDocUid = $oAppDocument->getAppDocUid();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user