From 642f045fd297d9ddcf3b7eeb481bec921cb36689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Wed, 25 Jun 2025 19:25:57 +0200 Subject: [PATCH] add api document feature on interventional (#34609) add get feature update upload feature (fichinter not reconized, we need ficheinter instread) --- htdocs/api/class/api_documents.class.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index f34c9307a4f..df0cb7fd6b5 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * Copyright (C) 2025 William Mead + * Copyright (C) 2025 Charlene Benke * * This program is free software you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -599,6 +600,17 @@ class Documents extends DolibarrApi } $upload_dir = $conf->contract->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract'); + } elseif ($modulepart == 'intervention' || $modulepart == 'ficheinter') { + $modulepart = 'ficheinter'; + require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; + + $object = new Fichinter($this->db); + $result = $object->fetch($id, $ref); + if (!$result) { + throw new RestException(404, 'Interventional not found'); + } + + $upload_dir = $conf->ficheinter->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'ficheinter'); } elseif ($modulepart == 'projet' || $modulepart == 'project') { $modulepart = 'project'; require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; @@ -808,7 +820,7 @@ class Documents extends DolibarrApi } elseif ($modulepart == 'expensereport') { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; $object = new ExpenseReport($this->db); - } elseif ($modulepart == 'fichinter') { + } elseif ($modulepart == 'ficheinter' || $modulepart == 'intervention') { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $object = new Fichinter($this->db); } elseif ($modulepart == 'adherent' || $modulepart == 'member') {