From eb2c27452589c06da04fa967de004dac4cddfc80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Ferry?= Date: Sat, 15 Mar 2014 23:58:16 +0100 Subject: [PATCH] Add method to load type code from dictionary --- .../class/html.formresource.class.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 739e4a82311..eaf38da9559 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -135,6 +135,63 @@ class FormResource if ($outputmode) return $outarray; return $out; } + + /** + * Return html list of tickets type + * + * @param string $selected Id du type pre-selectionne + * @param string $htmlname Nom de la zone select + * @param string $filtertype To filter on field type in llx_c_ticketsup_type (array('code'=>xx,'label'=>zz)) + * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code + * @param int $empty 1=peut etre vide, 0 sinon + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @return void + */ + function select_types_resource($selected='',$htmlname='type_resource',$filtertype='',$format=0, $empty=0, $noadmininfo=0,$maxlength=0) + { + global $langs,$user; + + $resourcestat = new Resource($this->db); + + dol_syslog(get_class($this)."::select_types_resource ".$selected.", ".$htmlname.", ".$filtertype.", ".$format,LOG_DEBUG); + + $filterarray=array(); + + if ($filtertype != '' && $filtertype != '-1') $filterarray=explode(',',$filtertype); + + $resourcestat->load_cache_code_type_resource(); + + print ''; + if ($user->admin && ! $noadmininfo) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); + } + }