From f85b666e72b2ec2b56f55eaacf2f73c64f95244a Mon Sep 17 00:00:00 2001 From: Alexandre Boin Date: Tue, 14 Mar 2023 16:18:25 +0100 Subject: [PATCH 1/4] Test deployment --- htdocs/test-deploy.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/test-deploy.php diff --git a/htdocs/test-deploy.php b/htdocs/test-deploy.php new file mode 100644 index 00000000000..4138a886454 --- /dev/null +++ b/htdocs/test-deploy.php @@ -0,0 +1 @@ + From 1907891b140c3c56041e5c499d8ced3e26f5ddbf Mon Sep 17 00:00:00 2001 From: Alexandre Boin Date: Tue, 14 Mar 2023 16:19:18 +0100 Subject: [PATCH 2/4] Remove deployment test --- htdocs/test-deploy.php | 1 - 1 file changed, 1 deletion(-) delete mode 100644 htdocs/test-deploy.php diff --git a/htdocs/test-deploy.php b/htdocs/test-deploy.php deleted file mode 100644 index 4138a886454..00000000000 --- a/htdocs/test-deploy.php +++ /dev/null @@ -1 +0,0 @@ - From a804999d92e3a1145d831ddab85a46164546eef1 Mon Sep 17 00:00:00 2001 From: Sarah Mainguet Date: Mon, 1 May 2023 22:11:35 +0200 Subject: [PATCH 3/4] Can now add documents to events in agenda --- htdocs/api/class/api_documents.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 78442622c7e..bec16dfc8b7 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -666,6 +666,10 @@ class Documents extends DolibarrApi $modulepart = 'propale'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $object = new Propal($this->db); + } elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') { + $modulepart = 'agenda'; + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $object = new ActionComm($this->db); } else { // TODO Implement additional moduleparts throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); @@ -742,6 +746,11 @@ class Documents extends DolibarrApi throw new RestException(500, "File with name '".$original_file."' already exists."); } + // in case temporary directory doesn't exist + if (!dol_is_dir(dirname(DOL_DATA_ROOT . '/admin/temp/'))) { + dol_mkdir(DOL_DATA_ROOT . '/admin/temp/'); + } + $fhandle = @fopen($destfiletmp, 'w'); if ($fhandle) { $nbofbyteswrote = fwrite($fhandle, $newfilecontent); From 06979fa0168d929db8f0a7b0fd3c6bbe10b40ff6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 May 2023 05:58:18 +0200 Subject: [PATCH 4/4] Update api_documents.class.php --- htdocs/api/class/api_documents.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 9c357dc5679..1c4e7a8ea11 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -756,9 +756,9 @@ class Documents extends DolibarrApi throw new RestException(500, "File with name '".$original_file."' already exists."); } - // in case temporary directory doesn't exist - if (!dol_is_dir(dirname(DOL_DATA_ROOT . '/admin/temp/'))) { - dol_mkdir(DOL_DATA_ROOT . '/admin/temp/'); + // in case temporary directory admin/temp doesn't exist + if (!dol_is_dir(dirname($destfiletmp))) { + dol_mkdir(dirname($destfiletmp)); } $fhandle = @fopen($destfiletmp, 'w');