Update api_setup.class.php

This commit is contained in:
ptibogxiv 2022-02-13 13:22:01 +01:00 committed by GitHub
parent f2b88c6d7c
commit 061dd565cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1307,7 +1307,7 @@ class Setup extends DolibarrApi
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @param int $limit Number of items per page * @param int $limit Number of items per page
* @param int $page Page number (starting from zero) * @param int $page Page number (starting from zero)
* @param string $country To filter on country * @param int $country To filter on country
* @param int $active Lega form is active or not {@min 0} {@max 1} * @param int $active Lega form is active or not {@min 0} {@max 1}
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
* @return array List of legal form * @return array List of legal form
@ -1316,7 +1316,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
public function getListOfLegalForm($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $country = '', $active = 1, $sqlfilters = '') public function getListOfLegalForm($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $country = 0, $active = 1, $sqlfilters = '')
{ {
$list = array(); $list = array();
@ -1324,7 +1324,7 @@ class Setup extends DolibarrApi
$sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as t"; $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as t";
$sql .= " WHERE t.active = ".((int) $active); $sql .= " WHERE t.active = ".((int) $active);
if ($country) { if ($country) {
$sql .= " AND t.fk_pays = '".$this->db->escape($country)."'"; $sql .= " AND t.fk_pays = ".((int) $country);
} }
// Add sql filters // Add sql filters
if ($sqlfilters) { if ($sqlfilters) {