NEW Add option PROPOSAL/ORDER/INVOICE_ALLOW_EXTERNAL_DOWNLOAD

This commit is contained in:
Laurent Destailleur 2017-10-29 21:24:54 +01:00
parent 0d09e1d223
commit 76b0e7ee5a

View File

@ -4091,7 +4091,12 @@ abstract class CommonObject
$ecmfile=new EcmFiles($this->db);
$result = $ecmfile->fetch(0, '', ($rel_dir?$rel_dir.'/':'').$filename);
if (! empty($conf->global->PROPOSAL_USE_ONLINE_SIGN))
// Set the public "share" key
$setsharekey = false;
if ($this->element == 'propal' && ! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
if ($setsharekey)
{
if (empty($ecmfile->share)) // Because object not found or share not set yet
{