Fix: avertir qu'on doit activer des codes barres
This commit is contained in:
parent
5d35f719c4
commit
0e761f7257
@ -3547,6 +3547,8 @@ class Form
|
||||
*/
|
||||
function select_barcode_type($selected='',$htmlname='coder_id',$useempty=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT rowid, code, libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sql.= " WHERE coder > 0";
|
||||
@ -3555,13 +3557,19 @@ class Form
|
||||
if ($result)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
{
|
||||
print '<option value="0"> </option>';
|
||||
}
|
||||
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
if ($useempty && $num > 0)
|
||||
{
|
||||
print '<option value="0"> </option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="0" disabled="disabled">'.$langs->trans('NoActivatedBarcode').'</option>';
|
||||
}
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user