From e0ba0f835fa2dc8f11a5ca6f2fc8c4059bc60c04 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Sat, 9 Jul 2011 14:11:40 +0000
Subject: [PATCH] Qual: A lot of fixes to enhance package quality

---
 build/deb/apache.conf                         |  6 ++
 build/deb/changelog                           |  4 ++
 build/deb/control                             |  2 +-
 build/deb/copyright                           |  3 +
 build/deb/install.forced.php.install          |  5 +-
 build/deb/postinst                            | 62 +++++--------------
 build/deb/postrm                              | 59 ++++--------------
 build/deb/templates                           |  4 +-
 dev/initdata/generate-commande.php            |  3 +-
 dev/initdata/generate-facture.php             |  5 +-
 dev/initdata/generate-produit.php             |  3 +-
 dev/initdata/generate-propale.php             |  5 +-
 dev/initdata/generate-societe.php             |  3 +-
 dev/samples/create_invoice.php                |  7 ++-
 dev/samples/create_order.php                  |  7 ++-
 dev/samples/create_product.php                |  7 ++-
 dev/skeletons/build_class_from_table.php      |  5 +-
 dev/skeletons/build_webservice_from_class.php |  5 +-
 dev/skeletons/skeleton_script.php             |  7 ++-
 dev/translation/autotranslator.php            |  7 ++-
 scripts/banks/build-graph-sold-example.php    |  4 +-
 .../company/export-contacts-xls-example.php   |  7 ++-
 .../company/sync_contacts_dolibarr2ldap.php   |  7 ++-
 ...ail_unpaid_invoices_to_representatives.php |  4 +-
 scripts/invoices/rebuild_merge_pdf.php        |  6 +-
 .../members/sync_members_dolibarr2ldap.php    |  7 ++-
 .../members/sync_members_ldap2dolibarr.php    |  7 ++-
 scripts/user/sync_groups_dolibarr2ldap.php    |  7 ++-
 scripts/user/sync_users_dolibarr2ldap.php     |  7 ++-
 scripts/withdrawals/build_withdrawal_file.php |  7 ++-
 30 files changed, 121 insertions(+), 151 deletions(-)
 create mode 100644 build/deb/changelog

diff --git a/build/deb/apache.conf b/build/deb/apache.conf
index 05b21148f8d..d37b433fb98 100644
--- a/build/deb/apache.conf
+++ b/build/deb/apache.conf
@@ -60,3 +60,9 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
     Order deny,allow
     Allow from all
 </Directory>
+
+<Directory /var/lib/dolibarr>
+    AllowOverride All
+    Order deny,allow
+    Allow from all
+</Directory>
diff --git a/build/deb/changelog b/build/deb/changelog
new file mode 100644
index 00000000000..182110624de
--- /dev/null
+++ b/build/deb/changelog
@@ -0,0 +1,4 @@
+ dolibarr 3.1.0 unstable; urgency=low
+  * New 3.1.0 release
+    More information into /usr/share/dolibarr/ChangeLog file.
+ -- maintainer Laurent Destailleur <eldy@users.sourceforge.net>  2011-07-09
\ No newline at end of file
diff --git a/build/deb/control b/build/deb/control
index 19eb51664e7..3f564f5608f 100644
--- a/build/deb/control
+++ b/build/deb/control
@@ -9,7 +9,7 @@ Section: web
 Priority: optional
 Recommends: mozilla | netscape
 Homepage: http://www.dolibarr.org
-Description: An ERP & CRM software to manage your activity.
+Description: ERP & CRM software to manage your activity.
  Dolibarr ERP & CRM is an easy to use open source/free software for small 
  and medium companies, foundations or freelances. It includes different 
  features for Enterprise Resource Planning (ERP) and Customer Relationship
diff --git a/build/deb/copyright b/build/deb/copyright
index 74752ea4864..00aafd563b1 100644
--- a/build/deb/copyright
+++ b/build/deb/copyright
@@ -1 +1,4 @@
+Copyright 2011 Laurent Destailleur <eldy@users.sourceforge.net>
+
+This software is distributed under GPL v2 licence.
 See file /usr/share/common-licenses/GPL-2
\ No newline at end of file
diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install
index 4b92d7681d6..198565d3211 100755
--- a/build/deb/install.forced.php.install
+++ b/build/deb/install.forced.php.install
@@ -4,11 +4,12 @@
 // This file must be present into htdocs/install directory
 // during install process to be used.
 //
-// $Id: install.forced.php.install,v 1.5 2011/06/26 11:41:50 eldy Exp $
+// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $
 //
 $force_install_noedit=1;
 $force_install_message='KeepDefaultValuesDeb';
-$force_install_main_data_root='/usr/share/dolibarr/documents';
+#$force_install_main_data_root='/usr/share/dolibarr/documents';
+$force_install_main_data_root='/var/lib/dolibarr';
 $force_install_type='mysqli';
 $force_install_dbserver='localhost';
 $force_install_port='3306';
diff --git a/build/deb/postinst b/build/deb/postinst
index 0fbb8c73d7e..4d065f58ca0 100644
--- a/build/deb/postinst
+++ b/build/deb/postinst
@@ -51,7 +51,7 @@ case "$1" in
 		
         # Create /var/lib/dolibarr/documents
         mkdir -p /var/lib/dolibarr/documents
-        chown -R www-data.www-data /var/lib/dolibarr/documents;
+        chown -R www-data:www-data /var/lib/dolibarr/documents;
         chmod -R 775 /var/lib/dolibarr/documents;
         chmod -R g+s /var/lib/dolibarr/documents;
 
@@ -60,15 +60,15 @@ case "$1" in
 		then 
 			echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php		
 			touch /usr/share/dolibarr/htdocs/conf/conf.php
-			chown -R www-data.www-data /usr/share/dolibarr/htdocs/conf/conf.php;
+			chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php;
 	    	chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php;
 		fi
 
 		#db_reset "dolibarr/webserver"
 
 		# Get the web server type (use db_get for interactive mode).
-#		db_get "dolibarr/webserver"		# Read value for webserver.
-#		webserver="$RET"
+		#db_get "dolibarr/webserver"		# Read value for webserver.
+		#webserver="$RET"
 
 		case $webserver in
 			Apache)		webservers="apache2" ;;
@@ -81,23 +81,10 @@ case "$1" in
 		for server in $webservers ; do
 			echo Complete config of server $server
 			
-			# Add info for PHP (obsolete)
-			#typestr='application/x-httpd-php'
-			#extension='.php'
-			#. /usr/share/wwwconfig-common/apache-addtype_all.sh
-			
-			# Enable PHP module (obsolete)
-			#. /usr/share/wwwconfig-common/apache-php.sh
-			#echo Result of enabling PHP modules: $status
-			
 			# Detect webuser and webgroup
 			webuser=
 			webgroup=
 
-			# Search in httpd.conf (obsolete)
-			#. /usr/share/wwwconfig-common/apache-run.get
-			#echo Web user.group found is $webuser.$webgroup
-
 			if [ -z "$webuser" ] ; then
 				webuser=www-data
 			fi
@@ -111,22 +98,12 @@ case "$1" in
 			# That may lead to problems if apache & apache-ssl do
 			# not have the same user/group.
 			#
-			chown -R $webuser.$webgroup /usr/share/dolibarr
+			chown -R $webuser:$webgroup /usr/share/dolibarr
 
-            # Put content of conf file into apache httpd.conf main file (/etc/apache2/httpd.conf)
-			#includefile="/etc/dolibarr/apache.conf"
-			#. /usr/share/dolibarr/build/deb/apache-include_all.sh
-			#test "$status" = "uncomment" -o "$status" = "include" && restart="$server $restart"
-			
 			# Add link to config file
             echo Setup web server $server to add dolibarr config file
-			ln -fs /etc/dolibarr/apache.conf /etc/apache2/conf.d
+			ln -fs /etc/dolibarr/apache.conf /etc/apache2/conf.d/dolibarr.conf
 			
-			# (useless)
-			#for index in index.php; do
-			#	. /usr/share/wwwconfig-common/apache-index_all.sh
-			#	test "$status" = "added" && restart="$server $restart"
-			#done
 		done
 
 		# Copy icon file
@@ -157,22 +134,17 @@ case "$1" in
 
 		# Restart servers
 		servers="apache2-ssl apache2 mysql"
-		if [ -f /usr/share/wwwconfig-common/restart.sh ] ;
-		then
-            echo Restart web servers running /usr/share/wwwconfig-common/restart.sh
-			. /usr/share/wwwconfig-common/restart.sh
-		else
-			# Another way to restart
-			for server in $servers ; do
-			    echo Restart web server $server
-        		if [ -x /usr/sbin/invoke-rc.d ]; then
-        		    # This on works with Debian (5.05,...) and Ubuntu (9.10,10.04,...)
-        	    	invoke-rc.d $server reload || true
-        		else
-        	    	/etc/init.d/$server reload || true
-        		fi
-			done
-		fi
+		# Another way to restart
+		for server in $servers ; do
+    		if [ -x /usr/sbin/invoke-rc.d ]; then
+                echo Restart web server $server using invoke-rc.d
+    		    # This works with Debian (5.05,...) and Ubuntu (9.10,10.04,...)
+    	    	invoke-rc.d $server reload || true
+    		else
+                echo Restart web server $server using $server reload
+    	    	/etc/init.d/$server reload || true
+    		fi
+		done
 		
 		echo ----------
 		echo "Call Dolibarr page http://localhost/dolibarr/ to complete the installation and use Dolibarr."
diff --git a/build/deb/postrm b/build/deb/postrm
index 610f67772ac..c4d1c790e5d 100644
--- a/build/deb/postrm
+++ b/build/deb/postrm
@@ -72,10 +72,6 @@ case "$1" in
 			echo postrm Mysql superuser found to use is $superuserlogin
 			dbadmin="$superuserlogin"
 			dbadmpass="$superuserpassword"
-			#db_get "dolibarr/db/admin/name"
-			#dbadmin="$RET"
-			#db_get "dolibarr/db/admin/password"
-			#dbadmpass="$RET"
 			dbtype="mysql"
 			
 			# To delete a mysql user (disabled)
@@ -149,30 +145,6 @@ case "$1" in
 	
 		# Remove include files
 		for server in $webservers ; do
-            
-            # Old usage
-			#export conffile="/etc/$server/httpd.conf"
-            #export error=""     
-			#echo "postrm conffile=$conffile" 
-			#if [ -f $conffile ] ;
-			#then
-			#	if [ -s $conffile ] ;
-			#	then
-            #        echo postrm remove dolibarr include from /etc/dolibarr/apache.conf
-			#		# We disable set -e to avoid premature end of script if error
-			#		set +e
-			#	    GREP="Include[[:space:]]\+$includefile\b"
-			#	    if grep -e "$GREP" $conffile > /dev/null 2>&1; then
-			#		log="${log}Include of $includefile found in $conffile file, purging."
-			#		status=purge
-			#		grep -v -e "$GREP" < $conffile > $conffile.purg
-			#		mv $conffile.purg $conffile
-			#		fi
-			#		# We restore blocking errors
-			#		set -e
-			#	fi
-			#fi
-			
 			# New usage
 			export conffile="/etc/$server/conf.d/dolibarr.conf"
             if [ -f $conffile ] ;
@@ -189,25 +161,18 @@ case "$1" in
 		rm -rf /etc/dolibarr
 
 		# Restart servers
-		servers="apache2-ssl apache2 mysql"
-		if [ -f /usr/share/wwwconfig-common/restart.sh ] ;
-		then
-			. /usr/share/wwwconfig-common/restart.sh
-		else
-			# Another way to restart
-			for server in $servers ; do
-                # We disable blocking errors
-                set +e
-                echo "Restart server $server if exists"
-        		if [ -x /usr/sbin/invoke-rc.d ]; then
-        		     invoke-rc.d $server reload || true
-        		else
-        		     /etc/init.d/$server reload || true
-        		fi
-        		# We restore blocking errors
-        		set -e
-			done
-		fi
+		for server in $servers ; do
+            # We disable blocking errors
+            set +e
+            echo "Restart server $server if exists"
+    		if [ -x /usr/sbin/invoke-rc.d ]; then
+    		     invoke-rc.d $server reload || true
+    		else
+    		     /etc/init.d/$server reload || true
+    		fi
+    		# We restore blocking errors
+    		set -e
+		done
 		
 		# Remove file and conf file
 		for dir in /usr/share/dolibarr ; do
diff --git a/build/deb/templates b/build/deb/templates
index 82fcaa1ba48..3b370ee68f2 100644
--- a/build/deb/templates
+++ b/build/deb/templates
@@ -91,6 +91,6 @@ Template: dolibarr/postrm
 Type: boolean
 Default: true
 Description: Delete database ?
- Do I have to delete also the Dolibarr MySQL database and all its datas
- (datas subjected to this quetion are the Dolibarr DBMS account and all
+ Answer yes if you want to delete also the Dolibarr MySQL database and all 
+ its datas (datas subjected to this quetion are the Dolibarr DBMS account and all
  Dolibarr tables) ?
diff --git a/dev/initdata/generate-commande.php b/dev/initdata/generate-commande.php
index 98305ee38dd..a0b65ca05b3 100644
--- a/dev/initdata/generate-commande.php
+++ b/dev/initdata/generate-commande.php
@@ -1,3 +1,4 @@
+#!/usr/bin/php
 <?php
 /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2007 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
 /**
 	    \file       htdocs/dev/generate-commande.php
 		\brief      Script de generation de donnees aleatoires pour les commandes
-		\version    $Id$
+		\version    $Id: generate-commande.php,v 1.17 2011/07/09 14:11:40 eldy Exp $
 */
 
 // Test si mode batch
diff --git a/dev/initdata/generate-facture.php b/dev/initdata/generate-facture.php
index 354f724fc62..7653d65ce41 100644
--- a/dev/initdata/generate-facture.php
+++ b/dev/initdata/generate-facture.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -21,7 +22,7 @@
 /**
  *	    \file       htdocs/dev/generate-facture.php
  *		\brief      Script de generation de donnees aleatoires pour les factures
- *		\version    $Id$
+ *		\version    $Id: generate-facture.php,v 1.14 2011/07/09 14:11:40 eldy Exp $
  */
 
 // Test si mode batch
diff --git a/dev/initdata/generate-produit.php b/dev/initdata/generate-produit.php
index 37c7557b327..6bbc92b812e 100644
--- a/dev/initdata/generate-produit.php
+++ b/dev/initdata/generate-produit.php
@@ -1,3 +1,4 @@
+#!/usr/bin/php
 <?php
 /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
 /**
  *      \file       htdocs/dev/generate-produit.php
  *		\brief      Script de generation de donnees aleatoires pour les produits
- *		\version    $Id$
+ *		\version    $Id: generate-produit.php,v 1.16 2011/07/09 14:11:40 eldy Exp $
  */
 
 // Test si mode batch
diff --git a/dev/initdata/generate-propale.php b/dev/initdata/generate-propale.php
index 16bd4d7d9a8..56c6debdad2 100644
--- a/dev/initdata/generate-propale.php
+++ b/dev/initdata/generate-propale.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2007 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
@@ -22,7 +23,7 @@
 /**
  *	    \file       htdocs/dev/generate-propale.php
  *		\brief      Script de generation de donnees aleatoires pour les propales
- *		\version    $Id$
+ *		\version    $Id: generate-propale.php,v 1.15 2011/07/09 14:11:40 eldy Exp $
  */
 
 // Test si mode batch
diff --git a/dev/initdata/generate-societe.php b/dev/initdata/generate-societe.php
index 58fe6269eff..ed6cb9edce2 100644
--- a/dev/initdata/generate-societe.php
+++ b/dev/initdata/generate-societe.php
@@ -1,3 +1,4 @@
+#!/usr/bin/php
 <?php
 /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
 /**
  *      \file       htdocs/dev/generate-societe.php
  *		\brief      Script de generation de donnees aleatoires pour les societes
- *		\version    $Id$
+ *		\version    $Id: generate-societe.php,v 1.16 2011/07/09 14:11:40 eldy Exp $
  */
 
 // Test si mode batch
diff --git a/dev/samples/create_invoice.php b/dev/samples/create_invoice.php
index 25c70fc1fe6..47cd61cac1b 100644
--- a/dev/samples/create_invoice.php
+++ b/dev/samples/create_invoice.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -19,7 +20,7 @@
 /**
  *      \file       dev/samples/manage_order.php
  *      \brief      This file is an example for a command line script
- *      \version    $Id$
+ *      \version    $Id: create_invoice.php,v 1.5 2011/07/09 14:11:41 eldy Exp $
  *		\author		Put author name here
  *		\remarks	Put here some comments
  */
@@ -35,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
 }
 
 // Global variables
-$version='$Revision$';
+$version='$Revision: 1.5 $';
 $error=0;
 
 
diff --git a/dev/samples/create_order.php b/dev/samples/create_order.php
index d099fd29ae9..d955f35d0d4 100644
--- a/dev/samples/create_order.php
+++ b/dev/samples/create_order.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -19,7 +20,7 @@
 /**
  *      \file       dev/samples/manage_order.php
  *      \brief      This file is an example for a command line script
- *      \version    $Id$
+ *      \version    $Id: create_order.php,v 1.9 2011/07/09 14:11:41 eldy Exp $
  *		\author		Put author name here
  *		\remarks	Put here some comments
  */
@@ -35,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
 }
 
 // Global variables
-$version='$Revision$';
+$version='$Revision: 1.9 $';
 $error=0;
 
 
diff --git a/dev/samples/create_product.php b/dev/samples/create_product.php
index 055d28aa4cd..fbf4c5ab835 100644
--- a/dev/samples/create_product.php
+++ b/dev/samples/create_product.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -19,7 +20,7 @@
 /**
  *      \file       dev/samples/create_product.php
  *      \brief      This file is an example for a command line script
- *      \version    $Id$
+ *      \version    $Id: create_product.php,v 1.8 2011/07/09 14:11:41 eldy Exp $
  *		\author		Put author name here
  *		\remarks	Put here some comments
  */
@@ -35,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
 }
 
 // Global variables
-$version='$Revision$';
+$version='$Revision: 1.8 $';
 $error=0;
 
 
diff --git a/dev/skeletons/build_class_from_table.php b/dev/skeletons/build_class_from_table.php
index d228068d99f..c50f3ac4ec4 100644
--- a/dev/skeletons/build_class_from_table.php
+++ b/dev/skeletons/build_class_from_table.php
@@ -1,3 +1,4 @@
+#!/usr/bin/php
 <?php
 /* Copyright (C) 2008-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
@@ -20,7 +21,7 @@
  *	\file       dev/skeletons/build_class_from_table.php
  *  \ingroup    core
  *  \brief      Create a complete class file from a table in database
- *  \version    $Id$
+ *  \version    $Id: build_class_from_table.php,v 1.32 2011/07/09 14:11:40 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -38,7 +39,7 @@ require_once($path."../../htdocs/master.inc.php");
 // After this $db is a defined handler to database.
 
 // Main
-$version='$Revision$';
+$version='$Revision: 1.32 $';
 @set_time_limit(0);
 $error=0;
 
diff --git a/dev/skeletons/build_webservice_from_class.php b/dev/skeletons/build_webservice_from_class.php
index 8a890118ab7..03c1f254ab7 100644
--- a/dev/skeletons/build_webservice_from_class.php
+++ b/dev/skeletons/build_webservice_from_class.php
@@ -1,3 +1,4 @@
+#!/usr/bin/php
 <?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
@@ -20,7 +21,7 @@
  *	\file       dev/skeletons/build_webservice_from_class.php
  *  \ingroup    core
  *  \brief      Create a complete webservice file from CRUD functions of a PHP class
- *  \version    $Id$
+ *  \version    $Id: build_webservice_from_class.php,v 1.6 2011/07/09 14:11:40 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -38,7 +39,7 @@ require_once($path."../../htdocs/master.inc.php");
 // After this $db is a defined handler to database.
 
 // Main
-$version='$Revision$';
+$version='$Revision: 1.6 $';
 @set_time_limit(0);
 $error=0;
 
diff --git a/dev/skeletons/skeleton_script.php b/dev/skeletons/skeleton_script.php
index 8e1d2c7824e..eaffb1e1357 100644
--- a/dev/skeletons/skeleton_script.php
+++ b/dev/skeletons/skeleton_script.php
@@ -1,5 +1,6 @@
+#!/usr/bin/php
 <?php
-/* Copyright (C) 2007-2008 Laurent Destailleur  <eldy@users.sourceforge.net>
+/* Copyright (C) 2007-2011 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) ---Put here your own copyright and developer email---
  *
  * This program is free software; you can redistribute it and/or modify
@@ -21,7 +22,7 @@
  *      \file       dev/skeletons/skeleton_script.php
  *		\ingroup    mymodule othermodule1 othermodule2
  *      \brief      This file is an example for a command line script
- *      \version    $Id$
+ *      \version    $Id: skeleton_script.php,v 1.27 2011/07/09 14:11:41 eldy Exp $
  *		\author		Put author name here
  *		\remarks	Put here some comments
  */
@@ -37,7 +38,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
 }
 
 // Global variables
-$version='$Revision$';
+$version='$Revision: 1.27 $';
 $error=0;
 
 
diff --git a/dev/translation/autotranslator.php b/dev/translation/autotranslator.php
index b7f01926b06..0b43ca0c34f 100644
--- a/dev/translation/autotranslator.php
+++ b/dev/translation/autotranslator.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -20,7 +21,7 @@
  *      \file       dev/translation/autotranslator.php
  *		\ingroup    mymodule othermodule1 othermodule2
  *      \brief      This file is an example for a command line script
- *      \version    $Id: autotranslator.php,v 1.11 2011/06/26 18:52:49 eldy Exp $
+ *      \version    $Id: autotranslator.php,v 1.12 2011/07/09 14:11:41 eldy Exp $
  * 		\author		Put author name here
  *		\remarks	Put here some comments
  */
@@ -44,7 +45,7 @@ require_once($path.'../../htdocs/lib/files.lib.php');
 $langs->load("main");
 
 // Global variables
-$version='$Revision: 1.11 $';
+$version='$Revision: 1.12 $';
 $error=0;
 
 
diff --git a/scripts/banks/build-graph-sold-example.php b/scripts/banks/build-graph-sold-example.php
index de00b5c1c04..08cf68fd6bb 100644
--- a/scripts/banks/build-graph-sold-example.php
+++ b/scripts/banks/build-graph-sold-example.php
@@ -1,5 +1,5 @@
 #!/usr/bin/php
-<?PHP
+<?php
 /**
  * Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -24,7 +24,7 @@
  *		\ingroup    	banque
  *		\brief      	Script to build graph of sold for each bank account
  *		\deprecated		Ce script n'est plus utilise car les graphiques sont generes dynamiquement maintenant.
- *		\version		$Id: build-graph-sold-example.php,v 1.9 2011/07/08 14:54:35 eldy Exp $
+ *		\version		$Id: build-graph-sold-example.php,v 1.10 2011/07/09 14:11:41 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php
index 24c07fe61c9..009f7d6b482 100644
--- a/scripts/company/export-contacts-xls-example.php
+++ b/scripts/company/export-contacts-xls-example.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /**
  * Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
  *      \file       scripts/company/export-contacts-xls-example.php
  *      \ingroup    company
  *      \brief      Export third parties' contacts with emails
- *		\version	$Id$
+ *		\version	$Id: export-contacts-xls-example.php,v 1.7 2011/07/09 14:11:42 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -42,7 +43,7 @@ if (! isset($argv[1]) || ! $argv[1]) {
 $now=$argv[1];
 
 // Recupere env dolibarr
-$version='$Revision$';
+$version='$Revision: 1.7 $';
 
 require_once("../../htdocs/master.inc.php");
 require_once(PHP_WRITEEXCEL_PATH."/class.writeexcel_workbook.inc.php");
diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php
index 7d7c2f84ec7..2dd446eb842 100644
--- a/scripts/company/sync_contacts_dolibarr2ldap.php
+++ b/scripts/company/sync_contacts_dolibarr2ldap.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /**
  * Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
  *      \file       scripts/company/sync_contacts_dolibarr2ldap.php
  *      \ingroup    ldap company
  *      \brief      Script to update all contacts from Dolibarr into a LDAP database
- *		\version	$Id$
+ *		\version	$Id: sync_contacts_dolibarr2ldap.php,v 1.23 2011/07/09 14:11:42 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -42,7 +43,7 @@ if (! isset($argv[1]) || ! $argv[1]) {
 $now=$argv[1];
 
 // Recupere env dolibarr
-$version='$Revision$';
+$version='$Revision: 1.23 $';
 
 require_once($path."../../htdocs/master.inc.php");
 require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php
index 6dc9046bfc5..8ee631df756 100644
--- a/scripts/invoices/email_unpaid_invoices_to_representatives.php
+++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php
@@ -1,5 +1,5 @@
 #!/usr/bin/php
-<?PHP
+<?php
 /**
  * Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2005-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -23,7 +23,7 @@
  *      \file       scripts/invoices/email_unpaid_invoices_to_representatives.php
  *      \ingroup    facture
  *      \brief      Script to send a mail to dolibarr users linked to companies with unpaid invoices
- *		\version	$Id$
+ *		\version	$Id: email_unpaid_invoices_to_representatives.php,v 1.9 2011/07/09 14:11:41 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php
index edfa13ac705..631f4475be6 100644
--- a/scripts/invoices/rebuild_merge_pdf.php
+++ b/scripts/invoices/rebuild_merge_pdf.php
@@ -1,5 +1,5 @@
 #!/usr/bin/php
-<?PHP
+<?php
 /**
  * Copyright (C) 2009-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
@@ -22,7 +22,7 @@
  *      \file       scripts/invoices/rebuild_merge_pdf.php
  *      \ingroup    facture
  *      \brief      Script to rebuild PDF and merge PDF files into one
- *		\version	$Id$
+ *		\version	$Id: rebuild_merge_pdf.php,v 1.20 2011/07/09 14:11:41 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -49,7 +49,7 @@ require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
 $langs->load("main");
 
 // Global variables
-$version='$Revision$';
+$version='$Revision: 1.20 $';
 $error=0;
 
 
diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php
index 42ee711fc3f..3481510fdd3 100644
--- a/scripts/members/sync_members_dolibarr2ldap.php
+++ b/scripts/members/sync_members_dolibarr2ldap.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /**
  * Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006-2008 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
  *      \file       scripts/members/sync_members_dolibarr2ldap.php
  *      \ingroup    ldap member
  *      \brief      Script de mise a jour des adherents dans LDAP depuis base Dolibarr
- * 		\version	$Id$
+ * 		\version	$Id: sync_members_dolibarr2ldap.php,v 1.9 2011/07/09 14:11:41 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -36,7 +37,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
 }
 
 // Main
-$version='$Revision$';
+$version='$Revision: 1.9 $';
 $path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
 @set_time_limit(0);
 $error=0;
diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php
index 359ec7cd662..47aacc54898 100644
--- a/scripts/members/sync_members_ldap2dolibarr.php
+++ b/scripts/members/sync_members_ldap2dolibarr.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /**
  * Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
  *      \file       scripts/members/sync_members_ldap2dolibarr.php
  *      \ingroup    ldap member
  *      \brief      Script de mise a jour des adherents dans Dolibarr depuis LDAP
- * 		\version	$Id$
+ * 		\version	$Id: sync_members_ldap2dolibarr.php,v 1.12 2011/07/09 14:11:41 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -36,7 +37,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
 }
 
 // Main
-$version='$Revision$';
+$version='$Revision: 1.12 $';
 @set_time_limit(0);
 $error=0;
 $forcecommit=0;
diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php
index 046225bcf8f..c98720713c3 100644
--- a/scripts/user/sync_groups_dolibarr2ldap.php
+++ b/scripts/user/sync_groups_dolibarr2ldap.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /**
  * Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
  *      \file       scripts/user/sync_groups_dolibarr2ldap.php
  *      \ingroup    ldap core
  *      \brief      Script de mise a jour des groupes dans LDAP depuis base Dolibarr
- * 		\version	$Id$
+ * 		\version	$Id: sync_groups_dolibarr2ldap.php,v 1.8 2011/07/09 14:11:42 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -42,7 +43,7 @@ if (! isset($argv[1]) || ! $argv[1]) {
 $now=$argv[1];
 
 // Recupere env dolibarr
-$version='$Revision$';
+$version='$Revision: 1.8 $';
 
 require_once($path."../../htdocs/master.inc.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/ldap.class.php");
diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php
index 56d3ed149f2..cb18a18979a 100644
--- a/scripts/user/sync_users_dolibarr2ldap.php
+++ b/scripts/user/sync_users_dolibarr2ldap.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /**
  * Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
  *      \file       scripts/user/sync_users_dolibarr2ldap.php
  *      \ingroup    ldap core
  *      \brief      Script de mise a jour des users dans LDAP depuis base Dolibarr
- *		\version	$Id$
+ *		\version	$Id: sync_users_dolibarr2ldap.php,v 1.11 2011/07/09 14:11:42 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -42,7 +43,7 @@ if (! isset($argv[1]) || ! $argv[1]) {
 $now=$argv[1];
 
 // Recupere env dolibarr
-$version='$Revision$';
+$version='$Revision: 1.11 $';
 
 require_once($path."../../htdocs/master.inc.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/ldap.class.php");
diff --git a/scripts/withdrawals/build_withdrawal_file.php b/scripts/withdrawals/build_withdrawal_file.php
index b5bbf50eab5..d5853858189 100644
--- a/scripts/withdrawals/build_withdrawal_file.php
+++ b/scripts/withdrawals/build_withdrawal_file.php
@@ -1,4 +1,5 @@
-<?PHP
+#!/usr/bin/php
+<?php
 /**
  * Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2005-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
@@ -22,7 +23,7 @@
  *      \file       scripts/withdrawals/build_withdrawal_file.php
  *      \ingroup    prelevement
  *      \brief      Script de prelevement
- * 		\version	$Id$
+ * 		\version	$Id: build_withdrawal_file.php,v 1.4 2011/07/09 14:11:41 eldy Exp $
  */
 
 $sapi_type = php_sapi_name();
@@ -36,7 +37,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
 }
 
 // Recupere env dolibarr
-$version='$Revision$';
+$version='$Revision: 1.4 $';
 
 require_once($path."../../htdocs/master.inc.php");
 require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/class/bon-prelevement.class.php");
-- 
GitLab