diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 7855fc0f32f..fcb42a2689e 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2007 Regis Houssin * @@ -19,7 +19,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -450,10 +449,7 @@ if ($_GET["action"] == 'create') } else { - $arraylist=$caction->liste_array(1,'code'); - $arraylist[0]=' '; - asort($arraylist); - $html->select_array("actioncode", $arraylist, 0); + $html->select_type_actions(0, "actioncode"); } print ''; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 2a67cd8d09f..041ea729332 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -647,7 +647,28 @@ class Form } - /** + /** + * \brief Retourne la liste des types de comptes financiers + * \param selected Type pré-sélectionné + * \param htmlname Nom champ formulaire + */ + function select_type_actions($selected='',$htmlname='actioncode') + { + global $langs,$user; + + require_once(DOL_DOCUMENT_ROOT."/cactioncomm.class.php"); + $caction=new CActionComm($this->db); + + $arraylist=$caction->liste_array(1,'code'); + $arraylist[0]=' '; + asort($arraylist); + + $this->select_array($htmlname, $arraylist, 0); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); + } + + + /** * \brief Retourne la liste déroulante des sociétés * \param selected Societe pré-sélectionnée * \param htmlname Nom champ formulaire diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 4c3c0c6c5e0..ebe97b5623f 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -1319,16 +1319,26 @@ function image_format_supported($file) /** \brief Affiche info admin - \param text Texte info + \param text Text info + \param infoonimgalt Info is shown on alt of star picto + \return string String with info text */ -function info_admin($texte) +function info_admin($texte,$infoonimgalt=0) { global $conf,$langs; - $s='
'; - $s.=img_picto($langs->trans("InfoAdmin"),'star'); - $s.=' '; - $s.=$texte; - $s.='
'; + $s=''; + if ($infoonimgalt) + { + $s.=img_picto($texte,'star'); + } + else + { + $s.='
'; + $s.=img_picto($langs->trans("InfoAdmin"),'star'); + $s.=' '; + $s.=$texte; + $s.='
'; + } return $s; }