dolibarr  7.0.0-beta
Public Member Functions | List of all members
mod_barcode_product_standard Class Reference

Class to manage barcode with standard rule. More...

+ Inheritance diagram for mod_barcode_product_standard:
+ Collaboration diagram for mod_barcode_product_standard:

Public Member Functions

 __construct ()
 Constructor.
 
 info ($langs)
 Return description of module. More...
 
 getExample ($langs, $objproduct=0)
 Return an example of result returned by getNextValue. More...
 
 getNextValue ($objproduct=null, $type='')
 Return next value. More...
 
 verif ($db, &$code, $product, $thirdparty_type, $type)
 Check validity of code according to its rules. More...
 
 verif_dispo ($db, $code, $product)
 Return if a code is used (by other element) More...
 
 verif_syntax ($codefortest, $typefortest)
 Return if a barcode value match syntax. More...
 
- Public Member Functions inherited from ModeleNumRefBarCode
 info ($langs)
 Return default description of numbering model. More...
 
 getNom ($langs)
 Return model name. More...
 
 getExample ($langs)
 Return a numbering example. More...
 
 getNextValue ($objproduct, $type='')
 Return next value available. More...
 
 getVersion ()
 Return version of module. More...
 
 getToolTip ($langs, $soc, $type)
 Return description of module parameters. More...
 

Detailed Description

Class to manage barcode with standard rule.

Definition at line 34 of file mod_barcode_product_standard.php.

Member Function Documentation

mod_barcode_product_standard::getExample (   $langs,
  $objproduct = 0 
)

Return an example of result returned by getNextValue.

Parameters
Translate$langsObject langs
Product$objproductObject product
Returns
string Return string example

Definition at line 110 of file mod_barcode_product_standard.php.

References getNextValue().

mod_barcode_product_standard::getNextValue (   $objproduct = null,
  $type = '' 
)

Return next value.

Parameters
Product$objproductObject product
string$typeType of barcode (EAN, ISBN, ...)
Returns
string Value if OK, '' if module not configured, <0 if KO

Definition at line 133 of file mod_barcode_product_standard.php.

References dol_now(), and get_next_value().

Referenced by getExample().

mod_barcode_product_standard::info (   $langs)

Return description of module.

Parameters
Translate$langsObject langs
Returns
string Description of module

Definition at line 68 of file mod_barcode_product_standard.php.

References $form.

mod_barcode_product_standard::verif (   $db,
$code,
  $product,
  $thirdparty_type,
  $type 
)

Check validity of code according to its rules.

Parameters
DoliDB$dbDatabase handler
string$codeCode to check/correct
Product$productObject product
int$thirdparty_type0 = customer/prospect , 1 = supplier
string$typetype of barcode (EAN, ISBN, ...)
Returns
int 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired

Definition at line 175 of file mod_barcode_product_standard.php.

References dol_strlen(), dol_syslog(), verif_dispo(), and verif_syntax().

mod_barcode_product_standard::verif_dispo (   $db,
  $code,
  $product 
)

Return if a code is used (by other element)

Parameters
DoliDB$dbHandler acces base
string$codeCode to check
Product$productObjet product
Returns
int 0 if available, <0 if KO

Definition at line 234 of file mod_barcode_product_standard.php.

References $resql.

Referenced by verif().

mod_barcode_product_standard::verif_syntax (   $codefortest,
  $typefortest 
)

Return if a barcode value match syntax.

Parameters
string$codefortestCode to check syntax
string$typefortestType of barcode (ISBN, EAN, ...)
Returns
int 0 if OK, <0 if KO

Definition at line 266 of file mod_barcode_product_standard.php.

References check_value(), and dol_syslog().

Referenced by verif().


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