ADD product document support in API
This commit is contained in:
parent
3ec2338c2d
commit
89c2d6731b
@ -355,6 +355,22 @@ class Documents extends DolibarrApi
|
|||||||
|
|
||||||
$upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice');
|
$upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||||
}
|
}
|
||||||
|
else if ($modulepart == 'produit' || $modulepart == 'product')
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
|
if (!DolibarrApiAccess::$user->rights->produit->lire) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$object = new Product($this->db);
|
||||||
|
$result=$object->fetch($id, $ref);
|
||||||
|
if ( ! $result ) {
|
||||||
|
throw new RestException(404, 'Product not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$upload_dir = $conf->product->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||||
|
}
|
||||||
else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user