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);
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>';
while ($obj = $db->fetch_object($resql))

View File

@ -2290,7 +2290,7 @@ if ($action == 'create')
// Select type
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>';
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
@ -2449,7 +2449,7 @@ if ($action == 'create')
// Select type
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>';
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;
$langs->load("trips");
print '<select class="flat" name="'.$htmlname.'">';
$out = '';
$out .= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($showempty)
{
print '<option value="-1"';
if ($selected == -1) print ' selected';
print '>&nbsp;</option>';
$out .= '<option value="-1"';
if ($selected == -1) $out .= ' selected';
$out .= '>&nbsp;</option>';
}
$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)
{
$obj = $db->fetch_object($resql);
print '<option value="'.$obj->id.'"';
if ($obj->code == $selected || $obj->id == $selected) print ' selected';
print '>';
if ($obj->code != $langs->trans($obj->code)) print $langs->trans($obj->code);
else print $langs->trans($obj->type);
$out .= '<option value="'.$obj->id.'"';
if ($obj->code == $selected || $obj->id == $selected) $out .= ' selected';
$out .= '>';
if ($obj->code != $langs->trans($obj->code)) $out .= $langs->trans($obj->code);
else $out .= $langs->trans($obj->type);
$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_YEA=by year (no limitation)
nolimitbyEX_EXP=by line (no limitation)
CarCategory=Category of car
CarCategory=Vehicle category
ExpenseRangeOffset=Offset amount: %s
RangeIk=Mileage range
AttachTheNewLineToTheDocument=Attach the line to an uploaded document