class FormBarCode (View source)

Class to manage barcode HTML

Properties

DoliDB $db
string $error

Methods

__construct($db)

Constructor

setBarcodeEncoder($selected, array<string, string> $barcodelist, $code_id, $idForm = 'formbarcode')

Return HTML select with list of bar code generators

select_barcode_type($selected = 0, string $htmlname = 'barcodetype_id', $useempty = 0)

Print form to select type of barcode

selectBarcodeType($selected = 0, string $htmlname = 'barcodetype_id', $useempty = 0)

Return html form to select type of barcode

form_barcode_type($page, int $selected = 0, $htmlname = 'barcodetype_id')

Show form to select type of barcode

formBarcodeType($page, int $selected = 0, $htmlname = 'barcodetype_id')

Return html form to select type of barcode

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

setBarcodeEncoder($selected, array<string, string> $barcodelist, $code_id, $idForm = 'formbarcode')

Return HTML select with list of bar code generators

@param int $selected Id code pre-selected

Parameters

$selected
array<string, string> $barcodelist

Array of barcodes generators @param int $code_id Id du code barre @param string $idForm Id of html form, ex id="idform" @return string HTML select string

$code_id
$idForm

select_barcode_type($selected = 0, string $htmlname = 'barcodetype_id', $useempty = 0)

Print form to select type of barcode

@param int $selected Id code pre-selected

Parameters

$selected
string $htmlname

Name of HTML select field @param int $useempty Affiche valeur vide dans liste @return void @deprecated

$useempty

selectBarcodeType($selected = 0, string $htmlname = 'barcodetype_id', $useempty = 0)

Return html form to select type of barcode

@param int $selected Id code pre-selected

Parameters

$selected
string $htmlname

Name of HTML select field @param int $useempty Display empty value in select @return string

$useempty

form_barcode_type($page, int $selected = 0, $htmlname = 'barcodetype_id')

Show form to select type of barcode

@param string $page Page

Parameters

$page
int $selected

Id condition preselected @param string $htmlname Nom du formulaire select @return void @deprecated

$htmlname

formBarcodeType($page, int $selected = 0, $htmlname = 'barcodetype_id')

Return html form to select type of barcode

@param string $page Page

Parameters

$page
int $selected

Id condition preselected @param string $htmlname Nom du formulaire select @return string

$htmlname