From e46e66b1ed37ed227f261511e24ad003d768edb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Jan 2018 14:34:48 +0100 Subject: [PATCH] NEW Introduce option THIRDPARTY_QUICKSEARCH_ON_FIELDS to personalize search fields for quick search --- htdocs/societe/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 6de4ae1296c..3966dfeb2fc 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -142,6 +142,9 @@ if (($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != if (($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof5']='ProfId5'; if (($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof6']='ProfId6'; if (!empty($conf->barcode->enabled)) $fieldstosearchall['s.barcode']='Gencod'; +// Personalized search criterias. Example: $conf->global->THIRDPARTY_QUICKSEARCH_ON_FIELDS = 's.nom=ThirdPartyName;s.name_alias=AliasNameShort;s.code_client=CustomerCode' +if (! empty($conf->global->THIRDPARTY_QUICKSEARCH_ON_FIELDS)) $fieldstosearchall=dolExplodeIntoArray($conf->global->THIRDPARTY_QUICKSEARCH_ON_FIELDS); + // Define list of fields to show into list $checkedcustomercode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0); @@ -513,7 +516,7 @@ $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($search_all != '') $param = "&sall=".urlencode($search_all); -if ($sall != '') $param .= "&sall=".urlencode($sall); +if ($sall != '') $param.= "&sall=".urlencode($sall); if ($search_categ_cus > 0) $param.='&search_categ_cus='.urlencode($search_categ_cus); if ($search_categ_sup > 0) $param.='&search_categ_sup='.urlencode($search_categ_sup); if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);