diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 69ce8ae8ae5..1dc0180bd60 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -31,6 +31,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; @@ -135,6 +136,7 @@ if (empty($reshook)) { $form = new Form($db); $formother = new FormOther($db); +$formfile = new FormFile($db); $tva_static = new Tva($db); $bankstatic = new Account($db); $accountingjournal = new AccountingJournal($db); @@ -445,7 +447,13 @@ while ($i < min($num, $limit)) { // Ref if (!empty($arrayfields['t.rowid']['checked'])) { - print ''.$tva_static->getNomUrl(1).''; + print ''; + print $tva_static->getNomUrl(1); + $filename = dol_sanitizeFileName($tva_static->ref); + $filedir = $conf->tax->dir_output.'/vat/'.dol_sanitizeFileName($tva_static->ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$tva_static->id; + print $formfile->getDocumentsLink($tva_static->element, $filename, $filedir, '', 'valignmiddle paddingleft2imp'); + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2b8a2d15aff..3a5cff5ea9e 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -985,9 +985,10 @@ class FormFile * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Full path to directory to scan * @param string $filter Filter filenames on this regex string (Example: '\.pdf$') + * @param string $morecss Add more css to the download picto * @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles */ - public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '') + public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '', $morecss = 'valignmiddle') { global $conf, $langs; @@ -1019,7 +1020,7 @@ class FormFile $out .= ''."\n"; if (!empty($file_list)) { $out = '