FIX #13182
This commit is contained in:
parent
8b1fff202b
commit
9bc5eb44ca
@ -70,8 +70,7 @@ if (! $sortfield) $sortfield="name";
|
||||
$object = new Tva($db);
|
||||
if ($id > 0) $object->fetch($id);
|
||||
|
||||
$upload_dir = $conf->tax->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$modulepart='tax';
|
||||
$upload_dir = $conf->tax->dir_output.'/vat/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
|
||||
/*
|
||||
@ -144,7 +143,7 @@ if ($object->id)
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
$modulepart = 'tax';
|
||||
$modulepart = 'tax-vat';
|
||||
$permission = $user->rights->tax->charges->creer;
|
||||
$permtoedit = $user->rights->fournisseur->facture->creer;
|
||||
$param = '&id=' . $object->id;
|
||||
|
||||
@ -1099,7 +1099,7 @@ class FormFile
|
||||
if ($disablecrop == -1)
|
||||
{
|
||||
$disablecrop = 1;
|
||||
if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'mrp', 'project', 'product', 'produit', 'propal', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0;
|
||||
if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'mrp', 'project', 'product', 'produit', 'propal', 'service', 'societe', 'tax', 'tax-vat', 'ticket', 'user'))) $disablecrop = 0;
|
||||
}
|
||||
|
||||
// Define relative path used to store the file
|
||||
@ -1121,6 +1121,8 @@ class FormFile
|
||||
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $upload_dir);
|
||||
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
|
||||
}
|
||||
// For example here $upload_dir = '/pathtodocuments/commande/SO2001-123/'
|
||||
// For example here $upload_dir = '/pathtodocuments/tax/vat/1'
|
||||
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
$parameters = array(
|
||||
|
||||
@ -2401,10 +2401,11 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
$original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file;
|
||||
}
|
||||
// Wrapping for taxes
|
||||
elseif ($modulepart == 'tax' && !empty($conf->tax->dir_output))
|
||||
elseif (in_array($modulepart, array('tax', 'tax-vat')) && !empty($conf->tax->dir_output))
|
||||
{
|
||||
if ($fuser->rights->tax->charges->{$lire}) $accessallowed=1;
|
||||
$original_file=$conf->tax->dir_output.'/'.$original_file;
|
||||
$modulepartsuffix = str_replace('tax-', '', $modulepart);
|
||||
$original_file=$conf->tax->dir_output.'/'.($modulepartsuffix != 'tax' ? $modulepartsuffix.'/' : '').$original_file;
|
||||
}
|
||||
// Wrapping for events
|
||||
elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output))
|
||||
|
||||
@ -49,7 +49,7 @@ function vat_prepare_head($object)
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->tax->dir_output . "/vat/" . dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id;
|
||||
|
||||
@ -72,6 +72,7 @@ if ($action == 'delete')
|
||||
|
||||
$formfile=new FormFile($db);
|
||||
|
||||
|
||||
// We define var to enable the feature to add prefix of uploaded files.
|
||||
// Caller of this include can make
|
||||
// $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
|
||||
@ -93,6 +94,7 @@ if (!isset($savingdocmask) || !empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_
|
||||
'project_task',
|
||||
'expensereport',
|
||||
'tax',
|
||||
'tax-vat',
|
||||
'produit',
|
||||
'product_batch',
|
||||
'bom',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user