From f9908c48cbc2c9db8081b204286ce9ca5f77202e Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 3 May 2015 10:07:04 +0200 Subject: [PATCH] Add datamatrix en qrcode barcodes --- .../modules/barcode/doc/tcpdfbarcode.modules.php | 2 +- htdocs/core/modules/modBarcode.class.php | 12 ++++++++---- htdocs/langs/en_US/admin.lang | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index d608543d5f5..56acdc704cb 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -194,7 +194,7 @@ class modTcpdfbarcode extends ModeleBarCode * @param string $dolEncodingType dolibarr barcode encoding type * @return string tcpdf encoding type */ - private function getTcpdfEncodingType($dolEncodingType) + public function getTcpdfEncodingType($dolEncodingType) { $tcpdf1dEncodingTypes = array( 'C39' => 'C39', diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index c9ba87250bb..780a3539bf5 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -65,9 +65,11 @@ class modBarcode extends DolibarrModules // Constants // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); - $this->const = array( - //0=>array('GENBARCODE_LOCATION','chaine',DOL_DOCUMENT_ROOT.'/includes/barcode/genbarcode/genbarcode','Path to genbarcode command line tool',0) - ); + $this->const = array(); + //$this->const[0] = array('BARCODE_LABEL_LEFT_TEXT','chaine','%BARCODE%','Print barcode on left side of label',1); + //$this->const[1] = array('BARCODE_LABEL_RIGHT_TEXT','chaine','%LOGO%','Print Company logo on right side',1); + //$this->const[2] = array('BARCODE_LABEL_HEADER_TEXT','chaine','My header','Print header text on label',1); + //$this->const[3] = array('BARCODE_LABEL_FOOTER_TEXT','chaine','My footer','Print footer text on label',1); // Boxes $this->boxes = array(); @@ -137,7 +139,9 @@ class modBarcode extends DolibarrModules array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)",'ignoreerror'=>1), array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)",'ignoreerror'=>1), array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)",'ignoreerror'=>1), - array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)",'ignoreerror'=>1) + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)",'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('DATAMATRIX', 'Datamatrix', 0, '1234567xyz', __ENTITY__)",'ignoreerror'=>1), + array('sql'=>"INSERT INTO ".MAIN_DB_PREFIX."c_barcode_type (code, libelle, coder, example, entity) VALUES ('QRCODE', 'Qr Code', 0, 'www.dolibarr.org', __ENTITY__)",'ignoreerror'=>1) ); return $this->_init($sql, $options); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f6041a2abf0..09aafd228f7 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1422,6 +1422,8 @@ BarcodeDescUPC=Barcode of type UPC BarcodeDescISBN=Barcode of type ISBN BarcodeDescC39=Barcode of type C39 BarcodeDescC128=Barcode of type C128 +BarcodeDescDATAMATRIX=Barcode of type Datamatrix +BarcodeDescQRCODE=Barcode of type QR code GenbarcodeLocation=Bar code generation command line tool (used by internal engine for some bar code types). Must be compatible with "genbarcode".
For example: /usr/local/bin/genbarcode BarcodeInternalEngine=Internal engine BarCodeNumberManager=Manager to auto define barcode numbers