Merge pull request #1370 from jfefe/ajax_extralist
New : ajax list for extrafields list and sellist
This commit is contained in:
commit
08e4dc29de
@ -670,7 +670,14 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
elseif ($type == 'select')
|
elseif ($type == 'select')
|
||||||
{
|
{
|
||||||
$out='<select class="flat" name="options_'.$key.'">';
|
$out = '';
|
||||||
|
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
|
||||||
|
{
|
||||||
|
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
|
||||||
|
$out.= ajax_combobox('options_'.$key, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||||
|
}
|
||||||
|
|
||||||
|
$out.='<select class="flat" name="options_'.$key.'" id="options_'.$key.'">';
|
||||||
foreach ($param['options'] as $key=>$val )
|
foreach ($param['options'] as $key=>$val )
|
||||||
{
|
{
|
||||||
list($val, $parent) = explode('|', $val);
|
list($val, $parent) = explode('|', $val);
|
||||||
@ -683,7 +690,14 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
elseif ($type == 'sellist')
|
elseif ($type == 'sellist')
|
||||||
{
|
{
|
||||||
$out='<select class="flat" name="options_'.$key.'">';
|
$out = '';
|
||||||
|
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
|
||||||
|
{
|
||||||
|
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
|
||||||
|
$out.= ajax_combobox('options_'.$key, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||||
|
}
|
||||||
|
|
||||||
|
$out.='<select class="flat" name="options_'.$key.'" id="options_'.$key.'">';
|
||||||
if (is_array($param['options']))
|
if (is_array($param['options']))
|
||||||
{
|
{
|
||||||
$param_list=array_keys($param['options']);
|
$param_list=array_keys($param['options']);
|
||||||
@ -753,6 +767,7 @@ class ExtraFields
|
|||||||
$fields_label = explode('|',$InfoFieldList[1]);
|
$fields_label = explode('|',$InfoFieldList[1]);
|
||||||
if(is_array($fields_label))
|
if(is_array($fields_label))
|
||||||
{
|
{
|
||||||
|
$notrans = true;
|
||||||
foreach ($fields_label as $field_toshow)
|
foreach ($fields_label as $field_toshow)
|
||||||
{
|
{
|
||||||
$labeltoshow.= $obj->$field_toshow.' ';
|
$labeltoshow.= $obj->$field_toshow.' ';
|
||||||
@ -778,12 +793,15 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$translabel=$langs->trans($obj->$InfoFieldList[1]);
|
if(!$notrans)
|
||||||
if ($translabel!=$obj->$InfoFieldList[1]) {
|
{
|
||||||
$labeltoshow=dol_trunc($translabel,18);
|
$translabel=$langs->trans($obj->$InfoFieldList[1]);
|
||||||
}
|
if ($translabel!=$obj->$InfoFieldList[1]) {
|
||||||
else {
|
$labeltoshow=dol_trunc($translabel,18);
|
||||||
$labeltoshow=dol_trunc($obj->$InfoFieldList[1],18);
|
}
|
||||||
|
else {
|
||||||
|
$labeltoshow=dol_trunc($obj->$InfoFieldList[1],18);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (empty($labeltoshow)) $labeltoshow='(not defined)';
|
if (empty($labeltoshow)) $labeltoshow='(not defined)';
|
||||||
if ($value==$obj->rowid)
|
if ($value==$obj->rowid)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user