From 76b0e7ee5a8982046adc617353729f5ff2a6640e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Oct 2017 21:24:54 +0100 Subject: [PATCH] NEW Add option PROPOSAL/ORDER/INVOICE_ALLOW_EXTERNAL_DOWNLOAD --- htdocs/core/class/commonobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2f1a56c5595..1ae79e0c8fe 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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 {