Skip to content

Commit

Permalink
Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 2, 2024
2 parents 7b16039 + 6337a98 commit 9ec4575
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/tpl/extrafields_list_search_input.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) {
$morecss = 'maxwidth200';
}
echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
echo $extrafields->showInputField($key, (!isset($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
}
print '</td>';
}
Expand Down
20 changes: 18 additions & 2 deletions htdocs/core/tpl/extrafields_list_search_param.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,24 @@
$param .= '&'.$search_options_pattern.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M');
$val = '';
}
if ($val != '') {
$param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val);
if ($val !== '') {
if (is_array($val)) {
foreach ($val as $val2) {
$param .= '&'.$search_options_pattern.$tmpkey.'[]='.urlencode($val2);
}
} else {
// test if we have checkbox type, we add the _multiselect needed into param
$tmpkey = preg_replace('/'.$search_options_pattern.'/', '', $key);
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('checkbox', 'chkbxlst'))) {
$param .= '&'.$search_options_pattern.$tmpkey.'_multiselect='.urlencode($val);
}
// test if we have boolean type, we add the _booleand needed into param
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('boolean'))) {
$param .= '&'.$search_options_pattern.$tmpkey.'_boolean='.urlencode($val);
}

$param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val);
}
}
}
}

0 comments on commit 9ec4575

Please sign in to comment.