FIX #6535
This commit is contained in:
parent
7dd0f14563
commit
dfc1ed7d72
@ -248,6 +248,7 @@ class Categories extends DolibarrApi
|
|||||||
if( ! count($obj_ret)) {
|
if( ! count($obj_ret)) {
|
||||||
throw new RestException(404, 'No category found');
|
throw new RestException(404, 'No category found');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj_ret;
|
return $obj_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,8 +352,46 @@ class Categories extends DolibarrApi
|
|||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
// Remove the subscriptions because they are handled as a subresource.
|
// Remove fields not relevent to categories
|
||||||
//unset($object->subscriptions);
|
unset($object->country);
|
||||||
|
unset($object->country_id);
|
||||||
|
unset($object->country_code);
|
||||||
|
unset($object->total_ht);
|
||||||
|
unset($object->total_ht);
|
||||||
|
unset($object->total_localtax1);
|
||||||
|
unset($object->total_localtax2);
|
||||||
|
unset($object->total_ttc);
|
||||||
|
unset($object->total_tva);
|
||||||
|
unset($object->lines);
|
||||||
|
unset($object->fk_incoterms);
|
||||||
|
unset($object->libelle_incoterms);
|
||||||
|
unset($object->location_incoterms);
|
||||||
|
unset($object->civility_id);
|
||||||
|
unset($object->name);
|
||||||
|
unset($object->lastname);
|
||||||
|
unset($object->firstname);
|
||||||
|
unset($object->shipping_method_id);
|
||||||
|
unset($object->fk_delivery_address);
|
||||||
|
unset($object->cond_reglement);
|
||||||
|
unset($object->cond_reglement_id);
|
||||||
|
unset($object->mode_reglement_id);
|
||||||
|
unset($object->barcode_type_coder);
|
||||||
|
unset($object->barcode_type_label);
|
||||||
|
unset($object->barcode_type_code);
|
||||||
|
unset($object->barcode_type);
|
||||||
|
unset($object->canvas);
|
||||||
|
unset($object->cats);
|
||||||
|
unset($object->motherof);
|
||||||
|
unset($object->context);
|
||||||
|
unset($object->socid);
|
||||||
|
unset($object->thirdparty);
|
||||||
|
unset($object->contact);
|
||||||
|
unset($object->contact_id);
|
||||||
|
unset($object->user);
|
||||||
|
unset($object->fk_account);
|
||||||
|
unset($object->fk_project);
|
||||||
|
unset($object->note);
|
||||||
|
unset($object->statut);
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -291,7 +291,7 @@ class CategoryApi extends DolibarrApi
|
|||||||
* @url GET /customer/{cusid}/categories
|
* @url GET /customer/{cusid}/categories
|
||||||
*/
|
*/
|
||||||
function getListCustomerCategories($cusid, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getListCustomerCategories($cusid, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
return $this->getListForItem('customer', $sortfield, $sortorder, $limit, $page, $cusid);
|
return $this->getListForItem($sortfield, $sortorder, $limit, $page, 'customer', $cusid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -264,7 +264,7 @@ class Products extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
$categories = new Categories();
|
$categories = new Categories();
|
||||||
return $categories->getListForItem('product', $sortfield, $sortorder, $limit, $page, $id);
|
return $categories->getListForItem($sortfield, $sortorder, $limit, $page, 'product', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -318,7 +318,7 @@ class Contacts extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
$categories = new Categories();
|
$categories = new Categories();
|
||||||
return $categories->getListForItem('contact', $sortfield, $sortorder, $limit, $page, $id);
|
return $categories->getListForItem($sortfield, $sortorder, $limit, $page, 'contact', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -267,7 +267,7 @@ class Thirdparties extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
$categories = new Categories();
|
$categories = new Categories();
|
||||||
return $categories->getListForItem('customer', $sortfield, $sortorder, $limit, $page, $id);
|
return $categories->getListForItem($sortfield, $sortorder, $limit, $page, 'customer', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user