Fix preview link

This commit is contained in:
Laurent Destailleur 2018-01-12 16:28:10 +01:00
parent 8b972313ae
commit 32a998e68d

View File

@ -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 "</td>\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 '</a>';
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 "</td>\n";
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
@ -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)