diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index af7542516ac..857812b890f 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -876,7 +876,8 @@ if ($type == Categorie::TYPE_CONTACT) { print ''; print ''; print ''; print '
'; print $langs->trans("AssignCategoryTo").'  '; - print $form->selectcontacts('', '', 'elemid'); + //print $form->selectcontacts('', '', 'elemid'); + print $form->select_contact(0, '', 'elemid', '', '', '', 0, 'maxwidth300 widthcentpercentminusx'); print '
'; diff --git a/htdocs/contact/ajax/contact.php b/htdocs/contact/ajax/contact.php index 82d593785c6..52d7eea5d9f 100644 --- a/htdocs/contact/ajax/contact.php +++ b/htdocs/contact/ajax/contact.php @@ -45,7 +45,6 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $htmlname = GETPOST('htmlname', 'aZ09'); -$search_project_contact = GETPOST('search_project_contact', 'alpha'); $outjson = (GETPOSTINT('outjson') ? GETPOSTINT('outjson') : 0); $action = GETPOST('action', 'aZ09'); @@ -98,9 +97,9 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { return; } - // Filter on the company to search can be: + // The filter on the company to search for can be: // Into an array with key $htmlname123 (we take first one found). Which page use this ? - // Into a var with name $htmlname can be 'prodid', 'productid', ... + // Into a var with name $htmlname can be 'elemid', ... $match = preg_grep('/('.preg_quote($htmlname, '/').'[0-9]+)/', array_keys($_GET)); sort($match); @@ -129,7 +128,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { $prefix = getDolGlobalString('CONTACT_DONOTSEARCH_ANYWHERE') ? '' : '%'; // Can use index if CONTACT_DONOTSEARCH_ANYWHERE is on - $filter = "(lastname:like:'".$prefix.$search_project_contact."%') OR (firstname:like:'".$prefix.$search_project_contact."'%)"; + $filter = "(lastname:like:'".$prefix.$searchkey."%') OR (firstname:like:'".$prefix.$searchkey."'%)"; // FIXME // If CONTACT_USE_SEARCH_TO_SELECT is set, check that nb of chars in $filter is >= to avoid DOS attack diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index bba09012b17..7ab64fcb43d 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -97,7 +97,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { return; } - // Filter on the company to search can be: + // The filter on the company to search for can be: // Into an array with key $htmlname123 (we take first one found). Which page use this ? // Into a var with name $htmlname can be 'prodid', 'productid', ... $match = preg_grep('/('.preg_quote($htmlname, '/').'[0-9]+)/', array_keys($_GET)); @@ -105,7 +105,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { $id = (!empty($match[0]) ? $match[0] : ''); // Take first key found into GET array with matching $htmlname123 - // When used from jQuery, the search term is added as GET param "term". + // When used from jQuery, the search term is added as GET param $htmlname. $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); if (!$searchkey) { return;