BUG 10957 "Feature request - Limit input document..." SOLVED
- Feature request - Limit input document maximum size - Problema resuelto, al crear un nuevo Input Document se ha adicionado un nuevo campo "Maximum file size" y un dropdown que determina la unidad de medida en "KB y MB", esto permite definir el limite del tamañel archivo a anexar. Cuando se ejectua el caso al hacer click en "Attach", se muestra el tamañaximo que se puede adjuntar el archivo si es mayor al limite se mostrara un mensaje; asi tambien si se tiene un file asocioado a un input document al igual que lo anterior se mostrara un mensaje.
This commit is contained in:
@@ -3517,9 +3517,10 @@ class Cases
|
||||
* @param string $file File ($_FILES["form"]["name"]["APP_DOC_FILENAME"] or path to file)
|
||||
* @param int $fileError File error ($_FILES["form"]["error"]["APP_DOC_FILENAME"] or 0)
|
||||
* @param string $fileTmpName File temporal name ($_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] or null)
|
||||
* @param string $fileSize File size ($_FILES["form"]["size"]["APP_DOC_FILENAME"] or 0)
|
||||
* @return string Return application document ID
|
||||
*/
|
||||
public function addInputDocument($inputDocumentUid, $appDocUid, $docVersion, $appDocType, $appDocComment, $inputDocumentAction, $applicationUid, $delIndex, $taskUid, $userUid, $option, $file, $fileError = 0, $fileTmpName = null)
|
||||
public function addInputDocument($inputDocumentUid, $appDocUid, $docVersion, $appDocType, $appDocComment, $inputDocumentAction, $applicationUid, $delIndex, $taskUid, $userUid, $option, $file, $fileError = 0, $fileTmpName = null, $fileSize = 0)
|
||||
{
|
||||
$appDocFileName = null;
|
||||
$sw = 0;
|
||||
@@ -3549,6 +3550,16 @@ class Cases
|
||||
$inputDocument = new InputDocument();
|
||||
$arrayInputDocumentData = $inputDocument->load($inputDocumentUid);
|
||||
|
||||
//---
|
||||
$inpDocMaxFilesize = $arrayInputDocumentData["INP_DOC_MAX_FILESIZE"];
|
||||
$inpDocMaxFilesizeUnit = $arrayInputDocumentData["INP_DOC_MAX_FILESIZE_UNIT"];
|
||||
|
||||
$inpDocMaxFilesize = $inpDocMaxFilesize * (($inpDocMaxFilesizeUnit == "MB")? 1024 *1024 : 1024); //Bytes
|
||||
|
||||
if ($fileSize > $inpDocMaxFilesize) {
|
||||
throw new Exception(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"));
|
||||
}
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$appFolder = new AppFolder();
|
||||
$folderId = $appFolder->createFromPath($arrayInputDocumentData["INP_DOC_DESTINATION_PATH"], $applicationUid);
|
||||
|
||||
Reference in New Issue
Block a user