diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index a8db6ddd81b..062b8992e93 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -3898,19 +3898,18 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) } /** - * Advanced sort array by second index function, which produces - * ascending (default) or descending output and uses optionally - * natural case insensitive sorting (which can be optionally case - * sensitive as well). + * Advanced sort array by second index function, which produces ascending (default) + * or descending output and uses optionally natural case insensitive sorting (which + * can be optionally case sensitive as well). * - * @param array Array to sort - * @param index - * @param order - * @param natsort - * @param case_sensitive Sort is case sensitive - * @return Sorted array + * @param array $array Array to sort + * @param string $index Key in array to use for sorting criteria + * @param int $order Sort order + * @param int $natsort 1=use "natural" sort (natsort), 0=use "standard sort (asort) + * @param int $case_sensitive 1=sort is case sensitive, 0=not case sensitive + * @return array Sorted array */ -function dol_sort_array(&$array, $index, $order='asc', $natsort, $case_sensitive) +function dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0) { // Clean parameters $order=strtolower($order); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1ccdaf0a0fb..c71a286631c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -477,7 +477,7 @@ class Societe extends CommonObject $sql.= ",ville = ".($this->town?"'".$this->db->escape($this->town)."'":"null"); $sql .= ",fk_departement = '" . ($this->state_id?$this->state_id:'0') ."'"; - $sql .= ",fk_pays = '" . ($this->country_id?$this->country_id:'0') ."'"; + $sql .= ",fk_pays = '" . ($this->pays_id?$this->pays_id:'0') ."'"; $sql .= ",tel = ".($this->tel?"'".$this->db->escape($this->tel)."'":"null"); $sql .= ",fax = ".($this->fax?"'".$this->db->escape($this->fax)."'":"null");