Dbut ajout de l'autocompltion ajax sur la liste droulante des pays

Ajout fonction pour afficher les images gif
This commit is contained in:
Regis Houssin 2007-02-11 20:49:44 +00:00
parent 823d72e722
commit 5d1834f282
2 changed files with 14 additions and 1 deletions

View File

@ -327,11 +327,12 @@ class Form
$pays_id = $obj->rowid?$obj->rowid:'';
print '<div>';
print '<input type="text" size="45" id="pays" name="pays" value="'.$obj->libelle.'" />';
print '<span id="indicator1" style="display: none">'.img_gif('Working...','ajaxworking').'</span>';
print '<input type="hidden" name="pays_id" id="pays_id" value="'.$pays_id.'" '.$htmloption.' />';
print '</div>';
print '<div id="hint" class="autocomplete"></div>';
print '<script type="text/javascript">';
print 'new Ajax.Autocompleter(\'pays\',\'hint\',\''.DOL_URL_ROOT.'/ajaxresponse.php\',{method: \'post\',paramName: \'pays\',afterUpdateElement: ac_return});';
print 'new Ajax.Autocompleter(\'pays\',\'hint\',\''.DOL_URL_ROOT.'/ajaxresponse.php\',{method: \'post\',paramName: \'pays\',indicator: \'indicator1\',afterUpdateElement: ac_return});';
print '</script>';
}
else

View File

@ -1088,6 +1088,18 @@ function img_allow($allow)
}
}
/**
\brief Affiche image gif (fonction générique)
\param alt Texte sur le alt de l'image
\param picto Nom de l'image a afficher
\return string Retourne tag img
*/
function img_gif($alt, $picto, $options='')
{
global $conf,$langs;
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/'.$picto.'.gif" border="0" alt="'.$alt.'" title="'.$alt.'"'.($options?' '.$options:'').'>';
}
/**
\brief Affiche info admin