From 1dbc91e3431a7059a7b9fa0af30d4e9423171b91 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Nov 2020 13:44:57 +0100 Subject: [PATCH] Clean code --- htdocs/core/class/html.formfile.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 0381a031a7d..380b7a1ad17 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1221,7 +1221,6 @@ class FormFile // Size $sizetoshow = dol_print_size($file['size'], 1, 1); $sizetoshowbytes = dol_print_size($file['size'], 0, 1); - print ''; if ($sizetoshow == $sizetoshowbytes) print $sizetoshow; else { @@ -1659,8 +1658,21 @@ class FormFile print $this->showPreview($file, $modulepart, $file['relativename']); print "\n"; - print ''.dol_print_size($file['size'], 1, 1).''; + + // Size + $sizetoshow = dol_print_size($file['size'], 1, 1); + $sizetoshowbytes = dol_print_size($file['size'], 0, 1); + print ''; + if ($sizetoshow == $sizetoshowbytes) print $sizetoshow; + else { + print $form->textwithpicto($sizetoshow, $sizetoshowbytes, -1); + } + print ''; + + // Date print ''.dol_print_date($file['date'], "dayhour").''; + + // Share link print ''; if ($file['share']) { // Define $urlwithroot