diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 4d3072ef021..fa1d1aedb48 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -3,6 +3,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006-2007 Rodolphe Quiedeville * Copyright (C) 2007 Auguria SARL + * Copyright (C) 2005-2007 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -149,6 +150,12 @@ else if ($_POST["action"] == 'useecotaxe') Header("Location: produit.php"); exit; } +else if ($_POST["action"] == 'setdefaultbarcodetype') +{ + dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $_POST["coder_id"]); + Header("Location: produit.php"); + exit; +} /* @@ -292,6 +299,23 @@ print ""; print ''; print ''; +// Barcode +if ($conf->barcode->enabled) +{ + $var=!$var; + print "
"; + print ""; + print ""; + print ''.$langs->trans("SetDefaultBarcodeType").''; + print ''; + print $html->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"coder_id",1); + print ''; + print ''; + print ""; + print ''; + print '
'; +} + print ''; print " ".$langs->trans("ProductSpecial")."\n"; print " ".$langs->trans("Value")."\n"; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index ad51419de39..5e0e375afca 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -3525,6 +3525,52 @@ class Form $select_encoder.= ''; return $select_encoder; } + + /** + * \brief Retourne la liste des types de codes barres + * \param selected Id code présélectionné + * \param htmlname Nom de la zone select + * \param useempty Affiche valeur vide dans liste + */ + function select_barcode_type($selected='',$htmlname='coder_id',$useempty=0) + { + $sql = "SELECT rowid, code, libelle"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode"; + $sql.= " WHERE coder > 0"; + $sql.= " ORDER BY rowid"; + $result = $this->db->query($sql); + if ($result) + { + print '"; + } + else { + dolibarr_print_error($this->db); + } + } + } ?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0362bd535b3..209fcf3f208 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -694,6 +694,7 @@ ModifyProductDescAbility=Personalization of descriptions produced in the forms ViewProductDescInFormAbility=Visualization of descriptions produced in the forms UseSearchToSelectProduct=Use a search form to choose a product (intead of using a list box) UseEcoTaxeAbility=Support Eco-Taxe (WEEE) +SetDefaultBarcodeType=Select the default barcode type to use for products ##### Syslog ##### SyslogSetup=Syslog module setup SyslogOutput=Log output diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index f02f23ec40a..6265f367ff6 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -696,6 +696,7 @@ ModifyProductDescAbility=Personnalisation des descriptions produits dans les for ViewProductDescInFormAbility=Visualisation des descriptions produits dans les formulaires UseSearchToSelectProduct=Utiliser un formulaire de recherche pour choix d'un produit (plutôt que liste déroulante) UseEcoTaxeAbility=Prise en charge des éco-taxes (DEEE) +SetDefaultBarcodeType=Sélectionner le type de code barre utilisé par défaut pour les produits ##### Syslog ##### SyslogSetup=Configuration du module Syslog SyslogOutput=Sortie des log