NEw translation for shipping method API
cf https://github.com/Dolibarr/dolibarr/pull/22699
This commit is contained in:
parent
41175b73ee
commit
ebcaa34134
@ -1188,6 +1188,7 @@ class Setup extends DolibarrApi
|
|||||||
* @param int $limit Number of items per page
|
* @param int $limit Number of items per page
|
||||||
* @param int $page Page number {@min 0}
|
* @param int $page Page number {@min 0}
|
||||||
* @param int $active Shipping methodsm is active or not {@min 0} {@max 1}
|
* @param int $active Shipping methodsm is active or not {@min 0} {@max 1}
|
||||||
|
* @param string $lang Code of the language the label of the method must be translated to
|
||||||
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
||||||
*
|
*
|
||||||
* @url GET dictionary/shipping_methods
|
* @url GET dictionary/shipping_methods
|
||||||
@ -1196,7 +1197,7 @@ class Setup extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException 400
|
* @throws RestException 400
|
||||||
*/
|
*/
|
||||||
public function getShippingModes($limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
public function getShippingModes($limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||||
{
|
{
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
@ -1232,7 +1233,9 @@ class Setup extends DolibarrApi
|
|||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||||
for ($i = 0; $i < $min; $i++) {
|
for ($i = 0; $i < $min; $i++) {
|
||||||
$list[] = $this->db->fetch_object($result);
|
$method = $this->db->fetch_object($result);
|
||||||
|
$this->translateLabel($method, $lang, '', array('dict'));
|
||||||
|
$list[] = $method;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new RestException(400, $this->db->lasterror());
|
throw new RestException(400, $this->db->lasterror());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user