Fix : reception list sql error
This commit is contained in:
parent
e5b71a1a89
commit
d451703bbf
@ -85,7 +85,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$search_array_options = (array) $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
$fieldstosearchall = array(
|
$fieldstosearchall = array(
|
||||||
@ -537,21 +537,7 @@ if ($sall) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
foreach ($search_array_options as $key => $val) {
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
$crit = $val;
|
|
||||||
$tmpkey = preg_replace('/search_options_/', '', $key);
|
|
||||||
$typ = $extrafields->attributes[$object->table_element]['type'][$tmpkey];
|
|
||||||
$mode = 0;
|
|
||||||
if (in_array($typ, array('int', 'double', 'real'))) {
|
|
||||||
$mode = 1; // Search on a numeric
|
|
||||||
}
|
|
||||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') {
|
|
||||||
$mode = 2; // Search on a foreign key int
|
|
||||||
}
|
|
||||||
if ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0')) {
|
|
||||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user