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 = '
- - '.img_picto('', 'listlight', '', 0, 0, 0, '', 'valignmiddle').'
+ - '.img_picto('', 'listlight', '', 0, 0, 0, '', $morecss).'
';
$tmpout = '';
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 05d8c6c4ec5..3c35bcda2a9 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -2235,7 +2235,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(
* Security check when accessing to a document (used by document.php, viewimage.php and webservices to get documents).
* TODO Replace code that set $accesallowed by a call to restrictedArea()
*
- * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp')
+ * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp'). Exemple: 'medias', 'invoice', 'logs', 'tax-vat', ...
* @param string $original_file Relative path with filename, relative to modulepart.
* @param string $entity Restrict onto entity (0=no restriction)
* @param User $fuser User object (forced)
@@ -2263,10 +2263,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$entity = 0;
}
}
- // Fix modulepart
+ // Fix modulepart for backward compatibility
if ($modulepart == 'users') {
$modulepart = 'user';
}
+ if ($modulepart == 'tva') {
+ $modulepart = 'tax-vat';
+ }
//print 'dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity;
dol_syslog('dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity);
@@ -2436,7 +2439,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$accessallowed = 1;
}
$original_file = (!empty($conf->product->multidir_temp[$entity]) ? $conf->product->multidir_temp[$entity] : $conf->service->multidir_temp[$entity]).'/'.$original_file;
- } elseif (in_array($modulepart, array('tax', 'tax-vat')) && !empty($conf->tax->dir_output)) {
+ } elseif (in_array($modulepart, array('tax', 'tax-vat', 'tva')) && !empty($conf->tax->dir_output)) {
// Wrapping for taxes
if ($fuser->rights->tax->charges->{$lire}) {
$accessallowed = 1;
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index ab9ab624801..e384007262f 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -736,6 +736,9 @@ textarea.centpercent {
.paddingleft2 {
padding-: 2px;
}
+.paddingleft2imp {
+ padding-: 2px !important;
+}
.paddingright {
padding-: 4px;
}
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 8e679e754f2..dfa8b00f9eb 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -878,12 +878,18 @@ textarea.centpercent {
.paddingleft2 {
padding-: 2px;
}
+.paddingleft2imp {
+ padding-: 2px !important;
+}
.paddingright {
padding-: 4px;
}
.paddingright2 {
padding-: 2px;
}
+.paddingright2imp {
+ padding-: 2px !important;
+}
.marginleft2 {
margin-: 2px;
}