2
0
forked from Wavyzz/dolibarr

Debug v21

This commit is contained in:
ldestailleur
2025-02-22 13:57:07 +01:00
parent 93ec574121
commit e8df374b6b
4 changed files with 10 additions and 10 deletions

View File

@@ -11418,7 +11418,7 @@ class Form
$search_component_params_hidden = '(' . $search_component_params_hidden . ')'; $search_component_params_hidden = '(' . $search_component_params_hidden . ')';
} }
$ret = ''; $ret = '<!-- searchComponent -->';
$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; $ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
@@ -11573,7 +11573,7 @@ class Form
$ret .= '<p class="assistance-errors error" style="display:none">' . $langs->trans('AllFieldsRequired') . ' </p>'; $ret .= '<p class="assistance-errors error" style="display:none">' . $langs->trans('AllFieldsRequired') . ' </p>';
$ret .= '<div class="operand">'; $ret .= '<div class="operand">';
$ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width250', 1); $ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width200 combolargeelem', 1);
$ret .= '</div>'; $ret .= '</div>';
$ret .= '<span class="separator"></span>'; $ret .= '<span class="separator"></span>';

View File

@@ -38,6 +38,8 @@
* @var HookManager $hookmanager * @var HookManager $hookmanager
* @var Translate $langs * @var Translate $langs
* @var User $user * @var User $user
*
* @var array $toselect
*/ */
// Initialise values // Initialise values
@@ -88,13 +90,12 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) {
$object = null; $object = null;
} else { } else {
// When included // When included into a main page
' '
@phan-var-force int<0,1> $SHOWLEGEND @phan-var-force int<0,1> $SHOWLEGEND
@phan-var-force string customreportkey @phan-var-force string customreportkey
'; ';
$langs->load("main");
// $search_measures, $search_xaxis or $search_yaxis may have been defined by the parent. // $search_measures, $search_xaxis or $search_yaxis may have been defined by the parent.
if (empty($user) || empty($user->id)) { if (empty($user) || empty($user->id)) {

View File

@@ -1122,9 +1122,11 @@ function getParameterByName(name, valueifnotfound)
} }
/** /**
* Get the list of operators for a given field type * Get the list of possible operators for a given field type that we can use in the generic filter.
*/ */
function getOperatorsForFieldType(type, maybenull = 0) { function getOperatorsForFieldType(type, maybenull = 0) {
console.log('Get list of operators for type='+type);
// Define the list of operators for each general field category // Define the list of operators for each general field category
const operatorList = { const operatorList = {
selectlink: { selectlink: {
@@ -1160,15 +1162,12 @@ function getOperatorsForFieldType(type, maybenull = 0) {
} }
}; };
// Determine the general category for the given type using regex // Determine the general category for the given type using regex
let generalType = ""; let generalType = "";
console.log('Get list of operators for type='+type);
if (/^select$/i.test(type) || /^link$/i.test(type)) { if (/^select$/i.test(type) || /^link$/i.test(type)) {
generalType = "selectlink"; generalType = "selectlink";
} else if (/^(varchar|char|text|blob|nchar|mediumtext|longtext)\(\d+\)$/i.test(type) || /^varchar$/i.test(type)) { } else if (/^(varchar|char|text|blob|nchar|mediumtext|longtext)\(\d+\)$/i.test(type) || /^(varchar|mail|phone|ip)$/i.test(type)) {
generalType = "text"; generalType = "text";
} else if (/^(int|integer|float|double|decimal|numeric)(\(\d+,\d+\))?$/i.test(type)) { } else if (/^(int|integer|float|double|decimal|numeric)(\(\d+,\d+\))?$/i.test(type)) {
generalType = "number"; generalType = "number";

View File

@@ -550,7 +550,7 @@ function fillArrayOfFilterFields($object, $tablealias, $labelofobject, &$arrayof
// Exclude some fields // Exclude some fields
if (in_array($key, array( if (in_array($key, array(
'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams', 'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { 'parent', 'pass', 'pass_crypted', 'pass_temp', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) {
continue; continue;
} }
if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) {