diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index b6d294c6e18..b7603400c61 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1059,13 +1059,20 @@ class Facture extends CommonInvoice
*/
function getDirectExternalLink($withpicto=0)
{
+ global $dolibarr_main_url_root;
+
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
- $url='eee';
- return ''.$this->ref.'';
+ // TODO Read into ecmfile table to get entry and hash exists (PS: If not found, add it)
+ include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
+ $ecmfile=new EcmFiles($this->db);
+ //$result = $ecmfile->get();
+
+ $hashp='todo';
+ return ''.$this->ref.'';
}
/**
diff --git a/htdocs/document.php b/htdocs/document.php
index 11017f52cc2..0b2db2323cd 100644
--- a/htdocs/document.php
+++ b/htdocs/document.php
@@ -25,7 +25,7 @@
* \file htdocs/document.php
* \brief Wrapper to download data files
* \remarks Call of this wrapper is made with URL:
- * document.php?modulepart=repfichierconcerne&file=pathrelatifdufichier
+ * document.php?modulepart=repfichierconcerne&file=relativepathoffile
* document.php?modulepart=logs&file=dolibarr.log
*/
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 259db698024..4a5f349215b 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -324,6 +324,17 @@ class MyObject extends CommonObject
return $result;
}
+ /**
+ * Return link to download file from a direct external access
+ *
+ * @param int $withpicto Add download picto into link
+ * @return string HTML link to file
+ */
+ function getDirectExternalLink($withpicto=0)
+ {
+ return 'todo';
+ }
+
/**
* Retourne le libelle du status d'un user (actif, inactif)
*