From 6b38b89c3b568bb4d77efb3850e4793cf747853f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 19:05:25 +0200 Subject: [PATCH] NEW Add a way to enter LICENSE file content in property of website --- htdocs/website/class/website.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index b18daba1031..bddb8b43c24 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -979,8 +979,13 @@ class Website extends CommonObject dol_syslog("Copy pages from ".$srcdir." into ".$destdir); dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array('old', 'back')); - // Copy file README.md from containers to root - dol_copy($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md', $conf->website->dir_temp.'/'.$website->ref.'/README.md'); + // Copy file README.md and LICENSE from directory containers into directory root + if (dol_is_file($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md')) { + dol_copy($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md', $conf->website->dir_temp.'/'.$website->ref.'/README.md'); + } + if (dol_is_file($conf->website->dir_temp.'/'.$website->ref.'/containers/LICENSE')) { + dol_copy($conf->website->dir_temp.'/'.$website->ref.'/containers/LICENSE', $conf->website->dir_temp.'/'.$website->ref.'/LICENSE'); + } // Copy files into medias/image $srcdir = DOL_DATA_ROOT.'/medias/image/'.$website->ref;