diff --git a/ChangeLog b/ChangeLog
index a0e0011309c..9111edc92b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,20 +47,21 @@ For users:
whatever is its status.
- New: Add filter date in bank writing list page.
- New: Extrafields can be used as substitution key %EXTRA_XXX% into emails texts for members.
-- Fix: Project Task numbering customs rule works.
-- Fix: Add actions events not implemented.
-- Fix: Price min of composition is not supplier price min by quantity.
-- Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers.
- New: Add categories translation.
- New: Enable option "clone target emailing".
- New: Improved tax module: Add specific page for salaries payment
- New: Add composer.json file so Dolibarr can be publish onto packagist.org.
-
-TODO
-- New: Predefined product and free product use same form.
+- New: The combo list of juridical status is now sorted
- New: [ task #926 ] Add extrafield feature on order lines.
- New: [ task #927 ] Add extrafield feature on Proposal lines.
- New: [ task #928 ] Add extrafield feature on invoice lines.
+- Fix: Project Task numbering customs rule works.
+- Fix: Add actions events not implemented.
+- Fix: Price min of composition is not supplier price min by quantity.
+- Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers.
+
+TODO
+- New: Predefined product and free product use same form.
For translators:
- Update language files.
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index c339f306e4c..2cf381b31cb 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -392,7 +392,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '
'.$langs->trans("JuridicalStatus").'
';
if ($mysoc->country_code)
{
- $formcompany->select_forme_juridique($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE,$mysoc->country_code);
+ print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE,$mysoc->country_code);
}
else
{
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index a72eebc9fb8..623864ebd1d 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -415,6 +415,7 @@ class FormCompany
* @param mixed $country_codeid 0=liste tous pays confondus, sinon code du pays a afficher
* @param string $filter Add a SQL filter on list
* @return void
+ * @deprecated Use print xxx->select_juridicalstatus instead
*/
function select_forme_juridique($selected='', $country_codeid=0, $filter='')
{
@@ -425,8 +426,8 @@ class FormCompany
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays
*
- * @param string $selected Code forme juridique a pre-selectionne
- * @param int $country_codeid 0=liste tous pays confondus, sinon code du pays a afficher
+ * @param string $selected Preselected code of juridical type
+ * @param int $country_codeid 0=list for all countries, otherwise list only country requested
* @param string $filter Add a SQL filter on list
* @return string String with HTML select
*/
@@ -438,56 +439,62 @@ class FormCompany
$out='';
// On recherche les formes juridiques actives des pays actifs
- $sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as country, p.code as country_code";
+ $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, p.libelle as country, p.code as country_code";
$sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE f.fk_pays=p.rowid";
$sql .= " AND f.active = 1 AND p.active = 1";
if ($country_codeid) $sql .= " AND p.code = '".$country_codeid."'";
if ($filter) $sql .= " ".$filter;
- $sql .= " ORDER BY p.code, f.code";
+ $sql .= " ORDER BY p.code";
- dol_syslog("Form::select_forme_juridique sql=".$sql);
- $result=$this->db->query($sql);
- if ($result)
+ dol_syslog(get_class($this)."::select_juridicalstatus sql=".$sql);
+ $resql=$this->db->query($sql);
+ if ($resql)
{
$out.= '
';
$out.= '';
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index be6fc4d1e62..f740fa1b6ab 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4102,7 +4102,7 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
* @param array &$array Array to sort (array of array('key','otherkey1','otherkey2'...))
* @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 $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
*/
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index d085c6a8e3e..b80d6445f0a 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -969,7 +969,7 @@ else
print '