From 259f3b3020ab50a2941ad63abaf3872ed9502731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Apr 2018 13:23:26 +0200 Subject: [PATCH] Add hidden option MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP --- htdocs/core/class/html.formfile.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 69faa73b7de..0e125a7b944 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -863,8 +863,15 @@ class FormFile } // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files and get only generated files) - // @TODO Why not showing all files by just removing the '[^\-]+' at end of regex ? - $filterforfilesearch = preg_quote(basename($modulesubdir),'/').'[^\-]+'; + // @TODO Why not showing by default all files by just removing the '[^\-]+' at end of regex ? + if (! empty($conf->global->MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP)) + { + $filterforfilesearch = preg_quote(basename($modulesubdir),'/'); + } + else + { + $filterforfilesearch = preg_quote(basename($modulesubdir),'/').'[^\-]+'; + } $file_list=dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview //var_dump($file_list);