Debug hidden option MAIN_USE_EXPENSE_IK

This commit is contained in:
Laurent Destailleur 2020-09-08 12:00:14 +02:00
parent 86ed4dfa2b
commit 54c0f673c1
4 changed files with 19 additions and 14 deletions

View File

@ -7622,7 +7622,7 @@ class Form
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
if ($useempty) $out .= '<option value="0">&nbsp;</option>'; if ($useempty) $out .= '<option value="0">&nbsp;</option>';
while ($obj = $db->fetch_object($resql)) while ($obj = $db->fetch_object($resql))

View File

@ -2290,7 +2290,7 @@ if ($action == 'create')
// Select type // Select type
print '<td class="center">'; print '<td class="center">';
select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees'); print select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees');
print '</td>'; print '</td>';
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
@ -2449,7 +2449,7 @@ if ($action == 'create')
// Select type // Select type
print '<td class="center">'; print '<td class="center">';
select_type_fees_id($fk_c_type_fees, 'fk_c_type_fees', 1); print select_type_fees_id($fk_c_type_fees, 'fk_c_type_fees', 1);
print '</td>'; print '</td>';
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) if (!empty($conf->global->MAIN_USE_EXPENSE_IK))

View File

@ -2774,12 +2774,14 @@ function select_type_fees_id($selected = '', $htmlname = 'type', $showempty = 0,
global $db, $langs, $user; global $db, $langs, $user;
$langs->load("trips"); $langs->load("trips");
print '<select class="flat" name="'.$htmlname.'">'; $out = '';
$out .= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($showempty) if ($showempty)
{ {
print '<option value="-1"'; $out .= '<option value="-1"';
if ($selected == -1) print ' selected'; if ($selected == -1) $out .= ' selected';
print '>&nbsp;</option>'; $out .= '>&nbsp;</option>';
} }
$sql = "SELECT c.id, c.code, c.label as type FROM ".MAIN_DB_PREFIX."c_type_fees as c"; $sql = "SELECT c.id, c.code, c.label as type FROM ".MAIN_DB_PREFIX."c_type_fees as c";
@ -2794,13 +2796,16 @@ function select_type_fees_id($selected = '', $htmlname = 'type', $showempty = 0,
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<option value="'.$obj->id.'"'; $out .= '<option value="'.$obj->id.'"';
if ($obj->code == $selected || $obj->id == $selected) print ' selected'; if ($obj->code == $selected || $obj->id == $selected) $out .= ' selected';
print '>'; $out .= '>';
if ($obj->code != $langs->trans($obj->code)) print $langs->trans($obj->code); if ($obj->code != $langs->trans($obj->code)) $out .= $langs->trans($obj->code);
else print $langs->trans($obj->type); else $out .= $langs->trans($obj->type);
$i++; $i++;
} }
} }
print '</select>'; $out .= '</select>';
$out .= ajax_combobox($htmlname);
return $out;
} }

View File

@ -145,7 +145,7 @@ nolimitbyEX_DAY=by day (no limitation)
nolimitbyEX_MON=by month (no limitation) nolimitbyEX_MON=by month (no limitation)
nolimitbyEX_YEA=by year (no limitation) nolimitbyEX_YEA=by year (no limitation)
nolimitbyEX_EXP=by line (no limitation) nolimitbyEX_EXP=by line (no limitation)
CarCategory=Category of car CarCategory=Vehicle category
ExpenseRangeOffset=Offset amount: %s ExpenseRangeOffset=Offset amount: %s
RangeIk=Mileage range RangeIk=Mileage range
AttachTheNewLineToTheDocument=Attach the line to an uploaded document AttachTheNewLineToTheDocument=Attach the line to an uploaded document