From c6a96fec73609e70fcf9d509e0d1cbf44c1080df Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sun, 8 Jan 2012 01:59:33 +0100
Subject: [PATCH] Qual: Uniformize lib filename

---
 .../lib/{phpbarcode.php => barcode.lib.php}   | 24 +++++++++++--------
 .../modules/barcode/phpbarcode.modules.php    |  7 +++---
 2 files changed, 17 insertions(+), 14 deletions(-)
 rename htdocs/core/lib/{phpbarcode.php => barcode.lib.php} (93%)

diff --git a/htdocs/core/lib/phpbarcode.php b/htdocs/core/lib/barcode.lib.php
similarity index 93%
rename from htdocs/core/lib/phpbarcode.php
rename to htdocs/core/lib/barcode.lib.php
index 5fbf7286927..5c345887824 100644
--- a/htdocs/core/lib/phpbarcode.php
+++ b/htdocs/core/lib/barcode.lib.php
@@ -1,8 +1,8 @@
 <?php
-/* Copyright (C) 2004-2011          Laurent Destailleur <eldy@users.sourceforge.net>
- * Copyright (C) 2004-2010			Folke Ashberg: Some lines of code were inspired from work
- *                                  of Folke Ashberg into PHP-Barcode 0.3pl2, available as GPL
- *                                  source code at http://www.ashberg.de/bar.
+/* Copyright (C) 2004-2012 Laurent Destailleur     <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2010 Folke Ashberg: Some lines of code were inspired from work
+ *                         of Folke Ashberg into PHP-Barcode 0.3pl2, available as GPL
+ *                         source code at http://www.ashberg.de/bar.
  *
  * 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
@@ -18,6 +18,11 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+/**
+ *	\file       htdocs/core/barcode.lib.php
+ *	\brief      Set of functions used for barcode generation
+ *	\ingroup    core
+ */
 
 /* ******************************************************************** */
 /*                          COLORS                                      */
@@ -65,7 +70,7 @@ else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
 function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
 {
     // DOLCHANGE LDR Add log
-    dol_syslog("phpbarcode.php::barcode_print $code $encoding $scale $mode");
+    dol_syslog("barcode.lib.php::barcode_print $code $encoding $scale $mode");
 
     $bars=barcode_encode($code,$encoding);
 
@@ -73,7 +78,7 @@ function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
     {
         // DOLCHANGE LDR Return error message instead of array
         $error='Bad Value '.$code.' for encoding '.$encoding;
-        dol_syslog('phpbarcode.php::barcode_print '.$error, LOG_ERR);
+        dol_syslog('barcode.lib.php::barcode_print '.$error, LOG_ERR);
         return $error;
     }
     if (! $mode) $mode="png";
@@ -127,13 +132,13 @@ function barcode_encode($code,$encoding)
     )
     {
         /* use built-in EAN-Encoder */
-        dol_syslog("phpbarcode.php::barcode_encode Use barcode_encode_ean");
+        dol_syslog("barcode.lib.php::barcode_encode Use barcode_encode_ean");
         $bars=barcode_encode_ean($code, $encoding);
     }
     else if (file_exists($genbarcode_loc))
     {
         /* use genbarcode */
-        dol_syslog("phpbarcode.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding);
+        dol_syslog("barcode.lib.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding);
         $bars=barcode_encode_genbarcode($code, $encoding);
     }
     else
@@ -284,7 +289,7 @@ function barcode_encode_genbarcode($code,$encoding)
     }
     else
     {
-        dol_syslog("phpbarcode::barcode_encode_genbarcode failed to run popen ".$fullcommandclear, LOG_ERR);
+        dol_syslog("barcode.lib.php::barcode_encode_genbarcode failed to run popen ".$fullcommandclear, LOG_ERR);
         return false;
     }
     //var_dump($bars);
@@ -427,5 +432,4 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
     }
 }
 
-
 ?>
diff --git a/htdocs/core/modules/barcode/phpbarcode.modules.php b/htdocs/core/modules/barcode/phpbarcode.modules.php
index ce9034c9ec5..3e34e40f4a0 100644
--- a/htdocs/core/modules/barcode/phpbarcode.modules.php
+++ b/htdocs/core/modules/barcode/phpbarcode.modules.php
@@ -19,12 +19,12 @@
 
 /**
  *	\file       htdocs/core/modules/barcode/phpbarcode.modules.php
- *	\ingroup    facture
+ *	\ingroup    barcode
  *	\brief      Fichier contenant la classe du modele de generation code barre phpbarcode
  */
 
 require_once(DOL_DOCUMENT_ROOT."/core/modules/barcode/modules_barcode.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/phpbarcode.php");    // This is to include def like $genbarcode_loc and $font_loc
+require_once(DOL_DOCUMENT_ROOT."/core/lib/barcode.lib.php");    // This is to include def like $genbarcode_loc and $font_loc
 
 
 /**		\class      modPhpbarcode
@@ -123,8 +123,7 @@ class modPhpbarcode extends ModeleBarCode
 		$_GET["scale"]=$scale;
 		$_GET["mode"]=$mode;
 
-		require_once(DOL_DOCUMENT_ROOT.'/core/lib/phpbarcode.php');
-		dol_syslog("modPhpbarcode::buildBarCode $code,$encoding,$scale,$mode");
+		dol_syslog(get_class($this)."::buildBarCode $code,$encoding,$scale,$mode");
 		if ($code) $result=barcode_print($code,$encoding,$scale,$mode);
 
 		if (! is_array($result))
-- 
GitLab