From 32a998e68dcf316dd934d23331d65ff3c4ac6d4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 16:28:10 +0100 Subject: [PATCH] Fix preview link --- htdocs/core/class/html.formfile.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1a67e374e68..4bff96700d5 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -944,6 +944,7 @@ class FormFile * @param int $disablemove 1=Disable move button, 0=Position move is possible. * @param int $addfilterfields Add line with filters * @return int <0 if KO, nb of files shown if OK + * @see list_of_autoecmfiles */ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) { @@ -1115,7 +1116,7 @@ class FormFile // Preview link if (! $editline) print $this->showPreview($file, $modulepart, $filepath); // Public share link - if (! $editline && ! empty($filearray[$key]['hashp'])) print 'ee'; + //if (! $editline && ! empty($filearray[$key]['hashp'])) print pictowithlinktodirectdownload; print "\n"; @@ -1269,6 +1270,7 @@ class FormFile * @param string $url Full url to use for click links ('' = autodetect) * @param int $addfilterfields Add line with filters * @return int <0 if KO, nb of files shown if OK + * @see list_of_documents */ function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0) { @@ -1475,7 +1477,8 @@ class FormFile print dol_trunc($file['name'],$maxlength,'middle'); print ''; - print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); + //print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); + print $this->showPreview($file, $modulepart, $file['relativename']); print "\n"; print ''.dol_print_size($file['size'],1,1).''; @@ -1677,7 +1680,7 @@ class FormFile /** * Show detail icon with link for preview * - * @param array $file File + * @param array $file Array with data of file. Example: array('name'=>...) * @param string $modulepart propal, facture, facture_fourn, ... * @param string $relativepath Relative path of docs * @param string $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file)