mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 09:01:40 +01:00
Merge pull request #25566 from hansemschnokeloch/rest-extra
Add filter to restrict the data returned
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Cedric Ancelin <icedo.anc@gmail.com>
|
||||
* Copyright (C) 2023 Lionel Vessiller <lvessiller@open-dsi.fr>
|
||||
* Copyright (C) 2023 Lionel Vessiller <lvessiller@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -64,18 +64,18 @@ class Accountancy extends DolibarrApi
|
||||
/**
|
||||
* Accountancy export data
|
||||
*
|
||||
* @param string $period Period : 'lastmonth', 'currentmonth', 'last3months', 'last6months', 'currentyear', 'lastyear', 'fiscalyear', 'lastfiscalyear', 'actualandlastfiscalyear' or 'custom' (see above)
|
||||
* @param string $date_min [=''] Start date of period if 'custom' is set in period parameter
|
||||
* Date format is 'YYYY-MM-DD'
|
||||
* @param string $date_max [=''] End date of period if 'custom' is set in period parameter
|
||||
* Date format is 'YYYY-MM-DD'
|
||||
* @param string $format [=''] by default uses '1' for 'Configurable (CSV)' for format number
|
||||
* @param string $period Period : 'lastmonth', 'currentmonth', 'last3months', 'last6months', 'currentyear', 'lastyear', 'fiscalyear', 'lastfiscalyear', 'actualandlastfiscalyear' or 'custom' (see above)
|
||||
* @param string $date_min [=''] Start date of period if 'custom' is set in period parameter
|
||||
* Date format is 'YYYY-MM-DD'
|
||||
* @param string $date_max [=''] End date of period if 'custom' is set in period parameter
|
||||
* Date format is 'YYYY-MM-DD'
|
||||
* @param string $format [=''] by default uses '1' for 'Configurable (CSV)' for format number
|
||||
* or '1000' for FEC
|
||||
* or '1010' for FEC2
|
||||
* (see AccountancyExport class)
|
||||
* or '1010' for FEC2
|
||||
* (see AccountancyExport class)
|
||||
* @param int $lettering [=0] by default don't export or 1 to export lettering data (columns 'letterring_code' and 'date_lettering' returns empty or not)
|
||||
* @param int $alreadyexport [=0] by default export data only if it's not yet exported or 1 already exported (always export data even if 'date_export" is set)
|
||||
* @param int $notnotifiedasexport [=0] by default notified as exported or 1 not notified as exported (when the export is done, notified or not the column 'date_export')
|
||||
* @param int $alreadyexport [=0] by default export data only if it's not yet exported or 1 already exported (always export data even if 'date_export" is set)
|
||||
* @param int $notnotifiedasexport [=0] by default notified as exported or 1 not notified as exported (when the export is done, notified or not the column 'date_export')
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
|
||||
@@ -55,8 +55,8 @@ class Members extends DolibarrApi
|
||||
*
|
||||
* Return an array with member informations
|
||||
*
|
||||
* @param int $id ID of member
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of member
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -88,9 +88,9 @@ class Members extends DolibarrApi
|
||||
*
|
||||
* Return an array with member informations
|
||||
*
|
||||
* @param int $thirdparty ID of third party
|
||||
* @param int $thirdparty ID of third party
|
||||
*
|
||||
* @return Object Data without useless information
|
||||
* @return Object Data without useless information
|
||||
*
|
||||
* @url GET thirdparty/{thirdparty}
|
||||
*
|
||||
@@ -123,7 +123,7 @@ class Members extends DolibarrApi
|
||||
*
|
||||
* @param string $email Email of third party
|
||||
*
|
||||
* @return Object Data without useless information
|
||||
* @return Object Data without useless information
|
||||
*
|
||||
* @url GET thirdparty/email/{email}
|
||||
*
|
||||
@@ -160,9 +160,9 @@ class Members extends DolibarrApi
|
||||
*
|
||||
* Return an array with member informations
|
||||
*
|
||||
* @param string $barcode Barcode of third party
|
||||
* @param string $barcode Barcode of third party
|
||||
*
|
||||
* @return Object Data without useless information
|
||||
* @return Object Data without useless information
|
||||
*
|
||||
* @url GET thirdparty/barcode/{barcode}
|
||||
*
|
||||
@@ -204,14 +204,15 @@ class Members extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $typeid ID of the type of member
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma.
|
||||
* Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of member objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $category = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $category = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -263,7 +264,7 @@ class Members extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$member = new Adherent($this->db);
|
||||
if ($member->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($member);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($member), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -483,11 +484,11 @@ class Members extends DolibarrApi
|
||||
/**
|
||||
* Add a subscription for a member
|
||||
*
|
||||
* @param int $id ID of member
|
||||
* @param string $start_date Start date {@from body} {@type timestamp}
|
||||
* @param string $end_date End date {@from body} {@type timestamp}
|
||||
* @param float $amount Amount (may be 0) {@from body}
|
||||
* @param string $label Label {@from body}
|
||||
* @param int $id ID of member
|
||||
* @param string $start_date Start date {@from body} {@type timestamp}
|
||||
* @param string $end_date End date {@from body} {@type timestamp}
|
||||
* @param float $amount Amount (may be 0) {@from body}
|
||||
* @param string $label Label {@from body}
|
||||
* @return int ID of subscription
|
||||
*
|
||||
* @url POST {id}/subscriptions
|
||||
|
||||
@@ -48,8 +48,8 @@ class MembersTypes extends DolibarrApi
|
||||
*
|
||||
* Return an array with member type informations
|
||||
*
|
||||
* @param int $id ID of member type
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of member type
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -82,11 +82,12 @@ class MembersTypes extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.libelle:like:'SO-%') and (t.subscription:=:'1')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of member type objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -128,7 +129,7 @@ class MembersTypes extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$membertype = new AdherentType($this->db);
|
||||
if ($membertype->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($membertype);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($membertype), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ class Subscriptions extends DolibarrApi
|
||||
*
|
||||
* Return an array with subscription informations
|
||||
*
|
||||
* @param int $id ID of subscription
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of subscription
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -81,11 +81,12 @@ class Subscriptions extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of subscription objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -125,7 +126,7 @@ class Subscriptions extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$subscription = new Subscription($this->db);
|
||||
if ($subscription->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($subscription);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($subscription), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -93,6 +93,29 @@ class DolibarrApi
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Filter properties that will be returned on object
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @param String $properties Comma separated list of properties names
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
protected function _filterObjectProperties($object, $properties)
|
||||
{
|
||||
// If properties is empty, we return all properties
|
||||
if (empty($properties)) {
|
||||
return $object;
|
||||
}
|
||||
// Else we filter properties
|
||||
foreach (get_object_vars($object) as $key => $value) {
|
||||
if (!in_array($key, explode(',', $properties))) {
|
||||
unset($object->$key);
|
||||
}
|
||||
}
|
||||
return $object;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Christian Humpel <christian.humpel@live.com>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Christian Humpel <christian.humpel@live.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
|
||||
@@ -57,11 +57,11 @@ class Boms extends DolibarrApi
|
||||
*
|
||||
* Return an array with bom informations
|
||||
*
|
||||
* @param int $id ID of bom
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of bom
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET {id}
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -87,16 +87,17 @@ class Boms extends DolibarrApi
|
||||
*
|
||||
* Get a list of boms
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -174,7 +175,7 @@ class Boms extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$bom_static = new BOM($this->db);
|
||||
if ($bom_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($bom_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($bom_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ class Categories extends DolibarrApi
|
||||
*
|
||||
* Return an array with category informations
|
||||
*
|
||||
* @param int $id ID of category
|
||||
* @param bool $include_childs Include child categories list (true or false)
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $id ID of category
|
||||
* @param bool $include_childs Include child categories list (true or false)
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id, $include_childs = false)
|
||||
{
|
||||
@@ -126,11 +126,12 @@ class Categories extends DolibarrApi
|
||||
* @param int $page Page number
|
||||
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact')
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of category objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -174,7 +175,7 @@ class Categories extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$category_static = new Categorie($this->db);
|
||||
if ($category_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($category_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($category_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -58,9 +58,9 @@ class AgendaEvents extends DolibarrApi
|
||||
* Return an array with Agenda Events informations
|
||||
*
|
||||
* @param int $id ID of Agenda Events
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -99,11 +99,12 @@ class AgendaEvents extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $user_ids User ids filter field (owners of event). Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param string $user_ids User ids filter field (owners of event). Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of Agenda Events objects
|
||||
*/
|
||||
public function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -185,7 +186,7 @@ class AgendaEvents extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$actioncomm_static = new ActionComm($this->db);
|
||||
if ($actioncomm_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($actioncomm_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($actioncomm_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -59,11 +59,11 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* Return an array with commercial proposal informations
|
||||
*
|
||||
* @param int $id ID of commercial proposal
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of commercial proposal
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id, $contact_list = 1)
|
||||
{
|
||||
@@ -76,12 +76,12 @@ class Proposals extends DolibarrApi
|
||||
* Return an array with proposal informations
|
||||
*
|
||||
* @param string $ref Ref of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET ref/{ref}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRef($ref, $contact_list = 1)
|
||||
{
|
||||
@@ -94,12 +94,12 @@ class Proposals extends DolibarrApi
|
||||
* Return an array with proposal informations
|
||||
*
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET ref_ext/{ref_ext}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRefExt($ref_ext, $contact_list = 1)
|
||||
{
|
||||
@@ -114,10 +114,10 @@ class Proposals extends DolibarrApi
|
||||
* @param int $id ID of order
|
||||
* @param string $ref Ref of object
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
private function _fetch($id, $ref = '', $ref_ext = '', $contact_list = 1)
|
||||
{
|
||||
@@ -150,15 +150,16 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* Get a list of commercial proposals
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter commercial proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter commercial proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -237,7 +238,7 @@ class Proposals extends DolibarrApi
|
||||
if (is_array($tmparray)) {
|
||||
$proposal_static->contacts_ids = $tmparray;
|
||||
}
|
||||
$obj_ret[] = $this->_cleanObjectDatas($proposal_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($proposal_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -285,7 +286,7 @@ class Proposals extends DolibarrApi
|
||||
* Get lines of a commercial proposal
|
||||
*
|
||||
* @param int $id Id of commercial proposal
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. d is the alias for proposal lines table, p is the alias for product table. "Syntax example "(p.ref:like:'SO-%') AND (d.date_start:<:'20220101')"
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. d is the alias for proposal lines table, p is the alias for product table. "Syntax example "(p.ref:like:'SO-%') AND (d.date_start:<:'20220101')"
|
||||
*
|
||||
* @url GET {id}/lines
|
||||
*
|
||||
@@ -470,10 +471,10 @@ class Proposals extends DolibarrApi
|
||||
/**
|
||||
* Update a line of given commercial proposal
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data Commercial proposal line data
|
||||
* @return Object|false Object with cleaned properties
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data Commercial proposal line data
|
||||
* @return Object|false Object with cleaned properties
|
||||
*
|
||||
* @url PUT {id}/lines/{lineid}
|
||||
*/
|
||||
@@ -546,9 +547,9 @@ class Proposals extends DolibarrApi
|
||||
* Delete a line of given commercial proposal
|
||||
*
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $lineid Id of line to delete
|
||||
* @return Object|false Object with cleaned properties
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $lineid Id of line to delete
|
||||
* @return Object|false Object with cleaned properties
|
||||
*
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
@@ -628,10 +629,10 @@ class Proposals extends DolibarrApi
|
||||
/**
|
||||
* Delete a contact type of given commercial proposal
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $contactid Row key of the contact in the array contact_ids.
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER).
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $contactid Row key of the contact in the array contact_ids.
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER).
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url DELETE {id}/contact/{contactid}/{type}
|
||||
*
|
||||
@@ -673,9 +674,9 @@ class Proposals extends DolibarrApi
|
||||
/**
|
||||
* Update commercial proposal general fields (won't touch lines of commercial proposal)
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
@@ -751,7 +752,7 @@ class Proposals extends DolibarrApi
|
||||
* Set a proposal to draft
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/settodraft
|
||||
*/
|
||||
@@ -802,7 +803,7 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @param int $id Commercial proposal ID
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/validate
|
||||
*
|
||||
@@ -851,10 +852,10 @@ class Proposals extends DolibarrApi
|
||||
* Close (Accept or refuse) a quote / commercial proposal
|
||||
*
|
||||
* @param int $id Commercial proposal ID
|
||||
* @param int $status Must be 2 (accepted) or 3 (refused) {@min 2}{@max 3}
|
||||
* @param int $status Must be 2 (accepted) or 3 (refused) {@min 2}{@max 3}
|
||||
* @param string $note_private Add this mention at end of private note
|
||||
* @param int $notrigger Disabled triggers
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/close
|
||||
*/
|
||||
@@ -898,7 +899,7 @@ class Proposals extends DolibarrApi
|
||||
* Set a commercial proposal billed. Could be also called setbilled
|
||||
*
|
||||
* @param int $id Commercial proposal ID
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/setinvoiced
|
||||
*/
|
||||
|
||||
@@ -58,9 +58,9 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return array|mixed data without useless information
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id, $contact_list = 1)
|
||||
{
|
||||
@@ -74,11 +74,11 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @param string $ref Ref of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return array|mixed data without useless information
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @url GET ref/{ref}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRef($ref, $contact_list = 1)
|
||||
{
|
||||
@@ -92,11 +92,11 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return array|mixed data without useless information
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @url GET ref_ext/{ref_ext}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRefExt($ref_ext, $contact_list = 1)
|
||||
{
|
||||
@@ -108,13 +108,13 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* Return an array with order informations
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @param int $id ID of order
|
||||
* @param string $ref Ref of object
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
private function _fetch($id, $ref = '', $ref_ext = '', $contact_list = 1)
|
||||
{
|
||||
@@ -150,18 +150,19 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* Get a list of orders
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException 404 Not found
|
||||
* @throws RestException 503 Error
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -243,7 +244,7 @@ class Orders extends DolibarrApi
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
$commande_static->online_payment_url = getOnlinePaymentUrl(0, 'order', $commande_static->ref);
|
||||
|
||||
$obj_ret[] = $this->_cleanObjectDatas($commande_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($commande_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -391,9 +392,9 @@ class Orders extends DolibarrApi
|
||||
/**
|
||||
* Update a line to given order
|
||||
*
|
||||
* @param int $id Id of order to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data OrderLine data
|
||||
* @param int $id Id of order to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data OrderLine data
|
||||
* @return Object|false Object with cleaned properties
|
||||
*
|
||||
* @url PUT {id}/lines/{lineid}
|
||||
@@ -457,8 +458,8 @@ class Orders extends DolibarrApi
|
||||
/**
|
||||
* Delete a line of a given order
|
||||
*
|
||||
* @param int $id Id of order to update
|
||||
* @param int $lineid Id of line to delete
|
||||
* @param int $id Id of order to update
|
||||
* @param int $lineid Id of line to delete
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
@@ -494,13 +495,13 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* Return an array with contact informations
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER)
|
||||
* @param int $id ID of order
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER)
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET {id}/contacts
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getContacts($id, $type = '')
|
||||
{
|
||||
@@ -621,8 +622,8 @@ class Orders extends DolibarrApi
|
||||
/**
|
||||
* Update order general fields (won't touch lines of order)
|
||||
*
|
||||
* @param int $id Id of order to update
|
||||
* @param array $request_data Datas
|
||||
* @param int $id Id of order to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
@@ -791,7 +792,7 @@ class Orders extends DolibarrApi
|
||||
/**
|
||||
* Classify the order as invoiced. Could be also called setbilled
|
||||
*
|
||||
* @param int $id Id of the order
|
||||
* @param int $id Id of the order
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/setinvoiced
|
||||
@@ -883,7 +884,7 @@ class Orders extends DolibarrApi
|
||||
* Set an order to draft
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on)
|
||||
* @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on)
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/settodraft
|
||||
@@ -1070,8 +1071,8 @@ class Orders extends DolibarrApi
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
@@ -56,13 +56,14 @@ class BankAccounts extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array List of account objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@@ -108,7 +109,7 @@ class BankAccounts extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$account = new Account($this->db);
|
||||
if ($account->fetch($obj->rowid) > 0) {
|
||||
$list[] = $this->_cleanObjectDatas($account);
|
||||
$list[] = $this->_filterObjectProperties($this->_cleanObjectDatas($account), $properties);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -121,8 +122,8 @@ class BankAccounts extends DolibarrApi
|
||||
/**
|
||||
* Get account by ID.
|
||||
*
|
||||
* @param int $id ID of account
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of account
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -144,8 +145,8 @@ class BankAccounts extends DolibarrApi
|
||||
/**
|
||||
* Create account object
|
||||
*
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of account
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of account
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
@@ -312,9 +313,9 @@ class BankAccounts extends DolibarrApi
|
||||
/**
|
||||
* Update account
|
||||
*
|
||||
* @param int $id ID of account
|
||||
* @param array $request_data data
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of account
|
||||
* @param array $request_data data
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
@@ -480,7 +481,7 @@ class BankAccounts extends DolibarrApi
|
||||
* @param string $accountancycode Accountancy code {@from body}
|
||||
* @param string $datev Payment date value (timestamp) {@from body} {@type timestamp}
|
||||
* @param string $num_releve Bank statement numero {@from body}
|
||||
* @return int ID of line
|
||||
* @return int ID of line
|
||||
*
|
||||
* @url POST {id}/lines
|
||||
*/
|
||||
@@ -527,7 +528,7 @@ class BankAccounts extends DolibarrApi
|
||||
/**
|
||||
* Add a link to an account line
|
||||
*
|
||||
* @param int $id ID of account
|
||||
* @param int $id ID of account
|
||||
* @param int $line_id ID of account line
|
||||
* @param int $url_id ID to set in the URL {@from body}
|
||||
* @param string $url URL of the link {@from body}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
*
|
||||
* 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
|
||||
@@ -65,11 +65,11 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* Return an array with invoice informations
|
||||
*
|
||||
* @param int $id ID of invoice
|
||||
* @param int $contact_list 0:Return array contains all properties, 1:Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of invoice
|
||||
* @param int $contact_list 0:Return array contains all properties, 1:Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id, $contact_list = 1)
|
||||
{
|
||||
@@ -82,12 +82,12 @@ class Invoices extends DolibarrApi
|
||||
* Return an array with invoice informations
|
||||
*
|
||||
* @param string $ref Ref of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET ref/{ref}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRef($ref, $contact_list = 1)
|
||||
{
|
||||
@@ -100,12 +100,12 @@ class Invoices extends DolibarrApi
|
||||
* Return an array with invoice informations
|
||||
*
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET ref_ext/{ref_ext}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getByRefExt($ref_ext, $contact_list = 1)
|
||||
{
|
||||
@@ -117,13 +117,13 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* Return an array with invoice informations
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @param int $id ID of order
|
||||
* @param string $ref Ref of object
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
private function _fetch($id, $ref = '', $ref_ext = '', $contact_list = 1)
|
||||
{
|
||||
@@ -164,19 +164,20 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* Get a list of invoices
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $status Filter by invoice status : draft | unpaid | paid | cancelled
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $status Filter by invoice status : draft | unpaid | paid | cancelled
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of invoice objects
|
||||
*
|
||||
* @throws RestException 404 Not found
|
||||
* @throws RestException 503 Error
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -273,7 +274,7 @@ class Invoices extends DolibarrApi
|
||||
if (is_array($tmparray)) {
|
||||
$invoice_static->contacts_ids = $tmparray;
|
||||
}
|
||||
$obj_ret[] = $this->_cleanObjectDatas($invoice_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($invoice_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -365,8 +366,8 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Get lines of an invoice
|
||||
*
|
||||
* @param int $id Id of invoice
|
||||
* @return array Array of lines
|
||||
* @param int $id Id of invoice
|
||||
* @return array Array of lines
|
||||
*
|
||||
* @url GET {id}/lines
|
||||
*/
|
||||
@@ -395,9 +396,9 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Update a line to a given invoice
|
||||
*
|
||||
* @param int $id Id of invoice to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data InvoiceLine data
|
||||
* @param int $id Id of invoice to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data InvoiceLine data
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url PUT {id}/lines/{lineid}
|
||||
@@ -467,9 +468,9 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Add a contact type of given invoice
|
||||
*
|
||||
* @param int $id Id of invoice to update
|
||||
* @param int $contactid Id of contact to add
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER)
|
||||
* @param int $id Id of invoice to update
|
||||
* @param int $contactid Id of contact to add
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER)
|
||||
* @return array
|
||||
*
|
||||
* @url POST {id}/contact/{contactid}/{type}
|
||||
@@ -514,9 +515,9 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Delete a contact type of given invoice
|
||||
*
|
||||
* @param int $id Id of invoice to update
|
||||
* @param int $contactid Row key of the contact in the array contact_ids.
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER).
|
||||
* @param int $id Id of invoice to update
|
||||
* @param int $contactid Row key of the contact in the array contact_ids.
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER).
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url DELETE {id}/contact/{contactid}/{type}
|
||||
@@ -559,9 +560,9 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Deletes a line of a given invoice
|
||||
*
|
||||
* @param int $id Id of invoice
|
||||
* @param int $lineid Id of the line to delete
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Id of invoice
|
||||
* @param int $lineid Id of the line to delete
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
@@ -599,9 +600,9 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Update invoice
|
||||
*
|
||||
* @param int $id Id of invoice to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object|false Object with cleaned properties
|
||||
* @param int $id Id of invoice to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object|false Object with cleaned properties
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
@@ -642,8 +643,8 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Delete invoice
|
||||
*
|
||||
* @param int $id Invoice ID
|
||||
* @return array
|
||||
* @param int $id Invoice ID
|
||||
* @return array
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
@@ -769,10 +770,10 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Adds a contact to an invoice
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if souce = 'internal') to link
|
||||
* @param string $type_contact Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING
|
||||
* @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
|
||||
* @param int $id Order ID
|
||||
* @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if souce = 'internal') to link
|
||||
* @param string $type_contact Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING
|
||||
* @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
|
||||
* @param int $notrigger Disable all triggers
|
||||
*
|
||||
* @url POST {id}/contacts
|
||||
@@ -823,7 +824,7 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param int $idwarehouse Warehouse ID
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/settodraft
|
||||
*
|
||||
@@ -921,10 +922,10 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Sets an invoice as paid
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param string $close_code Code filled if we classify to 'Paid completely' when payment is not complete (for escompte for example)
|
||||
* @param string $close_note Comment defined if we classify to 'Paid' when payment is not complete (for escompte for example)
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Order ID
|
||||
* @param string $close_code Code filled if we classify to 'Paid completely' when payment is not complete (for escompte for example)
|
||||
* @param string $close_note Comment defined if we classify to 'Paid' when payment is not complete (for escompte for example)
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/settopaid
|
||||
*
|
||||
@@ -972,7 +973,7 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Sets an invoice as unpaid
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param int $id Order ID
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/settounpaid
|
||||
@@ -1058,7 +1059,7 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Create a discount (credit available) for a credit note or a deposit.
|
||||
*
|
||||
* @param int $id Invoice ID
|
||||
* @param int $id Invoice ID
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url POST {id}/markAsCreditAvailable
|
||||
@@ -1318,7 +1319,7 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Get list of payments of a given invoice
|
||||
*
|
||||
* @param int $id Id of invoice
|
||||
* @param int $id Id of invoice
|
||||
* @return array
|
||||
*
|
||||
* @url GET {id}/payments
|
||||
@@ -1690,8 +1691,8 @@ class Invoices extends DolibarrApi
|
||||
/**
|
||||
* Validate fields before create or update object
|
||||
*
|
||||
* @param array|null $data Datas to validate
|
||||
* @return array
|
||||
* @param array|null $data Datas to validate
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -1713,13 +1714,13 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* Return an array with invoice informations
|
||||
*
|
||||
* @param int $id ID of template invoice
|
||||
* @param int $contact_list 0:Return array contains all properties, 1:Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @param int $id ID of template invoice
|
||||
* @param int $contact_list 0:Return array contains all properties, 1:Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET templates/{id}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getTemplateInvoice($id, $contact_list = 1)
|
||||
{
|
||||
@@ -1731,13 +1732,13 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* Return an array with invoice informations
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @param int $id ID of order
|
||||
* @param string $ref Ref of object
|
||||
* @param string $ref_ext External reference of object
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id, -1: Do not return contacts/adddesses
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
private function _fetchTemplateInvoice($id, $ref = '', $ref_ext = '', $contact_list = 1)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@@ -61,8 +61,8 @@ class Contracts extends DolibarrApi
|
||||
* Return an array with contract informations
|
||||
*
|
||||
* @param int $id ID of contract
|
||||
* @return Object Object with cleaned properties
|
||||
* @throws RestException
|
||||
* @return Object Object with cleaned properties
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -90,18 +90,19 @@ class Contracts extends DolibarrApi
|
||||
*
|
||||
* Get a list of contracts
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter contracts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter contracts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of contract objects
|
||||
*
|
||||
* @throws RestException 404 Not found
|
||||
* @throws RestException 503 Error
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -174,7 +175,7 @@ class Contracts extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$contrat_static = new Contrat($this->db);
|
||||
if ($contrat_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($contrat_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($contrat_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -370,11 +371,11 @@ class Contracts extends DolibarrApi
|
||||
/**
|
||||
* Activate a service line of a given contract
|
||||
*
|
||||
* @param int $id Id of contract to activate
|
||||
* @param int $lineid Id of line to activate
|
||||
* @param string $datestart {@from body} Date start {@type timestamp}
|
||||
* @param int $id Id of contract to activate
|
||||
* @param int $lineid Id of line to activate
|
||||
* @param string $datestart {@from body} Date start {@type timestamp}
|
||||
* @param string $dateend {@from body} Date end {@type timestamp}
|
||||
* @param string $comment {@from body} Comment
|
||||
* @param string $comment {@from body} Comment
|
||||
*
|
||||
* @url PUT {id}/lines/{lineid}/activate
|
||||
*
|
||||
@@ -409,10 +410,10 @@ class Contracts extends DolibarrApi
|
||||
/**
|
||||
* Unactivate a service line of a given contract
|
||||
*
|
||||
* @param int $id Id of contract to activate
|
||||
* @param int $lineid Id of line to activate
|
||||
* @param string $datestart {@from body} Date start {@type timestamp}
|
||||
* @param string $comment {@from body} Comment
|
||||
* @param int $id Id of contract to activate
|
||||
* @param int $lineid Id of line to activate
|
||||
* @param string $datestart {@from body} Date start {@type timestamp}
|
||||
* @param string $comment {@from body} Comment
|
||||
*
|
||||
* @url PUT {id}/lines/{lineid}/unactivate
|
||||
*
|
||||
|
||||
@@ -57,9 +57,9 @@ class Donations extends DolibarrApi
|
||||
* Return an array with donation informations
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -95,11 +95,12 @@ class Donations extends DolibarrApi
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -158,7 +159,7 @@ class Donations extends DolibarrApi
|
||||
if ($don_static->fetch($obj->rowid)) {
|
||||
// Add external contacts ids
|
||||
//$don_static->contacts_ids = $don_static->liste_contact(-1, 'external', 1);
|
||||
$obj_ret[] = $this->_cleanObjectDatas($don_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($don_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ class Shipments extends DolibarrApi
|
||||
* Return an array with shipment informations
|
||||
*
|
||||
* @param int $id ID of shipment
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -89,17 +89,18 @@ class Shipments extends DolibarrApi
|
||||
*
|
||||
* Get a list of shipments
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter shipments of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter shipments of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of shipment objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -172,7 +173,7 @@ class Shipments extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$shipment_static = new Expedition($this->db);
|
||||
if ($shipment_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($shipment_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($shipment_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ class ExpenseReports extends DolibarrApi
|
||||
* Return an array with Expense Report informations
|
||||
*
|
||||
* @param int $id ID of Expense Report
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -91,11 +91,12 @@ class ExpenseReports extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of Expense Report objects
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -144,7 +145,7 @@ class ExpenseReports extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$expensereport_static = new ExpenseReport($this->db);
|
||||
if ($expensereport_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($expensereport_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($expensereport_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ class Interventions extends DolibarrApi
|
||||
* Return an array with Expense Report information
|
||||
*
|
||||
* @param int $id ID of Expense Report
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -100,17 +100,18 @@ class Interventions extends DolibarrApi
|
||||
* List of interventions
|
||||
* Return a list of interventions
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -183,7 +184,7 @@ class Interventions extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$fichinter_static = new Fichinter($this->db);
|
||||
if ($fichinter_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($fichinter_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($fichinter_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -257,7 +258,7 @@ class Interventions extends DolibarrApi
|
||||
/**
|
||||
* Add a line to given intervention
|
||||
*
|
||||
* @param int $id Id of intervention to update
|
||||
* @param int $id Id of intervention to update
|
||||
* @param array $request_data Request data
|
||||
*
|
||||
* @url POST {id}/lines
|
||||
@@ -339,8 +340,8 @@ class Interventions extends DolibarrApi
|
||||
* "notrigger": 0
|
||||
* }
|
||||
*
|
||||
* @param int $id Intervention ID
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @param int $id Intervention ID
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
*
|
||||
* @url POST {id}/validate
|
||||
*
|
||||
@@ -376,7 +377,7 @@ class Interventions extends DolibarrApi
|
||||
/**
|
||||
* Close an intervention
|
||||
*
|
||||
* @param int $id Intervention ID
|
||||
* @param int $id Intervention ID
|
||||
*
|
||||
* @url POST {id}/close
|
||||
*
|
||||
|
||||
@@ -58,10 +58,10 @@ class SupplierInvoices extends DolibarrApi
|
||||
*
|
||||
* Return an array with supplier invoice information
|
||||
*
|
||||
* @param int $id ID of supplier invoice
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of supplier invoice
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -87,18 +87,19 @@ class SupplierInvoices extends DolibarrApi
|
||||
*
|
||||
* Get a list of supplier invoices
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter invoices of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $status Filter by invoice status : draft | unpaid | paid | cancelled
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter invoices of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $status Filter by invoice status : draft | unpaid | paid | cancelled
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of invoice objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db;
|
||||
|
||||
@@ -185,7 +186,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$invoice_static = new FactureFournisseur($this->db);
|
||||
if ($invoice_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($invoice_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($invoice_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -662,7 +663,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
* Deletes a line of a given supplier invoice
|
||||
*
|
||||
* @param int $id Id of supplier invoice
|
||||
* @param int $lineid Id of the line to delete
|
||||
* @param int $lineid Id of the line to delete
|
||||
*
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
|
||||
@@ -56,10 +56,10 @@ class SupplierOrders extends DolibarrApi
|
||||
*
|
||||
* Return an array with supplier order information
|
||||
*
|
||||
* @param int $id ID of supplier order
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $id ID of supplier order
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -85,19 +85,20 @@ class SupplierOrders extends DolibarrApi
|
||||
*
|
||||
* Get a list of supplier orders
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $product_ids Product ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $status Filter by order status : draft | validated | approved | running | received_start | received_end | cancelled | refused
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $product_ids Product ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $status Filter by order status : draft | validated | approved | running | received_start | received_end | cancelled | refused
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -201,7 +202,7 @@ class SupplierOrders extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$order_static = new CommandeFournisseur($this->db);
|
||||
if ($order_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($order_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($order_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -292,14 +293,14 @@ class SupplierOrders extends DolibarrApi
|
||||
*
|
||||
* Return an array with contact informations
|
||||
*
|
||||
* @param int $id ID of supplier order
|
||||
* @param string $source Source of the contact (internal, external, all).
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER, SALESREPFOLL, ...)
|
||||
* @param int $id ID of supplier order
|
||||
* @param string $source Source of the contact (internal, external, all).
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER, SALESREPFOLL, ...)
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET {id}/contacts
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getContacts($id, $source, $type = '')
|
||||
{
|
||||
@@ -333,10 +334,10 @@ class SupplierOrders extends DolibarrApi
|
||||
/**
|
||||
* Add a contact type of given supplier order
|
||||
*
|
||||
* @param int $id Id of supplier order to update
|
||||
* @param int $contactid Id of contact/user to add
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER, SALESREPFOLL, ...)
|
||||
* @param string $source Source of the contact (external, internal)
|
||||
* @param int $id Id of supplier order to update
|
||||
* @param int $contactid Id of contact/user to add
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER, SALESREPFOLL, ...)
|
||||
* @param string $source Source of the contact (external, internal)
|
||||
* @return array
|
||||
*
|
||||
* @url POST {id}/contact/{contactid}/{type}/{source}
|
||||
@@ -380,10 +381,10 @@ class SupplierOrders extends DolibarrApi
|
||||
/**
|
||||
* Unlink a contact type of given supplier order
|
||||
*
|
||||
* @param int $id Id of supplier order to update
|
||||
* @param int $contactid Id of contact/user to add
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER, SALESREPFOLL, ...).
|
||||
* @param string $source Source of the contact (internal, external).
|
||||
* @param int $id Id of supplier order to update
|
||||
* @param int $contactid Id of contact/user to add
|
||||
* @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER, SALESREPFOLL, ...).
|
||||
* @param string $source Source of the contact (internal, external).
|
||||
*
|
||||
* @url DELETE {id}/contact/{contactid}/{type}/{source}
|
||||
*
|
||||
@@ -439,7 +440,7 @@ class SupplierOrders extends DolibarrApi
|
||||
/**
|
||||
* Delete supplier order
|
||||
*
|
||||
* @param int $id Supplier order ID
|
||||
* @param int $id Supplier order ID
|
||||
* @return array Array of result
|
||||
*/
|
||||
public function delete($id)
|
||||
|
||||
@@ -60,8 +60,8 @@ class KnowledgeManagement extends DolibarrApi
|
||||
*
|
||||
* Return an array with knowledgerecord informations
|
||||
*
|
||||
* @param int $id ID of knowledgerecord
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of knowledgerecord
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET knowledgerecords/{id}
|
||||
*
|
||||
@@ -125,19 +125,20 @@ class KnowledgeManagement extends DolibarrApi
|
||||
*
|
||||
* Get a list of knowledgerecords
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @url GET /knowledgerecords/
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -223,7 +224,7 @@ class KnowledgeManagement extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$tmp_object = new KnowledgeRecord($this->db);
|
||||
if ($tmp_object->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($tmp_object);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($tmp_object), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ class MyModuleApi extends DolibarrApi
|
||||
*
|
||||
* Return an array with myobject informations
|
||||
*
|
||||
* @param int $id ID of myobject
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of myobject
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET myobjects/{id}
|
||||
*
|
||||
@@ -93,18 +93,19 @@ class MyModuleApi extends DolibarrApi
|
||||
*
|
||||
* Get a list of myobjects
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @url GET /myobjects/
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -182,7 +183,7 @@ class MyModuleApi extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$tmp_object = new MyObject($this->db);
|
||||
if ($tmp_object->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($tmp_object);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($tmp_object), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ class Mos extends DolibarrApi
|
||||
*
|
||||
* Return an array with MO informations
|
||||
*
|
||||
* @param int $id ID of MO
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of MO
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET {id}
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -85,16 +85,17 @@ class Mos extends DolibarrApi
|
||||
*
|
||||
* Get a list of MOs
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -172,7 +173,7 @@ class Mos extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$tmp_object = new Mo($this->db);
|
||||
if ($tmp_object->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($tmp_object);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($tmp_object), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -295,8 +296,8 @@ class Mos extends DolibarrApi
|
||||
* "arraytoproduce": []
|
||||
* }
|
||||
*
|
||||
* @param int $id ID of state
|
||||
* @param array $request_data Request datas
|
||||
* @param int $id ID of state
|
||||
* @param array $request_data Request datas
|
||||
*
|
||||
* @url POST {id}/produceandconsume
|
||||
*
|
||||
@@ -647,8 +648,8 @@ class Mos extends DolibarrApi
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
@@ -45,13 +45,14 @@ class MultiCurrencies extends DolibarrApi
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.product_id:=:1) and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of warehouse objects
|
||||
* @param int $limit Limit for list
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.product_id:=:1) and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of warehouse objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db;
|
||||
|
||||
@@ -89,7 +90,7 @@ class MultiCurrencies extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$multicurrency_static = new MultiCurrency($this->db);
|
||||
if ($multicurrency_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($multicurrency_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($multicurrency_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -108,7 +109,7 @@ class MultiCurrencies extends DolibarrApi
|
||||
*
|
||||
* Return an array with Currency informations
|
||||
*
|
||||
* @param int $id ID of Currency
|
||||
* @param int $id ID of Currency
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
@@ -133,8 +134,8 @@ class MultiCurrencies extends DolibarrApi
|
||||
* Return an array with Currency informations
|
||||
* @url GET /bycode/{code}
|
||||
*
|
||||
* @param string $code Code of Currency (ex: EUR)
|
||||
* @return array|mixed Data without useless information
|
||||
* @param string $code Code of Currency (ex: EUR)
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -158,8 +159,8 @@ class MultiCurrencies extends DolibarrApi
|
||||
* Get a list of Currency rates
|
||||
*
|
||||
* @url GET {id}/rates
|
||||
* @param int $id ID of Currency
|
||||
* @return array|mixed Data without useless information
|
||||
* @param int $id ID of Currency
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -190,7 +191,7 @@ class MultiCurrencies extends DolibarrApi
|
||||
* Create Currency object
|
||||
*
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of Currency
|
||||
* @return int ID of Currency
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -234,7 +235,7 @@ class MultiCurrencies extends DolibarrApi
|
||||
*
|
||||
* @param int $id Id of Currency to update
|
||||
* @param array $request_data Datas
|
||||
* @return array The updated Currency
|
||||
* @return array The updated Currency
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -301,7 +302,7 @@ class MultiCurrencies extends DolibarrApi
|
||||
*
|
||||
* @param int $id Currency ID
|
||||
* @param array $request_data Request data
|
||||
* @return Object|false Object with cleaned properties
|
||||
* @return Object|false Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@@ -334,7 +335,7 @@ class MultiCurrencies extends DolibarrApi
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param MultiCurrency $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
@@ -360,7 +361,7 @@ class MultiCurrencies extends DolibarrApi
|
||||
* Clean sensible MultiCurrencyRate object datas
|
||||
*
|
||||
* @param MultiCurrency $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
protected function _cleanObjectDatasRate($object)
|
||||
{
|
||||
|
||||
@@ -59,8 +59,8 @@ class PartnershipApi extends DolibarrApi
|
||||
*
|
||||
* Return an array with partnership informations
|
||||
*
|
||||
* @param int $id ID of partnership
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of partnership
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET partnerships/{id}
|
||||
*
|
||||
@@ -91,18 +91,19 @@ class PartnershipApi extends DolibarrApi
|
||||
*
|
||||
* Get a list of partnerships
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @url GET /partnerships/
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -180,7 +181,7 @@ class PartnershipApi extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$tmp_object = new Partnership($this->db);
|
||||
if ($tmp_object->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($tmp_object);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($tmp_object), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -162,20 +162,21 @@ class Products extends DolibarrApi
|
||||
*
|
||||
* Get a list of products
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service)
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)"
|
||||
* @param bool $ids_only Return only IDs of product instead of all properties (faster, above all if list is long)
|
||||
* @param int $variant_filter Use this param to filter list (0 = all, 1=products without variants, 2=parent of variants, 3=variants only)
|
||||
* @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service)
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)"
|
||||
* @param bool $ids_only Return only IDs of product instead of all properties (faster, above all if list is long)
|
||||
* @param int $variant_filter Use this param to filter list (0 = all, 1=products without variants, 2=parent of variants, 3=variants only)
|
||||
* @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0
|
||||
* @param int $includestockdata Load also information about stock (slower)
|
||||
* @return array Array of product objects
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of product objects
|
||||
*/
|
||||
public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $ids_only = false, $variant_filter = 0, $pagination_data = false, $includestockdata = 0)
|
||||
public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $ids_only = false, $variant_filter = 0, $pagination_data = false, $includestockdata = 0, $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -266,7 +267,7 @@ class Products extends DolibarrApi
|
||||
}
|
||||
|
||||
|
||||
$obj_ret[] = $this->_cleanObjectDatas($product_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($product_static), $properties);
|
||||
}
|
||||
} else {
|
||||
$obj_ret[] = $obj->rowid;
|
||||
@@ -431,7 +432,7 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Delete product
|
||||
*
|
||||
* @param int $id Product ID
|
||||
* @param int $id Product ID
|
||||
* @return array
|
||||
*/
|
||||
public function delete($id)
|
||||
@@ -643,8 +644,8 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Get prices per customer for a product
|
||||
*
|
||||
* @param int $id ID of product
|
||||
* @param string $thirdparty_id Thirdparty id to filter orders of (example '1') {@pattern /^[0-9,]*$/i}
|
||||
* @param int $id ID of product
|
||||
* @param string $thirdparty_id Thirdparty id to filter orders of (example '1') {@pattern /^[0-9,]*$/i}
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
@@ -730,28 +731,28 @@ class Products extends DolibarrApi
|
||||
* Add/Update purchase prices for a product.
|
||||
*
|
||||
* @param int $id ID of Product
|
||||
* @param float $qty Min quantity for which price is valid
|
||||
* @param float $buyprice Purchase price for the quantity min
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param int $fourn_id Supplier ID
|
||||
* @param int $availability Product availability
|
||||
* @param string $ref_fourn Supplier ref
|
||||
* @param float $tva_tx New VAT Rate (For example 8.5. Should not be a string)
|
||||
* @param string $charges costs affering to product
|
||||
* @param float $remise_percent Discount regarding qty (percent)
|
||||
* @param float $remise Discount regarding qty (amount)
|
||||
* @param int $newnpr Set NPR or not
|
||||
* @param int $delivery_time_days Delay in days for delivery (max). May be '' if not defined.
|
||||
* @param float $qty Min quantity for which price is valid
|
||||
* @param float $buyprice Purchase price for the quantity min
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param int $fourn_id Supplier ID
|
||||
* @param int $availability Product availability
|
||||
* @param string $ref_fourn Supplier ref
|
||||
* @param float $tva_tx New VAT Rate (For example 8.5. Should not be a string)
|
||||
* @param string $charges costs affering to product
|
||||
* @param float $remise_percent Discount regarding qty (percent)
|
||||
* @param float $remise Discount regarding qty (amount)
|
||||
* @param int $newnpr Set NPR or not
|
||||
* @param int $delivery_time_days Delay in days for delivery (max). May be '' if not defined.
|
||||
* @param string $supplier_reputation Reputation with this product to the defined supplier (empty, FAVORITE, DONOTORDER)
|
||||
* @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function).
|
||||
* @param string $newdefaultvatcode Default vat code
|
||||
* @param float $multicurrency_buyprice Purchase price for the quantity min in currency
|
||||
* @param string $multicurrency_price_base_type HT or TTC in currency
|
||||
* @param float $multicurrency_tx Rate currency
|
||||
* @param string $multicurrency_code Currency code
|
||||
* @param string $desc_fourn Custom description for product_fourn_price
|
||||
* @param string $barcode Barcode
|
||||
* @param int $fk_barcode_type Barcode type
|
||||
* @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function).
|
||||
* @param string $newdefaultvatcode Default vat code
|
||||
* @param float $multicurrency_buyprice Purchase price for the quantity min in currency
|
||||
* @param string $multicurrency_price_base_type HT or TTC in currency
|
||||
* @param float $multicurrency_tx Rate currency
|
||||
* @param string $multicurrency_code Currency code
|
||||
* @param string $desc_fourn Custom description for product_fourn_price
|
||||
* @param string $barcode Barcode
|
||||
* @param int $fk_barcode_type Barcode type
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500 System error
|
||||
@@ -1010,6 +1011,7 @@ class Products extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:color)"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 401
|
||||
@@ -1018,7 +1020,7 @@ class Products extends DolibarrApi
|
||||
*
|
||||
* @url GET attributes
|
||||
*/
|
||||
public function getAttributes($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function getAttributes($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->produit->lire) {
|
||||
throw new RestException(401);
|
||||
@@ -1063,7 +1065,7 @@ class Products extends DolibarrApi
|
||||
$tmp->position = $obj->position;
|
||||
$tmp->entity = $obj->entity;
|
||||
|
||||
$return[] = $this->_cleanObjectDatas($tmp);
|
||||
$return[] = $this->_filterObjectProperties($this->_cleanObjectDatas($tmp), $properties);
|
||||
}
|
||||
|
||||
if (!count($return)) {
|
||||
@@ -1076,8 +1078,8 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Get attribute by ID.
|
||||
*
|
||||
* @param int $id ID of Attribute
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of Attribute
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
@@ -1251,9 +1253,9 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Update attributes by id.
|
||||
*
|
||||
* @param int $id ID of Attribute
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of Attribute
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 401
|
||||
@@ -1299,7 +1301,7 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Delete attributes by id.
|
||||
*
|
||||
* @param int $id ID of Attribute
|
||||
* @param int $id ID of Attribute
|
||||
* @return int Result of deletion
|
||||
*
|
||||
* @throws RestException 500 System error
|
||||
@@ -1559,9 +1561,9 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Update attribute value.
|
||||
*
|
||||
* @param int $id ID of Attribute
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of Attribute
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 500 System error
|
||||
@@ -1632,7 +1634,7 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Get product variants.
|
||||
*
|
||||
* @param int $id ID of Product
|
||||
* @param int $id ID of Product
|
||||
* @param int $includestock Default value 0. If parameter is set to 1 the response will contain stock data of each variant
|
||||
* @return array
|
||||
*
|
||||
@@ -1857,7 +1859,7 @@ class Products extends DolibarrApi
|
||||
/**
|
||||
* Delete product variants.
|
||||
*
|
||||
* @param int $id ID of Variant
|
||||
* @param int $id ID of Variant
|
||||
* @return int Result of deletion
|
||||
*
|
||||
* @throws RestException 500 System error
|
||||
@@ -2014,16 +2016,16 @@ class Products extends DolibarrApi
|
||||
* Get properties of 1 product object.
|
||||
* Return an array with product information.
|
||||
*
|
||||
* @param int $id ID of product
|
||||
* @param string $ref Ref of element
|
||||
* @param string $ref_ext Ref ext of element
|
||||
* @param string $barcode Barcode of element
|
||||
* @param int $includestockdata Load also information about stock (slower)
|
||||
* @param bool $includesubproducts Load information about subproducts (if product is a virtual product)
|
||||
* @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
|
||||
* @param int $id ID of product
|
||||
* @param string $ref Ref of element
|
||||
* @param string $ref_ext Ref ext of element
|
||||
* @param string $barcode Barcode of element
|
||||
* @param int $includestockdata Load also information about stock (slower)
|
||||
* @param bool $includesubproducts Load information about subproducts (if product is a virtual product)
|
||||
* @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
|
||||
* @param bool $includeifobjectisused Check if product object is used and set property 'is_object_used' with result.
|
||||
* @param bool $includetrans Load also the translations of product label and description
|
||||
* @return array|mixed Data without useless information
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
|
||||
@@ -57,10 +57,10 @@ class StockMovements extends DolibarrApi
|
||||
*
|
||||
* Return an array with stock movement informations
|
||||
*
|
||||
* @param int $id ID of movement
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of movement
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
/*
|
||||
public function get($id)
|
||||
@@ -89,11 +89,12 @@ class StockMovements extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.product_id:=:1) and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of warehouse objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -136,7 +137,7 @@ class StockMovements extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$stockmovement_static = new MouvementStock($this->db);
|
||||
if ($stockmovement_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($stockmovement_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($stockmovement_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ class Warehouses extends DolibarrApi
|
||||
*
|
||||
* Return an array with warehouse informations
|
||||
*
|
||||
* @param int $id ID of warehouse
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of warehouse
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -89,11 +89,12 @@ class Warehouses extends DolibarrApi
|
||||
* @param int $page Page number
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'WH-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of warehouse objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -142,7 +143,7 @@ class Warehouses extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$warehouse_static = new Entrepot($this->db);
|
||||
if ($warehouse_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($warehouse_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($warehouse_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -65,9 +65,9 @@ class Projects extends DolibarrApi
|
||||
* Return an array with project informations
|
||||
*
|
||||
* @param int $id ID of project
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -95,16 +95,17 @@ class Projects extends DolibarrApi
|
||||
*
|
||||
* Get a list of projects
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter projects of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter projects of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of project objects
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $category = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $category = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->projet->lire) {
|
||||
throw new RestException(401);
|
||||
@@ -182,7 +183,7 @@ class Projects extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$project_static = new Project($this->db);
|
||||
if ($project_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($project_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($project_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ class Tasks extends DolibarrApi
|
||||
*
|
||||
* @param int $id ID of task
|
||||
* @param int $includetimespent 0=Return only task. 1=Include a summary of time spent, 2=Include details of time spent lines
|
||||
* @return array|mixed data without useless information
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id, $includetimespent = 0)
|
||||
{
|
||||
@@ -97,14 +97,15 @@ class Tasks extends DolibarrApi
|
||||
*
|
||||
* Get a list of tasks
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of project objects
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -177,7 +178,7 @@ class Tasks extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$task_static = new Task($this->db);
|
||||
if ($task_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($task_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($task_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -268,7 +269,7 @@ class Tasks extends DolibarrApi
|
||||
*
|
||||
* @param int $id Id of task
|
||||
* @param int $userid Id of user (0 = connected user)
|
||||
* @return array Array of roles
|
||||
* @return array Array of roles
|
||||
*
|
||||
* @url GET {id}/roles
|
||||
*
|
||||
|
||||
@@ -59,8 +59,8 @@ class Receptions extends DolibarrApi
|
||||
* Return an array with reception informations
|
||||
*
|
||||
* @param int $id ID of reception
|
||||
* @return Object Object with cleaned properties
|
||||
* @throws RestException
|
||||
* @return Object Object with cleaned properties
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -88,17 +88,18 @@ class Receptions extends DolibarrApi
|
||||
*
|
||||
* Get a list of receptions
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter receptions of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter receptions of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of reception objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -171,7 +172,7 @@ class Receptions extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$reception_static = new Reception($this->db);
|
||||
if ($reception_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($reception_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($reception_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -426,9 +427,9 @@ class Receptions extends DolibarrApi
|
||||
/**
|
||||
* Update reception general fields (won't touch lines of reception)
|
||||
*
|
||||
* @param int $id Id of reception to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Id of reception to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
@@ -496,8 +497,8 @@ class Receptions extends DolibarrApi
|
||||
* This may record stock movements if module stock is enabled and option to
|
||||
* decrease stock on reception is on.
|
||||
*
|
||||
* @param int $id Reception ID
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @param int $id Reception ID
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
*
|
||||
* @url POST {id}/validate
|
||||
*
|
||||
@@ -624,8 +625,8 @@ class Receptions extends DolibarrApi
|
||||
/**
|
||||
* Close a reception (Classify it as "Delivered")
|
||||
*
|
||||
* @param int $id Reception ID
|
||||
* @param int $notrigger Disabled triggers
|
||||
* @param int $id Reception ID
|
||||
* @param int $notrigger Disabled triggers
|
||||
*
|
||||
* @url POST {id}/close
|
||||
*
|
||||
|
||||
@@ -66,8 +66,8 @@ class Recruitment extends DolibarrApi
|
||||
*
|
||||
* Return an array with jobposition informations
|
||||
*
|
||||
* @param int $id ID of jobposition
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of jobposition
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET jobposition/{id}
|
||||
*
|
||||
@@ -97,7 +97,7 @@ class Recruitment extends DolibarrApi
|
||||
*
|
||||
* Return an array with candidature informations
|
||||
*
|
||||
* @param int $id ID of candidature
|
||||
* @param int $id ID of candidature
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET candidature/{id}
|
||||
@@ -129,18 +129,19 @@ class Recruitment extends DolibarrApi
|
||||
*
|
||||
* Get a list of jobpositions
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @url GET /jobposition/
|
||||
*/
|
||||
public function indexJobPosition($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function indexJobPosition($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -218,7 +219,7 @@ class Recruitment extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$tmp_object = new RecruitmentJobPosition($this->db);
|
||||
if ($tmp_object->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($tmp_object);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($tmp_object), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -236,10 +237,10 @@ class Recruitment extends DolibarrApi
|
||||
*
|
||||
* Get a list of candidatures
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of order objects
|
||||
*
|
||||
@@ -405,9 +406,9 @@ class Recruitment extends DolibarrApi
|
||||
/**
|
||||
* Update jobposition
|
||||
*
|
||||
* @param int $id Id of jobposition to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Id of jobposition to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
@@ -448,9 +449,9 @@ class Recruitment extends DolibarrApi
|
||||
/**
|
||||
* Update candidature
|
||||
*
|
||||
* @param int $id Id of candidature to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Id of candidature to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
|
||||
@@ -62,12 +62,12 @@ class Contacts extends DolibarrApi
|
||||
*
|
||||
* Return an array with contact informations
|
||||
*
|
||||
* @param int $id ID of contact
|
||||
* @param int $id ID of contact
|
||||
* @param int $includecount Count and return also number of elements the contact is used as a link for
|
||||
* @param int $includeroles Includes roles of the contact
|
||||
* @return array|mixed data without useless information
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id, $includecount = 0, $includeroles = 0)
|
||||
{
|
||||
@@ -107,10 +107,10 @@ class Contacts extends DolibarrApi
|
||||
/**
|
||||
* Get properties of a contact object by Email
|
||||
*
|
||||
* @param string $email Email of contact
|
||||
* @param string $email Email of contact
|
||||
* @param int $includecount Count and return also number of elements the contact is used as a link for
|
||||
* @param int $includeroles Includes roles of the contact
|
||||
* @return array|mixed data without useless information
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @url GET email/{email}
|
||||
*
|
||||
@@ -157,20 +157,21 @@ class Contacts extends DolibarrApi
|
||||
*
|
||||
* Get a list of contacts
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter contacts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter contacts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param int $includecount Count and return also number of elements the contact is used as a link for
|
||||
* @param int $includeroles Includes roles of the contact
|
||||
* @param int $includeroles Includes roles of the contact
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of contact objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $category = 0, $sqlfilters = '', $includecount = 0, $includeroles = 0)
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $category = 0, $sqlfilters = '', $includecount = 0, $includeroles = 0, $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -261,7 +262,7 @@ class Contacts extends DolibarrApi
|
||||
$contact_static->getNoEmail();
|
||||
}
|
||||
|
||||
$obj_ret[] = $this->_cleanObjectDatas($contact_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($contact_static), $properties);
|
||||
}
|
||||
|
||||
$i++;
|
||||
@@ -372,7 +373,7 @@ class Contacts extends DolibarrApi
|
||||
/**
|
||||
* Create an user account object from contact (external user)
|
||||
*
|
||||
* @param int $id Id of contact
|
||||
* @param int $id Id of contact
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of user
|
||||
*
|
||||
|
||||
@@ -67,10 +67,10 @@ class Thirdparties extends DolibarrApi
|
||||
*
|
||||
* Return an array with thirdparty informations
|
||||
*
|
||||
* @param int $id Id of third party to load
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id Id of third party to load
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -124,11 +124,12 @@ class Thirdparties extends DolibarrApi
|
||||
* Set to 2 to show only prospects
|
||||
* Set to 3 to show only those are not customer neither prospect
|
||||
* Set to 4 to show only suppliers
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "((t.nom:like:'TheCompany%') or (t.name_alias:like:'TheCompany%')) and (t.datec:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of thirdparty objects
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
$obj_ret = array();
|
||||
|
||||
@@ -233,7 +234,7 @@ class Thirdparties extends DolibarrApi
|
||||
if (isModEnabled('mailing')) {
|
||||
$soc_static->getNoEmail();
|
||||
}
|
||||
$obj_ret[] = $this->_cleanObjectDatas($soc_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($soc_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -845,12 +846,12 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Get outstanding proposals of thirdparty
|
||||
*
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 'customer' or 'supplier'
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 'customer' or 'supplier'
|
||||
*
|
||||
* @url GET {id}/outstandingproposals
|
||||
*
|
||||
* @return array List of outstandings proposals of thirdparty
|
||||
* @return array List of outstandings proposals of thirdparty
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
@@ -887,12 +888,12 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Get outstanding orders of thirdparty
|
||||
*
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 'customer' or 'supplier'
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 'customer' or 'supplier'
|
||||
*
|
||||
* @url GET {id}/outstandingorders
|
||||
*
|
||||
* @return array List of outstandings orders of thirdparty
|
||||
* @return array List of outstandings orders of thirdparty
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
@@ -928,12 +929,12 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Get outstanding invoices of thirdparty
|
||||
*
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 'customer' or 'supplier'
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 'customer' or 'supplier'
|
||||
*
|
||||
* @url GET {id}/outstandinginvoices
|
||||
*
|
||||
* @return array List of outstandings invoices of thirdparty
|
||||
* @return array List of outstandings invoices of thirdparty
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
@@ -969,12 +970,12 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Get representatives of thirdparty
|
||||
*
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 0=Array with properties, 1=Array of id.
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $mode 0=Array with properties, 1=Array of id.
|
||||
*
|
||||
* @url GET {id}/representatives
|
||||
*
|
||||
* @return array List of representatives of thirdparty
|
||||
* @return array List of representatives of thirdparty
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
@@ -1007,10 +1008,10 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Get fixed amount discount of a thirdparty (all sources: deposit, credit note, commercial offers...)
|
||||
*
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $filter Filter exceptional discount. "none" will return every discount, "available" returns unapplied discounts, "used" returns applied discounts {@choice none,available,used}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $id ID of the thirdparty
|
||||
* @param string $filter Filter exceptional discount. "none" will return every discount, "available" returns unapplied discounts, "used" returns applied discounts {@choice none,available,used}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
*
|
||||
* @url GET {id}/fixedamountdiscounts
|
||||
*
|
||||
@@ -1347,9 +1348,9 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Generate a Document from a bank account record (like SEPA mandate)
|
||||
*
|
||||
* @param int $id Thirdparty id
|
||||
* @param int $companybankid Companybank id
|
||||
* @param string $model Model of document to generate
|
||||
* @param int $id Thirdparty id
|
||||
* @param int $companybankid Companybank id
|
||||
* @param string $model Model of document to generate
|
||||
* @return array
|
||||
*
|
||||
* @url GET {id}/generateBankAccountDocument/{companybankid}/{model}
|
||||
@@ -1650,9 +1651,9 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Update specified values of a specific gateway attached to a thirdparty
|
||||
*
|
||||
* @param int $id Id of thirdparty
|
||||
* @param string $site Site key
|
||||
* @param array $request_data Request data
|
||||
* @param int $id Id of thirdparty
|
||||
* @param string $site Site key
|
||||
* @param array $request_data Request data
|
||||
*
|
||||
* @return array|mixed
|
||||
*
|
||||
@@ -1860,7 +1861,7 @@ class Thirdparties extends DolibarrApi
|
||||
* @param string $idprof4 Prof id 4 of third party (Warning, this can return several records)
|
||||
* @param string $idprof5 Prof id 5 of third party (Warning, this can return several records)
|
||||
* @param string $idprof6 Prof id 6 of third party (Warning, this can return several records)
|
||||
* @param string $email Email of third party (Warning, this can return several records)
|
||||
* @param string $email Email of third party (Warning, this can return several records)
|
||||
* @param string $ref_alias Name_alias of third party (Warning, this can return several records)
|
||||
* @return array|mixed cleaned Societe object
|
||||
*
|
||||
|
||||
@@ -58,9 +58,9 @@ class SupplierProposals extends DolibarrApi
|
||||
* Return an array with supplier proposal informations
|
||||
*
|
||||
* @param int $id ID of supplier proposal
|
||||
* @return Object Object with cleaned properties
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
@@ -86,15 +86,16 @@ class SupplierProposals extends DolibarrApi
|
||||
*
|
||||
* Get a list of supplier proposals
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter supplier proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter supplier proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->supplier_proposal->lire) {
|
||||
throw new RestException(401);
|
||||
@@ -164,7 +165,7 @@ class SupplierProposals extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$propal_static = new SupplierProposal($this->db);
|
||||
if ($propal_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($propal_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($propal_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ class Tickets extends DolibarrApi
|
||||
*
|
||||
* Return an array with ticket informations
|
||||
*
|
||||
* @param int $id ID of ticket
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of ticket
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
@@ -82,14 +82,14 @@ class Tickets extends DolibarrApi
|
||||
*
|
||||
* Return an array with ticket informations
|
||||
*
|
||||
* @param string $track_id Tracking ID of ticket
|
||||
* @return array|mixed Data without useless information
|
||||
* @param string $track_id Tracking ID of ticket
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @url GET track_id/{track_id}
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
*/
|
||||
public function getByTrackId($track_id)
|
||||
{
|
||||
@@ -101,8 +101,8 @@ class Tickets extends DolibarrApi
|
||||
*
|
||||
* Return an array with ticket informations
|
||||
*
|
||||
* @param string $ref Reference for ticket
|
||||
* @return array|mixed Data without useless information
|
||||
* @param string $ref Reference for ticket
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @url GET ref/{ref}
|
||||
*
|
||||
@@ -119,10 +119,10 @@ class Tickets extends DolibarrApi
|
||||
* Get properties of a Ticket object
|
||||
* Return an array with ticket informations
|
||||
*
|
||||
* @param int $id ID of ticket
|
||||
* @param string $track_id Tracking ID of ticket
|
||||
* @param string $ref Reference for ticket
|
||||
* @return array|mixed Data without useless information
|
||||
* @param int $id ID of ticket
|
||||
* @param string $track_id Tracking ID of ticket
|
||||
* @param string $ref Reference for ticket
|
||||
* @return array|mixed Data without useless information
|
||||
*/
|
||||
private function getCommon($id = 0, $track_id = '', $ref = '')
|
||||
{
|
||||
@@ -194,11 +194,12 @@ class Tickets extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101') and (t.fk_statut:=:1)"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
*
|
||||
* @return array Array of ticket objects
|
||||
*
|
||||
*/
|
||||
public function index($socid = 0, $sortfield = "t.rowid", $sortorder = "ASC", $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($socid = 0, $sortfield = "t.rowid", $sortorder = "ASC", $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -277,7 +278,7 @@ class Tickets extends DolibarrApi
|
||||
$userStatic->fetch($ticket_static->fk_user_assign);
|
||||
$ticket_static->fk_user_assign_string = $userStatic->firstname.' '.$userStatic->lastname;
|
||||
}
|
||||
$obj_ret[] = $this->_cleanObjectDatas($ticket_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($ticket_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
*
|
||||
* 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
|
||||
@@ -63,12 +63,13 @@ class Users extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of User objects
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $category = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $category = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -126,7 +127,7 @@ class Users extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$user_static = new User($this->db);
|
||||
if ($user_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($user_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($user_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -142,9 +143,9 @@ class Users extends DolibarrApi
|
||||
/**
|
||||
* Get properties of an user object
|
||||
*
|
||||
* @param int $id ID of user
|
||||
* @param int $id ID of user
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed data without useless information
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
@@ -178,15 +179,15 @@ class Users extends DolibarrApi
|
||||
/**
|
||||
* Get properties of an user object by login
|
||||
*
|
||||
* @param string $login Login of user
|
||||
* @param string $login Login of user
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed Data without useless information
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @url GET login/{login}
|
||||
*
|
||||
* @throws RestException 400 Bad request
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
*/
|
||||
public function getByLogin($login, $includepermissions = 0)
|
||||
{
|
||||
@@ -217,9 +218,9 @@ class Users extends DolibarrApi
|
||||
/**
|
||||
* Get properties of an user object by Email
|
||||
*
|
||||
* @param string $email Email of user
|
||||
* @param string $email Email of user
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed Data without useless information
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @url GET email/{email}
|
||||
*
|
||||
@@ -259,7 +260,7 @@ class Users extends DolibarrApi
|
||||
* @url GET /info
|
||||
*
|
||||
* @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose)
|
||||
* @return array|mixed Data without useless information
|
||||
* @return array|mixed Data without useless information
|
||||
*
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
@@ -346,9 +347,9 @@ class Users extends DolibarrApi
|
||||
/**
|
||||
* Update user account
|
||||
*
|
||||
* @param int $id Id of account to update
|
||||
* @param array $request_data Datas
|
||||
* @return array|mixed Record after update
|
||||
* @param int $id Id of account to update
|
||||
* @param array $request_data Datas
|
||||
* @return array|mixed Record after update
|
||||
*
|
||||
* @throws RestException 401 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
@@ -513,14 +514,15 @@ class Users extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $group_ids Groups ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param string $group_ids Groups ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of User objects
|
||||
*
|
||||
* @throws RestException 404 User not found
|
||||
* @throws RestException 503 Error
|
||||
*/
|
||||
public function listGroups($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $group_ids = 0, $sqlfilters = '')
|
||||
public function listGroups($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $group_ids = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -569,7 +571,7 @@ class Users extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$group_static = new UserGroup($this->db);
|
||||
if ($group_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($group_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($group_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@@ -589,7 +591,7 @@ class Users extends DolibarrApi
|
||||
*
|
||||
* @url GET /groups/{group}
|
||||
*
|
||||
* @param int $group ID of group
|
||||
* @param int $group ID of group
|
||||
* @param int $load_members Load members list or not {@min 0} {@max 1}
|
||||
* @return object object of User objects
|
||||
*
|
||||
@@ -655,8 +657,8 @@ class Users extends DolibarrApi
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
||||
@@ -66,8 +66,8 @@ class Zapier extends DolibarrApi
|
||||
*
|
||||
* Return an array with hook informations
|
||||
*
|
||||
* @param int $id ID of hook
|
||||
* @return Object Object with cleaned properties
|
||||
* @param int $id ID of hook
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET /hooks/{id}
|
||||
* @throws RestException
|
||||
@@ -135,13 +135,14 @@ class Zapier extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @url GET /hooks/
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@@ -222,7 +223,7 @@ class Zapier extends DolibarrApi
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$hook_static = new Hook($this->db);
|
||||
if ($hook_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = $this->_cleanObjectDatas($hook_static);
|
||||
$obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($hook_static), $properties);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user