Merge pull request #21351 from Quatadah/dolicloud-qnasdami-product-allow-external-download
NEW #19680 Add option PRODUCT_ALLOW_EXTERNAL_DOWNLOAD
This commit is contained in:
commit
55ba95643b
@ -5569,6 +5569,9 @@ abstract class CommonObject
|
|||||||
if ($this->element == 'bank_account' && !empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
if ($this->element == 'bank_account' && !empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
$setsharekey = true;
|
$setsharekey = true;
|
||||||
}
|
}
|
||||||
|
if ($this->element == 'product' && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
|
$setsharekey = true;
|
||||||
|
}
|
||||||
if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
||||||
$setsharekey = true;
|
$setsharekey = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1717,7 +1717,9 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
|
|||||||
|
|
||||||
// Update index table of files (llx_ecm_files)
|
// Update index table of files (llx_ecm_files)
|
||||||
if ($donotupdatesession == 1) {
|
if ($donotupdatesession == 1) {
|
||||||
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', 0, $object);
|
$sharefile = 0;
|
||||||
|
if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) $sharefile = 1;
|
||||||
|
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', $sharefile, $object);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
if ($allowoverwrite) {
|
if ($allowoverwrite) {
|
||||||
// Do not show error message. We can have an error due to DB_ERROR_RECORD_ALREADY_EXISTS
|
// Do not show error message. We can have an error due to DB_ERROR_RECORD_ALREADY_EXISTS
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user