diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 3a0c790bc6c..e95503dc9f6 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -328,10 +328,6 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/.svn $BUILDROOT/$PROJECT/*/.svn $BUILDROOT/$PROJECT/*/*/.svn $BUILDROOT/$PROJECT/*/*/*/.svn $BUILDROOT/$PROJECT/*/*/*/*/.svn`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/AerialMono*.ttf`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/Tymes*.ttf`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/Veranda*.ttf`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/genbarcode`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/fckeditor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; @@ -438,7 +434,8 @@ if ($nboftargetok) { next; } - if ($target =~ /RPM/) { # Linux only + if ($target =~ /RPM/) # Linux only + { $NEWDESTI=$DESTI; $subdir="package_rpm_generic"; if ($target =~ /FEDO/i) { $subdir="package_rpm_redhat-fedora"; } @@ -477,65 +474,6 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $ret=`$cmd`; - -# print "Fix filefunc.inc.php, install/inc.php, support/inc.php\n"; -# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/filefunc.inc.php\" | -# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/filefunc.inc.php\""; -# $ret=`$cmd`; -# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/install/inc.php\" | -# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/install/inc.php\""; -# $ret=`$cmd`; -# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/support/inc.php\" | -# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/support/inc.php\""; -# $ret=`$cmd`; - - #print "Remove other files\n"; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/ChangeLog`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/COPYING`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/INSTALL`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/README`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/README-FR`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/README`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/README-FR`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/aps`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/deb`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/dmg`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/pad/README`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/tgz/README`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/deb/README`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/doap`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/exe`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/live`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/patch`; - #$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/rpm/conf.php`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/zip`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/perl`; - # We remove embedded libraries or fonts - #if ($target !~ /GENE/i) - #{ - # $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/artichow/font`, - # $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/barcode/php-barcode/fonts`, - #} - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip`; - #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip/gnu-lgpl.txt`; - - # Conf files - #print "Copy config files into $BUILDROOT/$FILENAMETGZ2/etc/$PROJECT\n"; - #$ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT"`; - #$ret=`cp "$SOURCE/build/rpm/httpd-dolibarr.conf" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/apache.conf"`; - #$ret=`cp "$SOURCE/build/rpm/file_contexts.dolibarr" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/file_contexts.dolibarr"`; - #$ret=`cp "$SOURCE/build/rpm/conf.php" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/conf.php"`; - #$installfile="install.forced.php.generic"; - #if ($target =~ /FEDO/i) { $installfile="install.forced.php.fedora"; } - #if ($target =~ /MAND/i) { $installfile="install.forced.php.mandriva"; } - #if ($target =~ /OPEN/i) { $installfile="install.forced.php.opensuse"; } - #$ret=`cp "$SOURCE/build/rpm/$installfile" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/install.forced.php"`; # Set owners print "Set owners on files/dir\n"; @@ -545,18 +483,6 @@ if ($nboftargetok) { $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; $cmd="find $BUILDROOT/$FILENAMETGZ2 -type f -exec chmod 644 {} \\; "; $ret=`$cmd`; - #$cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build -name '*.php' -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - #$cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build -name '*.pl' -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - #$cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev -name '*.php' -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - #$ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/translation/langAutoParser.class.php`; - #$ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/skeletons/skeleton_page.php`; - #$ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/skeletons/modMyModule.class.php`; - #$ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/dev/skeletons/skeleton_class.class.php`; - #$cmd="find $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; # Build tgz print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n"; @@ -727,7 +653,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/zip`; # We remove embedded libraries or fonts $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/artichow/font`, - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/barcode/php-barcode/fonts`, + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/fonts`, $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/geoip`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/nusoap`; diff --git a/htdocs/includes/barcode/php-barcode/php-barcode.php b/htdocs/core/lib/phpbarcode.php similarity index 89% rename from htdocs/includes/barcode/php-barcode/php-barcode.php rename to htdocs/core/lib/phpbarcode.php index 56c53467c16..3f4a99dca1c 100644 --- a/htdocs/includes/barcode/php-barcode/php-barcode.php +++ b/htdocs/core/lib/phpbarcode.php @@ -176,6 +176,11 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, { global $bar_color, $bg_color, $text_color; global $font_loc; + + //var_dump($text); + //var_dump($bars); + //var_dump($font_loc); + /* set defaults */ if ($scale<1) $scale=2; $total_y=(int)($total_y); @@ -204,25 +209,9 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, /* allocate the image */ $total_x=( $xpos )+$space['right']+$space['right']; $xpos=$space['left']; - if (!function_exists("imagecreate")){ + if (!function_exists("imagecreate")) + { print "You don't have the gd2 extension enabled
\n"; - print "
\n"; - print "
\n"; - print "Short HOWTO
\n"; - print "
\n"; - print "Debian: # apt-get install php4-gd2
\n"; - print "
\n"; - print "SuSE: ask YaST
\n"; - print "
\n"; - print "OpenBSD: # pkg_add /path/php4-gd-4.X.X.tgz (read output, you have to enable it)
\n"; - print "
\n"; - print "Windows: Download the PHP zip package from php.net, NOT the windows-installer, unzip the php_gd2.dll to C:\PHP (this is the default install dir) and uncomment 'extension=php_gd2.dll' in C:\WINNT\php.ini (or where ever your os is installed)
\n"; - print "
\n"; - print "
\n"; - print "The author of php-barcode will give not support on this topic!
\n"; - print "
\n"; - print "
\n"; - print "Folke Ashberg's OpenSource PHP-Barcode
\n"; return ""; } $im=imagecreate($total_x, $total_y); @@ -233,7 +222,6 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, $height=round($total_y-($scale*10)); $height2=round($total_y-$space['bottom']); - /* paint the bars */ $width=true; for ($i=0;$i&1"; //print "'$cmd'
\n"; + $fp=popen($cmd, "r"); - if ($fp){ + if ($fp) + { $bars=fgets($fp, 1024); $text=fgets($fp, 1024); $encoding=fgets($fp, 1024); pclose($fp); - } else return false; + } + else + { + dol_syslog("phpbarcode::barcode_encode_genbarcode failed to run popen ".$cmd, LOG_ERR); + return false; + } + //var_dump($bars); $ret=array( "encoding" => trim($encoding), "bars" => trim($bars), "text" => trim($text) ); + //var_dump($ret); if (!$ret['encoding']) return false; if (!$ret['bars']) return false; if (!$ret['text']) return false; @@ -358,6 +355,7 @@ function barcode_encode_genbarcode($code,$encoding) function barcode_encode($code,$encoding) { global $genbarcode_loc; + if ( ((preg_match("/^ean$/i", $encoding) && ( strlen($code)==12 || strlen($code)==13))) @@ -369,24 +367,29 @@ function barcode_encode($code,$encoding) || (( !isset($encoding) || !$encoding || (preg_match("/^ANY$/i", $encoding) )) && (preg_match("/^[0-9]{12,13}$/", $code))) - - ){ + ) + { /* use built-in EAN-Encoder */ + dol_syslog("phpbarcode.php::barcode_encode Use barcode_encode_ean"); $bars=barcode_encode_ean($code, $encoding); - } else if (file_exists($genbarcode_loc)){ + } + else if (file_exists($genbarcode_loc)) + { /* use genbarcode */ + dol_syslog("phpbarcode.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding); $bars=barcode_encode_genbarcode($code, $encoding); - } else { - print "php-barcode needs an external programm for encodings other then EAN/ISBN
\n"; + } + else + { + print "barcode_encode needs an external programm for encodings other then EAN/ISBN
\n"; print "\n"; print "
\n"; - print "Folke Ashberg's OpenSource PHP-Barcode
\n"; return false; } return $bars; @@ -402,17 +405,17 @@ function barcode_encode($code,$encoding) * array[bars] : the bars * array[text] : text-positioning info */ -function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png" ) +function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png") { // DOLCHANGE LDR Add log - dol_syslog("php-barcode.php:barcode_print $code $encoding $scale $mode"); + dol_syslog("phpbarcode.php::barcode_print $code $encoding $scale $mode"); $bars=barcode_encode($code,$encoding); if (!$bars) { // DOLCHANGE LDR Return error message instead of array $error='Bad Value '.$code.' for encoding '.$encoding; - dol_syslog('php-barcode.php:barcode_print '.$error, LOG_ERR); + dol_syslog('phpbarcode.php::barcode_print '.$error, LOG_ERR); return $error; } if (!$mode) $mode="png"; diff --git a/htdocs/core/modules/barcode/phpbarcode.modules.php b/htdocs/core/modules/barcode/phpbarcode.modules.php index 72f532d5f83..768f34948a2 100644 --- a/htdocs/core/modules/barcode/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/phpbarcode.modules.php @@ -120,7 +120,7 @@ class modPhpbarcode extends ModeleBarCode $_GET["scale"]=$scale; $_GET["mode"]=$mode; - require_once(DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/php-barcode.php'); + require_once(DOL_DOCUMENT_ROOT.'/core/lib/phpbarcode.php'); dol_syslog("modPhpbarcode::buildBarCode $code,$encoding,$scale,$mode"); if ($code) $result=barcode_print($code,$encoding,$scale,$mode); diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index 7d50a096163..baaea13e6c3 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -68,7 +68,7 @@ class modBarcode extends DolibarrModules // 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/php-barcode/genbarcode/genbarcode','Path to genbarcode command line tool',0) + //0=>array('GENBARCODE_LOCATION','chaine',DOL_DOCUMENT_ROOT.'/includes/barcode/genbarcode/genbarcode','Path to genbarcode command line tool',0) ); // Boxes diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index fc5eb564f50..c726feaa878 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -193,8 +193,8 @@ if (! defined('ARTICHOW_PATH')) { define('ARTICHOW_PATH', (!isset( // Other required path if (! defined('ARTICHOW_FONT')) { define('ARTICHOW_FONT', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?DOL_DOCUMENT_ROOT.'/includes/artichow/font':dirname($dolibarr_font_DOL_DEFAULT_TTF_BOLD)); } if (! defined('ARTICHOW_FONT_NAMES')) { define('ARTICHOW_FONT_NAMES', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?'Tuffy,TuffyBold,TuffyBoldItalic,TuffyItalic':'DejaVuSans,DejaVuSans-Bold,DejaVuSans-BoldOblique,DejaVuSans-Oblique'); } -if (! defined('DOL_DEFAULT_TTF')) { define('DOL_DEFAULT_TTF', (!isset($dolibarr_font_DOL_DEFAULT_TTF))?DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/fonts/Aerial.ttf':(empty($dolibarr_font_DOL_DEFAULT_TTF)?'':$dolibarr_font_DOL_DEFAULT_TTF)); } -if (! defined('DOL_DEFAULT_TTF_BOLD')) { define('DOL_DEFAULT_TTF_BOLD', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/fonts/AerialBd.ttf':(empty($dolibarr_font_DOL_DEFAULT_TTF_BOLD)?'':$dolibarr_font_DOL_DEFAULT_TTF_BOLD)); } +if (! defined('DOL_DEFAULT_TTF')) { define('DOL_DEFAULT_TTF', (!isset($dolibarr_font_DOL_DEFAULT_TTF))?DOL_DOCUMENT_ROOT.'/includes/fonts/Aerial.ttf':(empty($dolibarr_font_DOL_DEFAULT_TTF)?'':$dolibarr_font_DOL_DEFAULT_TTF)); } +if (! defined('DOL_DEFAULT_TTF_BOLD')) { define('DOL_DEFAULT_TTF_BOLD', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?DOL_DOCUMENT_ROOT.'/includes/fonts/AerialBd.ttf':(empty($dolibarr_font_DOL_DEFAULT_TTF_BOLD)?'':$dolibarr_font_DOL_DEFAULT_TTF_BOLD)); } // Old path to root deprecated (no more used). //if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); } diff --git a/htdocs/includes/barcode/php-barcode/README b/htdocs/includes/barcode/php-barcode/README deleted file mode 100644 index a9ea5187c62..00000000000 --- a/htdocs/includes/barcode/php-barcode/README +++ /dev/null @@ -1,162 +0,0 @@ -PHP-Barcode 0.3pl1 - -PHP-Barcode generates - - Barcode-Images using libgd (png, jpg,gif), - - HTML-Images (using 1x1 pixel and html-table) - - silly Text-Barcodes - -PHP-Barcode encodes using - - a built-in EAN-13/ISBN Encoder - - genbarcode (by Folke Ashberg), a command line - barcode-encoder which uses GNU-Barcode - genbarcode can encode EAN-13, EAN-8, UPC, ISBN, 39, 128(a,b,c), - I25, 128RAW, CBR, MSI, PLS - genbarcode is available at www.ashberg.de/bar - -(C) 2001,2002,2003,2004 by Folke Ashberg - -The newest version can be found at http://www.ashberg.de/bar - - -INSTALLATION: - - WHAT YOU NEED TO BE ABLE TO USE PHP-BARCODE - You need php>4 on your system. - You need the gd2-extension to be able to render images. - You need a TrueTypeFont if you want to see the CODE below the bars. - You need genbarcode (from www.ashberg.de/bar) in you want to use - another encoding than EAN-12/EAN-12/ISBN - - Copy the following files into your html/php-directory - - php-barcode.php - main library - - encode_bars.php - built-in encoders - optional: - - barcode.php - Sample-File - - white.png - for HTML-Images - - black.png - for HTML-Images - - FONT-Installation - UNIX: - A TrueTypeFont isn't included in this distribution! - Copy one into the html/php-directory and change in php-barcode.php - $font_loc (change the arialbd.tff to your font name). - arialbd.ttf from Windows looks great. - - WINDOWS: - If you use Windows the font should be located automatically. - - OPTIONAL - genbarcode: - If you want to generate not only EAN-12/EAN-13/ISBN-Codes you have to install - genbarcode, a small unix-commandline tool which uses GNU-Barcode. - genbarcode is available http://www.ashberg.de/bar , read genbarcodes - README for installation. - If you have installed genbarcode not to /usr/bin set the $genbarcode_loc - in php-barcode.php . - - TESTING - If everything works fine you should see an image if you call - http://localhost/path/barcode.php - - Or call http://localhost/path/barcode.php?code=&encoding=&mode=&size=<1,2,3,...> - - - -If you need more then the sample barcode.php can do, you need to build your own. - -FUNCTIONS - API-Reference - --------------------------------------------------------------------------- -function barcode_encode(code, encoding) - encodes $code with $encoding using genbarcode OR built-in encoder - if you don't have genbarcode only EAN-13/ISBN is possible - -You can use the following encodings (when you have genbarcode): - ANY choose best-fit (default) - EAN 8 or 13 EAN-Code - UPC 12-digit EAN - ISBN isbn numbers (still EAN-13) - 39 code 39 - 128 code 128 (a,b,c: autoselection) - 128C code 128 (compact form for digits) - 128B code 128, full printable ascii - I25 interleaved 2 of 5 (only digits) - 128RAW Raw code 128 (by Leonid A. Broukhis) - CBR Codabar (by Leonid A. Broukhis) - MSI MSI (by Leonid A. Broukhis) - PLS Plessey (by Leonid A. Broukhis) - - return: - array[encoding] : the encoding which has been used - array[bars] : the bars - array[text] : text-positioning info - --------------------------------------------------------------------------- -function barcode_outimage(text, bars [, scale [, mode [, total_y [, space ]]]] ) - - Outputs an image using libgd - - text : the text-line (:: ...) - bars : where to place the bars (...) - scale : scale factor ( 1 < scale < unlimited (scale 50 will produce - 5400x300 pixels when - using EAN-13!!!)) - mode : png,gif,jpg, depending on libgd ! (default='png') - total_y: the total height of the image ( default: scale * 60 ) - space : space - default: - $space[top] = 2 * $scale; - $space[bottom]= 2 * $scale; - $space[left] = 2 * $scale; - $space[right] = 2 * $scale; - --------------------------------------------------------------------------- -function barcode_outhtml(text, bars [, scale [, total_y [, space ]]] ) - - returns(!) HTML-Code for barcode-image using html-code (using a table and with black.png and white.png) - - text : the text-line (:: ...) - bars : where to place the bars (...) - scale : scale factor ( 1 < scale < unlimited (scale 50 will produce - 5400x300 pixels when - using EAN-13!!!)) - total_y: the total height of the image ( default: scale * 60 ) - space : space - default: - $space[top] = 2 * $scale; - $space[bottom]= 2 * $scale; - $space[left] = 2 * $scale; - $space[right] = 2 * $scale; - --------------------------------------------------------------------------- -function barcode_outtext(code, bars) - - Returns (!) a barcode as plain-text - ATTENTION: this is very silly! - - text : the text-line (:: ...) - bars : where to place the bars (...) - --------------------------------------------------------------------------- -For more function see php-barcode.php -Also see barcode.php or just use them :) - - - - - - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - diff --git a/htdocs/includes/barcode/php-barcode/fonts/AerialMono.ttf b/htdocs/includes/barcode/php-barcode/fonts/AerialMono.ttf deleted file mode 100644 index 910202c2f71..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/AerialMono.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/AerialMonoBd.ttf b/htdocs/includes/barcode/php-barcode/fonts/AerialMonoBd.ttf deleted file mode 100644 index 49247d84ecf..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/AerialMonoBd.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/AerialMonoBdIt.ttf b/htdocs/includes/barcode/php-barcode/fonts/AerialMonoBdIt.ttf deleted file mode 100644 index f1182773d1f..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/AerialMonoBdIt.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/AerialMonoIt.ttf b/htdocs/includes/barcode/php-barcode/fonts/AerialMonoIt.ttf deleted file mode 100644 index 159563c9d69..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/AerialMonoIt.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/Tymes.ttf b/htdocs/includes/barcode/php-barcode/fonts/Tymes.ttf deleted file mode 100644 index 1603d7ad9ea..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/Tymes.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/TymesBd.ttf b/htdocs/includes/barcode/php-barcode/fonts/TymesBd.ttf deleted file mode 100644 index 5c284b9ed96..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/TymesBd.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/Veranda.ttf b/htdocs/includes/barcode/php-barcode/fonts/Veranda.ttf deleted file mode 100644 index 9e6e0a9795c..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/Veranda.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/VerandaBd.ttf b/htdocs/includes/barcode/php-barcode/fonts/VerandaBd.ttf deleted file mode 100644 index d795e42f23a..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/VerandaBd.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/VerandaBdIt.ttf b/htdocs/includes/barcode/php-barcode/fonts/VerandaBdIt.ttf deleted file mode 100644 index cd098234a94..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/VerandaBdIt.ttf and /dev/null differ diff --git a/htdocs/includes/barcode/php-barcode/fonts/VerandaIt.ttf b/htdocs/includes/barcode/php-barcode/fonts/VerandaIt.ttf deleted file mode 100644 index 3c13e21f9d1..00000000000 Binary files a/htdocs/includes/barcode/php-barcode/fonts/VerandaIt.ttf and /dev/null differ diff --git a/htdocs/includes/dolibarr_changes.txt b/htdocs/includes/dolibarr_changes.txt index ae46dc295e9..21bca6def82 100644 --- a/htdocs/includes/dolibarr_changes.txt +++ b/htdocs/includes/dolibarr_changes.txt @@ -41,22 +41,3 @@ with //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth); window.location.href=pRef * Replace hard coded string with i18n["String"]; - - - -PHP-BARCODE: ------------- -If files are replaced by new version, following changes must be done: - -* Restore changes done into php-barcode.php marked with DOL_CHANGE LDR - -* Add lines into barcode_outimage function: - // DOLCHANGE LDR - global $filebarcode; - - - // Begin DOLCHANGE LDR - } else if (! empty($filebarcode)) - { - imagepng($im,$filebarcode); - // End DOLCHANGE LDR diff --git a/htdocs/includes/barcode/php-barcode/fonts/Aerial.ttf b/htdocs/includes/fonts/Aerial.ttf similarity index 100% rename from htdocs/includes/barcode/php-barcode/fonts/Aerial.ttf rename to htdocs/includes/fonts/Aerial.ttf diff --git a/htdocs/includes/barcode/php-barcode/fonts/AerialBd.ttf b/htdocs/includes/fonts/AerialBd.ttf similarity index 100% rename from htdocs/includes/barcode/php-barcode/fonts/AerialBd.ttf rename to htdocs/includes/fonts/AerialBd.ttf diff --git a/htdocs/includes/barcode/php-barcode/fonts/AerialBdIt.ttf b/htdocs/includes/fonts/AerialBdIt.ttf similarity index 100% rename from htdocs/includes/barcode/php-barcode/fonts/AerialBdIt.ttf rename to htdocs/includes/fonts/AerialBdIt.ttf diff --git a/htdocs/includes/barcode/php-barcode/fonts/AerialIt.ttf b/htdocs/includes/fonts/AerialIt.ttf similarity index 100% rename from htdocs/includes/barcode/php-barcode/fonts/AerialIt.ttf rename to htdocs/includes/fonts/AerialIt.ttf diff --git a/htdocs/includes/barcode/php-barcode/fonts/CHANGELOG.TXT b/htdocs/includes/fonts/CHANGELOG.TXT similarity index 100% rename from htdocs/includes/barcode/php-barcode/fonts/CHANGELOG.TXT rename to htdocs/includes/fonts/CHANGELOG.TXT diff --git a/htdocs/includes/barcode/php-barcode/fonts/COPYRIGHT.TXT b/htdocs/includes/fonts/COPYRIGHT.TXT similarity index 100% rename from htdocs/includes/barcode/php-barcode/fonts/COPYRIGHT.TXT rename to htdocs/includes/fonts/COPYRIGHT.TXT diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index d925df6505a..5bb702d8c40 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -103,7 +103,7 @@ PriceRemoved=Prix supprimé BarCode=Code-barres BarcodeType=Type de code-barres BarcodeValue=Valeur du code-barres -GenbarcodeLocation=Outil de génération de code-barres en ligne de commande (utilisé par le moteur phpbarcode pour certains types de codes-barres) +GenbarcodeLocation=Outil de génération de code-barres en ligne de commande (utilisé par le moteur interne pour certains types de codes-barres) SetDefaultBarcodeType=Définissez le type de code-barres NoteNotVisibleOnBill=Note (non visible sur les factures, propals...) CreateCopy=Créer copie diff --git a/test/phpunit/phpunittest.xml b/test/phpunit/phpunittest.xml index 9709e6dd19b..e2ecddfa384 100644 --- a/test/phpunit/phpunittest.xml +++ b/test/phpunit/phpunittest.xml @@ -16,7 +16,6 @@ ../../htdocs/societe/canvas/ ../../htdocs/includes/adodbtime/ ../../htdocs/includes/artichow/ - ../../htdocs/includes/barcode/php-barcode/ ../../htdocs/includes/ckeditor/ ../../htdocs/includes/fpdfi/ ../../htdocs/includes/geoip/ @@ -52,7 +51,6 @@ ../../htdocs/societe/canvas/ ../../htdocs/includes/adodbtime/ ../../htdocs/includes/artichow/ - ../../htdocs/includes/barcode/php-barcode/ ../../htdocs/includes/ckeditor/ ../../htdocs/includes/fpdfi/ ../../htdocs/includes/geoip/