dolibarr 20.0.0
modPhpbarcode Class Reference

Class to generate barcode images using php barcode generator. More...

Inheritance diagram for modPhpbarcode:
Collaboration diagram for modPhpbarcode:

Public Member Functions

 isEnabled ()
 Return if a module can be used or not.
 
 info ($langs)
 Return description.
 
 canBeActivated ($object)
 Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.
 
 encodingIsSupported ($encoding)
 Return true if encoding is supported.
 
 buildBarCode ($code, $encoding, $readable='Y', $scale=1, $nooutputiferror=0)
 Return an image file on the fly (no need to write on disk) with the HTTP content-type of image.
 
 writeBarCode ($code, $encoding, $readable='Y', $scale=1, $nooutputiferror=0)
 Save an image file on disk (with no output)
 

Detailed Description

Class to generate barcode images using php barcode generator.

Definition at line 33 of file phpbarcode.modules.php.

Member Function Documentation

◆ buildBarCode()

modPhpbarcode::buildBarCode ( $code,
$encoding,
$readable = 'Y',
$scale = 1,
$nooutputiferror = 0 )

Return an image file on the fly (no need to write on disk) with the HTTP content-type of image.

Parameters
string$codeValue to encode
string$encodingMode of encoding
string$readableCode can be read (What is this ? is this used ?)
integer$scaleScale
integer$nooutputiferrorNo output if error
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 136 of file phpbarcode.modules.php.

References barcode_print(), dol_escape_htmltag(), dol_syslog(), and encodingIsSupported().

Referenced by writeBarCode().

◆ canBeActivated()

modPhpbarcode::canBeActivated ( $object)

Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.

Parameters
Object$objectObject we need next value for
Returns
boolean false if KO (there is a conflict), true if OK

Definition at line 81 of file phpbarcode.modules.php.

◆ encodingIsSupported()

modPhpbarcode::encodingIsSupported ( $encoding)

Return true if encoding is supported.

Parameters
string$encodingEncoding norm
Returns
int >0 if supported, 0 if not

Definition at line 95 of file phpbarcode.modules.php.

Referenced by buildBarCode().

◆ info()

modPhpbarcode::info ( $langs)

Return description.

Parameters
Translate$langsLang object to use for output
Returns
string Descriptive text

Definition at line 64 of file phpbarcode.modules.php.

◆ isEnabled()

modPhpbarcode::isEnabled ( )

Return if a module can be used or not.

Returns
boolean true if module can be used

Reimplemented from ModeleBarCode.

Definition at line 52 of file phpbarcode.modules.php.

◆ writeBarCode()

modPhpbarcode::writeBarCode ( $code,
$encoding,
$readable = 'Y',
$scale = 1,
$nooutputiferror = 0 )

Save an image file on disk (with no output)

Parameters
string$codeValue to encode
string$encodingMode of encoding
string$readableCode can be read
integer$scaleScale
integer$nooutputiferrorNo output if error
Returns
int Return integer <0 if KO, >0 if OK

Reimplemented from ModeleBarCode.

Definition at line 187 of file phpbarcode.modules.php.

References buildBarCode(), dol_hash(), dol_mkdir(), dol_strlen(), and dol_syslog().


The documentation for this class was generated from the following file: