From 32b703e6c5f04f9aaf6e2defca98c6b1f1d7142c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 18 Apr 2019 09:33:47 +0200 Subject: [PATCH 1/3] Update myobject_list.php --- htdocs/modulebuilder/template/myobject_list.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 8cae415c6e1..0e580d7bc65 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -59,7 +59,12 @@ if (! $res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -dol_include_once('/mymodule/class/myobject.class.php'); + +// load mymodule libraries +require_once 'class/myobject.class.php'; + +// for other modules +//dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","other")); From 4912c69d8af6f18a4ad53bde4243589e3ed4ad81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 18 Apr 2019 10:12:00 +0200 Subject: [PATCH 2/3] Update functions2.lib.php --- htdocs/core/lib/functions2.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 45fea25224b..89c945d5ef4 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2496,7 +2496,7 @@ function autoOrManual($automaticmanual, $case = 1, $color = 0) /** * Convert links to local wrapper to medias files into a string into a public external URL readable on internet - * + * * @param string $notetoshow Text to convert * @return string String */ @@ -2504,7 +2504,7 @@ function convertBackOfficeMediasLinksToPublicLinks($notetoshow) { global $dolibarr_main_url_root; // Define $urlwithroot - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $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 $notetoshow=preg_replace('/src="[a-zA-Z0-9_\/\-\.]*(viewimage\.php\?modulepart=medias[^"]*)"/', 'src="'.$urlwithroot.'/\1"', $notetoshow); From 5dbf31d97575735ad1b70ad775b7e0ddb892baf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 18 Apr 2019 10:19:14 +0200 Subject: [PATCH 3/3] Update myobject_list.php --- htdocs/modulebuilder/template/myobject_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 0e580d7bc65..4035b82328d 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -61,7 +61,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // load mymodule libraries -require_once 'class/myobject.class.php'; +require_once __DIR__ . '/class/myobject.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php');