FIX Link of download main doc on vat list

This commit is contained in:
Laurent Destailleur
2021-08-06 12:18:51 +02:00
parent 591b8acd51
commit c0c46fb704
5 changed files with 27 additions and 6 deletions

View File

@@ -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;