add api document feature on interventional (#34609)

add get feature 
update upload feature (fichinter not reconized, we need ficheinter instread)
This commit is contained in:
Charlène Benke
2025-06-25 19:25:57 +02:00
committed by GitHub
parent d5ddc46d72
commit 642f045fd2

View File

@@ -7,6 +7,7 @@
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 William Mead <william@m34d.com>
* Copyright (C) 2025 Charlene Benke <charlene@patas-monkey.com>
*
* 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') {