Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
cb6835eb
Commit
cb6835eb
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix order of countries
parent
4f013c97
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/admin/company.php
+1
-1
1 addition, 1 deletion
htdocs/admin/company.php
htdocs/core/class/html.form.class.php
+16
-13
16 additions, 13 deletions
htdocs/core/class/html.form.class.php
htdocs/langs/fr_FR/dict.lang
+1
-1
1 addition, 1 deletion
htdocs/langs/fr_FR/dict.lang
with
18 additions
and
15 deletions
htdocs/admin/company.php
+
1
−
1
View file @
cb6835eb
...
@@ -302,7 +302,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
...
@@ -302,7 +302,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
print
'<tr '
.
$bc
[
$var
]
.
'><td class="fieldrequired">'
.
$langs
->
trans
(
"Country"
)
.
'</td><td>'
;
print
'<tr '
.
$bc
[
$var
]
.
'><td class="fieldrequired">'
.
$langs
->
trans
(
"Country"
)
.
'</td><td>'
;
$pays_selected
=
$pays_id
;
$pays_selected
=
$pays_id
;
//if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
//if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
$form
->
select_
pays
(
$pays_selected
,
'pays_id'
);
print
$form
->
select_
country
(
$pays_selected
,
'pays_id'
);
if
(
$user
->
admin
)
print
info_admin
(
$langs
->
trans
(
"YouCanChangeValuesForThisListFromDictionnarySetup"
),
1
);
if
(
$user
->
admin
)
print
info_admin
(
$langs
->
trans
(
"YouCanChangeValuesForThisListFromDictionnarySetup"
),
1
);
print
'</td></tr>'
.
"
\n
"
;
print
'</td></tr>'
.
"
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/class/html.form.class.php
+
16
−
13
View file @
cb6835eb
...
@@ -248,6 +248,7 @@ class Form
...
@@ -248,6 +248,7 @@ class Form
* @param selected Id or Code or Label of preselected country
* @param selected Id or Code or Label of preselected country
* @param htmlname Name of html select object
* @param htmlname Name of html select object
* @param htmloption Options html on select object
* @param htmloption Options html on select object
* @return string HTML string with select
*/
*/
function
select_country
(
$selected
=
''
,
$htmlname
=
'pays_id'
,
$htmloption
=
''
)
function
select_country
(
$selected
=
''
,
$htmlname
=
'pays_id'
,
$htmloption
=
''
)
{
{
...
@@ -257,7 +258,7 @@ class Form
...
@@ -257,7 +258,7 @@ class Form
$out
=
''
;
$out
=
''
;
$countryArray
=
array
();
$countryArray
=
array
();
$code_iso
=
array
();
//
$code_iso=array();
$label
=
array
();
$label
=
array
();
$sql
=
"SELECT rowid, code as code_iso, libelle as label"
;
$sql
=
"SELECT rowid, code as code_iso, libelle as label"
;
...
@@ -265,7 +266,7 @@ class Form
...
@@ -265,7 +266,7 @@ class Form
$sql
.
=
" WHERE active = 1"
;
$sql
.
=
" WHERE active = 1"
;
$sql
.
=
" ORDER BY code ASC"
;
$sql
.
=
" ORDER BY code ASC"
;
dol_syslog
(
"Form::select_
pays
sql="
.
$sql
);
dol_syslog
(
"Form::select_
country
sql="
.
$sql
);
$resql
=
$this
->
db
->
query
(
$sql
);
$resql
=
$this
->
db
->
query
(
$sql
);
if
(
$resql
)
if
(
$resql
)
{
{
...
@@ -276,27 +277,29 @@ class Form
...
@@ -276,27 +277,29 @@ class Form
{
{
$foundselected
=
false
;
$foundselected
=
false
;
while
(
$i
<
$num
)
{
while
(
$i
<
$num
)
{
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
$obj
=
$this
->
db
->
fetch_object
(
$resql
);
$countryArray
[
$i
][
'rowid'
]
=
$obj
->
rowid
;
$countryArray
[
$i
][
'rowid'
]
=
$obj
->
rowid
;
$countryArray
[
$i
][
'code_iso'
]
=
$obj
->
code_iso
;
$countryArray
[
$i
][
'code_iso'
]
=
$obj
->
code_iso
;
$countryArray
[
$i
][
'label'
]
=
(
$obj
->
code_iso
&&
$langs
->
trans
(
"Country"
.
$obj
->
code_iso
)
!=
"Country"
.
$obj
->
code_iso
?
$langs
->
trans
(
"Country"
.
$obj
->
code_iso
)
:
(
$obj
->
label
!=
'-'
?
$obj
->
label
:
'
'
));
$countryArray
[
$i
][
'label'
]
=
(
$obj
->
code_iso
&&
$langs
->
trans
(
"Country"
.
$obj
->
code_iso
)
!=
"Country"
.
$obj
->
code_iso
?
$langs
->
trans
(
"Country"
.
$obj
->
code_iso
)
:
(
$obj
->
label
!=
'-'
?
$obj
->
label
:
''
));
$code_iso
[
$i
]
=
$countryArray
[
$i
][
'code_iso'
];
//
$code_iso[$i] = $countryArray[$i]['code_iso'];
$label
[
$i
]
=
$countryArray
[
$i
][
'label'
];
$label
[
$i
]
=
$countryArray
[
$i
][
'label'
];
$i
++
;
$i
++
;
}
}
array_multisort
(
$label
,
SORT_ASC
,
$countryArray
);
array_multisort
(
$label
,
SORT_ASC
,
$countryArray
);
foreach
(
$countryArray
as
$row
)
{
foreach
(
$countryArray
as
$row
)
{
if
(
$selected
&&
$selected
!=
'-1'
&&
(
$selected
==
$row
[
'rowid'
]
||
$selected
==
$row
[
'code_iso'
]
||
$selected
==
$row
[
'label'
])
)
{
if
(
$selected
&&
$selected
!=
'-1'
&&
(
$selected
==
$row
[
'rowid'
]
||
$selected
==
$row
[
'code_iso'
]
||
$selected
==
$row
[
'label'
])
)
{
$foundselected
=
true
;
$foundselected
=
true
;
$out
.
=
'<option value="'
.
$row
[
'rowid'
]
.
'" selected="selected">'
;
$out
.
=
'<option value="'
.
$row
[
'rowid'
]
.
'" selected="selected">'
;
}
else
{
}
else
{
$out
.
=
'<option value="'
.
$row
[
'rowid'
]
.
'">'
;
$out
.
=
'<option value="'
.
$row
[
'rowid'
]
.
'">'
;
}
}
if
(
$row
[
'code_iso'
])
$out
.
=
$row
[
'code_iso'
]
.
' - '
;
$out
.
=
$row
[
'label'
];
$out
.
=
$row
[
'label'
];
if
(
$row
[
'code_iso'
])
$out
.
=
' ('
.
$row
[
'code_iso'
]
.
')'
;
$out
.
=
'</option>'
;
$out
.
=
'</option>'
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/langs/fr_FR/dict.lang
+
1
−
1
View file @
cb6835eb
...
@@ -141,7 +141,7 @@ CountryLI=Liechtenstein
...
@@ -141,7 +141,7 @@ CountryLI=Liechtenstein
CountryLT=Lituanie
CountryLT=Lituanie
CountryLU=Luxembourg
CountryLU=Luxembourg
CountryMO=Macao
CountryMO=Macao
CountryMK=
e
x-République yougoslave
de Macédoine
CountryMK=
Macédoine (E
x-République yougoslave
)
CountryMG=Madagascar
CountryMG=Madagascar
CountryMW=Malawi
CountryMW=Malawi
CountryMY=Malaisie
CountryMY=Malaisie
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment