Use autocompletion on list of taxes

This commit is contained in:
Laurent Destailleur 2017-11-23 15:46:52 +01:00
parent 39d00b2ea9
commit 5cf21fef05
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
*
@ -187,7 +187,7 @@ if ($resql)
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.$search_label.'"></td>';
// Type
print '<td class="liste_titre" align="left">';
$formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,16,0);
$formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone');
print '</td>';
// Period end date
print '<td class="liste_titre">&nbsp;</td>';

View File

@ -50,11 +50,12 @@ class FormSocialContrib
* @param int $useempty Set to 1 if we want an empty value
* @param int $maxlen Max length of text in combo box
* @param int $help Add or not the admin help picto
* @param string $morecss Add more CSS on select
* @return void
*/
function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1)
function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300')
{
global $db,$langs,$user,$mysoc;
global $conf,$db,$langs,$user,$mysoc;
if (empty($mysoc->country_id) && empty($mysoc->country_code))
{
@ -86,7 +87,7 @@ class FormSocialContrib
$num = $db->num_rows($resql);
if ($num)
{
print '<select class="flat" name="'.$htmlname.'">';
print '<select class="'.($morecss?$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
$i = 0;
if ($useempty) print '<option value="0">&nbsp;</option>';
@ -100,6 +101,7 @@ class FormSocialContrib
}
print '</select>';
if ($user->admin && $help) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
if (! empty($conf->use_javascript_ajax)) print ajax_combobox($htmlname);
}
else
{