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:
Luis Fernando Saisa Lopez
2014-09-18 14:01:56 -04:00
parent 5512f19413
commit 06412695ed
6 changed files with 19 additions and 23 deletions

View File

@@ -3550,14 +3550,16 @@ class Cases
$inputDocument = new InputDocument();
$arrayInputDocumentData = $inputDocument->load($inputDocumentUid);
//---
//--- Validate Filesize of $_FILE
$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"));
if ($inpDocMaxFilesize > 0 && $fileSize > 0) {
if ($fileSize > $inpDocMaxFilesize) {
throw new Exception(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"));
}
}
//Get the Custom Folder ID (create if necessary)