2
0
forked from Wavyzz/dolibarr

NEW translation with action triggers API (#30595)

* NEW translation with action triggers API

* Update api_setup.class.php
This commit is contained in:
ptibogxiv
2024-08-13 12:16:10 +02:00
committed by GitHub
parent ac929bc24f
commit 700ee5b39e

View File

@@ -62,6 +62,7 @@ class Setup extends DolibarrApi
* @param int $limit Number of items per page
* @param int $page Page number {@min 0}
* @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...)
* @param string $lang Code of the language the label of the type must be translated to
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'SO-%')"
* @return array List of extra fields
*
@@ -70,7 +71,7 @@ class Setup extends DolibarrApi
* @throws RestException 400 Bad value for sqlfilters
* @throws RestException 503 Error when retrieving list of action triggers
*/
public function getListOfActionTriggers($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $elementtype = '', $sqlfilters = '')
public function getListOfActionTriggers($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $elementtype = '', $lang = '', $sqlfilters = '')
{
$list = array();
@@ -111,7 +112,9 @@ class Setup extends DolibarrApi
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
$type = $this->db->fetch_object($result);
$this->translateLabel($type, $lang, 'Notify_', array('other'));
$list[] = $type;
}
} else {
throw new RestException(503, 'Error when retrieving list of action triggers : '.$this->db->lasterror());