Ajout du choix du type de code barre par dfaut pour les produits
This commit is contained in:
parent
abb3e8778f
commit
66059f70ec
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2006-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007 Auguria SARL <info@auguria.org>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
|
||||
*
|
||||
* 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 "</td>";
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
// Barcode
|
||||
if ($conf->barcode->enabled)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<form method=\"post\" action=\"produit.php\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"setdefaultbarcodetype\">";
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="80%">'.$langs->trans("SetDefaultBarcodeType").'</td>';
|
||||
print '<td width="60" align="right">';
|
||||
print $html->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"coder_id",1);
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print " <td>".$langs->trans("ProductSpecial")."</td>\n";
|
||||
print " <td align=\"right\" width=\"60\">".$langs->trans("Value")."</td>\n";
|
||||
|
||||
@ -3525,6 +3525,52 @@ class Form
|
||||
$select_encoder.= '</select></form>';
|
||||
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 '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
{
|
||||
print '<option value="0"> </option>';
|
||||
}
|
||||
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($selected == $obj->rowid)
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'">';
|
||||
}
|
||||
print $obj->libelle;
|
||||
print '</option>';
|
||||
$i++;
|
||||
}
|
||||
print "</select>";
|
||||
}
|
||||
else {
|
||||
dolibarr_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user