This commit is contained in:
Laurent Destailleur 2022-07-18 14:51:03 +02:00
parent 95ee25660e
commit 9b9d65562f
2 changed files with 5 additions and 4 deletions

View File

@ -1513,9 +1513,10 @@ class FormOther
* @param array $search_xaxis Array of preselected fields
* @param array $arrayofxaxis Array of groupby to fill
* @param string $showempty '1' or 'text'
* @param string $morecss More css
* @return string HTML string component
*/
public function selectXAxisField($object, $search_xaxis, &$arrayofxaxis, $showempty = '1')
public function selectXAxisField($object, $search_xaxis, &$arrayofxaxis, $showempty = '1', $morecss = 'minwidth250 maxwidth500')
{
global $form;
@ -1523,7 +1524,7 @@ class FormOther
foreach ($arrayofxaxis as $key => $val) {
$arrayofxaxislabel[$key] = $val['label'];
}
$result = $form->selectarray('search_xaxis', $arrayofxaxislabel, $search_xaxis, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth250 maxwidth500', 1);
$result = $form->selectarray('search_xaxis', $arrayofxaxislabel, $search_xaxis, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1);
return $result;
}

View File

@ -450,7 +450,7 @@ $simplearrayofmesures = array();
foreach ($arrayofmesures as $key => $val) {
$simplearrayofmesures[$key] = $arrayofmesures[$key]['label'];
}
print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth400', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields
print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields
print '</div>';
// XAxis
@ -458,7 +458,7 @@ $count = 0;
print '<div class="divadvancedsearchfield">';
print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span><span class="fas fa-caret-down caretdownaxis" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span></div>';
//var_dump($arrayofxaxis);
print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis")); // Fill the array $arrayofxaxis with possible fields
print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400'); // Fill the array $arrayofxaxis with possible fields
print '</div>';
// Group by