From 0bdd1efe2bef8cb07141943a1a674f079bf28579 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Wed, 7 Jan 2009 10:57:36 +0000
Subject: [PATCH] Qual: Renamed all function dolibarr_xxx to dol_xxx to use
 same prefix everywhere.

---
 htdocs/adherents/adherent.class.php           |   4 +-
 htdocs/adherents/card_subscriptions.php       |   6 +-
 htdocs/adherents/info.php                     |   4 +-
 htdocs/adherents/info_subscription.php        |   4 +-
 htdocs/boxes.php                              |   6 +-
 htdocs/categories/categorie.php               |   4 +-
 htdocs/comm/action/fiche.php                  |   4 +-
 htdocs/comm/action/index.php                  |   4 +-
 htdocs/comm/action/info.php                   |   2 +-
 htdocs/comm/adresse_livraison.php             |   4 +-
 htdocs/comm/contact.php                       |   2 +-
 htdocs/comm/fiche.php                         |   4 +-
 htdocs/comm/propal.php                        |   3 +-
 htdocs/comm/propal/info.php                   |   4 +-
 htdocs/comm/prospect/fiche.php                |   2 +-
 htdocs/commande/fiche.php                     |   4 +-
 htdocs/commande/info.php                      |   4 +-
 htdocs/compta/bank/info.php                   |   4 +-
 htdocs/compta/facture.php                     |   3 +-
 htdocs/compta/facture/info.php                |   4 +-
 htdocs/compta/fiche.php                       |   2 +-
 htdocs/compta/paiement/info.php               |   4 +-
 htdocs/contact.class.php                      |   2 +-
 htdocs/contact/fiche.php                      |  10 +-
 htdocs/contact/index.php                      |   6 +-
 htdocs/contact/info.php                       |   4 +-
 htdocs/contrat/fiche.php                      |   4 +-
 htdocs/contrat/info.php                       |   4 +-
 htdocs/fichinter/fiche.php                    |   2 +-
 htdocs/fichinter/info.php                     |   4 +-
 htdocs/fourn/commande/fiche.php               |   3 +-
 htdocs/fourn/facture/info.php                 |   4 +-
 htdocs/fourn/fiche.php                        |   2 +-
 htdocs/fourn/paiement/info.php                |   4 +-
 htdocs/html.formmail.class.php                |  17 +-
 .../modules/commande/pdf_einstein.modules.php |   3 +-
 .../modules/facture/pdf_crabe.modules.php     |   3 +-
 .../propale/pdf_propale_azur.modules.php      |   3 +-
 htdocs/install/etape5.php                     |   2 -
 htdocs/lib/company.lib.php                    |   6 +-
 htdocs/lib/datepicker.php                     |   8 +-
 htdocs/lib/functions.lib.php                  | 239 ++++++------------
 htdocs/lib/functions2.lib.php                 |  92 +++++++
 htdocs/product/stock/info.php                 |   2 +-
 htdocs/soc.php                                |   4 +-
 htdocs/societe/commerciaux.php                |   4 +-
 htdocs/societe/info.php                       |   4 +-
 htdocs/societe/lien.php                       |   4 +-
 htdocs/user/info.php                          |   4 +-
 htdocs/user/param_ihm.php                     |   3 +-
 .../adherents/sync_member_ldap2dolibarr.php   |  22 +-
 51 files changed, 278 insertions(+), 273 deletions(-)

diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php
index 9d7ed85d944..c372224af6a 100644
--- a/htdocs/adherents/adherent.class.php
+++ b/htdocs/adherents/adherent.class.php
@@ -991,8 +991,8 @@ class Adherent extends CommonObject
 		else
 		{
 			// If no end date, end date = date + 1 year - 1 day
-			$datefin = dolibarr_time_plus_duree($date,1,'y');
-			$datefin = dolibarr_time_plus_duree($datefin,-1,'d');
+			$datefin = dol_time_plus_duree($date,1,'y');
+			$datefin = dol_time_plus_duree($datefin,-1,'d');
 		}
 
 		// Create subscription
diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index e0a5c6680d4..4415074f86a 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -89,7 +89,7 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio
 	}
 	if (! $datesubend)
 	{
-		$datesubend=dolibarr_time_plus_duree(dolibarr_time_plus_duree($datecotisation,$defaultdelay,$defaultdelayunit),-1,'d');
+		$datesubend=dol_time_plus_duree(dol_time_plus_duree($datecotisation,$defaultdelay,$defaultdelayunit),-1,'d');
 	}
 	
 	// Payment informations
@@ -398,7 +398,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
 	{
 		if ($adh->datefin > 0)
 		{
-			$datefrom=dolibarr_time_plus_duree($adh->datefin,1,'d');
+			$datefrom=dol_time_plus_duree($adh->datefin,1,'d');
 		}
 		else
 		{
@@ -415,7 +415,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
 	}
 	if (! $dateto)
 	{
-		//$dateto=dolibarr_time_plus_duree(dolibarr_time_plus_duree($datefrom,$defaultdelay,$defaultdelayunit),-1,'d');
+		//$dateto=dol_time_plus_duree(dol_time_plus_duree($datefrom,$defaultdelay,$defaultdelayunit),-1,'d');
 		$dateto=-1;		// By default, no date is suggested
 	}
 	print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
diff --git a/htdocs/adherents/info.php b/htdocs/adherents/info.php
index 62f718fde5e..6bdde42b05c 100644
--- a/htdocs/adherents/info.php
+++ b/htdocs/adherents/info.php
@@ -61,12 +61,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans("Member"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($adh);
+dol_print_object_info($adh);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/adherents/info_subscription.php b/htdocs/adherents/info_subscription.php
index a50bc7e9f9b..dd7eaf0c723 100644
--- a/htdocs/adherents/info_subscription.php
+++ b/htdocs/adherents/info_subscription.php
@@ -72,12 +72,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans("Subscription"));
 $subscription->info($rowid);
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($subscription);
+dol_print_object_info($subscription);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/boxes.php b/htdocs/boxes.php
index ca80d5c5281..6bf7a160f86 100644
--- a/htdocs/boxes.php
+++ b/htdocs/boxes.php
@@ -41,7 +41,7 @@ class InfoBox
 
     /**
      *      \brief      Constructeur de la classe
-     *      \param      $DB         Handler d'acc�s base
+     *      \param      $DB         Handler d'acc�s base
      */
     function InfoBox($DB)
     {
@@ -170,6 +170,8 @@ class InfoBox
      */
 	function saveboxorder($zone,$boxorder,$userid=0)
 	{
+		require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
+		
 		dolibarr_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid);
 
 		if (! $userid || $userid == 0) return 0;
@@ -181,7 +183,7 @@ class InfoBox
 		// Sauve parametre indiquant que le user a une 
 		$confuserzone='MAIN_BOXES_'.$zone;
 		$tab[$confuserzone]=1;
- 		if (! dolibarr_set_user_page_param($this->db, $user, '', $tab))
+ 		if (! dol_set_user_page_param($this->db, $user, '', $tab))
  		{
 			$this->error=$this->db->error();
 			$this->db->rollback();
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index e6f64ef2aa6..681b7fe36bc 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -172,8 +172,8 @@ if ($_GET["socid"])
 		print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td></tr>';
 	}
 
-	print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
-	print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
+	print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
+	print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
 
 	print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$soc->url\" target=\"_blank\">".$soc->url."</a>&nbsp;</td></tr>";
 
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index 8fa422c20c8..216f956ff3f 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -770,7 +770,7 @@ if ($_GET["id"])
 		{
 			if ($act->societe->fetch($act->societe->id))
 			{
-				print "<br>".dolibarr_print_phone($act->societe->tel);
+				print "<br>".dol_print_phone($act->societe->tel);
 			}
 		}	
         print '</td>';
@@ -783,7 +783,7 @@ if ($_GET["id"])
 			{
 				if ($act->contact->fetch($act->contact->id))
 				{
-					print "<br>".dolibarr_print_phone($act->contact->phone_pro);
+					print "<br>".dol_print_phone($act->contact->phone_pro);
 				}
 			}	
         }
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index a364867e38a..27a2e4f542c 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -335,9 +335,9 @@ if ($showbirthday)
 			$obj = $db->fetch_object($resql);
 			$action=new ActionComm($db);
 			$action->id=$obj->rowid;	// We put contact id in action id for birthdays events
-			$datebirth=dolibarr_stringtotime($obj->birthday);
+			$datebirth=dol_stringtotime($obj->birthday);
 			//print 'ee'.$obj->birthday.'-'.$datebirth;
-			$datearray=dolibarr_getdate($datebirth,true);
+			$datearray=dol_getdate($datebirth,true);
 			$action->datep=dolibarr_mktime(0,0,0,$datearray['mon'],$datearray['mday'],$year);
 			$action->datef=$action->datep;
 			$action->type_code='BIRTHDAY';
diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php
index b3770536757..d9e249e4ede 100644
--- a/htdocs/comm/action/info.php
+++ b/htdocs/comm/action/info.php
@@ -70,7 +70,7 @@ dolibarr_fiche_head($head, $hselected, $langs->trans("Action"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($act);
+dol_print_object_info($act);
 print '</td></tr></table>';
 
 print '</div>';
diff --git a/htdocs/comm/adresse_livraison.php b/htdocs/comm/adresse_livraison.php
index bbac58fedc0..aa76f6409e9 100644
--- a/htdocs/comm/adresse_livraison.php
+++ b/htdocs/comm/adresse_livraison.php
@@ -413,9 +413,9 @@ else
 	
 			print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$livraison->lignes[$i]->pays.'</td>';
 			
-			print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($livraison->lignes[$i]->tel,$livraison->lignes[$i]->pays_code,0,$livraison->socid).'</td></tr>';
+			print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($livraison->lignes[$i]->tel,$livraison->lignes[$i]->pays_code,0,$livraison->socid).'</td></tr>';
         
-      print '<tr><td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($livraison->lignes[$i]->fax,$livraison->lignes[$i]->pays_code,0,$livraison->socid).'</td></tr>';
+      print '<tr><td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($livraison->lignes[$i]->fax,$livraison->lignes[$i]->pays_code,0,$livraison->socid).'</td></tr>';
 			
 			print '</td></tr>';
 	
diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php
index e91df1da5c1..63cfc8ce359 100644
--- a/htdocs/comm/contact.php
+++ b/htdocs/comm/contact.php
@@ -169,7 +169,7 @@ if ($resql)
       
       print '<td><a href="action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->email.'</a>&nbsp;</td>';
       
-      print '<td>'.dolibarr_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->rowid).'&nbsp;</td>';
+      print '<td>'.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->rowid).'&nbsp;</td>';
       
       print "</tr>\n";
       $i++;
diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index 6db894ac49a..a7b65e5ffeb 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -189,10 +189,10 @@ if ($socid > 0)
 	print '</td></tr>';
 
     // Phone
-    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($objsoc->tel,$objsoc->pays_code,0,$objsoc->id).'</td>';
+    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($objsoc->tel,$objsoc->pays_code,0,$objsoc->id).'</td>';
     
     // Fax
-	print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($objsoc->fax,$objsoc->pays_code,0,$objsoc->id).'</td></tr>';
+	print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($objsoc->fax,$objsoc->pays_code,0,$objsoc->id).'</td></tr>';
 
     print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$objsoc->url\" target=\"_blank\">".$objsoc->url."</a>&nbsp;</td></tr>";
 
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 13c286e15ae..e95dc4c20db 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -32,6 +32,7 @@ require("./pre.inc.php");
 require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
 require_once(DOL_DOCUMENT_ROOT."/includes/modules/propale/modules_propale.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 
 $langs->load('companies');
 $langs->load('propal');
@@ -1335,7 +1336,7 @@ if ($_GET['propalid'] > 0)
 				// Remise %
 				if ($objp->remise_percent > 0 && $objp->special_code != 3)
 				{
-					print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent)."</td>\n";
+					print '<td align="right">'.dol_print_reduction($objp->remise_percent)."</td>\n";
 				}
 				else
 				{
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index 2de1e4a5fb6..fc8244aaa29 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -58,12 +58,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans('Proposal'));
 $propal->info($propal->id);
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($propal);
+dol_print_object_info($propal);
 print '</td></tr></table>';
 
 print '</div>';
  
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php
index 7003d4db50c..998beab22e2 100644
--- a/htdocs/comm/prospect/fiche.php
+++ b/htdocs/comm/prospect/fiche.php
@@ -110,7 +110,7 @@ if ($socid > 0)
 	else print $societe->pays;
 	print '</td></tr>';
 
-    print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dolibarr_print_phone($societe->tel,$societe->pays_code,0,$societe->id).'</td><td>Fax</td><td>'.dolibarr_print_phone($societe->fax,$societe->pays_code).'</td></tr>';
+    print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id).'</td><td>Fax</td><td>'.dol_print_phone($societe->fax,$societe->pays_code).'</td></tr>';
     print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\">$societe->url</a></td></tr>";
 
     if ($societe->rubrique)
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index d1f706f9ca8..393e9182819 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -34,7 +34,7 @@ require_once(DOL_DOCUMENT_ROOT."/includes/modules/commande/modules_commande.php"
 require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
 require_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php');
 require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/lib/functions.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
 if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
 if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT.'/propal.class.php');
@@ -1553,7 +1553,7 @@ else
 						print '</td>';
 						if ($objp->remise_percent > 0)
 						{
-							print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent).'</td>';
+							print '<td align="right">'.dol_print_reduction($objp->remise_percent).'</td>';
 						}
 						else
 						{
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index 40857ccbd5d..fa52fdec477 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -56,12 +56,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans("CustomerOrder"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($commande);
+dol_print_object_info($commande);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php
index 52656313926..95581c993bf 100644
--- a/htdocs/compta/bank/info.php
+++ b/htdocs/compta/bank/info.php
@@ -57,12 +57,12 @@ $h++;
 dolibarr_fiche_head($head, $hselected, $langs->trans("LineRecord"));
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($line);
+dol_print_object_info($line);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index c6ccbc75d3e..31c8a543102 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -34,6 +34,7 @@ require_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php');
 require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
 require_once(DOL_DOCUMENT_ROOT.'/discount.class.php');
 require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
 if ($conf->projet->enabled)   require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
 if ($conf->projet->enabled)   require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
@@ -2638,7 +2639,7 @@ else
 						print '</td>';
 						if ($objp->remise_percent > 0)
 						{
-							print '<td align="right">'.dolibarr_print_reduction($objp->remise_percent)."</td>\n";
+							print '<td align="right">'.dol_print_reduction($objp->remise_percent)."</td>\n";
 						}
 						else
 						{
diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php
index 09cf65e75b2..44c40324255 100644
--- a/htdocs/compta/facture/info.php
+++ b/htdocs/compta/facture/info.php
@@ -52,12 +52,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($fac);
+dol_print_object_info($fac);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php
index b3277bddff2..240bea47a0e 100644
--- a/htdocs/compta/fiche.php
+++ b/htdocs/compta/fiche.php
@@ -140,7 +140,7 @@ if ($socid > 0)
 	else print $societe->pays;
 	print '</td></tr>';
 
-    print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dolibarr_print_phone($societe->tel,$societe->pays_code,0,$societe->id).'</td><td>'.$langs->trans("Fax").'</td><td>'.dolibarr_print_phone($societe->fax,$societe->pays_code,0,$societe->id).'</td></tr>';
+    print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id).'</td><td>'.$langs->trans("Fax").'</td><td>'.dol_print_phone($societe->fax,$societe->pays_code,0,$societe->id).'</td></tr>';
     print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\" target=\"_blank\">$societe->url</a>&nbsp;</td></tr>";
 
 	// Assujeti a TVA ou pas
diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php
index 32b3ab9d559..d70ae109fdf 100644
--- a/htdocs/compta/paiement/info.php
+++ b/htdocs/compta/paiement/info.php
@@ -67,12 +67,12 @@ print '</table>';
 print '<br>';
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($paiement);
+dol_print_object_info($paiement);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php
index fd1fb894165..1cc8e07ab23 100644
--- a/htdocs/contact.class.php
+++ b/htdocs/contact.class.php
@@ -422,7 +422,7 @@ class Contact extends CommonObject
                 $this->priv           = $obj->priv;
                 $this->mail           = $obj->email;
     
-                $this->birthday       = dolibarr_stringtotime($obj->birthday);
+                $this->birthday       = dol_stringtotime($obj->birthday);
 				//print "fetch: ".$obj->birthday.'-'.$this->birthday;
                 $this->birthday_alert = $obj->birthday_alert;
                 $this->note           = $obj->note;
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index 8082a05e43f..4da7f403ba8 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -483,7 +483,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
 	{
 		$login=strtolower(substr($contact->prenom, 0, 4)) . strtolower(substr($contact->nom, 0, 4));
 		
-		// Cr�e un tableau formulaire
+		// Cr�e un tableau formulaire
 		$formquestion=array(
 		array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login));
 		
@@ -533,11 +533,11 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
 	print $contact->pays;
 	print '</td></tr>';
 
-	print '<tr><td>'.$langs->trans("PhonePro").'</td><td>'.dolibarr_print_phone($contact->phone_pro,$contact->pays_code,$contact->id,$contact->socid).'</td>';
-	print '<td>'.$langs->trans("PhonePerso").'</td><td>'.dolibarr_print_phone($contact->phone_perso,$contact->pays_code,$contact->id,$contact->socid).'</td></tr>';
+	print '<tr><td>'.$langs->trans("PhonePro").'</td><td>'.dol_print_phone($contact->phone_pro,$contact->pays_code,$contact->id,$contact->socid).'</td>';
+	print '<td>'.$langs->trans("PhonePerso").'</td><td>'.dol_print_phone($contact->phone_perso,$contact->pays_code,$contact->id,$contact->socid).'</td></tr>';
 
-	print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td>'.dolibarr_print_phone($contact->phone_mobile,$contact->pays_code,$contact->id,$contact->socid).'</td>';
-	print '<td>'.$langs->trans("Fax").'</td><td>'.dolibarr_print_phone($contact->fax,$contact->pays_code,$contact->id,$contact->socid).'</td></tr>';
+	print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td>'.dol_print_phone($contact->phone_mobile,$contact->pays_code,$contact->id,$contact->socid).'</td>';
+	print '<td>'.$langs->trans("Fax").'</td><td>'.dol_print_phone($contact->fax,$contact->pays_code,$contact->id,$contact->socid).'</td></tr>';
 
 	print '<tr><td>'.$langs->trans("EMail").'</td><td>';
 	if ($contact->email && ! ValidEmail($contact->email))
diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php
index 5c68f2f1f3e..29964a40794 100644
--- a/htdocs/contact/index.php
+++ b/htdocs/contact/index.php
@@ -314,14 +314,14 @@ if ($result)
 		
 		// Phone
         print '<td>';
-		print dolibarr_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid);
+		print dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid);
     	print '</td>';
 		
         if ($_GET["view"] == 'phone')
         {
-            print '<td>'.dolibarr_print_phone($obj->phone_mobile,$obj->pays_code,$obj->cidp,$obj->socid).'&nbsp;</td>';
+            print '<td>'.dol_print_phone($obj->phone_mobile,$obj->pays_code,$obj->cidp,$obj->socid).'&nbsp;</td>';
 
-            print '<td>'.dolibarr_print_phone($obj->fax,$obj->pays_code,$obj->cidp,$obj->socid).'&nbsp;</td>';
+            print '<td>'.dol_print_phone($obj->fax,$obj->pays_code,$obj->cidp,$obj->socid).'&nbsp;</td>';
         }
         else
         {
diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php
index ef4db0843cc..ed0cd4cc319 100644
--- a/htdocs/contact/info.php
+++ b/htdocs/contact/info.php
@@ -73,11 +73,11 @@ if ($contact->socid > 0)
   print $langs->trans("Company").' : '.$societe->getNomUrl(0).'<br>';
 }
 
-dolibarr_print_object_info($contact);
+dol_print_object_info($contact);
 
 print "</div>";
 
 $db->close();
 
-llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
+llxFooter('$Date$ - $Revision$');
 ?>
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index d91c587ac5f..b4decc30b95 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -1064,7 +1064,7 @@ else
 					{
 						$product=new Product($db);
 						$product->fetch($objp->fk_product);
-						$dateactend = dolibarr_time_plus_duree (time(), $product->duration_value, $product->duration_unit);
+						$dateactend = dol_time_plus_duree (time(), $product->duration_value, $product->duration_unit);
 					}
 				}
 
@@ -1112,7 +1112,7 @@ else
 					{
 						$product=new Product($db);
 						$product->fetch($objp->fk_product);
-						$dateactend = dolibarr_time_plus_duree (time(), $product->duration_value, $product->duration_unit);
+						$dateactend = dol_time_plus_duree (time(), $product->duration_value, $product->duration_unit);
 					}
 				}
 				$now=mktime();
diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php
index 612a5b00315..e40a7e9232e 100644
--- a/htdocs/contrat/info.php
+++ b/htdocs/contrat/info.php
@@ -51,12 +51,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans("Contract"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($contrat);
+dol_print_object_info($contrat);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index f4e9d26a7d7..a03ef1e4a3a 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -838,7 +838,7 @@ elseif ($_GET["id"] > 0)
 	
 			// Date intervention
 			print '<td align="center" nowrap="nowrap">';
-			$timearray=dolibarr_getdate(mktime());
+			$timearray=dol_getdate(mktime());
 			$timewithnohour=dolibarr_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
 			$html->select_date($timewithnohour,'di',1,1,0,"addinter");
 			print '</td>';
diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php
index 0a1288f175f..13c3ad1f923 100644
--- a/htdocs/fichinter/info.php
+++ b/htdocs/fichinter/info.php
@@ -54,12 +54,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans('InterventionCard'));
 $fichinter->info($fichinter->id);
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($fichinter);
+dol_print_object_info($fichinter);
 print '</td></tr></table>';
 
 print '</div>';
  
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 40826157903..14f6c8e176e 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -33,6 +33,7 @@ require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_command
 require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php";
 require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.product.class.php";
 require_once DOL_DOCUMENT_ROOT."/lib/fourn.lib.php";
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 if ($conf->projet->enabled)	require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
 
 $langs->load('orders');
@@ -723,7 +724,7 @@ if ($id > 0)
 				print '<td align="right" nowrap="nowrap">'.$commandline->qty.'</td>';
 				if ($commandline->remise_percent >	0)
 				{
-					print '<td align="right" nowrap="nowrap">'.dolibarr_print_reduction($commandline->remise_percent)."</td>\n";
+					print '<td align="right" nowrap="nowrap">'.dol_print_reduction($commandline->remise_percent)."</td>\n";
 				}
 				else
 				{
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index c9d91a25585..178d1abd292 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -51,12 +51,12 @@ $titre=$langs->trans('SupplierInvoice');
 dolibarr_fiche_head($head, 'info', $langs->trans('SupplierInvoice'));
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($fac);
+dol_print_object_info($fac);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php
index ab465ce52f0..1cfc5ca818e 100644
--- a/htdocs/fourn/fiche.php
+++ b/htdocs/fourn/fiche.php
@@ -94,7 +94,7 @@ if ( $societe->fetch($socid) )
 	else print $societe->pays;
   	print '</td></tr>';
 
-  print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dolibarr_print_phone($societe->tel,$societe->pays_code,0,$societe->id).'</td><td>'.$langs->trans("Fax").'</td><td>'.dolibarr_print_phone($societe->fax,$societe->pays_code,0,$societe->id).'</td></tr>';
+  print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id).'</td><td>'.$langs->trans("Fax").'</td><td>'.dol_print_phone($societe->fax,$societe->pays_code,0,$societe->id).'</td></tr>';
   print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\">$societe->url</a>&nbsp;</td></tr>";
   
   // Assujetti a TVA ou pas
diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php
index 82b9bfb43fb..8d471629152 100644
--- a/htdocs/fourn/paiement/info.php
+++ b/htdocs/fourn/paiement/info.php
@@ -59,12 +59,12 @@ $paiement->fetch($_GET["id"], $user);
 $paiement->info($_GET["id"]);
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($paiement);
+dol_print_object_info($paiement);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/html.formmail.class.php b/htdocs/html.formmail.class.php
index 6ae6b7525c0..2543d9940d4 100644
--- a/htdocs/html.formmail.class.php
+++ b/htdocs/html.formmail.class.php
@@ -18,16 +18,15 @@
 
 /**
         \file       htdocs/html.formmail.class.php
-        \brief      Fichier de la classe permettant la g�n�ration du formulaire html d'envoi de mail unitaire
+        \brief      Fichier de la classe permettant la g�n�ration du formulaire html d'envoi de mail unitaire
         \version    $Id$
 */
 
 require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php");
-require_once(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php");
 
 
 /**     \class      FormMail
-        \brief      Classe permettant la g�n�ration du formulaire html d'envoi de mail unitaire
+        \brief      Classe permettant la g�n�ration du formulaire html d'envoi de mail unitaire
         \remarks    Utilisation: $formail = new FormMail($db)
         \remarks                 $formmail->proprietes=1 ou chaine ou tableau de valeurs
         \remarks                 $formmail->show_form() affiche le formulaire
@@ -67,7 +66,7 @@ class FormMail
   
 	/**
 		\brief     Constructeur
-	    \param     DB      handler d'acc�s base de donn�e
+	    \param     DB      handler d'acc�s base de donn�e
 	*/
 	function FormMail($DB)
 	{
@@ -153,7 +152,7 @@ class FormMail
 	}
 		
 	/**
-	 *	\brief  		Affiche la partie de formulaire pour saisie d'un mail en fonction des propri�t�s
+	 *	\brief  		Affiche la partie de formulaire pour saisie d'un mail en fonction des propri�t�s
 	 *	\param			addfileaction		Name of action when posting file attachments	
 	 * 	\remarks		this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
 	 */
@@ -457,10 +456,10 @@ class FormMail
 
   /*
    *    \brief  Affiche la partie de formulaire pour saisie d'un mail
-   *    \param  withtopic   1 pour proposer � la saisie le sujet
-   *    \param  withbody    1 pour proposer � la saisie le corps du message
-   *    \param  withfile    1 pour proposer � la saisie l'ajout d'un fichier joint
-   *    \todo   Fonction a virer quand fichier /comm/mailing.php vir� (= quand ecran dans /comm/mailing prets)
+   *    \param  withtopic   1 pour proposer � la saisie le sujet
+   *    \param  withbody    1 pour proposer � la saisie le corps du message
+   *    \param  withfile    1 pour proposer � la saisie l'ajout d'un fichier joint
+   *    \todo   Fonction a virer quand fichier /comm/mailing.php vir� (= quand ecran dans /comm/mailing prets)
    */
   function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody) {
     global $langs;
diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php
index 246b71501d7..8388a46e177 100644
--- a/htdocs/includes/modules/commande/pdf_einstein.modules.php
+++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php
@@ -30,6 +30,7 @@
 require_once(DOL_DOCUMENT_ROOT ."/includes/modules/commande/modules_commande.php");
 require_once(DOL_DOCUMENT_ROOT."/product.class.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 
 
 /**
@@ -301,7 +302,7 @@ class pdf_einstein extends ModelePDFCommandes
 					$pdf->SetXY ($this->posxdiscount, $curY);
 					if ($com->lignes[$i]->remise_percent)
 					{
-						$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, dolibarr_print_reduction($com->lignes[$i]->remise_percent), 0, 'R');
+						$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, dol_print_reduction($com->lignes[$i]->remise_percent), 0, 'R');
 					}
 
 					// Total HT ligne
diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php
index 94b310a2bdd..2ade047124a 100644
--- a/htdocs/includes/modules/facture/pdf_crabe.modules.php
+++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php
@@ -30,6 +30,7 @@
 require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php");
 require_once(DOL_DOCUMENT_ROOT."/product.class.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 
 
 /**
@@ -320,7 +321,7 @@ class pdf_crabe extends ModelePDFFactures
 					$pdf->SetXY ($this->posxdiscount, $curY);
 					if ($fac->lignes[$i]->remise_percent)
 					{
-						$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 4, dolibarr_print_reduction($fac->lignes[$i]->remise_percent), 0, 'R');
+						$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 4, dol_print_reduction($fac->lignes[$i]->remise_percent), 0, 'R');
 					}
 
 					// Total HT ligne
diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
index de5cea3e55d..f2ae42aebb5 100644
--- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
@@ -30,6 +30,7 @@
 require_once(DOL_DOCUMENT_ROOT."/includes/modules/propale/modules_propale.php");
 require_once(DOL_DOCUMENT_ROOT."/product.class.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 
 
 /**
@@ -303,7 +304,7 @@ class pdf_propale_azur extends ModelePDFPropales
 					$pdf->SetXY ($this->posxdiscount, $curY);
 					if ($propale->lignes[$i]->remise_percent && $propale->lignes[$i]->special_code != 3)
 					{
-						$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 4, dolibarr_print_reduction($propale->lignes[$i]->remise_percent), 0, 'R');
+						$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 4, dol_print_reduction($propale->lignes[$i]->remise_percent), 0, 'R');
 					}
 
 					// Total HT ligne
diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php
index 9348187ec0e..d882dc85437 100644
--- a/htdocs/install/etape5.php
+++ b/htdocs/install/etape5.php
@@ -87,8 +87,6 @@ pHeader($langs->trans("SetupEnd"),"etape5");
 
 if ($_POST["action"] == "set" || $_POST["action"] == "upgrade")
 {
-    require_once(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php");
-    
     print '<table cellspacing="0" cellpadding="2" width="100%">';
     $error=0;
     
diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php
index 03af481250f..75733317001 100644
--- a/htdocs/lib/company.lib.php
+++ b/htdocs/lib/company.lib.php
@@ -298,10 +298,10 @@ function show_contacts($conf,$langs,$db,$objsoc)
 
 			// Lien click to dial
 			print '<td>';
-			print dolibarr_print_phone($obj->phone,$obj->pays_code,$obj->rowid,$objsoc->id);
+			print dol_print_phone($obj->phone,$obj->pays_code,$obj->rowid,$objsoc->id);
 			print '</td>';
 			print '<td>';
-			print dolibarr_print_phone($obj->fax,$obj->pays_code,$obj->rowid,$objsoc->id);
+			print dol_print_phone($obj->fax,$obj->pays_code,$obj->rowid,$objsoc->id);
 			print '</td>';
 			print '<td>';
 			if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
@@ -310,7 +310,7 @@ function show_contacts($conf,$langs,$db,$objsoc)
 			if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
 			print '</a>';
 			// \TODO
-			//if ($obj->email) print dol_email_link($obj->email);
+			if ($obj->email) print dol_email_link($obj->email);
 			print '&nbsp;</td>';
 
 			print '<td align="center">';
diff --git a/htdocs/lib/datepicker.php b/htdocs/lib/datepicker.php
index cf7b0c75623..b0c7141eb0d 100644
--- a/htdocs/lib/datepicker.php
+++ b/htdocs/lib/datepicker.php
@@ -115,7 +115,7 @@ function displayBox($selectedDate,$month,$year){
 	$thedate=dolibarr_mktime(12,0,0,$month,1,$year);
 	//print "thedate=$thedate";
 	$today=mktime();
-	$todayArray=dolibarr_getdate($today);
+	$todayArray=dol_getdate($today);
 	if($selectedDate != "00000000")
 	{ 
 		$selDate=xyzToUnixTimestamp($selectedDate);
@@ -156,7 +156,7 @@ function displayBox($selectedDate,$month,$year){
 	</tr>
 <?php 
 		//print "x ".$thedate." y";
-		$firstdate=dolibarr_getdate($thedate);
+		$firstdate=dol_getdate($thedate);
 		$mydate=$firstdate;
 
 		// Loop on each day of month
@@ -205,7 +205,7 @@ function displayBox($selectedDate,$month,$year){
 			}
 			else
 			{
-				$mydate=dolibarr_getdate($thedate);
+				$mydate=dol_getdate($thedate);
 				if ($firstdate["month"] != $mydate["month"]) $stoploop=1;
 			}
 		}
@@ -219,7 +219,7 @@ function displayBox($selectedDate,$month,$year){
 	<tr><td id="dpExp" class="dpExplanation" colspan="7"><?php 
 		if($selDate)
 		{
-			$tempDate=dolibarr_getdate($selDate);
+			$tempDate=dol_getdate($selDate);
 			print $langs->trans($selectMonth)." ";
 			print sprintf("%02s",$tempDate["mday"]);
 			print ", ".$selectYear;
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index 9651153d03a..778a41f6350 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -158,6 +158,12 @@ function dol_escape_js($stringtoescape)
 }
 
 
+/* For backward compatiblity */
+function dolibarr_syslog($message, $level=LOG_INFO)
+{
+	return dol_syslog($message, $level);
+}
+
 /**
  *	\brief      Write log message in a file or to syslog process
  *				Pour fichier:   	fichier defined by SYSLOG_FILE
@@ -172,7 +178,7 @@ function dol_escape_js($stringtoescape)
  *	\remarks	On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=LOG_DEBUG=6
  *				On Linux   LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
  */
-function dolibarr_syslog($message, $level=LOG_INFO)
+function dol_syslog($message, $level=LOG_INFO)
 {
 	global $conf,$user,$langs,$REQUEST;
 
@@ -273,14 +279,21 @@ function dolibarr_syslog($message, $level=LOG_INFO)
 	}
 }
 
+
+/* For backward compatibility */
+function dolibarr_fiche_head($links, $active='0', $title='', $notab=0)
+{
+	return dol_fiche_head($links, $active, $title, $notab);
+}
+
 /**
- \brief      Affiche le header d'une fiche
- \param	    links		Tableau de titre d'onglets
- \param	    active      0=onglet non actif, 1=onglet actif
- \param      title       Titre tabelau ("" par defaut)
- \param      notab		0=Add tab header, 1=no tab header
+ *	\brief      Affiche le header d'une fiche
+ *	\param	    links		Tableau de titre d'onglets
+ *	\param	    active      0=onglet non actif, 1=onglet actif
+ *	\param      title       Titre tabelau ("" par defaut)
+ *	\param      notab		0=Add tab header, 1=no tab header
  */
-function dolibarr_fiche_head($links, $active='0', $title='', $notab=0)
+function dol_fiche_head($links, $active='0', $title='', $notab=0)
 {
 	print "\n".'<div class="tabs">'."\n";
 
@@ -325,112 +338,13 @@ function dolibarr_fiche_head($links, $active='0', $title='', $notab=0)
 
 
 /**
- \brief      Sauvegarde parametrage personnel
- \param	    db          Handler d'acc�s base
- \param	    user        Objet utilisateur
- \param	    url         Si defini, on sauve parametre du tableau tab dont cl� = (url avec sortfield, sortorder, begin et page)
- Si non defini on sauve tous parametres du tableau tab
- \param	    tab         Tableau (cl�=>valeur) des param�tres a sauvegarder
- \return     int         <0 si ko, >0 si ok
- */
-function dolibarr_set_user_page_param($db, &$user, $url='', $tab)
-{
-	// Verification parametres
-	if (sizeof($tab) < 1) return -1;
-
-	$db->begin();
-
-	// On efface anciens param�tres pour toutes les cl� dans $ta
-	$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_param";
-	$sql.= " WHERE fk_user = ".$user->id;
-	if ($url) $sql.=" AND page='".$url."'";
-	else $sql.=" AND page=''";	// Page ne peut etre null
-	$sql.= " AND param in (";
-	$i=0;
-	foreach ($tab as $key => $value)
-	{
-		if ($i > 0) $sql.=',';
-		$sql.="'".$key."'";
-		$i++;
-	}
-	$sql.= ")";
-	dolibarr_syslog("functions.lib::dolibarr_set_user_page_param $sql");
-
-	$resql=$db->query($sql);
-	if (! $resql)
-	{
-		dolibarr_print_error($db);
-		$db->rollback();
-		exit;
-	}
-
-	foreach ($tab as $key => $value)
-	{
-		// On positionne nouveaux param�tres
-		if ($value && (! $url || in_array($key,array('sortfield','sortorder','begin','page'))))
-		{
-			$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_param(fk_user,page,param,value)";
-			$sql.= " VALUES (".$user->id.",";
-			if ($url) $sql.= " '".urlencode($url)."',";
-			else $sql.= " '',";
-			$sql.= " '".$key."','".addslashes($value)."');";
-			dolibarr_syslog("functions.lib::dolibarr_set_user_page_param $sql");
-
-			$result=$db->query($sql);
-			if (! $result)
-			{
-				dolibarr_print_error($db);
-				$db->rollback();
-				exit;
-			}
-
-			$user->page_param[$key] = $value;
-		}
-	}
-
-	$db->commit();
-	return 1;
-}
-
-
-/**
- \brief  Formattage des nombres
- \param	ca			valeur a formater
- \return	int			valeur format�e
+ *	\brief      Add a delay to a date
+ *	\param	    time                Date timestamp ou au format YYYY-MM-DD
+ *	\param	    duration_value      Value of delay to add
+ *	\param	    duration_unit       Unit of added delay (d, m, y)
+ *	\return     int                 New timestamp
  */
-function dolibarr_print_ca($ca)
-{
-	global $langs,$conf;
-
-	if ($ca > 1000)
-	{
-		$cat = round(($ca / 1000),2);
-		$cat = "$cat K".$langs->trans("Currency".$conf->monnaie);
-	}
-	else
-	{
-		$cat = round($ca,2);
-		$cat = "$cat ".$langs->trans("Currency".$conf->monnaie);
-	}
-
-	if ($ca > 1000000)
-	{
-		$cat = round(($ca / 1000000),2);
-		$cat = "$cat M".$langs->trans("Currency".$conf->monnaie);
-	}
-
-	return $cat;
-}
-
-
-/**
- \brief      Effectue un d�calage de date par rapport a une dur�e
- \param	    time                Date timestamp ou au format YYYY-MM-DD
- \param	    duration_value      Valeur de la dur�e a ajouter
- \param	    duration_unit       Unit� de la dur�e a ajouter (d, m, y)
- \return     int                 Nouveau timestamp
- */
-function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
+function dol_time_plus_duree($time,$duration_value,$duration_unit)
 {
 	if ($duration_value == 0) return $time;
 	if ($duration_value > 0) $deltastring="+".abs($duration_value);
@@ -442,6 +356,12 @@ function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
 }
 
 
+/* For backward compatibility */
+function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='')
+{
+	return dol_print_date($time,$format,$to_gmt,$outputlangs);
+}
+
 /**
  *	\brief      Output date in a string format according to language $conf->language
  *	\param	    time        	GM Timestamps date (or 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' in server TZ)
@@ -455,7 +375,7 @@ function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
  * 								This means output is endoded in UTF-8 in default case.
  * 	\return     string      	Formated date or '' if time is null
  */
-function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='')
+function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='')
 {
 	global $conf,$langs;
 
@@ -519,12 +439,12 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='')
  *	\return		date			Date
  * 	\example	19700101020000 -> 7200
  */
-function dolibarr_stringtotime($string)
+function dol_stringtotime($string)
 {
 	if (eregi('^([0-9]+)\/([0-9]+)\/([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$string,$reg))
 	{
 		// This part of code should not be used.
-		dolibarr_syslog("Functions.lib::dolibarr_stringtotime call to function with deprecated parameter", LOG_WARN);
+		dolibarr_syslog("Functions.lib::dol_stringtotime call to function with deprecated parameter", LOG_WARN);
 		// Date est au format 'DD/MM/YY' ou 'DD/MM/YY HH:MM:SS'
 		// Date est au format 'DD/MM/YYYY' ou 'DD/MM/YYYY HH:MM:SS'
 		$sday = $reg[1];
@@ -574,7 +494,7 @@ function dolibarr_stringtotime($string)
  *				'ndays' => $ndays
  *	\remarks	PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
  */
-function dolibarr_getdate($timestamp,$fast=false)
+function dol_getdate($timestamp,$fast=false)
 {
 	$usealternatemethod=false;
 	if ($timestamp <= 0) $usealternatemethod=true;				// <= 1970
@@ -592,6 +512,12 @@ function dolibarr_getdate($timestamp,$fast=false)
 	return $arrayinfo;
 }
 
+/* For backward compatibility */
+function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1)
+{
+	return dol_mktime($hour,$minute,$second,$month,$day,$year,$gm,$check);
+}
+
 /**
  *	Return a GMT date built from detailed informations
  * 	Replace function mktime not available under Windows if year < 1970
@@ -606,7 +532,7 @@ function dolibarr_getdate($timestamp,$fast=false)
  *	@param		check			0=No check on parameters (Can use day 32, etc...)
  *	@return		timestamp		Date en timestamp, '' if error
  */
-function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1)
+function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1)
 {
 	//print "- ".$hour.",".$minute.",".$second.",".$month.",".$day.",".$year.",".$_SERVER["WINDIR"]." -";
 
@@ -651,6 +577,11 @@ function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1)
 }
 
 
+/* For backward compatibility */
+function dolibarr_date($fmt, $timestamp, $gm=0)
+{
+	return dol_date($fmt, $timestamp, $gm);
+}
 
 /**
  *	\brief  	Returns formated date
@@ -659,7 +590,7 @@ function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1)
  *	\param		gm				1 if timestamp was built with gmmktime, 0 if timestamp was build with mktime
  *	\return		string			Formated date
  */
-function dolibarr_date($fmt, $timestamp, $gm=0)
+function dol_date($fmt, $timestamp, $gm=0)
 {
 	$usealternatemethod=false;
 	if ($timestamp <= 0) $usealternatemethod=true;
@@ -682,7 +613,7 @@ function dolibarr_date($fmt, $timestamp, $gm=0)
  *	\brief  Affiche les informations d'un objet
  *	\param	object			objet a afficher
  */
-function dolibarr_print_object_info($object)
+function dol_print_object_info($object)
 {
 	global $langs;
 	$langs->load("other");
@@ -718,6 +649,13 @@ function dolibarr_print_object_info($object)
 	print $langs->trans("DateConciliating")." : " . dolibarr_print_date($object->date_rappro,"dayhourtext") . '<br>';
 }
 
+
+/* For backward compatibility */
+function dolibarr_print_phone($phone,$country="FR",$cid=0,$socid=0,$nolinks=false,$separ="&nbsp;")
+{
+	return dol_print_phone($phone,$country,$cid,$socid,$nolinks,$separ);
+}
+
 /**
  * 	\brief 		Format phone numbers according to country
  * 	\param 		phone 		Phone number to format
@@ -728,7 +666,7 @@ function dolibarr_print_object_info($object)
  * 	\param 		separ 		separation between numbers for a better visibility example : xx.xx.xx.xx.xx
  * 	\return 	string 		Formated phone number
  */
-function dolibarr_print_phone($phone,$country="FR",$cid=0,$socid=0,$nolinks=false,$separ="&nbsp;")
+function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$nolinks=false,$separ="&nbsp;")
 {
 	global $conf,$user;
 
@@ -903,7 +841,13 @@ function dol_substr($string,$start,$length,$stringencoding='')
 	return $ret;
 }
 
-	
+
+/* For backward compatibility */
+function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='')
+{
+	return dol_trunc($string,$size,$trunc,$stringencoding);
+}
+
 /**
  *	\brief      Truncate a string to a particular length adding '...' if string larger than length
  *	\param      string				String to truncate
@@ -912,7 +856,7 @@ function dol_substr($string,$start,$length,$stringencoding='')
  *	\return     string				Truncated string
  *	\remarks	USE_SHORT_TITLE=0 can disable all truncings
  */
-function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='')
+function dol_trunc($string,$size=40,$trunc='right',$stringencoding='')
 {
 	global $conf;
 
@@ -952,26 +896,6 @@ function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='')
 	}
 }
 
-/**
- *	\brief      Complete une chaine a une taille donnee par des espaces
- *	\param      string		Chaine a completer
- *	\param      size		Longueur de la chaine.
- *	\param      side		0=Completion a droite, 1=Completion a gauche
- *	\param		char		Chaine de completion
- *	\return     string		Chaine complete
- */
-function dolibarr_pad($string,$size,$side,$char=' ')
-{
-	$taille=sizeof($string);
-	$i=0;
-	while($i < ($size - $taille))
-	{
-		if ($side > 0) $string.=$char;
-		else $string=$char.$string;
-		$i++;
-	}
-	return $string;
-}
 
 /**
  *	\brief      Affiche picto propre a une notion/module (fonction g�n�rique)
@@ -1600,6 +1524,12 @@ function accessforbidden($message='',$printheader=1)
 }
 
 
+/* For backward compatibility */
+function dolibarr_print_error($db='',$error='')
+{
+	return dol_print_error($db, $error);
+}
+
 /**
  *	\brief      Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remont�e des bugs.
  *				On doit appeler cette fonction quand une erreur technique bloquante est rencontree.
@@ -1608,7 +1538,7 @@ function accessforbidden($message='',$printheader=1)
  *				\param      db      Database handler
  *				\param      error	Chaine erreur ou tableau de chaines erreur complementaires a afficher
  */
-function dolibarr_print_error($db='',$error='')
+function dol_print_error($db='',$error='')
 {
 	global $conf,$langs,$argv;
 	$syslog = '';
@@ -2766,29 +2696,6 @@ function monthArrayOrSelected($selected=0)
 	}
 }
 
-/**
- *	\brief  	Returns formated reduction
- *	\param		reduction		Reduction percentage
- *	\return		string			Formated reduction
- */
-function dolibarr_print_reduction($reduction=0)
-{
-	global $langs;
-	$langs->load("main");
-
-	$string = '';
-	if ($reduction == 100)
-	{
-		$string = $langs->trans("Offered");
-	}
-	else
-	{
-		$string = $reduction.'%';
-	}
-
-	return $string;
-}
-
 
 /**
  *	\brief  	Returns formated reduction
diff --git a/htdocs/lib/functions2.lib.php b/htdocs/lib/functions2.lib.php
index c4f1399c67a..f294a75da84 100644
--- a/htdocs/lib/functions2.lib.php
+++ b/htdocs/lib/functions2.lib.php
@@ -439,3 +439,95 @@ function weight_convert($weight,&$from_unit,$to_unit)
 	return $weight;
 }
 
+
+/**
+ *	\brief      Save personnal parameter
+ *	\param	    db          Handler database
+ *	\param	    user        Object user
+ *	\param	    url         Si defini, on sauve parametre du tableau tab dont cle = (url avec sortfield, sortorder, begin et page)
+ *							Si non defini on sauve tous parametres du tableau tab
+ *	\param	    tab         Tableau (cle=>valeur) des parametres a sauvegarder
+ *	\return     int         <0 si ko, >0 si ok
+ */
+function dol_set_user_page_param($db, &$user, $url='', $tab)
+{
+	// Verification parametres
+	if (sizeof($tab) < 1) return -1;
+
+	$db->begin();
+
+	// We remove old parameters for all keys in $tab
+	$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_param";
+	$sql.= " WHERE fk_user = ".$user->id;
+	if ($url) $sql.=" AND page='".$url."'";
+	else $sql.=" AND page=''";	// Page ne peut etre null
+	$sql.= " AND param in (";
+	$i=0;
+	foreach ($tab as $key => $value)
+	{
+		if ($i > 0) $sql.=',';
+		$sql.="'".$key."'";
+		$i++;
+	}
+	$sql.= ")";
+	dolibarr_syslog("functions2.lib::dol_set_user_page_param $sql");
+
+	$resql=$db->query($sql);
+	if (! $resql)
+	{
+		dolibarr_print_error($db);
+		$db->rollback();
+		exit;
+	}
+
+	foreach ($tab as $key => $value)
+	{
+		// Set new parameters
+		if ($value && (! $url || in_array($key,array('sortfield','sortorder','begin','page'))))
+		{
+			$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_param(fk_user,page,param,value)";
+			$sql.= " VALUES (".$user->id.",";
+			if ($url) $sql.= " '".urlencode($url)."',";
+			else $sql.= " '',";
+			$sql.= " '".$key."','".addslashes($value)."');";
+			dolibarr_syslog("functions2.lib::dol_set_user_page_param $sql");
+
+			$result=$db->query($sql);
+			if (! $result)
+			{
+				dolibarr_print_error($db);
+				$db->rollback();
+				exit;
+			}
+
+			$user->page_param[$key] = $value;
+		}
+	}
+
+	$db->commit();
+	return 1;
+}
+
+
+/**
+ *	\brief  	Returns formated reduction
+ *	\param		reduction		Reduction percentage
+ *	\return		string			Formated reduction
+ */
+function dol_print_reduction($reduction=0)
+{
+	global $langs;
+	$langs->load("main");
+
+	$string = '';
+	if ($reduction == 100)
+	{
+		$string = $langs->trans("Offered");
+	}
+	else
+	{
+		$string = $reduction.'%';
+	}
+
+	return $string;
+}
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index ea5d94c9589..d7762fd6e74 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -76,7 +76,7 @@ dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($entrepot);
+dol_print_object_info($entrepot);
 print '</td></tr></table>';
 
 print '</div>';
diff --git a/htdocs/soc.php b/htdocs/soc.php
index e4afb114f4c..53e914f6ba5 100644
--- a/htdocs/soc.php
+++ b/htdocs/soc.php
@@ -1025,8 +1025,8 @@ else
 
 	print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'.$soc->departement.'</td>';
 
-	print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
-	print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
+	print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
+	print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
 
 	print '<tr><td>'.$langs->trans('EMail').'</td><td>';
 	if ($soc->email) { print '<a href="mailto:'.$soc->email.'" target="_blank">'.$soc->email.'</a>'; }
diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php
index a5313a95a9c..e005a6da261 100644
--- a/htdocs/societe/commerciaux.php
+++ b/htdocs/societe/commerciaux.php
@@ -116,8 +116,8 @@ if ($_GET["socid"])
     
     print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>';
     
-    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
-    print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
+    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
+    print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
     
     print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
     if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php
index 271351ad6c4..166dbcbb8ca 100644
--- a/htdocs/societe/info.php
+++ b/htdocs/societe/info.php
@@ -57,12 +57,12 @@ dolibarr_fiche_head($head, 'info', $langs->trans("ThirdParty"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($soc);
+dol_print_object_info($soc);
 print '</td></tr></table>';
 
 print '</div>';
 
-// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
+// Juste pour �viter bug IE qui r�organise mal div pr�c�dents si celui-ci absent
 print '<div class="tabsAction">';
 print '</div>';
 
diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php
index d4ce2717943..452ca601cf7 100644
--- a/htdocs/societe/lien.php
+++ b/htdocs/societe/lien.php
@@ -118,8 +118,8 @@ if($_GET["socid"])
     
     print "<tr><td>".$langs->trans('Country')."</td><td colspan=\"3\">".$soc->pays."</td></tr>";
     
-    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
-    print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
+    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->pays_code,0,$soc->id).'</td>';
+    print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->pays_code,0,$soc->id).'</td></tr>';
     
     print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
     if ($soc->url) { print '<a href="http://'.$soc->url.'">http://'.$soc->url.'</a>'; }
diff --git a/htdocs/user/info.php b/htdocs/user/info.php
index 1761a5b63bb..cd84359ff72 100644
--- a/htdocs/user/info.php
+++ b/htdocs/user/info.php
@@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/user.class.php");
 
 $langs->load("users");
 
-// S�curit� acc�s client et commerciaux
+// S�curit� acc�s client et commerciaux
 $id = isset($_GET["id"])?$_GET["id"]:'';
 
 $fuser = new User($db);
@@ -59,7 +59,7 @@ dolibarr_fiche_head($head, 'info', $langs->trans("User"));
 
 
 print '<table width="100%"><tr><td>';
-dolibarr_print_object_info($fuser);
+dol_print_object_info($fuser);
 print '</td></tr></table>';
 
 print '</div>';
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 964552cb502..9b69d790c0f 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -23,6 +23,7 @@
 */
 
 require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php");
 require_once(DOL_DOCUMENT_ROOT."/html.formadmin.class.php");
 
@@ -93,7 +94,7 @@ if ($_POST["action"] == 'update' && ($caneditfield  || $user->admin))
         $tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"];
         $tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"];
     
-        dolibarr_set_user_page_param($db, $fuser, '', $tabparam);
+        dol_set_user_page_param($db, $fuser, '', $tabparam);
 
         $_SESSION["mainmenu"]="";   // Le gestionnaire de menu a pu changer
     
diff --git a/scripts/adherents/sync_member_ldap2dolibarr.php b/scripts/adherents/sync_member_ldap2dolibarr.php
index d38a6b6c558..930806cd047 100644
--- a/scripts/adherents/sync_member_ldap2dolibarr.php
+++ b/scripts/adherents/sync_member_ldap2dolibarr.php
@@ -134,10 +134,10 @@ if ($result >= 0)
 	$justthese=array();
 
 	
-	// On d�sactive la synchro Dolibarr vers LDAP
+	// On d�sactive la synchro Dolibarr vers LDAP
 	$conf->global->LDAP_MEMBER_ACTIVE=0;
 	
-	// Liste des champs a r�cup�rer de LDAP
+	// Liste des champs a r�cup�rer de LDAP
 	$required_fields = array(
 	$conf->global->LDAP_FIELD_FULLNAME,
 	$conf->global->LDAP_FIELD_LOGIN,
@@ -175,7 +175,7 @@ if ($result >= 0)
 	{
 		$db->begin();
 
-		// Warning $ldapuser a une cl� en minuscule
+		// Warning $ldapuser a une cl� en minuscule
 		foreach ($ldaprecords as $key => $ldapuser)
 		{
 			$member = new Adherent($db);
@@ -204,13 +204,13 @@ if ($result >= 0)
 			$member->morphy='phy';
 			$member->photo='';
 			$member->public=1;
-			$member->naiss=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE]);
+			$member->naiss=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE]);
 
 			$member->statut=-1;
 			if (isset($ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS]))
 			{
-				$member->datec=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
-				$member->datevalid=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
+				$member->datec=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
+				$member->datevalid=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
 				$member->statut=$ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS];
 			}
 			//if ($member->statut > 1) $member->statut=1;
@@ -240,19 +240,19 @@ if ($result >= 0)
 			$datefirst='';
 			if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)
 			{
-				$datefirst=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
+				$datefirst=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
 				$pricefirst=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT]);
 			}
 
 			$datelast='';
 			if ($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)
 			{
-				$datelast=dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE]);
+				$datelast=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE]);
 				$pricelast=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT]);
 			}
 			elseif ($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)
 			{
-				$datelast=dolibarr_time_plus_duree(dolibarr_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION]),-1,'y')+60*60*24;
+				$datelast=dol_time_plus_duree(dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION]),-1,'y')+60*60*24;
 				$pricelast=price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT]);
 
 				// Cas special ou date derniere <= date premiere
@@ -265,7 +265,7 @@ if ($result >= 0)
 			}
 
 			
-			// Insertion premi�re adh�sion
+			// Insertion premi�re adh�sion
 			if ($datefirst)
 			{
 				// Cree premiere cotisation et met a jour datefin dans adherent
@@ -273,7 +273,7 @@ if ($result >= 0)
 				$crowid=$member->cotisation($datefirst, $pricefirst, 0);
 			}
 
-			// Insertion derni�re adh�sion
+			// Insertion derni�re adh�sion
 			if ($datelast)
 			{
 				// Cree derniere cotisation et met a jour datefin dans adherent
-- 
GitLab