diff --git a/datamodels/2.x/itop-attachments/module.itop-attachments.php b/datamodels/2.x/itop-attachments/module.itop-attachments.php index 3d3448b33..d7a446482 100644 --- a/datamodels/2.x/itop-attachments/module.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/module.itop-attachments.php @@ -64,6 +64,7 @@ SetupWebPage::AddModule( 'allowed_classes' => array('Ticket'), // List of classes for which to manage "Attachments" 'position' => 'relations', // Where to display the attachments: relations | properties 'preview_max_width' => 290, + 'icon_preview_max_size' => 500000, // Maximum size for attachment preview to be displayed as an icon. In bits ), ) ); diff --git a/datamodels/2.x/itop-attachments/renderers.itop-attachments.php b/datamodels/2.x/itop-attachments/renderers.itop-attachments.php index 1c0d74c1d..679fd63e2 100644 --- a/datamodels/2.x/itop-attachments/renderers.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/renderers.itop-attachments.php @@ -506,12 +506,14 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer $sAttachmentThumbUrl = utils::GetAbsoluteUrlAppRoot().AttachmentPlugIn::GetFileIcon($sFileName); $sIconClass = ''; $iMaxWidth = MetaModel::GetModuleSetting('itop-attachments', 'preview_max_width', 290); + $iMaxSizeForPreview = MetaModel::GetModuleSetting('itop-attachments', 'icon_preview_max_size', self::MAX_SIZE_FOR_PREVIEW); + $sPreviewNotAvailable = Dict::S('Attachments:PreviewNotAvailable'); $sPreviewMarkup = $sPreviewNotAvailable; if ($oDoc->IsPreviewAvailable()) { $sIconClass = ' preview'; - if ($oDoc->GetSize() <= self::MAX_SIZE_FOR_PREVIEW) + if ($oDoc->GetSize() <= $iMaxSizeForPreview) { $sAttachmentThumbUrl = $sDocDownloadUrl; }