Merge pull request #18845 from indelog/fix_doc_prev_ecm

Fix show for external module in ecm index auto page
This commit is contained in:
Laurent Destailleur 2021-09-30 13:36:49 +02:00 committed by GitHub
commit 3deb424b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1813,9 +1813,11 @@ class FormFile
print '</td>';
// File
// Check if document source has external module part, if it the case use it for module part on document.php
preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix);
print '<td>';
//print "XX".$file['name']; //$file['name'] must be utf8
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.(empty($modulesuffix) ? $modulepart : $modulesuffix[1]);
if ($forcedownload) {
print '&attachment=1';
}
@ -1826,7 +1828,7 @@ class FormFile
//print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$');
print $this->showPreview($file, $modulepart, $file['relativename']);
print $this->showPreview($file, (empty($modulesuffix) ? $modulepart : $modulesuffix[1]), $file['relativename']);
print "</td>\n";