mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
feat(api/documents): list contract
This commit is contained in:
parent
ffaf748ac8
commit
458fb18b5d
|
|
@ -502,6 +502,17 @@ class Documents extends DolibarrApi
|
|||
// $upload_dir = $conf->ecm->dir_output;
|
||||
// $type = 'all';
|
||||
// $recursive = 0;
|
||||
} elseif($modulepart == 'contrat' || $modulepart == 'contract') {
|
||||
$modulepart = 'contrat';
|
||||
require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
|
||||
|
||||
$object = new Contrat($this->db);
|
||||
$result = $object->fetch($id, $ref);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Contract not found');
|
||||
}
|
||||
|
||||
$upload_dir = $conf->contrat->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract');
|
||||
} else {
|
||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user