Debug v20

This commit is contained in:
Laurent Destailleur 2024-05-08 12:40:15 +02:00
parent 61a523bf3d
commit 46a3941e84
3 changed files with 7 additions and 7 deletions

View file

@ -876,7 +876,8 @@ if ($type == Categorie::TYPE_CONTACT) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>';
print $langs->trans("AssignCategoryTo").' &nbsp;';
print $form->selectcontacts('', '', 'elemid');
//print $form->selectcontacts('', '', 'elemid');
print $form->select_contact(0, '', 'elemid', '', '', '', 0, 'maxwidth300 widthcentpercentminusx');
print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
print '</tr>';
print '</table>';

View file

@ -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

View file

@ -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;