Fix sort of dictionnary
This commit is contained in:
parent
ca324346e4
commit
58c4144123
@ -502,6 +502,14 @@ $tabfieldcheck[34] = array();
|
|||||||
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
||||||
|
|
||||||
|
|
||||||
|
// Defaut sortorder
|
||||||
|
if (empty($sortfield))
|
||||||
|
{
|
||||||
|
$tmp1 = explode(',',$tabsqlsort[$id]);
|
||||||
|
$tmp2 = explode(' ',$tmp1[0]);
|
||||||
|
$sortfield=preg_replace('/^.*\./', '', $tmp2[0]);
|
||||||
|
}
|
||||||
|
|
||||||
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
||||||
$elementList = array();
|
$elementList = array();
|
||||||
$sourceList=array();
|
$sourceList=array();
|
||||||
@ -944,7 +952,8 @@ if ($id)
|
|||||||
|
|
||||||
if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1";
|
if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1";
|
||||||
if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id;
|
if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id;
|
||||||
if ($search_code != '') $sql.= natural_search("code", $search_code);
|
if ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code);
|
||||||
|
if ($search_code != '' && $id == 9) $sql.= natural_search("code_iso", $search_code);
|
||||||
|
|
||||||
if ($sortfield)
|
if ($sortfield)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user