diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index fbe0a471e3d..d5899575eb4 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -73,6 +73,9 @@ $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; +$search_country_id = GETPOST('search_country_id','int'); + + // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('admin')); @@ -577,6 +580,16 @@ if ($id == 10) } + +/* + * Actions + */ + +if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) +{ + $search_country_id = ''; +} + // Actions add or modify an entry into a dictionary if (GETPOST('actionadd') || GETPOST('actionmodify')) { @@ -921,6 +934,13 @@ if ($id) // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; + if ($search_country_id > 0) + { + if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; + else $sql.=" WHERE "; + $sql.= " c.rowid = ".$search_country_id; + } + if ($sortfield) { // If sort order is "country", we use country_code instead @@ -946,6 +966,7 @@ if ($id) print '