diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d89360631db..7d86c04869c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -78,6 +78,21 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $hookmanager->initHooks(array('memberlist')); $extrafields = new ExtraFields($db); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'd.rowid'=>'Ref', + //'d.ref'=>'Ref', + 'd.lastname'=>'Lastname', + 'd.firstname'=>'Firstname', + 'd.societe'=>"Company", + 'd.email'=>'EMail', + 'd.address'=>'Address', + 'd.zip'=>'Zip', + 'd.town'=>'Town', + 'd.note_public'=>'NotePublic', + 'd.note_private'=>'NotePrivate', +); + /* * View @@ -111,7 +126,7 @@ if ($catid == -2) $sql.= " AND cm.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($search_categ); if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL"; $sql.= " AND d.entity IN (".getEntity('adherent', 1).")"; -if ($sall) $sql.=natural_search(array("d.rowid", "d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall); +if ($sall) $sql.=natural_search(array_keys($fieldstosearchall), $sall); if ($type > 0) $sql.=" AND t.rowid=".$db->escape($type); if (isset($_GET["statut"]) || isset($_POST["statut"])) $sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules if ($search_ref) @@ -180,16 +195,16 @@ if ($resql) if ($optioncss != '') $param.='&optioncss='.$optioncss; print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); - if ($sall) - { - print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): "; - print ''.$sall.''; - } - print '