From 0823322ba1e3c74c9d9eaedf610d6a00e8df8139 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Fri, 20 Feb 2009 22:53:15 +0000
Subject: [PATCH] Qual: All call to dolibarr_ functions are made on dol_
 functions.

---
 dev/load/generate-commande.php                |   6 +-
 dev/load/generate-facture.php                 |   4 +-
 dev/load/generate-propale.php                 |   4 +-
 dev/skeletons/skeleton_class.class.php        |  16 +-
 dev/skeletons/skeleton_script.php             |  20 +-
 .../accountancy/accountancyaccount.class.php  |   4 +-
 .../accountancy/accountancysystem.class.php   |   4 +-
 htdocs/actioncomm.class.php                   |  22 +-
 htdocs/adherents/adherent.class.php           |  82 +-
 htdocs/adherents/adherent_options.class.php   |  20 +-
 htdocs/adherents/adherent_type.class.php      |   6 +-
 htdocs/adherents/card_subscriptions.php       |  22 +-
 htdocs/adherents/cartes/carte.php             |   2 +-
 htdocs/adherents/cartes/etiquette.php         |   2 +-
 htdocs/adherents/cotisation.class.php         |  14 +-
 htdocs/adherents/cotisations.php              |  18 +-
 htdocs/adherents/fiche.php                    |  16 +-
 htdocs/adherents/fiche_subscription.php       |  16 +-
 htdocs/adherents/htpasswd.php                 |   2 +-
 htdocs/adherents/index.php                    |   6 +-
 htdocs/adherents/info.php                     |   2 +-
 htdocs/adherents/info_subscription.php        |   2 +-
 htdocs/adherents/ldap.php                     |   8 +-
 htdocs/adherents/liste.php                    |   6 +-
 htdocs/adherents/note.php                     |   2 +-
 htdocs/adherents/type.php                     |   6 +-
 htdocs/admin/agenda.php                       |   2 +-
 htdocs/admin/agenda_xcal.php                  |   2 +-
 htdocs/admin/bookmark.php                     |   2 +-
 htdocs/admin/boxes.php                        |  12 +-
 htdocs/admin/cashdesk.php                     |   2 +-
 htdocs/admin/clicktodial.php                  |   2 +-
 htdocs/admin/commande.php                     |   6 +-
 htdocs/admin/company.php                      |  20 +-
 htdocs/admin/confexped.php                    |   2 +-
 htdocs/admin/dict.php                         |  20 +-
 htdocs/admin/dons.php                         |   6 +-
 htdocs/admin/events.php                       |   2 +-
 htdocs/admin/expedition.php                   |  10 +-
 htdocs/admin/external_rss.php                 |  18 +-
 htdocs/admin/facture.php                      |  12 +-
 htdocs/admin/fichinter.php                    |   6 +-
 htdocs/admin/fournisseur.php                  |   8 +-
 htdocs/admin/import/dolibarrimport.class.php  |  14 +-
 htdocs/admin/ldap.php                         |   4 +-
 htdocs/admin/ldap_contacts.php                |   4 +-
 htdocs/admin/ldap_groups.php                  |   4 +-
 htdocs/admin/ldap_members.php                 |   4 +-
 htdocs/admin/ldap_users.php                   |   4 +-
 htdocs/admin/livraison.php                    |   8 +-
 htdocs/admin/mailing.php                      |   2 +-
 htdocs/admin/menus.php                        |   2 +-
 htdocs/admin/menus/edit.php                   |   4 +-
 htdocs/admin/menus/index.php                  |   2 +-
 htdocs/admin/modules.php                      |   4 +-
 htdocs/admin/notification.php                 |   2 +-
 htdocs/admin/paybox.php                       |   2 +-
 htdocs/admin/perms.php                        |   2 +-
 htdocs/admin/produit.php                      |   8 +-
 htdocs/admin/propale.php                      |   6 +-
 htdocs/admin/security.php                     |   6 +-
 htdocs/admin/security_other.php               |   4 +-
 htdocs/admin/societe.php                      |   6 +-
 htdocs/admin/stock.php                        |   4 +-
 htdocs/admin/syslog.php                       |   6 +-
 htdocs/admin/system/dolibarr.php              |   4 +-
 htdocs/admin/tools/eaccelerator.php           |  12 +-
 htdocs/admin/tools/export.php                 |   4 +-
 htdocs/admin/tools/listevents.php             |   4 +-
 htdocs/ajaxbox.php                            |   2 +-
 htdocs/bookmarks/bookmark.class.php           |  10 +-
 htdocs/bookmarks/bookmarks.lib.php            |   4 +-
 htdocs/bookmarks/fiche.php                    |   4 +-
 htdocs/bookmarks/liste.php                    |   8 +-
 htdocs/boutique/client/fiche.php              |   6 +-
 htdocs/boutique/client/index.php              |   2 +-
 htdocs/boutique/commande/ca.php               |   4 +-
 htdocs/boutique/commande/commande.class.php   |   2 +-
 htdocs/boutique/commande/index.php            |   4 +-
 htdocs/boutique/critiques/bestproduct.php     |   2 +-
 htdocs/boutique/critiques/index.php           |   2 +-
 htdocs/boutique/index.php                     |  12 +-
 htdocs/boutique/notification/index.php        |   2 +-
 htdocs/boutique/notification/produits.php     |   2 +-
 htdocs/boutique/osc_master.inc.php            |   2 +-
 htdocs/boutique/produits/index.php            |   2 +-
 htdocs/boutique/produits/osc-liste.php        |   2 +-
 htdocs/boutique/promotion/index.php           |   4 +-
 htdocs/boxes.php                              |  18 +-
 htdocs/cactioncomm.class.php                  |   2 +-
 htdocs/cashdesk/classes/Mysql.class.php       |   2 +-
 htdocs/cashdesk/deconnexion.php               |   4 +-
 htdocs/cashdesk/include/environnement.php     |   8 +-
 htdocs/cashdesk/index.php                     |   2 +-
 htdocs/categories/categorie.class.php         |  68 +-
 htdocs/categories/categorie.php               |   4 +-
 htdocs/categories/index.php                   |   4 +-
 htdocs/categories/liste.php                   |   4 +-
 htdocs/categories/viewcat.php                 |  14 +-
 htdocs/chargesociales.class.php               |  22 +-
 htdocs/client.class.php                       |   2 +-
 htdocs/comm/action/document.php               |   4 +-
 htdocs/comm/action/fiche.php                  |  28 +-
 htdocs/comm/action/index.php                  |  50 +-
 htdocs/comm/action/info.php                   |   2 +-
 htdocs/comm/action/listactions.php            |  10 +-
 htdocs/comm/action/rapport/index.php          |   4 +-
 htdocs/comm/addpropal.php                     |   4 +-
 htdocs/comm/adresse_livraison.class.php       |  32 +-
 htdocs/comm/adresse_livraison.php             |  12 +-
 htdocs/comm/bookmark.php                      |   4 +-
 htdocs/comm/clients.php                       |   4 +-
 htdocs/comm/contact.php                       |   2 +-
 htdocs/comm/fiche.php                         |  36 +-
 htdocs/comm/index.php                         |  22 +-
 htdocs/comm/mailing/cibles.php                |   6 +-
 htdocs/comm/mailing/fiche.php                 |  36 +-
 htdocs/comm/mailing/index.php                 |   8 +-
 htdocs/comm/mailing/liste.php                 |   4 +-
 htdocs/comm/mailing/mailing.class.php         |  18 +-
 htdocs/comm/multiprix.php                     |   6 +-
 htdocs/comm/propal.php                        |  62 +-
 htdocs/comm/propal/aideremise.php             |   2 +-
 htdocs/comm/propal/apercu.php                 |  10 +-
 htdocs/comm/propal/contact.php                |  12 +-
 htdocs/comm/propal/document.php               |   4 +-
 htdocs/comm/propal/info.php                   |   2 +-
 htdocs/comm/propal/note.php                   |   6 +-
 htdocs/comm/propal/stats/month.php            |   2 +-
 htdocs/comm/prospect/fiche.php                |  10 +-
 htdocs/comm/prospect/index.php                |   4 +-
 htdocs/comm/prospect/prospects.php            |  10 +-
 htdocs/comm/prospect/recap-prospect.php       |   4 +-
 htdocs/comm/recap-client.php                  |   4 +-
 htdocs/comm/remise.php                        |   6 +-
 htdocs/comm/remx.php                          |  12 +-
 htdocs/comm/stats.php                         |  24 +-
 htdocs/commande/apercu.php                    |  10 +-
 htdocs/commande/commande.class.php            |  94 +--
 htdocs/commande/contact.php                   |  12 +-
 htdocs/commande/document.php                  |   4 +-
 htdocs/commande/fiche.php                     |  54 +-
 htdocs/commande/index.php                     |   6 +-
 htdocs/commande/info.php                      |   2 +-
 htdocs/commande/liste.php                     |  10 +-
 htdocs/commande/note.php                      |   4 +-
 htdocs/commande/stats/month.php               |   2 +-
 htdocs/commonobject.class.php                 | 700 +++++++++---------
 htdocs/companybankaccount.class.php           |   4 +-
 htdocs/compta/bank/account.class.php          |  52 +-
 htdocs/compta/bank/account.php                |  20 +-
 htdocs/compta/bank/annuel.php                 |  10 +-
 htdocs/compta/bank/bankcateg.class.php        |  16 +-
 htdocs/compta/bank/bankid_fr.php              |   2 +-
 htdocs/compta/bank/budget.php                 |   2 +-
 htdocs/compta/bank/categ.php                  |   4 +-
 htdocs/compta/bank/fiche.php                  |   4 +-
 htdocs/compta/bank/graph.php                  |  38 +-
 htdocs/compta/bank/info.php                   |   2 +-
 htdocs/compta/bank/ligne.php                  |  16 +-
 htdocs/compta/bank/rappro.php                 |  14 +-
 htdocs/compta/bank/releve.php                 |  12 +-
 htdocs/compta/bank/search.php                 |   6 +-
 htdocs/compta/bank/treso.php                  |   6 +-
 htdocs/compta/bank/virement.php               |   2 +-
 htdocs/compta/charges/index.php               |   6 +-
 htdocs/compta/clients.php                     |   4 +-
 htdocs/compta/commande/fiche.php              |  18 +-
 htdocs/compta/commande/liste.php              |  10 +-
 htdocs/compta/comptacompte.class.php          |  10 +-
 .../compta/deplacement/deplacement.class.php  |   6 +-
 htdocs/compta/deplacement/fiche.php           |  12 +-
 htdocs/compta/deplacement/index.php           |   4 +-
 htdocs/compta/dons/fiche.php                  |  10 +-
 htdocs/compta/dons/index.php                  |   2 +-
 htdocs/compta/dons/liste.php                  |   4 +-
 htdocs/compta/dons/stats.php                  |   2 +-
 htdocs/compta/export/liste.php                |   4 +-
 .../export/modules/compta.export.class.php    |  10 +-
 .../modules/compta.export.poivre.class.php    |  22 +-
 htdocs/compta/facture.php                     |  96 +--
 htdocs/compta/facture/apercu.php              |  10 +-
 htdocs/compta/facture/contact.php             |  12 +-
 htdocs/compta/facture/document.php            |   4 +-
 htdocs/compta/facture/facture-rec.class.php   |  16 +-
 htdocs/compta/facture/fiche-rec.php           |   2 +-
 htdocs/compta/facture/impayees.php            |   8 +-
 htdocs/compta/facture/info.php                |   2 +-
 htdocs/compta/facture/note.php                |   2 +-
 htdocs/compta/facture/prelevement.php         |  16 +-
 htdocs/compta/facture/stats/month.php         |   2 +-
 htdocs/compta/fiche.php                       |  16 +-
 htdocs/compta/index.php                       | 182 ++---
 htdocs/compta/paiement.php                    |  12 +-
 htdocs/compta/paiement/avalider.php           |   2 +-
 htdocs/compta/paiement/cheque/fiche.php       |  20 +-
 htdocs/compta/paiement/cheque/index.php       |   6 +-
 htdocs/compta/paiement/cheque/liste.php       |   4 +-
 .../paiement/cheque/remisecheque.class.php    |  60 +-
 htdocs/compta/paiement/fiche.php              |   8 +-
 htdocs/compta/paiement/info.php               |   2 +-
 htdocs/compta/paiement/liste.php              |   4 +-
 htdocs/compta/paiement/rapport.php            |  10 +-
 htdocs/compta/paiement_charge.php             |   8 +-
 htdocs/compta/param/comptes/liste.php         |   4 +-
 .../prelevement/bon-prelevement.class.php     | 112 +--
 htdocs/compta/prelevement/bon.php             |   4 +-
 htdocs/compta/prelevement/bons.php            |   4 +-
 htdocs/compta/prelevement/create.php          |  10 +-
 htdocs/compta/prelevement/demandes.php        |   4 +-
 htdocs/compta/prelevement/factures.php        |   4 +-
 htdocs/compta/prelevement/facturesrejets.php  |   2 +-
 htdocs/compta/prelevement/fiche-rejet.php     |   4 +-
 htdocs/compta/prelevement/fiche-stat.php      |   2 +-
 htdocs/compta/prelevement/fiche.php           |  14 +-
 htdocs/compta/prelevement/index.php           |   6 +-
 .../prelevement/ligne-prelevement.class.php   |   6 +-
 htdocs/compta/prelevement/ligne.php           |  10 +-
 htdocs/compta/prelevement/lignes.php          |   4 +-
 htdocs/compta/prelevement/liste.php           |   4 +-
 htdocs/compta/prelevement/liste_factures.php  |   2 +-
 .../prelevement/rejet-prelevement.class.php   |  32 +-
 htdocs/compta/prelevement/rejets.php          |   2 +-
 htdocs/compta/prelevement/stats.php           |   4 +-
 htdocs/compta/propal.php                      |  42 +-
 htdocs/compta/recap-compta.php                |  12 +-
 htdocs/compta/resultat/clientfourn.php        |  18 +-
 htdocs/compta/resultat/index.php              |  32 +-
 htdocs/compta/sociales/charges.php            |  18 +-
 htdocs/compta/sociales/index.php              |   8 +-
 htdocs/compta/stats/cabyuser.php              |   4 +-
 htdocs/compta/stats/casoc.php                 |   4 +-
 htdocs/compta/stats/comm.php                  |  24 +-
 htdocs/compta/stats/comp.php                  |  12 +-
 htdocs/compta/stats/exercices.php             |  10 +-
 htdocs/compta/stats/index.php                 |  16 +-
 htdocs/compta/stats/prev.php                  |   2 +-
 htdocs/compta/tva/fiche.php                   |  12 +-
 htdocs/compta/tva/index.php                   |   6 +-
 htdocs/compta/tva/quadri.php                  |   6 +-
 htdocs/compta/tva/quadri_detail.php           |   8 +-
 htdocs/compta/tva/reglement.php               |   4 +-
 htdocs/compta/tva/tva.class.php               |  22 +-
 htdocs/compta/ventilation/lignes.php          |   4 +-
 htdocs/compta/ventilation/liste.php           |   4 +-
 htdocs/contact.class.php                      |  30 +-
 htdocs/contact/exportimport.php               |   2 +-
 htdocs/contact/fiche.php                      |   4 +-
 htdocs/contact/index.php                      |  10 +-
 htdocs/contact/info.php                       |   2 +-
 htdocs/contact/ldap.php                       |   4 +-
 htdocs/contact/perso.php                      |   6 +-
 htdocs/contrat/contact.php                    |  10 +-
 htdocs/contrat/contrat.class.php              |  14 +-
 htdocs/contrat/document.php                   |   2 +-
 htdocs/contrat/fiche.php                      |  78 +-
 htdocs/contrat/index.php                      |  20 +-
 htdocs/contrat/info.php                       |   2 +-
 htdocs/contrat/liste.php                      |   6 +-
 htdocs/contrat/note.php                       |   2 +-
 htdocs/contrat/services.php                   |  24 +-
 htdocs/core/dolgraph.class.php                |   4 +-
 htdocs/core/events.class.php                  |  16 +-
 htdocs/core/menubase.class.php                |  26 +-
 htdocs/discount.class.php                     |  22 +-
 .../pdf_courrier_droit_editeur.class.php      |  14 +-
 htdocs/docs/document.class.php                |   6 +-
 htdocs/docs/index.php                         |   4 +-
 htdocs/document.php                           |  14 +-
 htdocs/domain/index.php                       |   2 +-
 htdocs/don.class.php                          |  16 +-
 htdocs/ecm/docdir.php                         |   2 +-
 htdocs/ecm/docfile.php                        |  10 +-
 htdocs/ecm/docmine.php                        |  10 +-
 htdocs/ecm/docother.php                       |   2 +-
 htdocs/ecm/ecmdirectory.class.php             |  34 +-
 htdocs/ecm/index.php                          |  10 +-
 htdocs/ecm/search.php                         |   2 +-
 htdocs/energie/EnergieCompteur.class.php      |  20 +-
 htdocs/energie/EnergieGroupe.class.php        |   6 +-
 htdocs/energie/compteur.php                   |   6 +-
 htdocs/energie/compteur_graph.php             |   2 +-
 htdocs/energie/compteur_groupe.php            |   2 +-
 htdocs/energie/graph.php                      |   2 +-
 htdocs/energie/groupe.php                     |   4 +-
 htdocs/energie/releve.php                     |   4 +-
 htdocs/expedition/commande.php                |  16 +-
 htdocs/expedition/expedition.class.php        |  30 +-
 htdocs/expedition/fiche.php                   |  12 +-
 htdocs/expedition/index.php                   |   2 +-
 htdocs/expedition/liste.php                   |  10 +-
 .../stats/expeditionstats.class.php           |   4 +-
 htdocs/exports/export.class.php               |  26 +-
 htdocs/exports/export.php                     |  10 +-
 htdocs/facture.class.php                      |  20 +-
 htdocs/fichinter/apercu.php                   |  10 +-
 htdocs/fichinter/contact.php                  |  12 +-
 htdocs/fichinter/document.php                 |   2 +-
 htdocs/fichinter/fiche.php                    |  34 +-
 htdocs/fichinter/fichinter.class.php          |  82 +-
 htdocs/fichinter/index.php                    |  10 +-
 htdocs/fichinter/info.php                     |   2 +-
 htdocs/fichinter/note.php                     |   2 +-
 htdocs/fichinter/rapport.php                  |   6 +-
 htdocs/fourn/commande/contact.php             |  12 +-
 htdocs/fourn/commande/dispatch.php            |  10 +-
 htdocs/fourn/commande/document.php            |   6 +-
 htdocs/fourn/commande/fiche.php               |  24 +-
 htdocs/fourn/commande/history.php             |  10 +-
 htdocs/fourn/commande/index.php               |   4 +-
 htdocs/fourn/commande/liste.php               |   4 +-
 htdocs/fourn/commande/note.php                |   4 +-
 htdocs/fourn/contact.php                      |   2 +-
 htdocs/fourn/facture/contact.php              |  12 +-
 htdocs/fourn/facture/document.php             |   4 +-
 htdocs/fourn/facture/fiche.php                |  20 +-
 htdocs/fourn/facture/impayees.php             |  10 +-
 htdocs/fourn/facture/index.php                |  10 +-
 htdocs/fourn/facture/info.php                 |   2 +-
 htdocs/fourn/facture/note.php                 |   2 +-
 htdocs/fourn/facture/paiement.php             |  20 +-
 htdocs/fourn/facture/paiementfourn.class.php  |  32 +-
 htdocs/fourn/fiche-stats.php                  |   4 +-
 htdocs/fourn/fiche.php                        |  14 +-
 htdocs/fourn/fournisseur.class.php            |  18 +-
 htdocs/fourn/fournisseur.commande.class.php   | 106 +--
 htdocs/fourn/fournisseur.facture.class.php    |  48 +-
 htdocs/fourn/fournisseur.product.class.php    |  36 +-
 htdocs/fourn/index.php                        |   8 +-
 htdocs/fourn/liste.php                        |   4 +-
 htdocs/fourn/paiement/fiche.php               |  10 +-
 htdocs/fourn/paiement/info.php                |   2 +-
 htdocs/fourn/product/categorie.php            |   2 +-
 htdocs/fourn/product/fourn.php                |   4 +-
 htdocs/fourn/product/index.php                |   2 +-
 htdocs/fourn/product/liste.php                |   4 +-
 htdocs/fourn/product/photos.php               |   4 +-
 htdocs/fourn/recap-fourn.php                  |   4 +-
 htdocs/fourn/stats.php                        |   4 +-
 htdocs/html.form.class.php                    |  86 +--
 htdocs/html.formactions.class.php             |   8 +-
 htdocs/html.formcompany.class.php             |  34 +-
 htdocs/html.formfile.class.php                |   8 +-
 htdocs/html.formorder.class.php               |   4 +-
 htdocs/html.formother.class.php               |   4 +-
 htdocs/html.formproduct.class.php             |   6 +-
 .../barcode/html.formbarcode.class.php        |   2 +-
 .../barcode/php-barcode/php-barcode.php       |   4 +-
 htdocs/includes/boxes/box_actions.php         |  10 +-
 htdocs/includes/boxes/box_bookmarks.php       |   2 +-
 htdocs/includes/boxes/box_clients.php         |   4 +-
 htdocs/includes/boxes/box_commandes.php       |   4 +-
 htdocs/includes/boxes/box_comptes.php         |   4 +-
 htdocs/includes/boxes/box_external_rss.php    |  10 +-
 htdocs/includes/boxes/box_factures.php        |   4 +-
 htdocs/includes/boxes/box_factures_fourn.php  |   6 +-
 .../includes/boxes/box_factures_fourn_imp.php |   6 +-
 htdocs/includes/boxes/box_factures_imp.php    |   4 +-
 htdocs/includes/boxes/box_fournisseurs.php    |   4 +-
 htdocs/includes/boxes/box_osc_client.php      |   2 +-
 htdocs/includes/boxes/box_produits.php        |   4 +-
 htdocs/includes/boxes/box_propales.php        |   6 +-
 htdocs/includes/boxes/box_prospect.php        |   8 +-
 htdocs/includes/boxes/box_services_vendus.php |   4 +-
 htdocs/includes/boxes/modules_boxes.php       |   8 +-
 .../filemanager/connectors/php/config.php     |   2 +-
 htdocs/includes/login/functions_dolibarr.php  |  14 +-
 htdocs/includes/login/functions_forceuser.php |   2 +-
 htdocs/includes/login/functions_http.php      |   2 +-
 htdocs/includes/login/functions_ldap.php      |  18 +-
 .../modules/DolibarrModules.class.php         |  48 +-
 .../includes/modules/action/rapport.pdf.php   |  10 +-
 .../modules/cheque/pdf/pdf_blochet.class.php  |   4 +-
 .../modules/commande/mod_commande_marbre.php  |   4 +-
 .../modules/commande/modules_commande.php     |   4 +-
 .../modules/dons/html_cerfafr.modules.php     |   2 +-
 htdocs/includes/modules/dons/modules_don.php  |   4 +-
 .../expedition/methode_expedition.modules.php |   2 +-
 .../pdf/ModelePdfExpedition.class.php         |   4 +-
 .../modules/export/export_csv.modules.php     |   4 +-
 .../modules/export/export_excel.modules.php   |   4 +-
 .../modules/export/export_tsv.modules.php     |   4 +-
 .../modules/export/modules_export.php         |   6 +-
 .../modules/facture/modules_facture.php       |   6 +-
 .../modules/facture/pdf_crabe.modules.php     |   6 +-
 .../modules/facture/pdf_oursin.modules.php    |   4 +-
 .../modules/facture/terre/terre.modules.php   |   4 +-
 .../modules/fichinter/modules_fichinter.php   |   6 +-
 .../modules/fichinter/pdf_soleil.modules.php  |   4 +-
 .../modules/livraison/modules_livraison.php   |   4 +-
 .../livraison/pdf/pdf_sirocco.modules.php     |   2 +-
 .../livraison/pdf/pdf_typhon.modules.php      |   2 +-
 .../modules/mailings/fraise.modules.php       |   4 +-
 .../modules/mailings/kiwi.modules.php         |   4 +-
 .../modules/mailings/modules_mailings.php     |   8 +-
 .../modules/mailings/peche.modules.php        |   4 +-
 .../modules/mailings/poire.modules.php        |   6 +-
 .../modules/mailings/pomme.modules.php        |   4 +-
 .../modules/propale/mod_propale_marbre.php    |   4 +-
 .../modules/propale/modules_propale.php       |   6 +-
 .../modules/rapport/pdf_paiement.class.php    |   6 +-
 .../societe/mod_codeclient_elephant.php       |   2 +-
 .../modules/societe/mod_codeclient_monkey.php |   6 +-
 .../societe/mod_codecompta_aquarium.php       |  10 +-
 .../modules_commandefournisseur.php           |   4 +-
 .../interface_all_Logevents.class.php         |  66 +-
 .../interface_modAgenda_ActionsAuto.class.php |  46 +-
 .../interface_modLdap_Ldapsynchro.class.php   |  34 +-
 ...ace_modNotification_Notification.class.php |   8 +-
 ...nterface_modPhenix_Phenixsynchro.class.php |  46 +-
 ...ace_modWebcalendar_Webcalsynchro.class.php |  42 +-
 htdocs/index.php                              |   2 +-
 htdocs/install/etape0.php                     |   2 +-
 htdocs/install/etape1.php                     |   2 +-
 htdocs/install/inc.php                        |   2 +-
 htdocs/install/upgrade2.php                   |  60 +-
 htdocs/interfaces.class.php                   |  12 +-
 htdocs/lib/CMailFile.class.php                |  34 +-
 htdocs/lib/admin.lib.php                      |  26 +-
 htdocs/lib/agenda.lib.php                     |  12 +-
 htdocs/lib/antispamimage.php                  |   2 +-
 htdocs/lib/bank.lib.php                       |   2 +-
 htdocs/lib/bookmark.lib.php                   |   2 +-
 htdocs/lib/company.lib.php                    |  24 +-
 htdocs/lib/databases/mssql.lib.php            |  28 +-
 htdocs/lib/databases/mysql.lib.php            |  42 +-
 htdocs/lib/databases/mysqli.lib.php           |  42 +-
 htdocs/lib/databases/pgsql.lib.php            |  26 +-
 htdocs/lib/datepicker.php                     |  20 +-
 htdocs/lib/doleditor.class.php                |   2 +-
 htdocs/lib/files.lib.php                      |   2 +-
 htdocs/lib/functions.lib.php                  |  18 +-
 htdocs/lib/functions2.lib.php                 |  18 +-
 htdocs/lib/images.lib.php                     |   6 +-
 htdocs/lib/ldap.class.php                     |  34 +-
 htdocs/lib/pdf.lib.php                        |   6 +-
 htdocs/lib/price.lib.php                      |   2 +-
 htdocs/lib/product.lib.php                    |  12 +-
 htdocs/lib/project.lib.php                    |  10 +-
 htdocs/lib/report.lib.php                     |   4 +-
 htdocs/lib/security.lib.php                   |  10 +-
 htdocs/lib/sendings.lib.php                   |  14 +-
 htdocs/lib/tax.lib.php                        |  12 +-
 htdocs/lib/xcal.lib.php                       |  16 +-
 htdocs/livraison/fiche.php                    |  10 +-
 htdocs/livraison/livraison.class.php          |  42 +-
 htdocs/main.inc.php                           |   8 +-
 htdocs/master.inc.php                         |   4 +
 htdocs/notify.class.php                       |   6 +-
 htdocs/oscommerce_ws/clients/fiche.php        |   2 +-
 htdocs/oscommerce_ws/clients/index.php        |   6 +-
 .../clients/osc_customer.class.php            |   6 +-
 htdocs/oscommerce_ws/commandes/fiche.php      |   2 +-
 htdocs/oscommerce_ws/commandes/index.php      |   6 +-
 .../commandes/osc_order.class.php             |   6 +-
 htdocs/oscommerce_ws/index.php                |  20 +-
 htdocs/oscommerce_ws/produits/OSCvente.php    |   2 +-
 htdocs/oscommerce_ws/produits/categories.php  |   6 +-
 htdocs/oscommerce_ws/produits/fiche.php       |   2 +-
 htdocs/oscommerce_ws/produits/index.php       |   6 +-
 .../produits/osc_categories.class.php         |  20 +-
 .../produits/osc_product.class.php            |   6 +-
 htdocs/paiement.class.php                     |  26 +-
 htdocs/phenix/phenix.class.php                |  12 +-
 htdocs/postnuke/articles/index.php            |   2 +-
 htdocs/product.class.php                      |  68 +-
 htdocs/product/barcode.php                    |   2 +-
 htdocs/product/canvas/product.livre.class.php |  16 +-
 .../canvas/product.livrecontrat.class.php     |   2 +-
 htdocs/product/document.php                   |   2 +-
 .../product/droitpret/modules_droitpret.php   |   2 +-
 htdocs/product/fiche.php                      |  44 +-
 htdocs/product/fournisseurs.php               |   4 +-
 htdocs/product/index.php                      |   6 +-
 htdocs/product/liste.php                      |   6 +-
 htdocs/product/photos.php                     |   2 +-
 htdocs/product/price.php                      |   6 +-
 htdocs/product/reassort.php                   |   2 +-
 htdocs/product/sousproduits/fiche.php         |   4 +-
 htdocs/product/stats/commande.php             |  10 +-
 htdocs/product/stats/commande_fournisseur.php |  10 +-
 htdocs/product/stats/contrat.php              |  10 +-
 htdocs/product/stats/facture.php              |  10 +-
 htdocs/product/stats/facture_fournisseur.php  |  10 +-
 htdocs/product/stats/fiche.php                |   8 +-
 htdocs/product/stats/index.php                |   2 +-
 htdocs/product/stats/propal.php               |  10 +-
 htdocs/product/stock/entrepot.class.php       |  16 +-
 htdocs/product/stock/fiche-valo.php           |   4 +-
 htdocs/product/stock/fiche.php                |  12 +-
 htdocs/product/stock/index.php                |   6 +-
 htdocs/product/stock/info.php                 |   2 +-
 htdocs/product/stock/liste.php                |   2 +-
 htdocs/product/stock/mouvement.php            |   8 +-
 htdocs/product/stock/mouvementstock.class.php |  44 +-
 htdocs/product/stock/product.php              |  12 +-
 htdocs/product/stock/user.php                 |   6 +-
 htdocs/product/stock/valo.php                 |   2 +-
 htdocs/product/traduction.php                 |   2 +-
 htdocs/project.class.php                      |  48 +-
 htdocs/projet/activity/index.php              |  14 +-
 htdocs/projet/activity/list.php               |   2 +-
 htdocs/projet/element.php                     |   4 +-
 htdocs/projet/fiche.php                       |   2 +-
 htdocs/projet/index.php                       |   4 +-
 htdocs/projet/liste.php                       |   4 +-
 htdocs/projet/tasks/fiche.php                 |   4 +-
 htdocs/projet/tasks/index.php                 |   2 +-
 htdocs/projet/tasks/task.php                  |   6 +-
 htdocs/projet/tasks/who.php                   |   4 +-
 htdocs/propal.class.php                       |  92 +--
 htdocs/prospect.class.php                     |   2 +-
 htdocs/public/donations/donateurs_code.php    |   4 +-
 htdocs/public/members/public_list.php         |   2 +-
 htdocs/public/paybox/newpayment.php           |  14 +-
 htdocs/rapport/Atome.class.php                |   2 +-
 htdocs/searchpostalcode.php                   |   2 +-
 htdocs/service.class.php                      |   2 +-
 htdocs/soc.php                                |  12 +-
 htdocs/societe.class.php                      |  92 +--
 htdocs/societe.php                            |   2 +-
 htdocs/societe/ajaxcompanies.php              |   2 +-
 htdocs/societe/checkvat/checkVatPopup.php     |   4 +-
 htdocs/societe/commerciaux.php                |   6 +-
 htdocs/societe/document.php                   |   8 +-
 htdocs/societe/info.php                       |   2 +-
 htdocs/societe/lien.php                       |   4 +-
 htdocs/societe/notify/fiche.php               |  12 +-
 htdocs/societe/notify/index.php               |   2 +-
 htdocs/societe/rib.php                        |   2 +-
 htdocs/societe/socnote.php                    |   2 +-
 htdocs/stats.class.php                        |  20 +-
 htdocs/support/inc.php                        |   2 +-
 htdocs/task.class.php                         |  20 +-
 htdocs/telephonie/adsl/fiche.php              |   4 +-
 .../telephonie/adsl/fournisseurxdsl.class.php |   8 +-
 htdocs/telephonie/adsl/history.php            |   4 +-
 htdocs/telephonie/adsl/ligneadsl.class.php    |  12 +-
 htdocs/telephonie/adsl/liste.php              |   2 +-
 htdocs/telephonie/adsl/productxdsl.class.php  |   8 +-
 htdocs/telephonie/ca/index.php                |   2 +-
 htdocs/telephonie/client/commentaires.php     |   6 +-
 htdocs/telephonie/client/facture.php          |  36 +-
 htdocs/telephonie/client/factures.php         |   6 +-
 htdocs/telephonie/client/fiche.php            |   6 +-
 htdocs/telephonie/client/lignes.php           |  10 +-
 htdocs/telephonie/client/new.php              |   4 +-
 htdocs/telephonie/client/permissions.php      |   6 +-
 htdocs/telephonie/client/stats.php            |   2 +-
 htdocs/telephonie/client/tarifs.php           |   6 +-
 htdocs/telephonie/communication.class.php     |   8 +-
 htdocs/telephonie/config/perms.php            |   2 +-
 htdocs/telephonie/config/xdsl.php             |   2 +-
 htdocs/telephonie/config/xdsl_product.php     |   2 +-
 htdocs/telephonie/config/xdsl_wkf.php         |   2 +-
 htdocs/telephonie/contrat/fiche.php           |   8 +-
 htdocs/telephonie/contrat/info.php            |   2 +-
 htdocs/telephonie/contrat/services.php        |   2 +-
 htdocs/telephonie/contrat/stats.php           |   2 +-
 htdocs/telephonie/distributeurs/comm/ca.php   |   2 +-
 .../distributeurs/comm/commercial.php         |   2 +-
 .../telephonie/distributeurs/commissions.php  |   2 +-
 htdocs/telephonie/distributeurs/contrat.php   |   2 +-
 .../telephonie/distributeurs/distributeur.php |   2 +-
 htdocs/telephonie/distributeurs/fiche.php     |   4 +-
 htdocs/telephonie/distributeurs/index.php     |   2 +-
 htdocs/telephonie/distributeurs/po.php        |   2 +-
 htdocs/telephonie/distributeurs/remav.php     |   2 +-
 htdocs/telephonie/distributeurs/remconso.php  |   2 +-
 .../telephonie/distributeurs/remuneration.php |   2 +-
 htdocs/telephonie/distributeurs/stats.php     |   2 +-
 htdocs/telephonie/distributeurtel.class.php   |   6 +-
 htdocs/telephonie/dolibarrmail.class.php      |   8 +-
 .../facturation/FacturationCalcul.class.php   |  58 +-
 .../facturation/FacturationEmission.class.php |  70 +-
 .../FacturationImportCdr.class.php            |  38 +-
 .../facturation/FacturationVerifCdr.class.php |   4 +-
 htdocs/telephonie/facture/liste.php           |   2 +-
 htdocs/telephonie/facturetel.class.php        |   6 +-
 .../cdrformat/cdrformat.fructidor.class.php   |   6 +-
 .../cdrformat/cdrformat.messidor.class.php    |   6 +-
 .../commande/commande.tableur.class.php       |  14 +-
 .../commande/methode.commande.class.php       |   4 +-
 htdocs/telephonie/fournisseur/fiche.php       |   2 +-
 htdocs/telephonie/fournisseurtel.class.php    |   8 +-
 htdocs/telephonie/ligne/commande.php          |   4 +-
 htdocs/telephonie/ligne/commande/archives.php |   2 +-
 htdocs/telephonie/ligne/commande/fiche.php    |   2 +-
 .../telephonie/ligne/commande/historique.php  |   2 +-
 htdocs/telephonie/ligne/commande/liste.php    |   2 +-
 .../ligne/commande/retour/atraiter.php        |   2 +-
 .../ligne/commande/retour/liste.php           |   2 +-
 htdocs/telephonie/ligne/commentaires.php      |   4 +-
 htdocs/telephonie/ligne/conso.php             |   4 +-
 htdocs/telephonie/ligne/factures.php          |   4 +-
 htdocs/telephonie/ligne/fiche.php             |  10 +-
 htdocs/telephonie/ligne/groupe.php            |   2 +-
 htdocs/telephonie/ligne/history.php           |   4 +-
 htdocs/telephonie/ligne/index.php             |   2 +-
 htdocs/telephonie/ligne/infoc.php             |   4 +-
 htdocs/telephonie/ligne/liste.php             |   2 +-
 htdocs/telephonie/ligne/listecommande.php     |   2 +-
 htdocs/telephonie/ligne/numdata.php           |   2 +-
 htdocs/telephonie/ligne/remises.php           |   4 +-
 htdocs/telephonie/ligne/stat.php              |   4 +-
 htdocs/telephonie/lignetel.class.php          |  46 +-
 .../pdf/pdfdetail_nodet.modules.php           |   6 +-
 .../pdf/pdfdetail_papier.modules.php          |   2 +-
 .../pdf/pdfdetail_papier1.modules.php         |   2 +-
 .../pdf/pdfdetail_standard.modules.php        |   8 +-
 .../pdf/xlsdetail_nodet.modules.php           |   8 +-
 htdocs/telephonie/script/analyse-traffic.php  |   4 +-
 .../script/api/presel-activation-manuelle.php |  10 +-
 .../api/presel-resiliation-manuelle.php       |  10 +-
 .../script/api/presel-resiliation.php         |  22 +-
 htdocs/telephonie/script/bascule.php          |   2 +-
 htdocs/telephonie/script/commande_presel.php  |  34 +-
 htdocs/telephonie/script/commission.php       |  84 +--
 .../script/cron/presel-resiliation.php        |  22 +-
 htdocs/telephonie/script/delete_presel.php    |  22 +-
 .../script/envoi-emails-speciaux.php          |  16 +-
 .../telephonie/script/facturation-alerte.php  |   8 +-
 .../telephonie/script/facturation-analyse.php |   2 +-
 .../telephonie/script/facturation-calcul.php  |  56 +-
 .../script/facturation-correction-import.php  |   2 +-
 .../script/facturation-details-tableur.php    |  12 +-
 .../telephonie/script/facturation-details.php |  12 +-
 .../script/facturation-emission.php           |  66 +-
 .../script/facturation-import-cdr.php         |  50 +-
 .../script/facturation-impression.php         |  26 +-
 .../script/facturation-pre-consolidation.php  |   8 +-
 .../telephonie/script/facturation-verif.php   |  10 +-
 .../facture-detail-tableur-one.class.php      |  12 +-
 .../facture-detail-tableur-two.class.php      |  10 +-
 htdocs/telephonie/script/import-cdr-bt.php    |  62 +-
 htdocs/telephonie/script/import-cdr-ftp.php   |  64 +-
 htdocs/telephonie/script/import-cdr.php       |  50 +-
 .../telephonie/script/import-rename-cdr.php   |   8 +-
 htdocs/telephonie/script/plan-facturation.php |   2 +-
 htdocs/telephonie/script/rapport.php          |   2 +-
 htdocs/telephonie/script/retour-check.php     |  10 +-
 .../telephonie/script/retour-traitement.php   |  26 +-
 htdocs/telephonie/script/retour.php           | 164 ++--
 .../script/tools/update-contrat-contact.php   |   6 +-
 .../script/update-contrat-statut.php          |   2 +-
 htdocs/telephonie/script/update_presel.php    |  22 +-
 htdocs/telephonie/script/verif-import-cdr.php |   2 +-
 htdocs/telephonie/service/contrats.php        |   2 +-
 htdocs/telephonie/service/fiche.php           |   4 +-
 .../modules/ServiceFactureTableur.class.php   |  10 +-
 htdocs/telephonie/service/vendus.php          |   2 +-
 .../stats/ProcessGraphContrats.class.php      |   2 +-
 .../stats/ProcessGraphLignes.class.php        |   4 +-
 htdocs/telephonie/stats/clients/alerte.php    |   2 +-
 htdocs/telephonie/stats/clients/gain.php      |   2 +-
 htdocs/telephonie/stats/clients/index.php     |   2 +-
 htdocs/telephonie/stats/commerciaux/ca.php    |   2 +-
 .../stats/commerciaux/commercial.php          |   2 +-
 .../stats/commerciaux/commercialca.php        |   2 +-
 .../stats/commerciaux/commercialpo.php        |   2 +-
 .../telephonie/stats/commerciaux/contrats.php |   2 +-
 .../stats/commerciaux/groupes/groupe.php      |   2 +-
 htdocs/telephonie/stats/commerciaux/index.php |   2 +-
 .../telephonie/stats/commerciaux/lignes.php   |   2 +-
 .../telephonie/stats/commerciaux/mensuel.php  |   2 +-
 .../stats/communications/analyse.php          |   2 +-
 .../stats/communications/destmonth.php        |   2 +-
 .../telephonie/stats/communications/index.php |   2 +-
 .../stats/communications/lastmonth.php        |   2 +-
 .../stats/communications/rentabilite.php      |   2 +-
 .../telephonie/stats/consultation/index.php   |   2 +-
 htdocs/telephonie/stats/contrats/index.php    |   2 +-
 .../telephonie/stats/destinations/index.php   |   2 +-
 .../stats/distributeurs/commercial.php        |   2 +-
 .../stats/distributeurs/commercialca.php      |   2 +-
 .../stats/distributeurs/distributeur.php      |   2 +-
 .../distributeur.po.month.class.php           |   2 +-
 .../telephonie/stats/distributeurs/index.php  |   2 +-
 .../telephonie/stats/distributeurs/lignes.php |   2 +-
 .../stats/distributeurs/resultats.php         |   2 +-
 htdocs/telephonie/stats/factures/gain.php     |   2 +-
 htdocs/telephonie/stats/factures/index.php    |   2 +-
 .../telephonie/stats/factures/lastmonth.php   |   2 +-
 htdocs/telephonie/stats/factures/marge.php    |   2 +-
 htdocs/telephonie/stats/factures/type.php     |   2 +-
 .../telephonie/stats/fournisseurs/index.php   |   2 +-
 .../stats/graph/comm.nbmensuel.class.php      |   2 +-
 .../stats/graph/comm.nbminutes.class.php      |   4 +-
 htdocs/telephonie/stats/lignes/commande.php   |   2 +-
 .../stats/lignes/commandes.week.class.php     |   4 +-
 htdocs/telephonie/stats/lignes/index.php      |   2 +-
 .../telephonie/stats/lignes/resiliation.php   |   2 +-
 htdocs/telephonie/tarifs/config/grille.php    |   2 +-
 htdocs/telephonie/tarifs/fiche.php            |  10 +-
 htdocs/telephonie/tarifs/tarif-log.php        |   6 +-
 htdocs/telephonie/tarifs/tarif.php            |   2 +-
 htdocs/telephonie/telephonie-tarif.class.php  |   4 +-
 .../telephonie.commercial.class.php           |   2 +-
 .../telephonie/telephonie.contrat.class.php   |  22 +-
 .../telephonie/telephonie.service.class.php   |   2 +-
 htdocs/telephonie/telephonie.tarif.class.php  |  10 +-
 .../telephonie.tarif.grille.class.php         |  20 +-
 .../telephonie.tarif.prefix.class.php         |   4 +-
 htdocs/telephonie/workflowtel.class.php       |  10 +-
 htdocs/translate.class.php                    |   2 +-
 htdocs/user.class.php                         |  78 +-
 htdocs/user/addon.php                         |   2 +-
 htdocs/user/clicktodial.php                   |   2 +-
 htdocs/user/fiche.php                         |  12 +-
 htdocs/user/group/fiche.php                   |   6 +-
 htdocs/user/group/index.php                   |   4 +-
 htdocs/user/group/ldap.php                    |   4 +-
 htdocs/user/group/perms.php                   |   4 +-
 htdocs/user/home.php                          |   8 +-
 htdocs/user/index.php                         |   6 +-
 htdocs/user/info.php                          |   2 +-
 htdocs/user/ldap.php                          |   4 +-
 htdocs/user/logout.php                        |   4 +-
 htdocs/user/note.php                          |   2 +-
 htdocs/user/param_ihm.php                     |   2 +-
 htdocs/user/passwordforgotten.php             |   4 +-
 htdocs/user/perms.php                         |   6 +-
 htdocs/usergroup.class.php                    |  22 +-
 htdocs/viewimage.php                          |   8 +-
 htdocs/webcal/webcal.class.php                |  20 +-
 htdocs/webservices/client.php                 |   4 +-
 htdocs/webservices/server.php                 |   4 +-
 .../adherents/sync_member_dolibarr2ldap.php   |   6 +-
 .../adherents/sync_member_ldap2dolibarr.php   |   8 +-
 scripts/banque/graph-solde.php                |  16 +-
 scripts/books/droits-editeurs.php             |   4 +-
 .../company/sync_contacts_dolibarr2ldap.php   |   2 +-
 scripts/cron/stock-graph.php                  |   6 +-
 scripts/energie/graph-line.php                |   8 +-
 scripts/energie/graph.php                     |  12 +-
 .../factures-impayees-commerciaux.php         |  10 +-
 scripts/mailing/mailing-prepare.php           |   4 +-
 scripts/mailing/mailing-send.php              |  22 +-
 scripts/prelevement/prelevement-verif.php     |  30 +-
 scripts/prelevement/prelevement.php           |  50 +-
 scripts/user/sync_group_dolibarr2ldap.php     |   2 +-
 scripts/user/sync_user_dolibarr2ldap.php      |   2 +-
 742 files changed, 4487 insertions(+), 4479 deletions(-)

diff --git a/dev/load/generate-commande.php b/dev/load/generate-commande.php
index 5facdd96e95..16488da670c 100644
--- a/dev/load/generate-commande.php
+++ b/dev/load/generate-commande.php
@@ -175,7 +175,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
 	    $result=$com->add_product($prodids[$prodid],rand(1,11),rand(1,6),rand(0,20));
 		if ($result < 0)
 		{
-			dolibarr_print_error($db,$propal->error);
+			dol_print_error($db,$propal->error);
 		}
 		$xnbp++;
 	}
@@ -187,12 +187,12 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
 		if ($result) print " OK";
 		else
 		{
-			dolibarr_print_error($db,$com->error);
+			dol_print_error($db,$com->error);
 		}
 	}
 	else
 	{
-		dolibarr_print_error($db,$facture->error);
+		dol_print_error($db,$facture->error);
 	}
 
 	print "\n";
diff --git a/dev/load/generate-facture.php b/dev/load/generate-facture.php
index f0894a1ef17..7656d65b674 100644
--- a/dev/load/generate-facture.php
+++ b/dev/load/generate-facture.php
@@ -119,12 +119,12 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
 		if ($result) print " OK";
 		else
 		{
-			dolibarr_print_error($db,$facture->error);
+			dol_print_error($db,$facture->error);
 		}
 	}
 	else
 	{
-		dolibarr_print_error($db,$facture->error);
+		dol_print_error($db,$facture->error);
 	}
 	
 	print "\n";
diff --git a/dev/load/generate-propale.php b/dev/load/generate-propale.php
index 8bc83c4fcb5..8d26c74c6e2 100644
--- a/dev/load/generate-propale.php
+++ b/dev/load/generate-propale.php
@@ -149,7 +149,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
 			$result=$propal->addline($propal->id, 'Description '.$xnbp, '100', rand(1,5), '19.6', $prodids[$prodid], 0);
 			if ($result < 0)
 			{
-				dolibarr_print_error($db,$propal->error);
+				dol_print_error($db,$propal->error);
 			}
 			$xnbp++;
 		}
@@ -157,7 +157,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
 	}
 	else
 	{
-		dolibarr_print_error($db,$propal->error);
+		dol_print_error($db,$propal->error);
 	}
 
 	print "\n";
diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php
index f438c87b3f0..381173f22c4 100644
--- a/dev/skeletons/skeleton_class.class.php
+++ b/dev/skeletons/skeleton_class.class.php
@@ -94,7 +94,7 @@ class Skeleton_class // extends CommonObject
 
 		$this->db->begin();
 		
-	   	dolibarr_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
+	   	dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
         
@@ -121,7 +121,7 @@ class Skeleton_class // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
@@ -151,7 +151,7 @@ class Skeleton_class // extends CommonObject
         $sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
         $sql.= " WHERE t.rowid = ".$id;
     
-    	dolibarr_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
+    	dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -171,7 +171,7 @@ class Skeleton_class // extends CommonObject
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
+            dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -205,7 +205,7 @@ class Skeleton_class // extends CommonObject
 
 		$this->db->begin();
         
-		dolibarr_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
+		dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
         
@@ -230,7 +230,7 @@ class Skeleton_class // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
@@ -260,7 +260,7 @@ class Skeleton_class // extends CommonObject
 	
 		$this->db->begin();
 		
-		dolibarr_syslog(get_class($this)."::delete sql=".$sql);
+		dol_syslog(get_class($this)."::delete sql=".$sql);
 		$resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
 		
@@ -285,7 +285,7 @@ class Skeleton_class // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
diff --git a/dev/skeletons/skeleton_script.php b/dev/skeletons/skeleton_script.php
index f70e7549289..3cd7bfc440b 100644
--- a/dev/skeletons/skeleton_script.php
+++ b/dev/skeletons/skeleton_script.php
@@ -70,37 +70,37 @@ $myobject=new Skeleton_class($db);
 
 // Example for inserting creating object in database
 /*
-dolibarr_syslog($script_file." CREATE", LOG_DEBUG);
+dol_syslog($script_file." CREATE", LOG_DEBUG);
 $myobject->prop1='value_prop1';
 $myobject->prop2='value_prop2';
 $id=$myobject->create($user);
-if ($id < 0) dolibarr_print_error($db,$myobject->error);
+if ($id < 0) dol_print_error($db,$myobject->error);
 else print "Object created with id=".$id."\n";
 */
 
 // Example for reading object from database
 /*
-dolibarr_syslog($script_file." FETCH", LOG_DEBUG);
+dol_syslog($script_file." FETCH", LOG_DEBUG);
 $result=$myobject->fetch($id);
-if ($result < 0) dolibarr_print_error($db,$myobject->error);
+if ($result < 0) dol_print_error($db,$myobject->error);
 else print "Object with id=".$id." loaded\n";
 */
 
 // Example for updating object in database ($myobject must have been loaded by a fetch before)
 /*
-dolibarr_syslog($script_file." UPDATE", LOG_DEBUG);
+dol_syslog($script_file." UPDATE", LOG_DEBUG);
 $myobject->prop1='newvalue_prop1';
 $myobject->prop2='newvalue_prop2';
 $result=$myobject->update($user);
-if ($result < 0) dolibarr_print_error($db,$myobject->error);
+if ($result < 0) dol_print_error($db,$myobject->error);
 else print "Object with id ".$myobject->id." updated\n";
 */
 
 // Example for deleting object in database ($myobject must have been loaded by a fetch before)
 /*
-dolibarr_syslog($script_file." DELETE", LOG_DEBUG);
+dol_syslog($script_file." DELETE", LOG_DEBUG);
 $result=$myobject->delete($user);
-if ($result < 0) dolibarr_print_error($db,$myobject->error);
+if ($result < 0) dol_print_error($db,$myobject->error);
 else print "Object with id ".$myobject->id." deleted\n";
 */
 
@@ -112,7 +112,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."c_pays";
 $sql.= " WHERE field3 = 'xxx'";
 $sql.= " ORDER BY field1 ASC";
 
-dolibarr_syslog($script_file." sql=".$sql, LOG_DEBUG);
+dol_syslog($script_file." sql=".$sql, LOG_DEBUG);
 $resql=$db->query($sql);
 if ($resql)
 {
@@ -135,7 +135,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 	exit;
 }
 */
diff --git a/htdocs/accountancy/accountancyaccount.class.php b/htdocs/accountancy/accountancyaccount.class.php
index 44cbaf83edd..5b4dd0f3e79 100644
--- a/htdocs/accountancy/accountancyaccount.class.php
+++ b/htdocs/accountancy/accountancyaccount.class.php
@@ -79,14 +79,14 @@ class AccountancyAccount
 			{
 				$result = -2;
 				$this->error="AccountancyAccount::Create Erreur $result";
-				dolibarr_syslog($this->error);
+				dol_syslog($this->error);
 			}
 		}
 		else
 		{
 			$result = -1;
 			$this->error="AccountancyAccount::Create Erreur $result";
-			dolibarr_syslog($this->error);
+			dol_syslog($this->error);
 		}
 
 		return $result;
diff --git a/htdocs/accountancy/accountancysystem.class.php b/htdocs/accountancy/accountancysystem.class.php
index a43a767e429..838c76662b8 100644
--- a/htdocs/accountancy/accountancysystem.class.php
+++ b/htdocs/accountancy/accountancysystem.class.php
@@ -79,14 +79,14 @@ class AccountancySystem
 			{
 				$result = -2;
 				$this->error="AccountancySystem::Create Erreur $result";
-				dolibarr_syslog($this->error);
+				dol_syslog($this->error);
 			}
 		}
 		else
 		{
 			$result = -1;
 			$this->error="AccountancySystem::Create Erreur $result";
-			dolibarr_syslog($this->error);
+			dol_syslog($this->error);
 		}
 
 		return $result;
diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php
index 65b4dbb4df2..e7c7247e658 100644
--- a/htdocs/actioncomm.class.php
+++ b/htdocs/actioncomm.class.php
@@ -173,7 +173,7 @@ class ActionComm
         $sql.= ($this->orderrowid?$this->orderrowid:"null");
         $sql.= ")";
     
-        dolibarr_syslog("ActionComm::add sql=".$sql);
+        dol_syslog("ActionComm::add sql=".$sql);
         $resql=$this->db->query($sql);
 		if ($resql)
         {
@@ -226,7 +226,7 @@ class ActionComm
 		$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c";
 		$sql.= " WHERE a.id=".$id." AND a.fk_action=c.id";
 	
-		dolibarr_syslog("ActionComm::fetch sql=".$sql);
+		dol_syslog("ActionComm::fetch sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -307,7 +307,7 @@ class ActionComm
         $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
         $sql.= " WHERE id=".$this->id;
 
-        dolibarr_syslog("ActionComm::delete sql=".$sql, LOG_DEBUG);
+        dol_syslog("ActionComm::delete sql=".$sql, LOG_DEBUG);
         if ($this->db->query($sql))
         {
             return 1;
@@ -363,7 +363,7 @@ class ActionComm
 		$sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null");
         $sql.= " WHERE id=".$this->id;
     
-		dolibarr_syslog("ActionComm::update sql=".$sql);
+		dol_syslog("ActionComm::update sql=".$sql);
         if ($this->db->query($sql))
         {
             return 1;
@@ -371,7 +371,7 @@ class ActionComm
         else
         {
         	$this->error=$this->db->error();
-			dolibarr_syslog("ActionComm::update ".$this->error,LOG_ERR);
+			dol_syslog("ActionComm::update ".$this->error,LOG_ERR);
         	return -1;
     	}
     }
@@ -429,7 +429,7 @@ class ActionComm
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
 		$sql.= ' WHERE a.id = '.$id;
 
-		dolibarr_syslog("ActionComm::info sql=".$sql);
+		dol_syslog("ActionComm::info sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -457,7 +457,7 @@ class ActionComm
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -546,7 +546,7 @@ class ActionComm
         else
         {
         	$libelle=$this->libelle;
-        	$libelleshort=dolibarr_trunc($this->libelle,$maxlength);
+        	$libelleshort=dol_trunc($this->libelle,$maxlength);
         }
 		
 		if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAction").': '.$libelle,'task').$lienfin);
@@ -571,7 +571,7 @@ class ActionComm
 
 		require_once (DOL_DOCUMENT_ROOT ."/lib/xcal.lib.php");
 
-		dolibarr_syslog("ActionComm::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".sizeof($filters), LOG_DEBUG);
+		dol_syslog("ActionComm::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".sizeof($filters), LOG_DEBUG);
 
 		// Check parameters
 		if (empty($format)) return -1;
@@ -658,7 +658,7 @@ class ActionComm
 			//$sql.= " AND a.datep != 'null'";	// To exclude corrupted events and avoid errors in lightning/sunbird import
 			$sql.= " ORDER by datep";
 
-			dolibarr_syslog("ActionComm::build_exportfile select events sql=".$sql);
+			dol_syslog("ActionComm::build_exportfile select events sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -702,7 +702,7 @@ class ActionComm
 			else
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("ActionComm::build_exportfile ".$this->db->lasterror(), LOG_ERR);
+				dol_syslog("ActionComm::build_exportfile ".$this->db->lasterror(), LOG_ERR);
 				return -1;
 			}
 			
diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php
index 9d6e26d3501..14a58fee46c 100644
--- a/htdocs/adherents/adherent.class.php
+++ b/htdocs/adherents/adherent.class.php
@@ -278,7 +278,7 @@ class Adherent extends CommonObject
 		$sql.= " '".$user->id."',null,null,'".$this->morphy."'";
 		$sql.= ")";
 
-		dolibarr_syslog("Adherent::create sql=".$sql);
+		dol_syslog("Adherent::create sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -348,7 +348,7 @@ class Adherent extends CommonObject
 		$nbrowsaffected=0;
 		$error=0;
 
-		dolibarr_syslog("Adherent::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", email=".$this->email);
+		dol_syslog("Adherent::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", email=".$this->email);
 
 		// Verification parametres
 		if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email))
@@ -385,7 +385,7 @@ class Adherent extends CommonObject
 		$sql.= ", fk_user_mod=".$user->id;
 		$sql.= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Adherent::update sql=".$sql);
+		dol_syslog("Adherent::update sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -394,7 +394,7 @@ class Adherent extends CommonObject
 			if (sizeof($this->array_options) > 0)
 			{
 				$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."adherent_options WHERE adhid = ".$this->id;
-				dolibarr_syslog("Adherent::update sql=".$sql_del);
+				dol_syslog("Adherent::update sql=".$sql_del);
 				$this->db->query($sql_del);
 
 				$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options (adhid";
@@ -418,7 +418,7 @@ class Adherent extends CommonObject
 				}
 				$sql.=")";
 
-				dolibarr_syslog("Adherent::update sql=".$sql);
+				dol_syslog("Adherent::update sql=".$sql);
 				$resql = $this->db->query($sql);
 				if ($resql)
 				{
@@ -427,7 +427,7 @@ class Adherent extends CommonObject
 				else
 				{
 					$this->error=$this->db->error();
-					dolibarr_syslog("Adherent::update ".$this->error,LOG_ERR);
+					dol_syslog("Adherent::update ".$this->error,LOG_ERR);
 					$this->db->rollback();
 					return -2;
 				}
@@ -477,7 +477,7 @@ class Adherent extends CommonObject
 						if ($result < 0)
 						{
 							$this->error=$luser->error;
-							dolibarr_syslog("Adherent::update ".$this->error,LOG_ERR);
+							dol_syslog("Adherent::update ".$this->error,LOG_ERR);
 							$error++;
 						}
 					}
@@ -519,7 +519,7 @@ class Adherent extends CommonObject
 			$this->db->rollback();
 
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Adherent::update ".$this->error,LOG_ERR);
+			dol_syslog("Adherent::update ".$this->error,LOG_ERR);
 			return -1;
 		}
 	}
@@ -544,7 +544,7 @@ class Adherent extends CommonObject
 		$sql.= " WHERE fk_adherent='".$this->id."'";
 		$sql.= " ORDER by dateadh DESC";	// Sort by start subscription date
 
-		dolibarr_syslog("Adherent::update_end_date sql=".$sql);
+		dol_syslog("Adherent::update_end_date sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -555,7 +555,7 @@ class Adherent extends CommonObject
 			$sql.= " datefin=".($datefin != '' ? "'".$this->db->idate($datefin)."'" : "null");
 			$sql.= " WHERE rowid = ".$this->id;
 
-			dolibarr_syslog("Adherent::update_end_date sql=".$sql);
+			dol_syslog("Adherent::update_end_date sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -571,7 +571,7 @@ class Adherent extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Adherent::update_end_date ".$this->error, LOG_ERR);
+			dol_syslog("Adherent::update_end_date ".$this->error, LOG_ERR);
 			$this->db->rollback();
 			return -1;
 		}
@@ -593,17 +593,17 @@ class Adherent extends CommonObject
 		// Suppression options
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_options WHERE adhid = ".$rowid;
 
-		dolibarr_syslog("Adherent::delete sql=".$sql);
+		dol_syslog("Adherent::delete sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."cotisation WHERE fk_adherent = ".$rowid;
-			dolibarr_syslog("Adherent::delete sql=".$sql);
+			dol_syslog("Adherent::delete sql=".$sql);
 			$resql=$this->db->query( $sql);
 			if ($resql)
 			{
 				$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
-				dolibarr_syslog("Adherent::delete sql=".$sql);
+				dol_syslog("Adherent::delete sql=".$sql);
 				$resql=$this->db->query($sql);
 				if ($resql)
 				{
@@ -669,7 +669,7 @@ class Adherent extends CommonObject
 
 		$error=0;
 
-		dolibarr_syslog("Adherent::Password user=".$user->id." password=".eregi_replace('.','*',$password)." isencrypted=".$isencrypted);
+		dol_syslog("Adherent::Password user=".$user->id." password=".eregi_replace('.','*',$password)." isencrypted=".$isencrypted);
 
 		// Si nouveau mot de passe non communique, on genere par module
 		if (! $password)
@@ -695,8 +695,8 @@ class Adherent extends CommonObject
 		$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET pass = '".addslashes($password_indatabase)."'";
 		$sql.= " WHERE rowid = ".$this->id;
 
-		//dolibarr_syslog("Adherent::Password sql=hidden");
-		dolibarr_syslog("Adherent::Password sql=".$sql);
+		//dol_syslog("Adherent::Password sql=hidden");
+		dol_syslog("Adherent::Password sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -723,7 +723,7 @@ class Adherent extends CommonObject
 						if ($result < 0)
 						{
 							$this->error=$luser->error;
-							dolibarr_syslog("Adherent::password ".$this->error,LOG_ERR);
+							dol_syslog("Adherent::password ".$this->error,LOG_ERR);
 							$error++;
 						}
 					}
@@ -753,7 +753,7 @@ class Adherent extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -779,7 +779,7 @@ class Adherent extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -810,7 +810,7 @@ class Adherent extends CommonObject
 		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
 		$sql.= " WHERE d.fk_adherent_type = t.rowid";
 		$sql.= " AND d.rowid = ".$rowid;
-		dolibarr_syslog("Adherent::fetch sql=".$sql);
+		dol_syslog("Adherent::fetch sql=".$sql);
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -898,7 +898,7 @@ class Adherent extends CommonObject
 		$sql.= " FROM ".MAIN_DB_PREFIX."cotisation as c";
 		$sql.= " WHERE c.fk_adherent = ".$this->id;
 		$sql.= " ORDER BY c.dateadh";
-		dolibarr_syslog("Adherent::fetch_subscriptions sql=".$sql);
+		dol_syslog("Adherent::fetch_subscriptions sql=".$sql);
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -939,7 +939,7 @@ class Adherent extends CommonObject
 		$sql.= " FROM ".MAIN_DB_PREFIX."adherent_options";
 		$sql.= " WHERE adhid=".$rowid;
 
-		dolibarr_syslog("Adherent::fetch_optionals sql=".$sql, LOG_DEBUG);
+		dol_syslog("Adherent::fetch_optionals sql=".$sql, LOG_DEBUG);
 		$result=$this->db->query( $sql);
 		if ($result)
 		{
@@ -959,7 +959,7 @@ class Adherent extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 	}
@@ -1038,7 +1038,7 @@ class Adherent extends CommonObject
 							// Met a jour la table cotisation
 							$sql="UPDATE ".MAIN_DB_PREFIX."cotisation SET fk_bank=".$insertid." WHERE rowid=".$rowid;
 
-							dolibarr_syslog("Adherent::cotisation sql=".$sql);
+							dol_syslog("Adherent::cotisation sql=".$sql);
 							$resql = $this->db->query($sql);
 							if (! $resql)
 							{
@@ -1104,7 +1104,7 @@ class Adherent extends CommonObject
 
 		if ($this->statut == 1)
 		{
-			dolibarr_syslog("Adherent::validate statut of member does not allow this", LOG_WARNING);
+			dol_syslog("Adherent::validate statut of member does not allow this", LOG_WARNING);
 			return 0;
 		}
 
@@ -1115,7 +1115,7 @@ class Adherent extends CommonObject
 		$sql.= " fk_user_valid=".$user->id;
 		$sql.= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Adherent::validate sql=".$sql);
+		dol_syslog("Adherent::validate sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -1153,7 +1153,7 @@ class Adherent extends CommonObject
 
 		if ($this->statut == 0)
 		{
-			dolibarr_syslog("Adherent::resiliate statut of member does not allow this", LOG_WARNING);
+			dol_syslog("Adherent::resiliate statut of member does not allow this", LOG_WARNING);
 			return 0;
 		}
 
@@ -1276,7 +1276,7 @@ class Adherent extends CommonObject
 	{
 		require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
 
-		dolibarr_syslog("Adherent::add_to_spip");
+		dol_syslog("Adherent::add_to_spip");
 
 		if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
 		defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
@@ -1388,7 +1388,7 @@ class Adherent extends CommonObject
 	{
 		global $conf,$langs;
 
-		dolibarr_syslog("Adherent::add_to_mailman");
+		dol_syslog("Adherent::add_to_mailman");
 
 		if (! function_exists("curl_init"))
 		{
@@ -1437,7 +1437,7 @@ class Adherent extends CommonObject
 				//--- Start buffering
 				//ob_start();
 				$result=curl_exec ($ch);
-				dolibarr_syslog($result);
+				dol_syslog($result);
 				//--- End buffering and clean output
 				//ob_end_clean();
 				if (curl_error($ch) > 0)
@@ -1505,7 +1505,7 @@ class Adherent extends CommonObject
 				//--- Start buffering
 				//ob_start();
 				$result=curl_exec ($ch);
-				dolibarr_syslog($result);
+				dol_syslog($result);
 				//--- End buffering and clean output
 				//ob_end_clean();
 				if (curl_error($ch) > 0)
@@ -1567,7 +1567,7 @@ class Adherent extends CommonObject
 
 		if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
 		if ($withpicto && $withpicto != 2) $result.=' ';
-		$result.=$lien.($maxlen?dolibarr_trunc($this->ref,$maxlen):$this->ref).$lienfin;
+		$result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
 		return $result;
 	}
 
@@ -1687,7 +1687,7 @@ class Adherent extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -1723,7 +1723,7 @@ class Adherent extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -1826,14 +1826,14 @@ class Adherent extends CommonObject
 		if ($this->phone_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->phone_mobile;
 		if ($this->fax && $conf->global->LDAP_FIELD_FAX)	      $info[$conf->global->LDAP_FIELD_FAX] = $this->fax;
 		if ($this->note && $conf->global->LDAP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note;
-		if ($this->naiss && $conf->global->LDAP_FIELD_BIRTHDATE)  $info[$conf->global->LDAP_FIELD_BIRTHDATE] = dolibarr_print_date($this->naiss,'dayhourldap');
+		if ($this->naiss && $conf->global->LDAP_FIELD_BIRTHDATE)  $info[$conf->global->LDAP_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap');
 		if (isset($this->statut) && $conf->global->LDAP_FIELD_MEMBER_STATUS)  $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
-		if ($this->datefin && $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)  $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dolibarr_print_date($this->datefin,'dayhourldap');
+		if ($this->datefin && $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)  $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
 
 		// Subscriptions
-		if ($this->firstsubscription_date && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)     $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]  = dolibarr_print_date($this->firstsubscription_date,'dayhourldap');
+		if ($this->firstsubscription_date && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)     $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]  = dol_print_date($this->firstsubscription_date,'dayhourldap');
 		if (isset($this->firstsubscription_amount) && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->firstsubscription_amount;
-		if ($this->lastsubscription_date && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)       $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE]   = dolibarr_print_date($this->lastsubscription_date,'dayhourldap');
+		if ($this->lastsubscription_date && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)       $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE]   = dol_print_date($this->lastsubscription_date,'dayhourldap');
 		if (isset($this->lastsubscription_amount) && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT)   $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->lastsubscription_amount;
 
 		return $info;
@@ -1853,7 +1853,7 @@ class Adherent extends CommonObject
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'adherent as a';
 		$sql.= ' WHERE a.rowid = '.$id;
 
-		dolibarr_syslog("Adherent::info sql=".$sql, LOG_DEBUG);
+		dol_syslog("Adherent::info sql=".$sql, LOG_DEBUG);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -1892,7 +1892,7 @@ class Adherent extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
diff --git a/htdocs/adherents/adherent_options.class.php b/htdocs/adherents/adherent_options.class.php
index 55e2ef72ee5..a68aaf6395d 100644
--- a/htdocs/adherents/adherent_options.class.php
+++ b/htdocs/adherents/adherent_options.class.php
@@ -150,14 +150,14 @@ class AdherentOptions
 					break;
 			}
 
-			dolibarr_syslog("AdherentOptions::create sql=".$sql, LOG_DEBUG);
+			dol_syslog("AdherentOptions::create sql=".$sql, LOG_DEBUG);
 			if ($this->db->query($sql))
 			{
 				return 1;
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				return 0;
 			}
 		}else{
@@ -182,14 +182,14 @@ class AdherentOptions
 			$sql .= " name='$attrname', label='".addslashes($label)."',";
 			$sql .= " type='".$type."', pos='".$pos."', size='".$size."'";
 
-			dolibarr_syslog("AdherentOptions::create_label sql=".$sql);
+			dol_syslog("AdherentOptions::create_label sql=".$sql);
 			if ($this->db->query($sql))
 			{
 				return 1;
 			}
 			else
 			{
-				print dolibarr_print_error($this->db);
+				print dol_print_error($this->db);
 				return 0;
 			}
 		}
@@ -207,7 +207,7 @@ class AdherentOptions
 			if ($result < 0)
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("AdherentOption::delete ".$this->error, LOG_ERR);
+				dol_syslog("AdherentOption::delete ".$this->error, LOG_ERR);
 			}
 
 			$result=$this->delete_label($attrname);
@@ -236,7 +236,7 @@ class AdherentOptions
 			}
 			else
 			{
-				print dolibarr_print_error($this->db);
+				print dol_print_error($this->db);
 				return 0;
 			}
 		}else{
@@ -277,7 +277,7 @@ class AdherentOptions
 			}
 			else
 			{
-				print dolibarr_print_error($this->db);
+				print dol_print_error($this->db);
 				return 0;
 			}
 		}else{
@@ -308,7 +308,7 @@ class AdherentOptions
 			}
 			else
 			{
-				print dolibarr_print_error($this->db);
+				print dol_print_error($this->db);
 				return 0;
 			}
 		}else{
@@ -336,7 +336,7 @@ class AdherentOptions
 		$sql = "SELECT name,label,type FROM ".MAIN_DB_PREFIX."adherent_options_label";
 		$sql.= " ORDER BY pos";
 
-		dolibarr_syslog("Adherent_options::fetch_name_optionals_label");
+		dol_syslog("Adherent_options::fetch_name_optionals_label");
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -354,7 +354,7 @@ class AdherentOptions
 				return array();
 			}
 		}else{
-			print dolibarr_print_error($this->db);
+			print dol_print_error($this->db);
 			return array() ;
 		}
 
diff --git a/htdocs/adherents/adherent_type.class.php b/htdocs/adherents/adherent_type.class.php
index 8d924454930..f529f049784 100644
--- a/htdocs/adherents/adherent_type.class.php
+++ b/htdocs/adherents/adherent_type.class.php
@@ -86,7 +86,7 @@ class AdherentType extends CommonObject
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (libelle)";
 		$sql.= " VALUES ('".addslashes($this->libelle)."')";
 
-		dolibarr_syslog("Adherent_type::create sql=".$sql);
+		dol_syslog("Adherent_type::create sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -170,7 +170,7 @@ class AdherentType extends CommonObject
 		$sql = "SELECT d.rowid, d.libelle, d.statut, d.cotisation, d.mail_valid, d.note, d.vote";
 		$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
 		$sql .= " WHERE d.rowid = ".$rowid;
-		dolibarr_syslog("Adherent_type::fetch sql=".$sql);
+		dol_syslog("Adherent_type::fetch sql=".$sql);
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -255,7 +255,7 @@ class AdherentType extends CommonObject
 
 		if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
 		if ($withpicto && $withpicto != 2) $result.=' ';
-		$result.=$lien.($maxlen?dolibarr_trunc($this->libelle,$maxlen):$this->libelle).$lienfin;
+		$result.=$lien.($maxlen?dol_trunc($this->libelle,$maxlen):$this->libelle).$lienfin;
 		return $result;
 	}
 
diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index 4415074f86a..f1b334574b7 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -73,11 +73,11 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio
 	$datesubend=0;
 	if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"])
 	{
-		$datecotisation=dolibarr_mktime(0, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+		$datecotisation=dol_mktime(0, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 	}
 	if ($_POST["endyear"] && $_POST["endmonth"] && $_POST["endday"])
 	{
-		$datesubend=dolibarr_mktime(0, 0, 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
+		$datesubend=dol_mktime(0, 0, 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
 	}
 	$cotisation=$_POST["cotisation"];	// Amount of subscription
 	$label=$_POST["label"];
@@ -186,7 +186,7 @@ $adho->fetch_optionals();
  */
 $head = member_prepare_head($adh);
 
-dolibarr_fiche_head($head, 'subscription', $langs->trans("Member"));
+dol_fiche_head($head, 'subscription', $langs->trans("Member"));
 
 print '<form action="fiche.php" method="post">';
 print '<table class="border" width="100%">';
@@ -310,8 +310,8 @@ if ($result)
 		$cotisationstatic->ref=$objp->crowid;
 		$cotisationstatic->id=$objp->crowid;
 		print '<td>'.$cotisationstatic->getNomUrl(1).'</td>';
-		print '<td align="center">'.dolibarr_print_date($objp->dateadh,'day')."</td>\n";
-		print '<td align="center">'.dolibarr_print_date($objp->datef,'day')."</td>\n";
+		print '<td align="center">'.dol_print_date($objp->dateadh,'day')."</td>\n";
+		print '<td align="center">'.dol_print_date($objp->datef,'day')."</td>\n";
 		print '<td align="right">'.price($objp->cotisation).'</td>';
 		if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
 		{
@@ -335,7 +335,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '</td><td valign="top">';
@@ -350,12 +350,12 @@ if ($adh->datefin)
 {
 	if ($adh->datefin < time())
 	{
-		print dolibarr_print_date($adh->datefin,'day');
+		print dol_print_date($adh->datefin,'day');
 		if ($adh->statut > 0) print " ".img_warning($langs->trans("Late"));	// Affiche picto retard uniquement si non brouillon et non resilie
 	}
 	else
 	{
-		print dolibarr_print_date($adh->datefin,'day');
+		print dol_print_date($adh->datefin,'day');
 	}
 }
 else
@@ -392,7 +392,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
 	print '<tr><td>'.$langs->trans("DateSubscription").'</td><td>';
 	if ($_POST["reday"])
 	{
-		$datefrom=dolibarr_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+		$datefrom=dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 	}
 	if (! $datefrom)
 	{
@@ -411,7 +411,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
 	// Date end subscription
 	if ($_POST["endday"])
 	{
-		$dateto=dolibarr_mktime(0,0,0,$_POST["endmonth"],$_POST["endday"],$_POST["endyear"]);
+		$dateto=dol_mktime(0,0,0,$_POST["endmonth"],$_POST["endday"],$_POST["endyear"]);
 	}
 	if (! $dateto)
 	{
@@ -430,7 +430,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
 		// Label
 		print '<tr><td>'.$langs->trans("Label").'</td>';
 		print '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' ';
-		print dolibarr_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
+		print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
 		
 		// Bank account
 		if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php
index 6f64e9cb091..6f99893a703 100755
--- a/htdocs/adherents/cartes/carte.php
+++ b/htdocs/adherents/cartes/carte.php
@@ -146,7 +146,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 
 	llxFooter('$Date$ - $Revision$');
 }
diff --git a/htdocs/adherents/cartes/etiquette.php b/htdocs/adherents/cartes/etiquette.php
index 41eaf032383..82021d7c1fd 100755
--- a/htdocs/adherents/cartes/etiquette.php
+++ b/htdocs/adherents/cartes/etiquette.php
@@ -114,7 +114,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 
 	llxFooter('$Date$ - $Revision$');
 }
diff --git a/htdocs/adherents/cotisation.class.php b/htdocs/adherents/cotisation.class.php
index c24c8502a13..fa714961ef1 100644
--- a/htdocs/adherents/cotisation.class.php
+++ b/htdocs/adherents/cotisation.class.php
@@ -76,7 +76,7 @@ class Cotisation extends CommonObject
 		$sql.= " ".$this->db->idate($this->datef).",";
 		$sql.= " ".$this->amount.",'".$this->note."')";
 
-		dolibarr_syslog("Cotisation::create sql=".$sql);
+		dol_syslog("Cotisation::create sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -85,7 +85,7 @@ class Cotisation extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog($this->error);
+			dol_syslog($this->error);
 			return -1;
 		}
 	}
@@ -106,7 +106,7 @@ class Cotisation extends CommonObject
 		$sql.=" FROM ".MAIN_DB_PREFIX."cotisation";
 		$sql.="	WHERE rowid=".$rowid;
 
-		dolibarr_syslog("Cotisation::fetch sql=".$sql);
+		dol_syslog("Cotisation::fetch sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -160,7 +160,7 @@ class Cotisation extends CommonObject
 		$sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
 		$sql .= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Cotisation::update sql=".$sql);
+		dol_syslog("Cotisation::update sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -175,7 +175,7 @@ class Cotisation extends CommonObject
 		{
 			$this->db->rollback();
 			$this->error=$this->db->error();
-			dolibarr_syslog("Cotisation::update ".$this->error);
+			dol_syslog("Cotisation::update ".$this->error);
 			return -1;
 		}
 	}
@@ -198,7 +198,7 @@ class Cotisation extends CommonObject
 		$this->db->begin();
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."cotisation WHERE rowid = ".$this->id;
-		dolibarr_syslog("Cotisation::delete sql=".$sql);
+		dol_syslog("Cotisation::delete sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -293,7 +293,7 @@ class Cotisation extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}	
 }
diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php
index e8ed78a8faa..71c46c94863 100644
--- a/htdocs/adherents/cotisations.php
+++ b/htdocs/adherents/cotisations.php
@@ -100,7 +100,7 @@ if ($allowinsertbankafter && $_POST["action"] == '2bank' && $_POST["rowid"] !=''
 				$insertid=$acct->addline($dateop, $_POST["paymenttypeid"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE,$user);
 				if ($insertid < 0)
 				{
-					dolibarr_print_error($db,$acct->error);
+					dol_print_error($db,$acct->error);
 				}
 				else
 				{
@@ -111,7 +111,7 @@ if ($allowinsertbankafter && $_POST["action"] == '2bank' && $_POST["rowid"] !=''
 					$sql.=" SET fk_bank=".$insertid.",";
 					$sql.=" note='".addslashes($_POST["label"])."'";
 					$sql.=" WHERE rowid=".$_POST["rowid"];
-					dolibarr_syslog("cotisations sql=".$sql);
+					dol_syslog("cotisations sql=".$sql);
 					$result = $db->query($sql);
 					if ($result)
 					{
@@ -121,14 +121,14 @@ if ($allowinsertbankafter && $_POST["action"] == '2bank' && $_POST["rowid"] !=''
 					else
 					{
 						$db->rollback();
-						dolibarr_print_error($db);
+						dol_print_error($db);
 					}
 				}
 	        }
 	        else
 	        {
 				$db->rollback();
-	            dolibarr_print_error($db,$cotisation->error);
+	            dol_print_error($db,$cotisation->error);
 	        }
 		}
     }
@@ -226,14 +226,14 @@ if ($result)
 		print '<td>';
         if ($allowinsertbankafter && $user->rights->banque->modifier && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation)
 		{
-			print "<input name=\"label\" type=\"text\" class=\"flat\" size=\"30\" value=\"".$langs->trans("Subscriptions").' '.dolibarr_print_date($objp->dateadh,"%Y")."\" >\n";
+			print "<input name=\"label\" type=\"text\" class=\"flat\" size=\"30\" value=\"".$langs->trans("Subscriptions").' '.dol_print_date($objp->dateadh,"%Y")."\" >\n";
 	                //	print "<td><input name=\"debit\" type=\"text\" size=8></td>";
 	                //	print "<td><input name=\"credit\" type=\"text\" size=8></td>";
 			print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
 		}
 		else
 		{
-			print dolibarr_trunc($objp->note,32);
+			print dol_trunc($objp->note,32);
 		}
 		print '</td>';
 
@@ -269,10 +269,10 @@ if ($result)
         }
 
 		// Date start
-		print '<td align="center">'.dolibarr_print_date($objp->dateadh,'day')."</td>\n";
+		print '<td align="center">'.dol_print_date($objp->dateadh,'day')."</td>\n";
         
 		// Date end
-		print '<td align="center">'.dolibarr_print_date($objp->datef,'day')."</td>\n";
+		print '<td align="center">'.dol_print_date($objp->datef,'day')."</td>\n";
 
 		// Price
 		print '<td align="right">'.price($objp->cotisation).'</td>';
@@ -308,7 +308,7 @@ if ($result)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index d8aa740126b..f5693adf882 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -140,7 +140,7 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"])
 			&& isset($_POST["naissmonth"]) && $_POST["naissmonth"]
 			&& isset($_POST["naissyear"]) && $_POST["naissyear"])
 		{
-			$datenaiss=dolibarr_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
+			$datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
 		}
 		//print $_POST["naissmonth"].", ".$_POST["naissday"].", ".$_POST["naissyear"]." ".$datenaiss." ".adodb_strftime('%Y-%m-%d %H:%M:%S',$datenaiss);
 
@@ -236,12 +236,12 @@ if ($user->rights->adherent->creer && $_POST["action"] == 'add')
 		&& isset($_POST["naissmonth"]) && $_POST["naissmonth"]
 		&& isset($_POST["naissyear"]) && $_POST["naissyear"])
 	{
-		$datenaiss=dolibarr_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
+		$datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
 	}
 	$datecotisation='';
 	if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"]))
     {
-		$datecotisation=dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+		$datecotisation=dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 	}
 
     $type=$_POST["type"];
@@ -352,7 +352,7 @@ if ($user->rights->adherent->creer && $_POST["action"] == 'add')
                     $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"], '', $user);
                     if ($insertid == '')
                     {
-                        dolibarr_print_error($db);
+                        dol_print_error($db);
                     }
                     else
                     {
@@ -366,7 +366,7 @@ if ($user->rights->adherent->creer && $_POST["action"] == 'add')
                         }
                         else
                         {
-                            dolibarr_print_error($db);
+                            dol_print_error($db);
                         }
                     }
                 }
@@ -573,7 +573,7 @@ if ($action == 'edit')
 	 */
 	$head = member_prepare_head($adh);
 
-	dolibarr_fiche_head($head, 'general', $langs->trans("Member"));
+	dol_fiche_head($head, 'general', $langs->trans("Member"));
 
 
 	print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
@@ -837,7 +837,7 @@ if ($rowid && $action != 'edit')
 	 */
 	$head = member_prepare_head($adh);
 
-	dolibarr_fiche_head($head, 'general', $langs->trans("Member"));
+	dol_fiche_head($head, 'general', $langs->trans("Member"));
 
 	if ($msg) print '<div class="error">'.$msg.'</div>';
 
@@ -1003,7 +1003,7 @@ if ($rowid && $action != 'edit')
     print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($adh->email,0,$adh->fk_soc,1).'</td></tr>';
 
 	// Date naissance
-    print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dolibarr_print_date($adh->naiss,'day').'</td></tr>';
+    print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($adh->naiss,'day').'</td></tr>';
 
     // Public
     print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($adh->public).'</td></tr>';
diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php
index 8bb13a5f4f7..3175a53d2c0 100644
--- a/htdocs/adherents/fiche_subscription.php
+++ b/htdocs/adherents/fiche_subscription.php
@@ -72,8 +72,8 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
 			}
 			else
 			{
-				$accountline->datev=dolibarr_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
-				$accountline->dateo=dolibarr_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
+				$accountline->datev=dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
+				$accountline->dateo=dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
 				$accountline->amount=$_POST["amount"];
 				$result=$accountline->update($user);
 				if ($result < 0)
@@ -86,8 +86,8 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
 		if (! $errmsg)
 		{
 			// Modifie valeures
-			$subscription->dateh=dolibarr_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
-			$subscription->datef=dolibarr_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']);
+			$subscription->dateh=dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
+			$subscription->datef=dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']);
 			$subscription->note=$_POST["note"];
 			$subscription->amount=$_POST["amount"];
 			//print 'datef='.$subscription->datef.' '.$_POST['datesubendday'];
@@ -187,7 +187,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
 	$head[$h][2] = 'info';
 	$h++;
 
-	dolibarr_fiche_head($head, 'general', $langs->trans("Subscription"));
+	dol_fiche_head($head, 'general', $langs->trans("Subscription"));
 
 	print "\n";
 	print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="post">';
@@ -286,7 +286,7 @@ if ($rowid && $action != 'edit')
 	$head[$h][2] = 'info';
 	$h++;
 
-	dolibarr_fiche_head($head, 'general', $langs->trans("Subscription"));
+	dol_fiche_head($head, 'general', $langs->trans("Subscription"));
 
 	if ($msg) print '<div class="error">'.$msg.'</div>';
 
@@ -318,12 +318,12 @@ if ($rowid && $action != 'edit')
 
     // Date subscription
     print '<tr>';
-	print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dolibarr_print_date($subscription->dateh,'dayhour').'</td>';
+	print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($subscription->dateh,'dayhour').'</td>';
     print '</tr>';
 
     // Date end subscription
     print '<tr>';
-	print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="3">'.dolibarr_print_date($subscription->datef,'day').'</td>';
+	print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($subscription->datef,'day').'</td>';
     print '</tr>';
 
     // Amount
diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php
index 2091557cb54..d774806960e 100644
--- a/htdocs/adherents/htpasswd.php
+++ b/htdocs/adherents/htpasswd.php
@@ -76,7 +76,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
index 475ea4e4dd1..f5a724b80aa 100644
--- a/htdocs/adherents/index.php
+++ b/htdocs/adherents/index.php
@@ -214,7 +214,7 @@ if ($resql)
 			$statictype->libelle=$obj->libelle;
 			print '<td>'.$staticmember->getNomUrl(1).'</td>';
 			print '<td>'.$statictype->getNomUrl(1).'</td>';
-			print '<td>'.dolibarr_print_date($obj->datem,'dayhour').'</td>';
+			print '<td>'.dol_print_date($obj->datem,'dayhour').'</td>';
 			print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$obj->date_end_subscription,5).'</td>';
 			print '</tr>';
 			$i++;
@@ -224,7 +224,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
@@ -250,7 +250,7 @@ if ($result)
 	while ($i < $num)
 	{
 		$objp = $db->fetch_object($result);
-		$year=dolibarr_print_date($objp->dateadh,"%Y");
+		$year=dol_print_date($objp->dateadh,"%Y");
 		$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->cotisation;
 		$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
 		$tot+=$objp->cotisation;
diff --git a/htdocs/adherents/info.php b/htdocs/adherents/info.php
index 46b93fe5080..9fca3b34818 100644
--- a/htdocs/adherents/info.php
+++ b/htdocs/adherents/info.php
@@ -55,7 +55,7 @@ $adh->info($_GET["id"]);
  */
 $head = member_prepare_head($adh);
 
-dolibarr_fiche_head($head, 'info', $langs->trans("Member"));
+dol_fiche_head($head, 'info', $langs->trans("Member"));
 
 
 print '<table width="100%"><tr><td>';
diff --git a/htdocs/adherents/info_subscription.php b/htdocs/adherents/info_subscription.php
index 68ded081c15..2f42188812d 100644
--- a/htdocs/adherents/info_subscription.php
+++ b/htdocs/adherents/info_subscription.php
@@ -68,7 +68,7 @@ $head[$h][2] = 'info';
 $h++;
 
 
-dolibarr_fiche_head($head, 'info', $langs->trans("Subscription"));
+dol_fiche_head($head, 'info', $langs->trans("Subscription"));
 
 $subscription->info($rowid);
 
diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php
index 1fe70449523..b72f7b85cbf 100644
--- a/htdocs/adherents/ldap.php
+++ b/htdocs/adherents/ldap.php
@@ -60,7 +60,7 @@ $adh->id = $rowid;
 $result=$adh->fetch($rowid);
 if (! $result)
 {
-	dolibarr_print_error($db,"Failed to get adherent: ".$adh->error);
+	dol_print_error($db,"Failed to get adherent: ".$adh->error);
 	exit;
 }
 $adh->fetch_optionals($rowid);
@@ -69,7 +69,7 @@ $adht = new AdherentType($db);
 $result=$adht->fetch($adh->typeid);
 if (! $result)
 {
-	dolibarr_print_error($db,"Failed to get type of adherent: ".$adht->error);
+	dol_print_error($db,"Failed to get type of adherent: ".$adht->error);
 	exit;
 }
 
@@ -80,7 +80,7 @@ if (! $result)
  */
 $head = member_prepare_head($adh);
 
-dolibarr_fiche_head($head, 'ldap', $langs->trans("Member"));
+dol_fiche_head($head, 'ldap', $langs->trans("Member"));
 
 
 /*
@@ -190,7 +190,7 @@ if ($result > 0)
 }
 else
 {
-	dolibarr_print_error('',$ldap->error);
+	dol_print_error('',$ldap->error);
 }
 
 
diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php
index 24a2722c06e..bb1a9ff96d3 100644
--- a/htdocs/adherents/liste.php
+++ b/htdocs/adherents/liste.php
@@ -257,11 +257,11 @@ if ($resql)
 	        print '<td align="center">';
             if ($objp->datefin < time() && $objp->statut > 0)
             {
-                print dolibarr_print_date($objp->datefin)." ".img_warning($langs->trans("SubscriptionLate"));
+                print dol_print_date($objp->datefin)." ".img_warning($langs->trans("SubscriptionLate"));
             }
             else
             {
-                print dolibarr_print_date($objp->datefin);
+                print dol_print_date($objp->datefin);
             }
             print '</td>';
         }
@@ -306,7 +306,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php
index cc6a3e4520a..a708378fde0 100644
--- a/htdocs/adherents/note.php
+++ b/htdocs/adherents/note.php
@@ -77,7 +77,7 @@ if ($id)
 {
 	$head = member_prepare_head($adh);
 	
-	dolibarr_fiche_head($head, 'note', $langs->trans("Member"));
+	dol_fiche_head($head, 'note', $langs->trans("Member"));
 
 	if ($msg) print '<div class="error">'.$msg.'</div>';
 
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 612468cd05a..60d3020b151 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -161,7 +161,7 @@ if (! $rowid && $_GET["action"] != 'create' && $_GET["action"] != 'edit')
     }
     else
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
     }
 
 
@@ -256,7 +256,7 @@ if ($rowid > 0)
         $head[$h][2] = 'card';
         $h++;
 
-        dolibarr_fiche_head($head, 'card', $langs->trans("MemberType"));
+        dol_fiche_head($head, 'card', $langs->trans("MemberType"));
 
 
         print '<table class="border" width="100%">';
@@ -328,7 +328,7 @@ if ($rowid > 0)
         $head[$h][2] = 'card';
         $h++;
 
-        dolibarr_fiche_head($head, 'card', $langs->trans("MemberType"));
+        dol_fiche_head($head, 'card', $langs->trans("MemberType"));
 
 
         print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'">';
diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php
index 304d01b7374..e0dd2cbbd52 100644
--- a/htdocs/admin/agenda.php
+++ b/htdocs/admin/agenda.php
@@ -98,7 +98,7 @@ print "<br>\n";
 
 $head=agenda_prepare_head();
 
-dolibarr_fiche_head($head, 'autoactions', $langs->trans("Agenda"));
+dol_fiche_head($head, 'autoactions', $langs->trans("Agenda"));
 
 
 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php
index 1c9be6fef5c..4e2bea89d45 100644
--- a/htdocs/admin/agenda_xcal.php
+++ b/htdocs/admin/agenda_xcal.php
@@ -76,7 +76,7 @@ print "<br>\n";
 
 $head=agenda_prepare_head();
 
-dolibarr_fiche_head($head, 'xcal', $langs->trans("Agenda"));
+dol_fiche_head($head, 'xcal', $langs->trans("Agenda"));
 
 
 print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
diff --git a/htdocs/admin/bookmark.php b/htdocs/admin/bookmark.php
index 602ba9f6703..f8db67eaaac 100644
--- a/htdocs/admin/bookmark.php
+++ b/htdocs/admin/bookmark.php
@@ -41,7 +41,7 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
   	}
   	else
   	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
     }
 }
 
diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php
index deb4aa0541f..372d107ba21 100644
--- a/htdocs/admin/boxes.php
+++ b/htdocs/admin/boxes.php
@@ -51,7 +51,7 @@ if ($_POST["action"] == 'add')
     $sql.= " FROM ".MAIN_DB_PREFIX."boxes";
     $sql.= " WHERE fk_user=0 AND box_id=".$_POST["boxid"]." AND position=".$_POST["pos"];
     $resql = $db->query($sql);
-    dolibarr_syslog("boxes.php::search if box active sql=".$sql);
+    dol_syslog("boxes.php::search if box active sql=".$sql);
 	if ($resql)
     {
 	    $num = $db->num_rows($resql);
@@ -61,13 +61,13 @@ if ($_POST["action"] == 'add')
 
 			// Si la boite n'est pas deja active, insert with box_order=''
 	        $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position, box_order, fk_user) values (".$_POST["boxid"].",".$_POST["pos"].", '', 0)";
-			dolibarr_syslog("boxes.php activate box sql=".$sql);
+			dol_syslog("boxes.php activate box sql=".$sql);
 	        $resql = $db->query($sql);
 
 		    // Remove all personalized setup when a box is activated or disabled
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_param";
 		    $sql.= " WHERE param like 'MAIN_BOXES_%'";
-			dolibarr_syslog("boxes.php delete user_param sql=".$sql);
+			dol_syslog("boxes.php delete user_param sql=".$sql);
 		    $resql = $db->query($sql);
 
 			$db->commit();
@@ -78,7 +78,7 @@ if ($_POST["action"] == 'add')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -114,11 +114,11 @@ if ($_GET["action"] == 'switch')
         $sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order='".$objto->box_order."' WHERE rowid=".$objfrom->rowid;
 		//print "xx".$sql;
         $resultupdatefrom = $db->query($sql);
-        if (! $resultupdatefrom) { dolibarr_print_error($db); }
+        if (! $resultupdatefrom) { dol_print_error($db); }
         $sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order='".$objfrom->box_order."' WHERE rowid=".$objto->rowid;
 		//print "xx".$sql;
         $resultupdateto = $db->query($sql);
-        if (! $resultupdateto) { dolibarr_print_error($db); }
+        if (! $resultupdateto) { dol_print_error($db); }
     }
 
     if ($resultupdatefrom && $resultupdateto)
diff --git a/htdocs/admin/cashdesk.php b/htdocs/admin/cashdesk.php
index 189e8c197c2..10c513cd061 100644
--- a/htdocs/admin/cashdesk.php
+++ b/htdocs/admin/cashdesk.php
@@ -47,7 +47,7 @@ if ($_POST["action"] == 'set')
 	dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT",$_POST["CASHDESK_ID_BANKACCOUNT"]);
 	dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",$_POST["CASHDESK_ID_WAREHOUSE"]);
 	
-	dolibarr_syslog("admin/cashdesk: level ".$_POST["level"]);
+	dol_syslog("admin/cashdesk: level ".$_POST["level"]);
 }
 
 
diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php
index 40de19b49f9..919a6c2c443 100644
--- a/htdocs/admin/clicktodial.php
+++ b/htdocs/admin/clicktodial.php
@@ -41,7 +41,7 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
   	}
   	else
   	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
     }
 }
 
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index 18c8a65da71..a1f58753dfa 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -77,13 +77,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$obj->error.'</div>';
-			dolibarr_syslog($obj->error, LOG_ERR);
+			dol_syslog($obj->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -302,7 +302,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $dir = "../includes/modules/commande/";
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index a46b650fbff..629aeb5080f 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -62,7 +62,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
 			$isimage=image_format_supported($original_file);
 			if ($isimage >= 0)
 			{
-				dolibarr_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->societe->dir_logos.'/'.$original_file);
+				dol_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->societe->dir_logos.'/'.$original_file);
 				if (! is_dir($conf->societe->dir_logos))
 				{
 					create_exdir($conf->societe->dir_logos);
@@ -82,7 +82,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
 							$imgThumbSmall = $reg[1];
 							dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall);
 						}
-						else dolibarr_syslog($imgThumbSmall);
+						else dol_syslog($imgThumbSmall);
 
 						// Cr�ation de la vignette de la page "Soci�t�/Institution"
 						$imgThumbMini = vignette($conf->societe->dir_logos.'/'.$original_file, 100, 30, '_mini', $quality);
@@ -91,9 +91,9 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
 							$imgThumbMini = $reg[1];
 							dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini);
 						}
-						else dolibarr_syslog($imgThumbMini);
+						else dol_syslog($imgThumbMini);
 					}
-					else dolibarr_syslog($langs->trans("ErrorImageFormatNotSupported"),LOG_WARNING);
+					else dol_syslog($langs->trans("ErrorImageFormatNotSupported"),LOG_WARNING);
 				}
 				else
 				{
@@ -142,7 +142,7 @@ if ($_GET["action"] == 'addthumb')
 				$imgThumbSmall = $reg[1];
 				dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall);
 			}
-			else dolibarr_syslog($imgThumbSmall);
+			else dol_syslog($imgThumbSmall);
 
 			// Cr�ation de la vignette de la page "Soci�t�/Institution"
 			$imgThumbMini = vignette($conf->societe->dir_logos.'/'.$_GET["file"], 100, 30, '_mini',80);
@@ -151,7 +151,7 @@ if ($_GET["action"] == 'addthumb')
 				$imgThumbMini = $reg[1];
 				dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini);
 			}
-			else dolibarr_syslog($imgThumbMini);
+			else dol_syslog($imgThumbMini);
 
 			Header("Location: ".$_SERVER["PHP_SELF"]);
 			exit;
@@ -159,13 +159,13 @@ if ($_GET["action"] == 'addthumb')
 		else
 		{
 			$message .= '<div class="error">'.$langs->trans("ErrorImageFormatNotSupported").'</div>';
-			dolibarr_syslog($langs->transnoentities("ErrorImageFormatNotSupported"),LOG_WARNING);
+			dol_syslog($langs->transnoentities("ErrorImageFormatNotSupported"),LOG_WARNING);
 		}
 	}
 	else
 	{
 		$message .= '<div class="error">'.$langs->trans("ErrorFileDoesNotExists",$_GET["file"]).'</div>';
-		dolibarr_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
+		dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
 	}
 }
 
@@ -320,7 +320,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
 			if ($obj->code) $code_pays=$obj->code;
 		}
 		else {
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
@@ -579,7 +579,7 @@ else
 			if ($obj->code) $code_pays=$obj->code;
 		}
 		else {
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php
index 8c89b4619f8..14e0dbdaed4 100644
--- a/htdocs/admin/confexped.php
+++ b/htdocs/admin/confexped.php
@@ -95,7 +95,7 @@ if ($conf->global->MAIN_SUBMODULE_LIVRAISON)
 	$h++;
 }
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
+dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
 
 /*
  * Formulaire parametres divers
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index d0dd82a565a..235537947e0 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -277,7 +277,7 @@ if ($_POST["actionadd"] || $_POST["actionmodify"])
                 $newid=($obj->newid + 1);
                         
             } else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
     
@@ -302,7 +302,7 @@ if ($_POST["actionadd"] || $_POST["actionmodify"])
         }
         $sql.=",1)";
 
-	     dolibarr_syslog("dict actionadd sql=".$sql);
+	     dol_syslog("dict actionadd sql=".$sql);
         $result = $db->query($sql);
         if (!$result)
         {
@@ -310,7 +310,7 @@ if ($_POST["actionadd"] || $_POST["actionmodify"])
                 $msg=$langs->trans("ErrorRecordAlreadyExists").'<br>';
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
     }
@@ -338,7 +338,7 @@ if ($_POST["actionadd"] || $_POST["actionmodify"])
         }
         $sql.= " WHERE ".$rowidcol." = '".$_POST["rowid"]."'";
 
-		dolibarr_syslog("dict actionmodify sql=".$sql);
+		dol_syslog("dict actionmodify sql=".$sql);
 		//print $sql;
         $resql = $db->query($sql);
         if (! $resql)
@@ -363,7 +363,7 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')       //
 
     $sql = "DELETE from ".$tabname[$_GET["id"]]." WHERE ".$rowidcol."='".$_GET["rowid"]."'";
 
-	dolibarr_syslog("dict delete sql=".$sql);
+	dol_syslog("dict delete sql=".$sql);
     $result = $db->query($sql);
     if (! $result)
     {
@@ -373,7 +373,7 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')       //
         }
         else 
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
     }
 }
@@ -393,7 +393,7 @@ if ($_GET["action"] == $acts[0])       // activate
     $result = $db->query($sql);
     if (!$result)
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -412,7 +412,7 @@ if ($_GET["action"] == $acts[1])       // disable
     $result = $db->query($sql);
     if (!$result)
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -551,7 +551,7 @@ if ($_GET["id"])
     }
 
     // Affiche table des valeurs
-	dolibarr_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG);
+	dol_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG);
     $resql=$db->query($sql);
 	if ($resql)
     {
@@ -664,7 +664,7 @@ if ($_GET["id"])
           }
       }
       else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 
     print '</table>';
diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php
index 2d192e5e6f9..53e50f47099 100644
--- a/htdocs/admin/dons.php
+++ b/htdocs/admin/dons.php
@@ -63,13 +63,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$obj->error.'</div>';
-			dolibarr_syslog($obj->error, LOG_ERR);
+			dol_syslog($obj->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -160,7 +160,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '<table class="noborder" width=\"100%\">';
diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php
index 15f1f6abdeb..f5c824fce43 100644
--- a/htdocs/admin/events.php
+++ b/htdocs/admin/events.php
@@ -112,7 +112,7 @@ print "<br>\n";
 
 $head=security_prepare_head();
 
-dolibarr_fiche_head($head, 'audit', $langs->trans("Security"));
+dol_fiche_head($head, 'audit', $langs->trans("Security"));
 
 
 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index e9f55fb68f9..3b1254e0086 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -70,13 +70,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$obj->error.'</div>';
-			dolibarr_syslog($obj->error, LOG_ERR);
+			dol_syslog($obj->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -172,7 +172,7 @@ if ($_GET["action"] == 'setmethod' || $_GET["action"] == 'setmod')
 		}
 		else
 		{
-			//dolibarr_print_error($db);
+			//dol_print_error($db);
 			$db->rollback();
 		}
 	}
@@ -241,7 +241,7 @@ if ($conf->global->MAIN_SUBMODULE_LIVRAISON)
 	$h++;
 }
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
+dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
 
 
 
@@ -270,7 +270,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '<table class="noborder" width="100%">';
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index e194bfced21..2c505444d05 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -51,7 +51,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 if ($_POST["action"] == 'add' || $_POST["modify"])
@@ -76,7 +76,7 @@ if ($_POST["action"] == 'add' || $_POST["modify"])
 			$resql=$db->query($sql);
 			if (! $resql)
 	        {
-				dolibarr_print_error($db,"sql=$sql");
+				dol_print_error($db,"sql=$sql");
 				exit;
 	        }
 */
@@ -88,7 +88,7 @@ if ($_POST["action"] == 'add' || $_POST["modify"])
 			$sql.= " VALUES ('box_external_rss.php','".addslashes($_POST["norss"].' ('.$_POST[$external_rss_title]).")')";
 	        if (! $db->query($sql))
 	        {
-	        	dolibarr_print_error($db);
+	        	dol_print_error($db);
 	            $err++;
 	        }
 		}
@@ -106,7 +106,7 @@ if ($_POST["action"] == 'add' || $_POST["modify"])
         else
         {
             $db->rollback();
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
     }
 }
@@ -141,7 +141,7 @@ if ($_POST["delete"])
 				if (! $resql)
 				{
 					$db->rollback();
-					dolibarr_print_error($db,"sql=$sql");
+					dol_print_error($db,"sql=$sql");
 					exit;
 				}
 				
@@ -153,7 +153,7 @@ if ($_POST["delete"])
 		else
 		{
 			$db->rollback();
-			dolibarr_print_error($db,"sql=$sql");
+			dol_print_error($db,"sql=$sql");
 			exit;
         }
 
@@ -171,7 +171,7 @@ if ($_POST["delete"])
         else
         {
             $db->rollback();
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
     }
 }
@@ -227,7 +227,7 @@ $sql ="select rowid, file, note from ".MAIN_DB_PREFIX."boxes_def";
 $sql.=" WHERE file = 'box_external_rss.php'";
 $sql.=" ORDER BY note";
 
-dolibarr_syslog("external_rss select rss boxes sql=".$sql,LOG_DEBUG);
+dol_syslog("external_rss select rss boxes sql=".$sql,LOG_DEBUG);
 $resql=$db->query($sql);
 if ($resql)
 {
@@ -311,7 +311,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 ?>
 
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 824e0479549..ab028368db9 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -81,13 +81,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$obj->error.'</div>';
-			dolibarr_syslog($obj->error, LOG_ERR);
+			dol_syslog($obj->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -181,7 +181,7 @@ if ($_POST["action"] == 'update' || $_POST["action"] == 'add')
 {
 	if (! dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],0,isset($_POST["constnote"])?$_POST["constnote"]:''));
 	{
-	   dolibarr_print_error($db);
+	   dol_print_error($db);
 	}
 }
 
@@ -189,7 +189,7 @@ if ($_GET["action"] == 'delete')
 {
   if (! dolibarr_del_const($db, $_GET["rowid"]));
   {
-    dolibarr_print_error($db);
+    dol_print_error($db);
   }
 }
 
@@ -223,7 +223,7 @@ $head[$h][1] = $langs->trans("Invoices");
 $hselected=$h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
+dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
 
 /*
  *  Module numerotation
@@ -358,7 +358,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '<table class="noborder" width="100%">';
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index b084fa4cbfd..98d5abf12b5 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -81,13 +81,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$obj->error.'</div>';
-			dolibarr_syslog($obj->error, LOG_ERR);
+			dol_syslog($obj->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -272,7 +272,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php
index ddb7b0ff6af..ba0fce2fde7 100644
--- a/htdocs/admin/fournisseur.php
+++ b/htdocs/admin/fournisseur.php
@@ -77,13 +77,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$obj->error.'</div>';
-			dolibarr_syslog($obj->error, LOG_ERR);
+			dol_syslog($obj->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -289,7 +289,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print "<table class=\"noborder\" width=\"100%\">\n";
@@ -419,7 +419,7 @@ print '</table><br/>';
  }
  else
  {
- dolibarr_print_error($db);
+ dol_print_error($db);
  }
  */
 
diff --git a/htdocs/admin/import/dolibarrimport.class.php b/htdocs/admin/import/dolibarrimport.class.php
index ad7b8f7c577..c4c60cd8521 100644
--- a/htdocs/admin/import/dolibarrimport.class.php
+++ b/htdocs/admin/import/dolibarrimport.class.php
@@ -46,7 +46,7 @@ class DolibarrImport
 		$this->nb_import_ko = 0;
 		$this->nb_import = 0;
 
-		dolibarr_syslog("DolibarrImport::ImportClients($file)", LOG_DEBUG);
+		dol_syslog("DolibarrImport::ImportClients($file)", LOG_DEBUG);
 
 		$this->ReadFile($file);
 
@@ -65,12 +65,12 @@ class DolibarrImport
 
 			if ( $societe->create($user) == 0)
 	  {
-	  	dolibarr_syslog("DolibarrImport::ImportClients ".$societe->nom." SUCCESS", LOG_DEBUG);
+	  	dol_syslog("DolibarrImport::ImportClients ".$societe->nom." SUCCESS", LOG_DEBUG);
 	  	$this->nb_import_ok++;
 	  }
 	  else
 	  {
-	  	dolibarr_syslog("DolibarrImport::ImportClients ".$societe->nom." ERROR", LOG_ERR);
+	  	dol_syslog("DolibarrImport::ImportClients ".$societe->nom." ERROR", LOG_ERR);
 	  	$this->nb_import_ko++;
 	  }
 		}
@@ -106,7 +106,7 @@ class DolibarrImport
 
 		if (is_readable($file))
 		{
-			dolibarr_syslog("DolibarrImport::ReadFile Lecture du fichier $file", LOG_DEBUG);
+			dol_syslog("DolibarrImport::ReadFile Lecture du fichier $file", LOG_DEBUG);
 
 			$line = 0;
 			$hf = fopen ($file, "r");
@@ -150,7 +150,7 @@ class DolibarrImport
 			umask(0);
 			if (! mkdir($upload_dir, 0755))
 		  {
-		  	dolibarr_syslog("DolibarrImport::ReadFile Impossible de cr�er $upload_dir",LOG_ERR);
+		  	dol_syslog("DolibarrImport::ReadFile Impossible de cr�er $upload_dir",LOG_ERR);
 		  }
 		}
 
@@ -161,7 +161,7 @@ class DolibarrImport
 			umask(0);
 			if (! mkdir($upload_dir, 0755))
 		  {
-		  	dolibarr_syslog("DolibarrImport::ReadFile Impossible de cr�er $upload_dir",LOG_ERR);
+		  	dol_syslog("DolibarrImport::ReadFile Impossible de cr�er $upload_dir",LOG_ERR);
 		  }
 		}
 
@@ -172,7 +172,7 @@ class DolibarrImport
 			umask(0);
 			if (! mkdir($upload_dir, 0755))
 		  {
-		  	dolibarr_syslog("DolibarrImport::ReadFile Impossible de cr�er $upload_dir",LOG_ERR);
+		  	dol_syslog("DolibarrImport::ReadFile Impossible de cr�er $upload_dir",LOG_ERR);
 		  }
 		}
 
diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php
index d925d71d51a..f19e27f6fcf 100644
--- a/htdocs/admin/ldap.php
+++ b/htdocs/admin/ldap.php
@@ -64,7 +64,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
 
 	if ($error)
 	{
-		dolibarr_print_error($db->error());
+		dol_print_error($db->error());
 	}
 }
 
@@ -89,7 +89,7 @@ if ($mesg) print '<div class="error">'.$mesg.'</div>';
 
 
 
-dolibarr_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
+dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
 
 $var=true;
 $html=new Form($db);
diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php
index 13038b29299..2181044feb6 100644
--- a/htdocs/admin/ldap_contacts.php
+++ b/htdocs/admin/ldap_contacts.php
@@ -67,7 +67,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
 	
 	if ($error)
 	{
-		dolibarr_print_error($db->error());
+		dol_print_error($db->error());
 	}
 }
 
@@ -90,7 +90,7 @@ if (! function_exists("ldap_connect"))
 if ($mesg) print '<div class="error">'.$mesg.'</div>';
 
 
-dolibarr_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
+dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
 
 
 print $langs->trans("LDAPDescContact").'<br>';
diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php
index 30f0d5c3e09..b424d53e6bb 100644
--- a/htdocs/admin/ldap_groups.php
+++ b/htdocs/admin/ldap_groups.php
@@ -58,7 +58,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
 
 	if ($error)
 	{
-		dolibarr_print_error($db->error());
+		dol_print_error($db->error());
 	}
 }
 
@@ -81,7 +81,7 @@ if (! function_exists("ldap_connect"))
 if ($mesg) print '<div class="error">'.$mesg.'</div>';
 
 
-dolibarr_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
+dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
 
 
 print $langs->trans("LDAPDescGroups").'<br>';
diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php
index 7c2362a05e5..d3ee7d0216b 100644
--- a/htdocs/admin/ldap_members.php
+++ b/htdocs/admin/ldap_members.php
@@ -81,7 +81,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
 
 	if ($error)
 	{
-		dolibarr_print_error($db->error());
+		dol_print_error($db->error());
 	}
 }
 
@@ -104,7 +104,7 @@ if (! function_exists("ldap_connect"))
 if ($mesg) print '<div class="error">'.$mesg.'</div>';
 
 
-dolibarr_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
+dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
 
 
 print $langs->trans("LDAPDescMembers").'<br>';
diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php
index e9b068f46b6..449ad6e502a 100644
--- a/htdocs/admin/ldap_users.php
+++ b/htdocs/admin/ldap_users.php
@@ -69,7 +69,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
 
 	if ($error)
 	{
-		dolibarr_print_error($db->error());
+		dol_print_error($db->error());
 	}
 }
 
@@ -92,7 +92,7 @@ if (! function_exists("ldap_connect"))
 if ($mesg) print '<div class="error">'.$mesg.'</div>';
 
 
-dolibarr_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
+dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
 
 
 print $langs->trans("LDAPDescUsers").'<br>';
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index e4beef06754..54a82d9d9f6 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -77,13 +77,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$obj->error.'</div>';
-			dolibarr_syslog($obj->error, LOG_ERR);
+			dol_syslog($obj->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -181,7 +181,7 @@ $hselected=$h;
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
+dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
 
 /*
  *  Module numerotation
@@ -299,7 +299,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '<table class="noborder" width="100%">';
diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php
index c98a0257867..818bbe8c734 100644
--- a/htdocs/admin/mailing.php
+++ b/htdocs/admin/mailing.php
@@ -43,7 +43,7 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
   	}
   	else
   	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
     }
 }
 
diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php
index 8ee7a40f010..ba929ae0dd1 100644
--- a/htdocs/admin/menus.php
+++ b/htdocs/admin/menus.php
@@ -107,7 +107,7 @@ $head[$h][2] = 'editor';
 $h++;
 
 
-dolibarr_fiche_head($head, 'handler', $langs->trans("Menus"));
+dol_fiche_head($head, 'handler', $langs->trans("Menus"));
 
 
 if (isset($_GET["action"]) && $_GET["action"] == 'edit')
diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php
index 4b6c2cead1c..d1938afa857 100644
--- a/htdocs/admin/menus/edit.php
+++ b/htdocs/admin/menus/edit.php
@@ -477,7 +477,7 @@ elseif (isset($_GET["action"]) && $_GET["action"] == 'edit')
 	$sql.= ' WHERE c.rowid = mc.fk_constraint';
 	$sql.= ' AND mc.fk_menu = '.$_GET['menuId'];
 
-	dolibarr_syslog("Edit: sql=".$sql, LOG_DEBUG);
+	dol_syslog("Edit: sql=".$sql, LOG_DEBUG);
 	$resql = $db->query($sql);
 	if ($resql)
 	{
@@ -542,7 +542,7 @@ elseif (isset($_GET["action"]) && $_GET["action"] == 'edit')
 		while ($i < $num)
 		{
 			$objc = $db->fetch_object($resql);
-			print '<option value="'.$objc->rowid.'">'.dolibarr_trunc($objc->action,70).'</option>';
+			print '<option value="'.$objc->rowid.'">'.dol_trunc($objc->action,70).'</option>';
 			$i++;
 			
 		}
diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index e11c05e8648..028b87f1774 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -212,7 +212,7 @@ $head[$h][1] = $langs->trans("MenuAdmin");
 $head[$h][2] = 'editor';
 $h++;
 
-dolibarr_fiche_head($head, 'editor', $langs->trans("Menus"));
+dol_fiche_head($head, 'editor', $langs->trans("Menus"));
 
 // Confirmation de la suppression menu
 if ($_GET["action"] == 'delete')
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 4ec0641625a..d55274a31d6 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -161,7 +161,7 @@ function UnActivate($value,$requiredby=1)
 			$genericMod->style_sheet=1;
 			$genericMod->rights_class=strtolower(eregi_replace('^mod','',$modName));
 			$genericMod->const_name='MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',$modName));
-			dolibarr_syslog("modules::UnActivate Failed to find module file, we use generic function with name ".$genericMod->name);
+			dol_syslog("modules::UnActivate Failed to find module file, we use generic function with name ".$genericMod->name);
 			$genericMod->_remove();
 		}
 	}
@@ -308,7 +308,7 @@ if (! empty($categ[$categidx]))
 	$h++;
 }
 
-dolibarr_fiche_head($head, $tagmode, $langs->trans("Modules"));
+dol_fiche_head($head, $tagmode, $langs->trans("Modules"));
 
 
 if ($mesg) print '<div class="error">'.$mesg.'</div>';
diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index 15f2c82ef89..46028988891 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -45,7 +45,7 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
   	}
   	else
   	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
     }
 }
 
diff --git a/htdocs/admin/paybox.php b/htdocs/admin/paybox.php
index a972468c3b7..5fb4261e317 100644
--- a/htdocs/admin/paybox.php
+++ b/htdocs/admin/paybox.php
@@ -52,7 +52,7 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
   	}
   	else
   	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
     }
 }
 
diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php
index b960132d1fc..37728e7ad90 100644
--- a/htdocs/admin/perms.php
+++ b/htdocs/admin/perms.php
@@ -59,7 +59,7 @@ print "<br>\n";
 
 $head=security_prepare_head();
 
-dolibarr_fiche_head($head, 'default', $langs->trans("Security"));
+dol_fiche_head($head, 'default', $langs->trans("Security"));
 
 print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
 
diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php
index 696194fcc87..f2d02bb5936 100644
--- a/htdocs/admin/produit.php
+++ b/htdocs/admin/produit.php
@@ -59,7 +59,7 @@ if ($_POST["action"] == 'multiprix')
 			// on ajoute le champ price_level dans la table societe
 			if ($db->DDLAddField(MAIN_DB_PREFIX."societe","price_level",$field_desc) < 0)
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 				exit;
 			}
 		}
@@ -68,7 +68,7 @@ if ($_POST["action"] == 'multiprix')
 	}
 	else
 	{
-		dolibarr_syslog("Table definition for ".MAIN_DB_PREFIX."societe already ok");
+		dol_syslog("Table definition for ".MAIN_DB_PREFIX."societe already ok");
 		dolibarr_set_const($db, "PRODUIT_MULTIPRICES", $_POST["activate_multiprix"]);
 		dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", "6");
 	}
@@ -86,7 +86,7 @@ else if ($_POST["action"] == 'sousproduits')
 		$keys['idx_product_association_fk_product_fils'] = "fk_product_fils" ;
 		if ($db->DDLCreateTable($table,$fields,"","InnoDB","","",$keys) < 0)
 		{
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 	  exit;
 		}
 		else
@@ -96,7 +96,7 @@ else if ($_POST["action"] == 'sousproduits')
 	}
 	else
 	{
-		dolibarr_syslog("Table definition already ok");
+		dol_syslog("Table definition already ok");
 		dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]);
 	}
 }
diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php
index 185c1eeea95..ed0de33d98a 100644
--- a/htdocs/admin/propale.php
+++ b/htdocs/admin/propale.php
@@ -78,13 +78,13 @@ if ($_GET["action"] == 'specimen')
 		else
 		{
 			$mesg='<div class="error">'.$module->error.'</div>';
-			dolibarr_syslog($module->error, LOG_ERR);
+			dol_syslog($module->error, LOG_ERR);
 		}
 	}
 	else
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
-		dolibarr_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
+		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
 	}
 }
 
@@ -318,7 +318,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $dir = "../includes/modules/propale/";
diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index 08d7b4f073f..0577f287433 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -47,7 +47,7 @@ if ($_GET["action"] == 'setgeneraterule')
 {
 	if (! dolibarr_set_const($db, 'USER_PASSWORD_GENERATED',$_GET["value"]))
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	else
 	{
@@ -78,7 +78,7 @@ if ($_GET["action"] == 'activate_encrypt')
 	else
 	{
 		$db->rollback();
-		dolibarr_print_error($db,'');
+		dol_print_error($db,'');
 	}
 }
 else if ($_GET["action"] == 'disable_encrypt')
@@ -169,7 +169,7 @@ print "<br>\n";
 
 $head=security_prepare_head();
 
-dolibarr_fiche_head($head, 'passwords', $langs->trans("Security"));
+dol_fiche_head($head, 'passwords', $langs->trans("Security"));
 
 
 $var=false;
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index b40a49484a0..8f8597c27b7 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -40,7 +40,7 @@ if ($_GET["action"] == 'set_main_upload_doc')
 {
 	if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"]))
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	else
 	{
@@ -104,7 +104,7 @@ print "<br>\n";
 
 $head=security_prepare_head();
 
-dolibarr_fiche_head($head, 'misc', $langs->trans("Security"));
+dol_fiche_head($head, 'misc', $langs->trans("Security"));
 
 
 $var=false;
diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php
index daa474d6ca3..a47d229d1fe 100644
--- a/htdocs/admin/societe.php
+++ b/htdocs/admin/societe.php
@@ -47,7 +47,7 @@ if ($_GET["action"] == 'setcodeclient')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -60,7 +60,7 @@ if ($_GET["action"] == 'setcodecompta')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -73,7 +73,7 @@ if ($_POST["action"] == 'usesearchtoselectcompany')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index a8c5455435b..297c3e7fdc0 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -76,7 +76,7 @@ if ($_POST["action"] == 'STOCK_CALCULATE_ON_BILL'
 	else
 	{
 		$db->rollback();
-		dolibarr_print_error("Error in some requests", LOG_ERR);
+		dol_print_error("Error in some requests", LOG_ERR);
 	}
 }
 // Mode of stock decrease
@@ -98,7 +98,7 @@ if ($_POST["action"] == 'STOCK_CALCULATE_ON_SUPPLIER_BILL'
 	else
 	{
 		$db->rollback();
-		dolibarr_print_error("Error in some requests", LOG_ERR);
+		dol_print_error("Error in some requests", LOG_ERR);
 	}
 }
 
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index 5f8d114ef23..55020ea9cb5 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -40,7 +40,7 @@ $langs->load("other");
 if (! empty($_POST["action"]) && $_POST["action"] == 'setlevel')
 {
 	dolibarr_set_const($db,"SYSLOG_LEVEL",$_POST["level"]);
-	dolibarr_syslog("admin/syslog: level ".$_POST["level"]);
+	dol_syslog("admin/syslog: level ".$_POST["level"]);
 }
 
 if (! empty($_POST["action"]) && $_POST["action"] == 'set')
@@ -55,7 +55,7 @@ if (! empty($_POST["action"]) && $_POST["action"] == 'set')
 
 			dolibarr_del_const($db,"SYSLOG_FILE");
 			dolibarr_set_const($db,"SYSLOG_FACILITY",$_POST["facility"]);
-			dolibarr_syslog("admin/syslog: facility ".$_POST["facility"]);
+			dol_syslog("admin/syslog: facility ".$_POST["facility"]);
 		}
 		else
 		{
@@ -72,7 +72,7 @@ if (! empty($_POST["action"]) && $_POST["action"] == 'set')
 			fclose($file);
 			dolibarr_del_const($db,"SYSLOG_FACILITY");
 			dolibarr_set_const($db,"SYSLOG_FILE",$_POST["filename"]);
-			dolibarr_syslog("admin/syslog: file ".$_POST["filename"]);
+			dol_syslog("admin/syslog: file ".$_POST["filename"]);
 		}
 		else
 		{
diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index db82d25725f..a4ceb746e82 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -133,9 +133,9 @@ if (function_exists('date_default_timezone_get'))
 	print "</td></tr>\n";	// value defined in http://fr3.php.net/manual/en/timezones.europe.php
 }
 $var=!$var;
-print "<tr ".$bc[$var]."><td width=\"300\">=> ".$langs->trans("PHPServerOffsetWithGreenwich")."</td><td>".(- dolibarr_mktime(0,0,0,1,1,1970))."</td></tr>\n";
+print "<tr ".$bc[$var]."><td width=\"300\">=> ".$langs->trans("PHPServerOffsetWithGreenwich")."</td><td>".(- dol_mktime(0,0,0,1,1,1970))."</td></tr>\n";
 $var=!$var;
-print "<tr ".$bc[$var]."><td width=\"300\">=> ".$langs->trans("CurrentHour")."</td><td>".dolibarr_print_date(time(),'dayhour')."</td></tr>\n";
+print "<tr ".$bc[$var]."><td width=\"300\">=> ".$langs->trans("CurrentHour")."</td><td>".dol_print_date(time(),'dayhour')."</td></tr>\n";
 $var=!$var;
 print "<tr ".$bc[$var].'><td width="300">=> dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0,"dayhourtext")."</td>";
 print '</table>';
diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php
index d7f7eee7ac8..ed648276a66 100644
--- a/htdocs/admin/tools/eaccelerator.php
+++ b/htdocs/admin/tools/eaccelerator.php
@@ -67,7 +67,7 @@ if (isset($_POST['caching'])) {
 }
 $info = eaccelerator_info();
 if (!is_array($info)) {
-	dolibarr_print_error('','An error occured getting eAccelerator information, this is caused if eAccelerator isn\'t initalised properly');
+	dol_print_error('','An error occured getting eAccelerator information, this is caused if eAccelerator isn\'t initalised properly');
 	exit;
 }
 
@@ -151,8 +151,8 @@ function revcompare($x, $y)
 
           foreach($list as $script) { ?>
         <tr <?php $var = ! $var; print $bc[$var]; ?>>
-            <td><?php print dolibarr_trunc($script['file'],80,'left'); ?></td>
-            <td align="center" nowrap="nowrap"><?php print dolibarr_print_date($script['mtime'],'dayhour'); ?></td>
+            <td><?php print dol_trunc($script['file'],80,'left'); ?></td>
+            <td align="center" nowrap="nowrap"><?php print dol_print_date($script['mtime'],'dayhour'); ?></td>
             <td align="right" nowrap="nowrap"><?php print number_format($script['size'] / 1024, 2); ?> KB</td>
             <td align="right" nowrap="nowrap"><?php print $script['reloads']; ?> (<?php print $script['usecount']; ?>)</td>
             <td align="right" nowrap="nowrap"><?php print $script['hits']; ?></td>
@@ -180,8 +180,8 @@ function create_key_table($list)
     foreach($list as $key) {
 ?>
         <tr <?php $var = ! $var; print $bc[$var]; ?>>
-            <td><?php print dolibarr_trunc($key['name'],80,'left'); ?></td>
-            <td align="center" nowrap="nowrap"><?php dolibarr_print_date($key['created'],'dayhour'); ?></td>
+            <td><?php print dol_trunc($key['name'],80,'left'); ?></td>
+            <td align="center" nowrap="nowrap"><?php dol_print_date($key['created'],'dayhour'); ?></td>
             <td align="right" nowrap="nowrap"><?php print number_format($key['size']/1024, 3); ?> KB</td>
             <td align="right" nowrap="nowrap"><?php
                 if ($key['ttl'] == -1) {
@@ -189,7 +189,7 @@ function create_key_table($list)
                 } elseif ($key['ttl'] == 0) {
                     print 'none';
                 } else {
-                    print dolibarr_print_date($key['ttl'],'dayhour');
+                    print dol_print_date($key['ttl'],'dayhour');
                 }
             ?></td>
         </tr>
diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php
index df998004ac5..de509060a53 100644
--- a/htdocs/admin/tools/export.php
+++ b/htdocs/admin/tools/export.php
@@ -160,7 +160,7 @@ if ($what == 'mysql')
 
 	if ($handle)
 	{	
-		dolibarr_syslog("Run command ".$fullcommandcrypted);
+		dol_syslog("Run command ".$fullcommandcrypted);
 		$handlein = popen($fullcommandclear, 'r');
 		while (!feof($handlein))
 		{
@@ -179,7 +179,7 @@ if ($what == 'mysql')
 	else
 	{
 		$langs->load("errors");
-		dolibarr_syslog("Failed to open file $outputfile",LOG_ERR);
+		dol_syslog("Failed to open file $outputfile",LOG_ERR);
 		$errormsg=$langs->trans("ErrorFailedToWriteInDir");
 	}
 	// Get errorstring
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index b3d70467b75..b9bb8b6f35c 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -155,7 +155,7 @@ if ($result)
 		print "<tr $bc[$var]>";
 
 		// Date
-		print '<td align="left" nowrap="nowrap">'.dolibarr_print_date($obj->dateevent,'%Y-%m-%d %H:%M:%S').'</td>';
+		print '<td align="left" nowrap="nowrap">'.dol_print_date($obj->dateevent,'%Y-%m-%d %H:%M:%S').'</td>';
 
 		// Code
 		print '<td>'.$obj->type.'</td>';
@@ -208,7 +208,7 @@ if ($result)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/ajaxbox.php b/htdocs/ajaxbox.php
index 3745f537337..73cd283a723 100644
--- a/htdocs/ajaxbox.php
+++ b/htdocs/ajaxbox.php
@@ -36,7 +36,7 @@ require_once(DOL_DOCUMENT_ROOT."/boxes.php");
 // Enregistrement de la position des boxes
 if((isset($_GET['boxorder']) && !empty($_GET['boxorder'])) && (isset($_GET['userid']) && !empty($_GET['userid'])))
 {
-	dolibarr_syslog("AjaxBox boxorder=".$_GET['boxorder']." userid=".$_GET['userid'], LOG_DEBUG);
+	dol_syslog("AjaxBox boxorder=".$_GET['boxorder']." userid=".$_GET['userid'], LOG_DEBUG);
 
 	$infobox=new InfoBox($db);
 	$result=$infobox->saveboxorder("0",$_GET['boxorder'],$_GET['userid']);
diff --git a/htdocs/bookmarks/bookmark.class.php b/htdocs/bookmarks/bookmark.class.php
index 2d8a2b30af9..8baec97e4c5 100644
--- a/htdocs/bookmarks/bookmark.class.php
+++ b/htdocs/bookmarks/bookmark.class.php
@@ -67,7 +67,7 @@ class Bookmark
         $sql.= " FROM ".MAIN_DB_PREFIX."bookmark";
         $sql.= " WHERE rowid = ".$id;
 
-		dolibarr_syslog("Bookmark::fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("Bookmark::fetch sql=".$sql, LOG_DEBUG);
         $resql  = $this->db->query ($sql);
         if ($resql)
         {
@@ -88,7 +88,7 @@ class Bookmark
         }
         else
         {
-            dolibarr_print_error($this->db);
+            dol_print_error($this->db);
             return -1;
         }
     }
@@ -116,7 +116,7 @@ class Bookmark
         if ($this->fk_soc) $sql.=",".$this->fk_soc;
         $sql.= ")";
 
-        dolibarr_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
+        dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query ($sql);
         if ($resql)
         {
@@ -163,7 +163,7 @@ class Bookmark
         $sql.= " ,favicon = '".$this->favicon."'";
         $sql.= " WHERE rowid = ".$this->id;
 
-        dolibarr_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
+        dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
         if ($this->db->query ($sql))
         {
             return 1;
@@ -185,7 +185,7 @@ class Bookmark
         $sql  = "DELETE FROM ".MAIN_DB_PREFIX."bookmark";
         $sql .= " WHERE rowid = ".$id;
 
-        dolibarr_syslog("Bookmark::remove sql=".$sql, LOG_DEBUG);
+        dol_syslog("Bookmark::remove sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query ($sql);
         if ($resql)
         {
diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php
index 5ecef2061a2..7c2d5b81999 100644
--- a/htdocs/bookmarks/bookmarks.lib.php
+++ b/htdocs/bookmarks/bookmarks.lib.php
@@ -73,13 +73,13 @@ function printBookmarksList ($aDb, $aLangs)
 			{
 				$ret.='<div class="menu_contenu"><a class="vsmenu" title="'.$obj->title.'" href="'.$obj->url.'"'.($obj->target == 1?' target="_blank"':'').'>';
 				$ret.=' '.img_object($langs->trans("BookmarkThisPage"),'bookmark').' ';
-				$ret.= dolibarr_trunc($obj->title, 20).'</a><br></div>';
+				$ret.= dol_trunc($obj->title, 20).'</a><br></div>';
 				$i++;
 			}
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
diff --git a/htdocs/bookmarks/fiche.php b/htdocs/bookmarks/fiche.php
index b7d2c8073dc..9e8eb60e9ed 100644
--- a/htdocs/bookmarks/fiche.php
+++ b/htdocs/bookmarks/fiche.php
@@ -175,7 +175,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"]))
     $bookmark->fetch($_GET["id"]);
 
 
-    dolibarr_fiche_head($head, $hselected, $langs->trans("Bookmark"));
+    dol_fiche_head($head, $hselected, $langs->trans("Bookmark"));
 
     if ($_GET["action"] == 'edit')
     {
@@ -234,7 +234,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"]))
     }
     print '</td></tr>';
 
-    print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dolibarr_print_date($bookmark->datec,'dayhour').'</td></tr>';
+    print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dol_print_date($bookmark->datec,'dayhour').'</td></tr>';
 
     if ($_GET["action"] == 'edit') print '<tr><td colspan="2" align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
 
diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php
index 56e0560c35e..b398f12fd5b 100644
--- a/htdocs/bookmarks/liste.php
+++ b/htdocs/bookmarks/liste.php
@@ -112,8 +112,8 @@ if ($resql)
         print '</td>';
 
         $lieninterne=0;
-        $title=dolibarr_trunc($obj->title,24);
-        $lien=dolibarr_trunc($obj->url,24);
+        $title=dol_trunc($obj->title,24);
+        $lien=dol_trunc($obj->url,24);
 
         // Title
         print "<td>";
@@ -165,7 +165,7 @@ if ($resql)
         print "</td>\n";
 
         // Date creation
-        print '<td align="center">'.dolibarr_print_date($obj->dateb,'day') ."</td>";
+        print '<td align="center">'.dol_print_date($obj->dateb,'day') ."</td>";
 
         // Actions
         print "<td>";
@@ -186,7 +186,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php
index 537c1f9d9c1..a8f7e1e4a33 100644
--- a/htdocs/boutique/client/fiche.php
+++ b/htdocs/boutique/client/fiche.php
@@ -80,7 +80,7 @@ if ($_GET['id'])
 
 	    print '<td><a href="'.DOL_URL_ROOT.'/boutique/commande/fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche">&nbsp;';
 
-	    print dolibarr_print_date($objp->date_purchased,'dayhour')."</a>\n";
+	    print dol_print_date($objp->date_purchased,'dayhour')."</a>\n";
 	    print $objp->total . "</a></TD>\n";
 	    print "</tr>\n";
 	    $i++;
@@ -91,14 +91,14 @@ if ($_GET['id'])
       else
 	{
 	  print "<p>ERROR 1</p>\n";
-	  dolibarr_print_error($dbosc);
+	  dol_print_error($dbosc);
 	}
 
     }
   else
     {
       print "<p>ERROR 1</p>\n";
-      dolibarr_print_error($dbosc);
+      dol_print_error($dbosc);
     }
 
 
diff --git a/htdocs/boutique/client/index.php b/htdocs/boutique/client/index.php
index ce3500baf89..fbe3df3dded 100644
--- a/htdocs/boutique/client/index.php
+++ b/htdocs/boutique/client/index.php
@@ -80,7 +80,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 $dbosc->close();
diff --git a/htdocs/boutique/commande/ca.php b/htdocs/boutique/commande/ca.php
index aa0baedaacc..34c7cc72b5a 100644
--- a/htdocs/boutique/commande/ca.php
+++ b/htdocs/boutique/commande/ca.php
@@ -75,7 +75,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 $sql = "SELECT sum(t.value) as value";
@@ -101,7 +101,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 
diff --git a/htdocs/boutique/commande/commande.class.php b/htdocs/boutique/commande/commande.class.php
index 97fe1fac533..61d8c348b7a 100644
--- a/htdocs/boutique/commande/commande.class.php
+++ b/htdocs/boutique/commande/commande.class.php
@@ -75,7 +75,7 @@ class Commande
 
 			$this->payment_method = stripslashes($array["payment_method"]);
 
-			$this->date = dolibarr_print_date($array["date_purchased"],'dayhour');
+			$this->date = dol_print_date($array["date_purchased"],'dayhour');
 
 			$this->delivery_adr->name = stripslashes($array["delivery_name"]);
 			$this->delivery_adr->street = stripslashes($array["delivery_street_address"]);
diff --git a/htdocs/boutique/commande/index.php b/htdocs/boutique/commande/index.php
index 1c2f009d3f4..b51ca81e21e 100644
--- a/htdocs/boutique/commande/index.php
+++ b/htdocs/boutique/commande/index.php
@@ -73,7 +73,7 @@ if ( $dbosc->query($sql) )
 
       print '<td><a href="fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche">&nbsp;';
       print $objp->orders_id ."</a></td><td>";
-      print dolibarr_print_date($objp->date_purchased,'dayhour').'</td>';
+      print dol_print_date($objp->date_purchased,'dayhour').'</td>';
       print '<td><a href="../client/fiche.php?id='.$objp->customers_id.'">'.$objp->customers_name."</a></TD>\n";
       print '<td align="right">'.price($objp->value).'</td>';
       print "</tr>\n";
@@ -84,7 +84,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 $dbosc->close();
diff --git a/htdocs/boutique/critiques/bestproduct.php b/htdocs/boutique/critiques/bestproduct.php
index 1126055f222..52e7852c8f7 100644
--- a/htdocs/boutique/critiques/bestproduct.php
+++ b/htdocs/boutique/critiques/bestproduct.php
@@ -85,7 +85,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($dbosc);
+	dol_print_error($dbosc);
 }
 
 print "</TABLE>";
diff --git a/htdocs/boutique/critiques/index.php b/htdocs/boutique/critiques/index.php
index 0bf8614d9d3..a081a7c78be 100644
--- a/htdocs/boutique/critiques/index.php
+++ b/htdocs/boutique/critiques/index.php
@@ -79,7 +79,7 @@ if ($resql) {
 }
 else
 {
-	dolibarr_print_error($dbosc);
+	dol_print_error($dbosc);
 }
 
 print "</TABLE>";
diff --git a/htdocs/boutique/index.php b/htdocs/boutique/index.php
index 55193f73dd5..7081e5cda0c 100644
--- a/htdocs/boutique/index.php
+++ b/htdocs/boutique/index.php
@@ -84,7 +84,7 @@ if ($result)
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 /* mensuel
@@ -113,7 +113,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 */
 
@@ -155,7 +155,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 /*
@@ -189,7 +189,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 /*
@@ -223,7 +223,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 
@@ -260,7 +260,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 print '</tr></table>';
 
diff --git a/htdocs/boutique/notification/index.php b/htdocs/boutique/notification/index.php
index 56b478d162b..f110abc7255 100644
--- a/htdocs/boutique/notification/index.php
+++ b/htdocs/boutique/notification/index.php
@@ -81,7 +81,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 $dbosc->close();
diff --git a/htdocs/boutique/notification/produits.php b/htdocs/boutique/notification/produits.php
index 4ae8e737509..3bcf0071de0 100644
--- a/htdocs/boutique/notification/produits.php
+++ b/htdocs/boutique/notification/produits.php
@@ -85,7 +85,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($dbosc);
+	dol_print_error($dbosc);
 }
 
 $dbosc->close();
diff --git a/htdocs/boutique/osc_master.inc.php b/htdocs/boutique/osc_master.inc.php
index 04f266c5482..f866e0c104c 100644
--- a/htdocs/boutique/osc_master.inc.php
+++ b/htdocs/boutique/osc_master.inc.php
@@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php");
 $dbosc = new DoliDb($conf->db->type,$conf->global->OSC_DB_HOST,$conf->global->OSC_DB_USER,$conf->global->OSC_DB_PASS,$conf->global->OSC_DB_NAME,$conf->global->OSC_DB_PORT);
 if (! $dbosc->connected)
 {
-    dolibarr_syslog($dbosc,"host=".$conf->global->OSC_DB_HOST.", user=".$conf->global->OSC_DB_USER.", databasename=".$conf->global->OSC_DB_NAME.", ".$db->error,LOG_ERR);
+    dol_syslog($dbosc,"host=".$conf->global->OSC_DB_HOST.", user=".$conf->global->OSC_DB_USER.", databasename=".$conf->global->OSC_DB_NAME.", ".$db->error,LOG_ERR);
 
 	llxHeader("",$langs->trans("OSCommerceShop"),"");
 	print '<div class="error">Failed to connect to oscommerce database. Check your module setup</div>';
diff --git a/htdocs/boutique/produits/index.php b/htdocs/boutique/produits/index.php
index 8acea35525a..f855acb4d85 100644
--- a/htdocs/boutique/produits/index.php
+++ b/htdocs/boutique/produits/index.php
@@ -79,7 +79,7 @@ if ( $dbosc->query($sql) )
 }
 else
 {
-  dolibarr_print_error($dbosc);
+  dol_print_error($dbosc);
 }
 
 $dbosc->close();
diff --git a/htdocs/boutique/produits/osc-liste.php b/htdocs/boutique/produits/osc-liste.php
index 24784bc7eba..6d2f6dda062 100644
--- a/htdocs/boutique/produits/osc-liste.php
+++ b/htdocs/boutique/produits/osc-liste.php
@@ -92,7 +92,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($dbosc);
+	dol_print_error($dbosc);
 }
 
 print "</TABLE>";
diff --git a/htdocs/boutique/promotion/index.php b/htdocs/boutique/promotion/index.php
index e0f63cc15d8..c5b5264cb39 100644
--- a/htdocs/boutique/promotion/index.php
+++ b/htdocs/boutique/promotion/index.php
@@ -103,7 +103,7 @@ if ($resql)
 	  print '<img src="/theme/'.$conf->theme.'/img/icon_status_green_light.png" border="0"></a></td>';
 	  print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red.png" border="0" alt="inactif"></td>';
 	}
-      print "<td>".dolibarr_print_date($objp->fin,'day')."</td>";
+      print "<td>".dol_print_date($objp->fin,'day')."</td>";
       print '<td align="right">'.price($objp->products_price)."</td>";
       print '<td align="right">'.price($objp->specials_new_products_price)."</td>";
       print "</tr>";
@@ -114,7 +114,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($dbosc);
+	dol_print_error($dbosc);
 }
 $dbosc->close();
 
diff --git a/htdocs/boxes.php b/htdocs/boxes.php
index b856a86e980..9fd939ac152 100644
--- a/htdocs/boxes.php
+++ b/htdocs/boxes.php
@@ -73,7 +73,7 @@ class InfoBox
 			$sql.= " AND b.fk_user = ".$user->id;
 			$sql.= " ORDER BY b.box_order";
 
-			dolibarr_syslog("InfoBox::listBoxes get user box list sql=".$sql, LOG_DEBUG);
+			dol_syslog("InfoBox::listBoxes get user box list sql=".$sql, LOG_DEBUG);
 			$result = $this->db->query($sql);
 			if ($result)
 			{
@@ -105,7 +105,7 @@ class InfoBox
 			}
 			else {
 				$this->error=$this->db->error();
-				dolibarr_syslog("InfoBox::listBoxes Error ".$this->error, LOG_ERR);
+				dol_syslog("InfoBox::listBoxes Error ".$this->error, LOG_ERR);
 				return array();
 			}
 		}
@@ -120,7 +120,7 @@ class InfoBox
 			$sql.= " AND b.fk_user = 0";
 			$sql.= " ORDER BY b.box_order";
 
-			dolibarr_syslog("InfoBox::listBoxes get default box list sql=".$sql, LOG_DEBUG);
+			dol_syslog("InfoBox::listBoxes get default box list sql=".$sql, LOG_DEBUG);
 			$result = $this->db->query($sql);
 			if ($result)
 			{
@@ -152,7 +152,7 @@ class InfoBox
 			}
 			else {
 				$this->error=$this->db->error();
-				dolibarr_syslog("InfoBox::listBoxes Error ".$this->error, LOG_ERR);
+				dol_syslog("InfoBox::listBoxes Error ".$this->error, LOG_ERR);
 				return array();
 			}
 		}
@@ -172,7 +172,7 @@ class InfoBox
 	{
 		require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
 
-		dolibarr_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid);
+		dol_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid);
 
 		if (! $userid || $userid == 0) return 0;
 
@@ -194,7 +194,7 @@ class InfoBox
 		$sql.=" WHERE fk_user = ".$userid;
 		$sql.=" AND position = ".$zone;
 
-		dolibarr_syslog("InfoBox::saveboxorder sql=".$sql);
+		dol_syslog("InfoBox::saveboxorder sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -204,7 +204,7 @@ class InfoBox
 				$part=split(':',$collist);
 				$colonne=$part[0];
 				$list=$part[1];
-				dolibarr_syslog('InfoBox::saveboxorder colonne='.$colonne.' list='.$list);
+				dol_syslog('InfoBox::saveboxorder colonne='.$colonne.' list='.$list);
 
 				$i=0;
 				$listarray=split(',',$list);
@@ -212,7 +212,7 @@ class InfoBox
 				{
 					if (is_numeric($id))
 					{
-						//dolibarr_syslog("aaaaa".sizeof($listarray));
+						//dol_syslog("aaaaa".sizeof($listarray));
 						$i++;
 						$ii=sprintf('%02d',$i);
 						$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes";
@@ -224,7 +224,7 @@ class InfoBox
 						$sql.= " ".$userid;
 						$sql.= ")";
 
-						dolibarr_syslog("InfoBox::saveboxorder sql=".$sql);
+						dol_syslog("InfoBox::saveboxorder sql=".$sql);
 						$result = $this->db->query($sql);
 						if ($result < 0)
 						{
diff --git a/htdocs/cactioncomm.class.php b/htdocs/cactioncomm.class.php
index c441d74dcd4..4e2d184c7cc 100644
--- a/htdocs/cactioncomm.class.php
+++ b/htdocs/cactioncomm.class.php
@@ -115,7 +115,7 @@ class CActionComm {
 			$sql.=" WHERE active=".$active;
 		}
 	
-		dolibarr_syslog("CActionComm::liste_array sql=".$sql);
+		dol_syslog("CActionComm::liste_array sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
diff --git a/htdocs/cashdesk/classes/Mysql.class.php b/htdocs/cashdesk/classes/Mysql.class.php
index 813caa15e4e..dacd6cdef72 100644
--- a/htdocs/cashdesk/classes/Mysql.class.php
+++ b/htdocs/cashdesk/classes/Mysql.class.php
@@ -52,7 +52,7 @@ class Sql implements intSql {
 		* @return Ressource vers la requ�te venant d'�tre effectu�e
 		*/
 	public function query ($aRequete) {
-		dolibarr_syslog("cashdesk query sql=".$aRequete, LOG_DEBUG);
+		dol_syslog("cashdesk query sql=".$aRequete, LOG_DEBUG);
 		return mysql_query($aRequete);
 
 	}
diff --git a/htdocs/cashdesk/deconnexion.php b/htdocs/cashdesk/deconnexion.php
index 62d0a0b24a1..0b94f35b2a0 100644
--- a/htdocs/cashdesk/deconnexion.php
+++ b/htdocs/cashdesk/deconnexion.php
@@ -22,14 +22,14 @@ $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_start();
-dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
+dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
 
 // Destroy session
 $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_destroy();
-dolibarr_syslog("End session in DOLSESSID_".$dolibarr_main_db_name);
+dol_syslog("End session in DOLSESSID_".$dolibarr_main_db_name);
 
 
 header ('Location: index.php');
diff --git a/htdocs/cashdesk/include/environnement.php b/htdocs/cashdesk/include/environnement.php
index 88ec14e38ba..3fe3aad515a 100644
--- a/htdocs/cashdesk/include/environnement.php
+++ b/htdocs/cashdesk/include/environnement.php
@@ -21,7 +21,7 @@ $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_start();
-dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
+dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
 
 
 $conf_db_type = $dolibarr_main_db_type;
@@ -43,9 +43,9 @@ $conf_fkaccount = $conf->global->CASHDESK_ID_BANKACCOUNT > 0?$conf->global->CASH
 $conf_fkentrepot = $conf->global->CASHDESK_ID_WAREHOUSE > 0?$conf->global->CASHDESK_ID_WAREHOUSE:$_SESSION["CASHDESK_ID_WAREHOUSE"];
 
 // Check if setup ok
-if (empty($conf_fksoc))      dolibarr_print_error("Setup of CashDesk module not complete. Third party not defined.");
-if ($conf->bank->enabled && empty($conf_fkaccount))  dolibarr_print_error("Setup of CashDesk module not complete. Bank account not defined.");
-if ($conf->stock->enabled && empty($conf_fkentrepot)) dolibarr_print_error("Setup of CashDesk module not complete. Warehous not defined.");
+if (empty($conf_fksoc))      dol_print_error("Setup of CashDesk module not complete. Third party not defined.");
+if ($conf->bank->enabled && empty($conf_fkaccount))  dol_print_error("Setup of CashDesk module not complete. Bank account not defined.");
+if ($conf->stock->enabled && empty($conf_fkentrepot)) dol_print_error("Setup of CashDesk module not complete. Warehous not defined.");
 
 // Parametres d'affichage
 $conf_taille_listes = 200;	// Nombre max de lignes a afficher dans les listes
diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php
index dc6308338c8..6a99ee8bac8 100644
--- a/htdocs/cashdesk/index.php
+++ b/htdocs/cashdesk/index.php
@@ -22,7 +22,7 @@ $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_start();
-dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
+dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
 
 if ( $_SESSION['uid'] > 0 ) {
 
diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php
index 9501430d62d..0b7c4caec61 100644
--- a/htdocs/categories/categorie.class.php
+++ b/htdocs/categories/categorie.class.php
@@ -76,7 +76,7 @@ class Categorie
 		$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
 		$sql.= " WHERE rowid = ".$id;
 
-		dolibarr_syslog("Categorie::fetch sql=".$sql);
+		dol_syslog("Categorie::fetch sql=".$sql);
 		$resql  = $this->db->query ($sql);
 		if ($resql)
 		{
@@ -93,7 +93,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 
@@ -101,7 +101,7 @@ class Categorie
 		$sql.= " FROM ".MAIN_DB_PREFIX."categorie_association";
 		$sql.= " WHERE fk_categorie_fille = '".$id."'";
 
-		dolibarr_syslog("Categorie::fetch sql=".$sql);
+		dol_syslog("Categorie::fetch sql=".$sql);
 		$resql  = $this->db->query ($sql);
 		if ($resql)
 		{
@@ -111,7 +111,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -174,7 +174,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -198,11 +198,11 @@ class Categorie
 		$sql = 'delete from '.MAIN_DB_PREFIX.'categorie_association';
 		$sql .= ' WHERE fk_categorie_fille = "'.$this->id.'"';
 
-		dolibarr_syslog("Categorie::update sql=".$sql);
+		dol_syslog("Categorie::update sql=".$sql);
 		if (! $this->db->query($sql))
 		{
 			$this->db->rollback();
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 
@@ -211,11 +211,11 @@ class Categorie
 			$sql = 'insert into '.MAIN_DB_PREFIX.'categorie_association(fk_categorie_mere,fk_categorie_fille)';
 			$sql .= ' VALUES ("'.$this->id_mere.'","'.$this->id.'")';
 
-			dolibarr_syslog("Categorie::update sql=".$sql);
+			dol_syslog("Categorie::update sql=".$sql);
 			if (! $this->db->query($sql))
 			{
 				$this->db->rollback();
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				return -1;
 			}
 		}
@@ -233,7 +233,7 @@ class Categorie
 		$sql .= ", visible = '".$this->visible."'";
 		$sql .= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Categorie::update sql=".$sql);
+		dol_syslog("Categorie::update sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			$this->db->commit();
@@ -242,7 +242,7 @@ class Categorie
 		else
 		{
 			$this->db->rollback();
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -260,7 +260,7 @@ class Categorie
 
 		if (!$this->db->query($sql))
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 
@@ -270,7 +270,7 @@ class Categorie
 
 		if (!$this->db->query($sql))
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 
@@ -279,7 +279,7 @@ class Categorie
 
 		if (!$this->db->query($sql))
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 		else
@@ -309,7 +309,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -416,7 +416,7 @@ class Categorie
 		$sql  = "SELECT fk_".$field." FROM ".MAIN_DB_PREFIX."categorie_".$table;
 		$sql .= " WHERE fk_categorie = ".$this->id;
 
-		dolibarr_syslog("Categorie::get_type sql=".$sql);
+		dol_syslog("Categorie::get_type sql=".$sql);
 		$res  = $this->db->query($sql);
 		if ($res)
 		{
@@ -431,7 +431,7 @@ class Categorie
 		else
 		{
 			$this->error=$this->db->error().' sql='.$sql;
-			dolibarr_syslog("Categorie::get_type ".$this->error, LOG_ERR);
+			dol_syslog("Categorie::get_type ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -461,7 +461,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -518,7 +518,7 @@ class Categorie
 		$sql = "SELECT fk_categorie_mere as id_mere, fk_categorie_fille as id_fille";
 		$sql.= " FROM ".MAIN_DB_PREFIX."categorie_association";
 
-		dolibarr_syslog("Categorie::get_full_arbo build motherof array sql=".$sql, LOG_DEBUG);
+		dol_syslog("Categorie::get_full_arbo build motherof array sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -529,7 +529,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 
@@ -541,7 +541,7 @@ class Categorie
 		$sql.= " WHERE c.type = ".$type;
 		$sql.= " ORDER BY c.label, c.rowid";
 
-		dolibarr_syslog("Categorie::get_full_arbo get category list sql=".$sql, LOG_DEBUG);
+		dol_syslog("Categorie::get_full_arbo get category list sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -562,19 +562,19 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 
 		// We add the fulpath property to each elements of first level (no parent exists)
-		dolibarr_syslog("Categorie::get_full_arbo call to build_path_from_id_categ", LOG_DEBUG);
+		dol_syslog("Categorie::get_full_arbo call to build_path_from_id_categ", LOG_DEBUG);
 		foreach($this->cats as $key => $val)
 		{
 			if (isset($this->motherof[$key])) continue;
 			$this->build_path_from_id_categ($key,0);	// Process a path of a root category (no parent exists)
 		}
 
-		dolibarr_syslog("Categorie::get_full_arbo dol_sort_array", LOG_DEBUG);
+		dol_syslog("Categorie::get_full_arbo dol_sort_array", LOG_DEBUG);
 		$this->cats=dol_sort_array($this->cats, 'fulllabel', 'asc', true, false);
 
 		//$this->debug_cats();
@@ -589,12 +589,12 @@ class Categorie
 	*/
 	function build_path_from_id_categ($id_categ,$protection=0)
 	{
-		dolibarr_syslog("Categorie::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
+		dol_syslog("Categorie::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
 
 		//if (! empty($this->cats[$id_categ]['fullpath']))
 		//{
 			// Already defined
-		//	dolibarr_syslog("Categorie::build_path_from_id_categ fullpath and fulllabel already defined", LOG_WARNING);
+		//	dol_syslog("Categorie::build_path_from_id_categ fullpath and fulllabel already defined", LOG_WARNING);
 		//	return;
 		//}
 
@@ -623,7 +623,7 @@ class Categorie
 			// Protection when a category has itself as a child (should not happen)
 			if ($idchild == $id_categ)
 			{
-				dolibarr_syslog("Categorie::build_path_from_id_categ bad couple (".$idchild.",".$id_categ.") in association table: An entry should not have itself has child", LOG_WARNING);
+				dol_syslog("Categorie::build_path_from_id_categ bad couple (".$idchild.",".$id_categ.") in association table: An entry should not have itself has child", LOG_WARNING);
 				continue;
 			}
 
@@ -673,7 +673,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -694,7 +694,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -724,7 +724,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 
@@ -856,7 +856,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -914,7 +914,7 @@ class Categorie
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -957,8 +957,8 @@ class Categorie
 		else
 		{
 			$this->error=$this->db->error().' sql='.$sql;
-			//dolibarr_syslog($this->error);
-			dolibarr_print_error('',$this->error);
+			//dol_syslog($this->error);
+			dol_print_error('',$this->error);
 			return -1;
 		}
 	}
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index 825ffab7cb1..938dce0aa78 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -136,7 +136,7 @@ if ($_GET["socid"])
 	*/
 	$head = societe_prepare_head($soc);
 
-	dolibarr_fiche_head($head, 'category', $langs->trans("ThirdParty"));
+	dol_fiche_head($head, 'category', $langs->trans("ThirdParty"));
 
 	print '<table class="border" width="100%">';
 
@@ -214,7 +214,7 @@ else if ($_GET["id"] || $_GET["ref"])
 
 	$head=product_prepare_head($product, $user);
 	$titre=$langs->trans("CardProduct".$product->type);
-	dolibarr_fiche_head($head, 'category', $titre);
+	dol_fiche_head($head, 'category', $titre);
 
 
 	print '<table class="border" width="100%">';
diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php
index 7c08afab80d..0cdbccf7f8f 100644
--- a/htdocs/categories/index.php
+++ b/htdocs/categories/index.php
@@ -249,14 +249,14 @@ foreach($fulltree as $key => $val)
 		// Show link
 		print '<td valign="middle">';
 		if ($section == $val['id']) print ' <u>';
-		print dolibarr_trunc($val['label'],28);
+		print dol_trunc($val['label'],28);
 		if ($section == $val['id']) print '</u>';
 		print '</td>';
 		print '</tr></table>';
 		print "</td>\n";
 
 		print '<td>';
-		print dolibarr_trunc($categstatic->get_desc($val['id']),48);
+		print dol_trunc($categstatic->get_desc($val['id']),48);
 		print '</td>';
 
 		// Edit link
diff --git a/htdocs/categories/liste.php b/htdocs/categories/liste.php
index 9f78de910f8..bfcf927a14d 100644
--- a/htdocs/categories/liste.php
+++ b/htdocs/categories/liste.php
@@ -56,7 +56,7 @@ if ($cats != -1)
       $var = ! $var;
       print "\t<tr ".$bc[$var].">\n";
       print "\t\t<td><a href='viewcat.php?id=".$cat->id."'>".$cat->label."</a></td>\n";
-      print "\t\t<td>".dolibarr_trunc($cat->description,36)."</td>\n";
+      print "\t\t<td>".dol_trunc($cat->description,36)."</td>\n";
       print '<td align="right">';
 	  if ($cat->type == 0) print $langs->trans("Product");
 	  elseif ($cat->type == 1) print $langs->trans("Supplier");
@@ -69,7 +69,7 @@ if ($cats != -1)
 }
 else
 {
-  dolibarr_print_error();
+  dol_print_error();
 }
 
 print '</td></tr></table>';
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 2b529106ad0..a5fd3a72f0c 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -30,7 +30,7 @@ require("./pre.inc.php");
 
 if ($_REQUEST['id'] == "")
 {
-  dolibarr_print_error('','Missing parameter id');
+  dol_print_error('','Missing parameter id');
   exit();
 }
 
@@ -92,7 +92,7 @@ if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
 if ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
 if ($type == 2) $title=$langs->trans("CustomersCategoryShort");
 
-dolibarr_fiche_head($head, 'card', $title);
+dol_fiche_head($head, 'card', $title);
 
 
 /*
@@ -138,7 +138,7 @@ if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
 
 		if ($catsMeres < 0)
 		{
-			dolibarr_print_error();
+			dol_print_error();
 		}
 		else if (count($catsMeres) > 0)
 		{
@@ -194,7 +194,7 @@ print "</div>";
 $cats = $c->get_filles ();
 if ($cats < 0)
 {
-	dolibarr_print_error();
+	dol_print_error();
 }
 else
 {
@@ -255,7 +255,7 @@ if ($c->type == 0)
 	$prods = $c->get_type ("product","Product");
 	if ($prods < 0)
 	{
-	  dolibarr_print_error();
+	  dol_print_error();
 	}
 	else
 	{
@@ -294,7 +294,7 @@ if ($c->type == 1)
 	$socs = $c->get_type ("societe","Fournisseur","fournisseur");
 	if ($socs < 0)
 	{
-	  dolibarr_print_error();
+	  dol_print_error();
 	}
 	else
 	{
@@ -331,7 +331,7 @@ if($c->type == 2)
 	$socs = $c->get_type ("societe","Societe");
 	if ($socs < 0)
 	{
-	  dolibarr_print_error();
+	  dol_print_error();
 	}
 	else
 	{
diff --git a/htdocs/chargesociales.class.php b/htdocs/chargesociales.class.php
index 11cdb9a75b2..5e3313fa660 100644
--- a/htdocs/chargesociales.class.php
+++ b/htdocs/chargesociales.class.php
@@ -68,7 +68,7 @@ class ChargeSociales extends CommonObject
         $sql.= " WHERE cs.fk_type = c.id";
         $sql.= " AND cs.rowid = ".$id;
 
-		dolibarr_syslog("ChargesSociales::fetch sql=".$sql);
+		dol_syslog("ChargesSociales::fetch sql=".$sql);
         $resql=$this->db->query($sql);
 		if ($resql)
         {
@@ -126,13 +126,13 @@ class ChargeSociales extends CommonObject
 		$sql.= " ".price2num($newamount);
 		$sql.= ")";
 		
-		dolibarr_syslog("ChargesSociales::create sql=".$sql);
+		dol_syslog("ChargesSociales::create sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
 			$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."chargesociales");
 
-			//dolibarr_syslog("ChargesSociales::create this->id=".$this->id);
+			//dol_syslog("ChargesSociales::create this->id=".$this->id);
 			$this->db->commit();
 			return $this->id;
 		}
@@ -154,7 +154,7 @@ class ChargeSociales extends CommonObject
     {
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales where rowid='".$this->id."'";
 
-		dolibarr_syslog("ChargesSociales::delete sql=".$sql);
+		dol_syslog("ChargesSociales::delete sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -183,7 +183,7 @@ class ChargeSociales extends CommonObject
 		$sql.= " periode='".$this->periode."'";
 		$sql.= " WHERE rowid=".$this->id;
 		
-		dolibarr_syslog("ChargesSociales::update sql=".$sql);
+		dol_syslog("ChargesSociales::update sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -309,7 +309,7 @@ class ChargeSociales extends CommonObject
 
 		if ($withpicto) $result.=($lien.img_object($langs->trans("ShowSocialContribution"),'bill').$lienfin.' ');
 		if ($withpicto && $withpicto != 2) $result.=' ';
-		if ($withpicto != 2) $result.=$lien.($maxlen?dolibarr_trunc($this->lib,$maxlen):$this->lib).$lienfin;
+		if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->lib,$maxlen):$this->lib).$lienfin;
 		return $result;
 	}
 
@@ -326,7 +326,7 @@ class ChargeSociales extends CommonObject
 		$sql.= ' FROM '.MAIN_DB_PREFIX.$table;
 		$sql.= ' WHERE '.$field.' = '.$this->id;
 
-		dolibarr_syslog("ChargeSociales::getSommePaiement sql=".$sql, LOG_DEBUG);
+		dol_syslog("ChargeSociales::getSommePaiement sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -401,7 +401,7 @@ class PaiementCharge
 			$sql.= ", ".$this->paiementtype.", '".$this->num_paiement."', '".addslashes($this->note)."', ".$user->id.",";
 			$sql.= "0)";
 
-			dolibarr_syslog("PaiementCharge::create sql=".$sql);
+			dol_syslog("PaiementCharge::create sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -422,7 +422,7 @@ class PaiementCharge
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("PaiementCharges::create ".$this->error, LOG_ERR);
+			dol_syslog("PaiementCharges::create ".$this->error, LOG_ERR);
 			$this->db->rollback();
 			return -1;
 		}
@@ -437,7 +437,7 @@ class PaiementCharge
 	{
         $sql = "UPDATE llx_paiementcharge set fk_bank = ".$id_bank." where rowid = ".$this->id;
 		
-        dolibarr_syslog("PaiementCharge::update_fk_bank sql=".$sql);
+        dol_syslog("PaiementCharge::update_fk_bank sql=".$sql);
         $result = $this->db->query($sql);
         if ($result) 
         {	    
@@ -446,7 +446,7 @@ class PaiementCharge
         else
         {
             $this->error=$this->db->error();
-			dolibarr_syslog("PaiementCharges::update_fk_bank ".$this->error, LOG_ERR);
+			dol_syslog("PaiementCharges::update_fk_bank ".$this->error, LOG_ERR);
             return 0;
         }
     }
diff --git a/htdocs/client.class.php b/htdocs/client.class.php
index 35972fe6ef0..f47ccc05bb7 100644
--- a/htdocs/client.class.php
+++ b/htdocs/client.class.php
@@ -113,7 +113,7 @@ class Client extends Societe
         }
         else 
         {
-            dolibarr_print_error($this->db);
+            dol_print_error($this->db);
             $this->error=$this->db->error();
             return -1;
         }
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 4c61fb5f371..4a02df48032 100755
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -144,7 +144,7 @@ if ($objectid > 0)
 		$head[$h][1] = $langs->trans('Info');
 		$h++;
 		
-		dolibarr_fiche_head($head, $hselected, $langs->trans("Action"));
+		dol_fiche_head($head, $hselected, $langs->trans("Action"));
 	
 		// Affichage fiche action en mode visu
 		print '<table class="border" width="100%"';
@@ -202,7 +202,7 @@ if ($objectid > 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}	
 }
 else
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index 5134d127e4a..0ef8572f9e0 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -86,25 +86,25 @@ if ($_POST["action"] == 'add_action')
 	//if ($_POST["admin"] == -1) $_POST["admin"]='0';
 	//if ($_POST["a2hour"] == -1) $_POST["a2hour"]='0';
 	//if ($_POST["a2min"] == -1) $_POST["a2min"]='0';
-	$datep=dolibarr_mktime($_POST["aphour"],
+	$datep=dol_mktime($_POST["aphour"],
                    $_POST["apmin"],
                    0,
                    $_POST["apmonth"],
                    $_POST["apday"],
                    $_POST["apyear"]);
-	$datep2=dolibarr_mktime($_POST["p2hour"],
+	$datep2=dol_mktime($_POST["p2hour"],
                    $_POST["p2min"],
                    0,
                    $_POST["p2month"],
                    $_POST["p2day"],
                    $_POST["p2year"]);
-	/*$datea=dolibarr_mktime($_POST["adhour"],	// deprecated
+	/*$datea=dol_mktime($_POST["adhour"],	// deprecated
                    $_POST["admin"],
                    0,
                    $_POST["admonth"],
                    $_POST["adday"],
                    $_POST["adyear"]);
-	$datea2=dolibarr_mktime($_POST["a2hour"],	// deprecated
+	$datea2=dol_mktime($_POST["a2hour"],	// deprecated
                    $_POST["a2min"],
                    0,
                    $_POST["a2month"],
@@ -236,7 +236,7 @@ if ($_POST["action"] == 'add_action')
                 $db->commit();
                 if ($_POST["from"])
                 {
-					dolibarr_syslog("Back to ".$_POST["from"]);
+					dol_syslog("Back to ".$_POST["from"]);
                 	Header("Location: ".$_POST["from"]);
                 }
                 elseif($idaction)
@@ -310,26 +310,26 @@ if ($_POST["action"] == 'update')
         $actioncomm = new Actioncomm($db);
         $actioncomm->fetch($_POST["id"]);
 
-    	$datep=dolibarr_mktime($_POST["aphour"],
+    	$datep=dol_mktime($_POST["aphour"],
                                    $_POST["apmin"],
                                    0,
                                    $_POST["apmonth"],
                                    $_POST["apday"],
                                    $_POST["apyear"]);
 
-		$datep2=dolibarr_mktime($_POST["p2hour"],
+		$datep2=dol_mktime($_POST["p2hour"],
 	                   $_POST["p2min"],
 	                   0,
 	                   $_POST["p2month"],
 	                   $_POST["p2day"],
 	                   $_POST["p2year"]);
-    	/*$datea=dolibarr_mktime($_POST["adhour"],
+    	/*$datea=dol_mktime($_POST["adhour"],
                                    $_POST["admin"],
                                    0,
                                    $_POST["admonth"],
                                    $_POST["adday"],
                                    $_POST["adyear"]);
-		$datea2=dolibarr_mktime($_POST["a2hour"],
+		$datea2=dol_mktime($_POST["a2hour"],
 	                   $_POST["a2min"],
 	                   0,
 	                   $_POST["a2month"],
@@ -512,7 +512,7 @@ if ($_GET["action"] == 'create')
 
 	if (! empty($_GET["datep"]) && eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$',$_GET["datep"],$reg))
 	{
-		$actioncomm->datep=dolibarr_mktime(0,0,0,$reg[2],$reg[3],$reg[1]);
+		$actioncomm->datep=dol_mktime(0,0,0,$reg[2],$reg[3],$reg[1]);
 	}
 
 	// Date start
@@ -594,7 +594,7 @@ if ($_GET["id"])
 
     $act = new ActionComm($db);
     $result=$act->fetch($_GET["id"]);
-	if ($result < 0) dolibarr_print_error($db,$act->error);
+	if ($result < 0) dol_print_error($db,$act->error);
 
 	$societe = new Societe($db);
 	if ($act->societe->id)
@@ -634,7 +634,7 @@ if ($_GET["id"])
 	$head[$h][1] = $langs->trans('Info');
 	$h++;
 
-    dolibarr_fiche_head($head, $hselected, $langs->trans("Action"));
+    dol_fiche_head($head, $hselected, $langs->trans("Action"));
 
     $now=gmmktime();
 	$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
@@ -819,13 +819,13 @@ if ($_GET["id"])
 
         // Date debut
 		print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="3">';
-		print dolibarr_print_date($act->datep,'dayhour');
+		print dol_print_date($act->datep,'dayhour');
 		if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
 		print '</td></tr>';
 
         // Date fin
         print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
-		print dolibarr_print_date($act->datef,'dayhour');
+		print dol_print_date($act->datef,'dayhour');
 		if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
 		print '</td></tr>';
 
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 27a2e4f542c..441dd0a6417 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -119,16 +119,16 @@ $next = dol_get_next_month($month, $year);
 $next_year  = $next['year'];
 $next_month = $next['month'];
 
-$max_day_in_prev_month = date("t",dolibarr_mktime(0,0,0,$prev_month,1,$prev_year));	// Nb of days in previous month
-$max_day_in_month = date("t",dolibarr_mktime(0,0,0,$month,1,$year));				// Nb of days in next month
-$tmpday = -date("w",dolibarr_mktime(0,0,0,$month,1,$year))+2;
+$max_day_in_prev_month = date("t",dol_mktime(0,0,0,$prev_month,1,$prev_year));	// Nb of days in previous month
+$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));				// Nb of days in next month
+$tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2;
 if ($tmpday >= 1) $tmpday -= 7;
-$firstdaytoshow=dolibarr_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year);
+$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year);
 $next_day=7-($max_day_in_month+1-$tmpday)%7;
 if ($next_day < 6) $next_day+=7;
-$lastdaytoshow=dolibarr_mktime(0,0,0,$next_month,$next_day,$next_year);
-//print dolibarr_print_date($firstdaytoshow,'day');
-//print dolibarr_print_date($lastdaytoshow,'day');
+$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
+//print dol_print_date($firstdaytoshow,'day');
+//print dol_print_date($lastdaytoshow,'day');
 
 $title=$langs->trans("DoneAndToDoActions");
 if ($status == 'done') $title=$langs->trans("DoneActions");
@@ -147,7 +147,7 @@ if (! empty($_REQUEST["type"]))   $param.="&type=".$_REQUEST["type"];
 
 // Show navigation bar
 $nav ="<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;region=".$region.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
-$nav.=" <span id=\"month_name\">".dolibarr_print_date(dolibarr_mktime(0,0,0,$month,1,$year),"%b");
+$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%b");
 $nav.=" ".$year;
 $nav.=" </span>\n";
 $nav.="<a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;region=".$region.$param."\">".img_next($langs->trans("Next"))."</a>\n";
@@ -220,14 +220,14 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a, '.MAIN_DB_PREFIX.'c_actioncomm
 $sql.= ' WHERE a.fk_action = ca.id';
 if ($_GET["action"] == 'show_day')
 {
-	$sql.= ' AND datep BETWEEN '.$db->idate(dolibarr_mktime(0,0,0,$month,$_GET["day"],$year));
-	$sql.= ' AND '.$db->idate(dolibarr_mktime(23,59,59,$month,$_GET["day"],$year));
+	$sql.= ' AND datep BETWEEN '.$db->idate(dol_mktime(0,0,0,$month,$_GET["day"],$year));
+	$sql.= ' AND '.$db->idate(dol_mktime(23,59,59,$month,$_GET["day"],$year));
 }
 else
 {
 	// To limit array
-    $sql.= ' AND datep BETWEEN '.$db->idate(dolibarr_mktime(0,0,0,$month,1,$year)-(60*60*24*7));	// Start 7 days before
-    $sql.= ' AND '.$db->idate(dolibarr_mktime(0,0,0,$month,28,$year)+(60*60*24*10));	// End 7 days after + 3 to go from 28 to 31
+    $sql.= ' AND datep BETWEEN '.$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7));	// Start 7 days before
+    $sql.= ' AND '.$db->idate(dol_mktime(0,0,0,$month,28,$year)+(60*60*24*10));	// End 7 days after + 3 to go from 28 to 31
 }
 if ($filtera > 0 || $filtert > 0 || $filterd > 0)
 {
@@ -290,7 +290,7 @@ if ($resql)
 		$jour = date('d',$daycursor);
 
 		$loop=true;
-		$daykey=dolibarr_mktime(0,0,0,$mois,$jour,$annee);
+		$daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
 		do
 		{
 			$actionarray[$daykey][]=$action;
@@ -303,7 +303,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 if ($showbirthday)
@@ -338,7 +338,7 @@ if ($showbirthday)
 			$datebirth=dol_stringtotime($obj->birthday);
 			//print 'ee'.$obj->birthday.'-'.$datebirth;
 			$datearray=dol_getdate($datebirth,true);
-			$action->datep=dolibarr_mktime(0,0,0,$datearray['mon'],$datearray['mday'],$year);
+			$action->datep=dol_mktime(0,0,0,$datearray['mon'],$datearray['mday'],$year);
 			$action->datef=$action->datep;
 			$action->type_code='BIRTHDAY';
 			$action->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->name;
@@ -355,7 +355,7 @@ if ($showbirthday)
 			$jour = date('d',$daycursor);
 	
 			$loop=true;
-			$daykey=dolibarr_mktime(0,0,0,$mois,$jour,$annee);
+			$daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
 			do
 			{
 				$actionarray[$daykey][]=$action;
@@ -368,7 +368,7 @@ if ($showbirthday)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -423,7 +423,7 @@ if ($_GET["action"] != 'show_day')
 			/* Show days of the current month */
 			elseif(($tmpday <= $max_day_in_month))
 			{
-				$curtime = dolibarr_mktime (0, 0, 0, $month, $tmpday, $year);
+				$curtime = dol_mktime (0, 0, 0, $month, $tmpday, $year);
 
 				if ($curtime < $now)
 				$style='cal_current_month';
@@ -454,8 +454,8 @@ else
 {
 	// Code to show just one day
 	$style='cal_current_month';
-	$timestamp=dolibarr_mktime(12,0,0,$month,$_GET["day"],$year);
-	$arraytimestamp=adodb_getdate(dolibarr_mktime(12,0,0,$month,$_GET["day"],$year));
+	$timestamp=dol_mktime(12,0,0,$month,$_GET["day"],$year);
+	$arraytimestamp=adodb_getdate(dol_mktime(12,0,0,$month,$_GET["day"],$year));
 	$dayname=array('0'=>'Sunday','1'=>'Monday','2'=>'Tuesday','3'=>'Wednesday','4'=>'Thursday','5'=>'Friday','6'=>'Saturday');
 	echo '<table width="100%" class="nocellnopadd">';
 	echo ' <tr class="liste_titre">';
@@ -497,11 +497,11 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
 	{
 		$maxPrint=0;
 	}
-	$curtime = dolibarr_mktime (0, 0, 0, $month, $day, $year);
+	$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
 
 	print '<table class="nobordernopadding" width="100%">';
 	print '<tr style="background: #EEEEEE"><td align="left" nowrap="nowrap">';
-	print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.$month.'&year='.$year.'">'.dolibarr_print_date($curtime,'%a %d').'</a>';
+	print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.$month.'&year='.$year.'">'.dol_print_date($curtime,'%a %d').'</a>';
 	print '</td><td align="right" nowrap="nowrap">';
 	print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).'">';
 	print img_picto($langs->trans("NewAction"),'edit_add.png');
@@ -509,7 +509,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
 	print '</td></tr>';
 	print '<tr height="60"><td valign="top" colspan="2" nowrap="nowrap">';	// Minimum 60px height
 
-	//$curtime = dolibarr_mktime (0, 0, 0, $month, $day, $year);
+	//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
 	$i=0;
 	
 	foreach ($actionarray as $daykey => $notused)
@@ -543,7 +543,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
 						// Hour start
 						if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour)
 						{
-							print dolibarr_print_date($action->date_start_in_calendar,'%H:%M');
+							print dol_print_date($action->date_start_in_calendar,'%H:%M');
 							if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar)
 							{
 								if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend)
@@ -563,7 +563,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
 						if ($action->date_end_in_calendar && $action->date_start_in_calendar != $action->date_end_in_calendar)
 						{
 							if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
-							print dolibarr_print_date($action->date_end_in_calendar,'%H:%M');
+							print dol_print_date($action->date_end_in_calendar,'%H:%M');
 						}
 						print '<br>';
 						print $action->getNomUrl(0,$nbofchartoshow,'cal_event');
diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php
index db78c34103f..8710ffc95a1 100644
--- a/htdocs/comm/action/info.php
+++ b/htdocs/comm/action/info.php
@@ -67,7 +67,7 @@ $head[$h][1] = $langs->trans('Info');
 $hselected=$h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("Action"));
+dol_fiche_head($head, $hselected, $langs->trans("Action"));
 
 
 print '<table width="100%"><tr><td>';
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index 38722e50c57..0ef4a4823db 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -149,7 +149,7 @@ $sql .= " ORDER BY ".$sortfield." ".$sortorder;
 $sql .= $db->plimit( $limit + 1, $offset);
 //print $sql;
 
-dolibarr_syslog("comm/action/listactions.php sql=".$sql);
+dol_syslog("comm/action/listactions.php sql=".$sql);
 $resql=$db->query($sql);
 if ($resql)
 {
@@ -266,11 +266,11 @@ if ($resql)
 
         // Titre
         //print '<td>';
-       	//print dolibarr_trunc($obj->label,12);
+       	//print dol_trunc($obj->label,12);
         //print '</td>';
 
        	print '<td align="center" nowrap="nowrap">';
-		print dolibarr_print_date($db->jdate($obj->dp),"day");
+		print dol_print_date($db->jdate($obj->dp),"day");
 		$late=0;
 		if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late=1;
 		if ($obj->percent == 0 && ! $obj->dp && $obj->dp2 && $db->jdate($obj->dp) < ($now - $delay_warning)) $late=1;
@@ -280,7 +280,7 @@ if ($resql)
 		print '</td>';
 
 		print '<td align="center" nowrap="nowrap">';
-		print dolibarr_print_date($db->jdate($obj->dp2),"day");
+		print dol_print_date($db->jdate($obj->dp2),"day");
 		print '</td>';
 
         // Third party
@@ -358,7 +358,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index dcb8fc6da7c..30bca16ab21 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -112,7 +112,7 @@ if ($resql)
 			if (file_exists($file))
 			{
 				print '<td align="center"><a href="'.DOL_URL_ROOT.'/document.php?page='.$page.'&amp;file='.urlencode($relativepath).'&amp;modulepart=actionsreport">'.img_pdf().'</a></td>';
-				print '<td align="center">'.dolibarr_print_date(filemtime($file),'dayhour').'</td>';
+				print '<td align="center">'.dol_print_date(filemtime($file),'dayhour').'</td>';
 				print '<td align="center">'.filesize($file). ' '.$langs->trans("Bytes").'</td>';
 			}
 			else {
@@ -130,7 +130,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php
index 43eec8437eb..9f3a64216af 100644
--- a/htdocs/comm/addpropal.php
+++ b/htdocs/comm/addpropal.php
@@ -71,7 +71,7 @@ if ($_GET["action"] == 'create')
 	$result=$soc->fetch($_GET["socid"]);
 	if ($result < 0)
 	{
-		dolibarr_print_error($db,$soc->error);
+		dol_print_error($db,$soc->error);
 		exit;
 	}
 
@@ -238,7 +238,7 @@ if ($_GET["action"] == 'create')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	print '</td></tr>';
 
diff --git a/htdocs/comm/adresse_livraison.class.php b/htdocs/comm/adresse_livraison.class.php
index 4defc6c70fe..e5074617fbb 100644
--- a/htdocs/comm/adresse_livraison.class.php
+++ b/htdocs/comm/adresse_livraison.class.php
@@ -82,7 +82,7 @@ class AdresseLivraison
         $this->nom=trim($this->nom);
         $this->label=trim($this->label);
 
-        dolibarr_syslog("societe.class.php::create delivery adress ".$this->label);
+        dol_syslog("societe.class.php::create delivery adress ".$this->label);
 
         $this->db->begin();
         
@@ -102,13 +102,13 @@ class AdresseLivraison
 
                 if ($ret >= 0)
                 {
-                    dolibarr_syslog("Societe::Create delivery adress success id=".$this->id);
+                    dol_syslog("Societe::Create delivery adress success id=".$this->id);
                     $this->db->commit();
 		            return 0;
                 }
                 else
                 {
-                    dolibarr_syslog("Societe::Create delivery adress echec update");
+                    dol_syslog("Societe::Create delivery adress echec update");
                     $this->db->rollback();
                     return -3;
                 }
@@ -123,7 +123,7 @@ class AdresseLivraison
                 }
                 else
                 {
-                    dolibarr_syslog("Societe::Create echec insert sql=$sql");
+                    dol_syslog("Societe::Create echec insert sql=$sql");
                 }
                 $this->db->rollback();
                 return -2;
@@ -133,7 +133,7 @@ class AdresseLivraison
         else
         {
             $this->db->rollback();
-            dolibarr_syslog("Societe::Create echec verify sql=$sql");
+            dol_syslog("Societe::Create echec verify sql=$sql");
             return -1;
         }
     }
@@ -167,7 +167,7 @@ class AdresseLivraison
     {
         global $langs;
 
-        dolibarr_syslog("Societe::Update");
+        dol_syslog("Societe::Update");
 
 		// Nettoyage des param�tres
 		
@@ -190,7 +190,7 @@ class AdresseLivraison
 
         if ($result >= 0)
         {
-            dolibarr_syslog("Societe::Update delivery adress verify ok");
+            dol_syslog("Societe::Update delivery adress verify ok");
         
             $sql = "UPDATE ".MAIN_DB_PREFIX."societe_adresse_livraison";
             $sql.= " SET label = '" . addslashes($this->label) ."'"; // Champ obligatoire
@@ -232,7 +232,7 @@ class AdresseLivraison
                 {
         
                     $this->error = $langs->trans("Error sql=$sql");
-                    dolibarr_syslog("Societe::Update delivery adress echec sql=$sql");
+                    dol_syslog("Societe::Update delivery adress echec sql=$sql");
                     $result =  -2;
                 }
             }
@@ -320,19 +320,19 @@ class AdresseLivraison
                  }
                  else
                  {
-                 	dolibarr_syslog('Erreur AdresseLivraison::Fetch aucune adresse dde livraison');
+                 	dol_syslog('Erreur AdresseLivraison::Fetch aucune adresse dde livraison');
                  	return -1;
 			           }
 		          }
 		          else
 		          {
-			          dolibarr_syslog('AdresseLivraison::Societe inconnue');
+			          dol_syslog('AdresseLivraison::Societe inconnue');
 			          return -2;
 		          }
 	       }
 	       else
 	       {
-	       	dolibarr_syslog('Erreur Societe::Fetch '.$this->db->error());
+	       	dol_syslog('Erreur Societe::Fetch '.$this->db->error());
 			    $this->error=$this->db->error();
 			  }
      }
@@ -387,7 +387,7 @@ class AdresseLivraison
 			}
 			else
 			{
-				dolibarr_syslog('Erreur Societe::Fetch aucune adresse de livraison avec id='.$this->id.' - '.$sql);
+				dol_syslog('Erreur Societe::Fetch aucune adresse de livraison avec id='.$this->id.' - '.$sql);
 				$this->error='Erreur Societe::Fetch aucune adresse de livraison avec id='.$this->id.' - '.$sql;
 				$result = -2;
 			}
@@ -396,8 +396,8 @@ class AdresseLivraison
 		}
 		else
 		{
-			dolibarr_syslog('Erreur Societe::Fetch echec sql='.$sql);
-			dolibarr_syslog('Erreur Societe::Fetch '.$this->db->error());
+			dol_syslog('Erreur Societe::Fetch echec sql='.$sql);
+			dol_syslog('Erreur Societe::Fetch '.$this->db->error());
 			$this->error=$this->db->error();
 			$result = -3;
 		}
@@ -412,7 +412,7 @@ class AdresseLivraison
      */
     function delete($idl,$socid)
     {
-      dolibarr_syslog("Societe::Delete delivery adress");
+      dol_syslog("Societe::Delete delivery adress");
 
       $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_adresse_livraison";
       $sql .= " WHERE rowid=".$idl." AND fk_societe = ".$socid;
@@ -467,7 +467,7 @@ class AdresseLivraison
         }
         else
         {
-            dolibarr_print_error($this->db);
+            dol_print_error($this->db);
         }
     }
 
diff --git a/htdocs/comm/adresse_livraison.php b/htdocs/comm/adresse_livraison.php
index d0774841ee5..48e45fedbdd 100644
--- a/htdocs/comm/adresse_livraison.php
+++ b/htdocs/comm/adresse_livraison.php
@@ -170,7 +170,7 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
 		$societe->fetch($_GET["socid"]);
 		$head = societe_prepare_head($societe);
 		
-		dolibarr_fiche_head($head, 'customer', $societe->nom);
+		dol_fiche_head($head, 'customer', $societe->nom);
 
         if ($_POST["label"] && $_POST["nom"])
         {
@@ -197,7 +197,7 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
             }
             else
             {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
             $livraison->pays_code=$obj->code;
             $livraison->pays=$obj->libelle;
@@ -266,7 +266,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
   $societe->fetch($_GET["socid"]);
 	$head = societe_prepare_head($societe);
 		
-	dolibarr_fiche_head($head, 'customer', $societe->nom);
+	dol_fiche_head($head, 'customer', $societe->nom);
 
   print_titre($langs->trans("EditDeliveryAddress"));
   print "<br>\n";
@@ -303,7 +303,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
                 }
                 else
                 {
-                    dolibarr_print_error($db);
+                    dol_print_error($db);
                 }
                 $livraison->pays_code=$obj->code;
                 $livraison->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
@@ -368,7 +368,7 @@ else
 	$result=$livraison->fetch($socid);
 	if ($result < 0)
 	{
-		dolibarr_print_error($db,$livraison->error);
+		dol_print_error($db,$livraison->error);
 		exit;
 	}
 
@@ -376,7 +376,7 @@ else
 	$societe->fetch($livraison->socid);
 	$head = societe_prepare_head($societe);
 	
-	dolibarr_fiche_head($head, 'customer', $societe->nom);
+	dol_fiche_head($head, 'customer', $societe->nom);
 
 
 	// Confirmation de la suppression de la facture
diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php
index 1d090a0fc12..7596a6b74de 100644
--- a/htdocs/comm/bookmark.php
+++ b/htdocs/comm/bookmark.php
@@ -130,7 +130,7 @@ if ($resql)
       //print "<td>" . ($i + 1 + ($limit * $page)) . "</td>";
       print "<td align=\"center\"><b>".$obj->bid."</b></td>";
       print "<td><a href='".DOL_URL_ROOT."/user/fiche.php?id=".$obj->fk_user."'>".img_object($langs->trans("ShowUser"),"user").' '.$obj->name." ".$obj->firstname."</a></td>\n";
-      print '<td align="center">'.dolibarr_print_date($obj->dateb) ."</td>";
+      print '<td align="center">'.dol_print_date($obj->dateb) ."</td>";
       print "<td><a href=\"index.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom."</a></td>\n";
       print '<td align="center">'.$obj->url."</td>";
       print '<td align="center">'.$obj->target."</td>";
@@ -143,7 +143,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php
index 358f2164be3..2a240bd5e8c 100644
--- a/htdocs/comm/clients.php
+++ b/htdocs/comm/clients.php
@@ -129,7 +129,7 @@ if ($result)
 		print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->rowid.'">'.stripslashes($obj->nom).'</a></td>';
 		print '<td>'.$obj->ville.'</td>';
 		print '<td>'.$obj->code_client.'</td>';
-		print '<td align="right">'.dolibarr_print_date($obj->datec).'</td>';
+		print '<td align="right">'.dol_print_date($obj->datec).'</td>';
 		print "</tr>\n";
 		$i++;
 	}
@@ -140,7 +140,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php
index 77041745127..100c31c3626 100644
--- a/htdocs/comm/contact.php
+++ b/htdocs/comm/contact.php
@@ -179,7 +179,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index c6626f0433c..a15bdaaac20 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -73,7 +73,7 @@ if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer)
 	$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET cond_reglement='".$_POST['cond_reglement_id'];
 	$sql.= "' WHERE rowid='".$_GET["socid"]."'";
     $result = $db->query($sql);
-    if (! $result) dolibarr_print_error($result);
+    if (! $result) dol_print_error($result);
 }
 // mode de reglement
 if ($_POST["action"] == 'setmode' && $user->rights->societe->creer)
@@ -83,7 +83,7 @@ if ($_POST["action"] == 'setmode' && $user->rights->societe->creer)
 	$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET mode_reglement='".$_POST['mode_reglement_id'];
 	$sql.= "' WHERE rowid='".$_GET["socid"]."'";
     $result = $db->query($sql);
-    if (! $result) dolibarr_print_error($result);
+    if (! $result) dol_print_error($result);
 }
 // assujetissement a la TVA
 if ($_POST["action"] == 'setassujtva' && $user->rights->societe->creer)
@@ -92,7 +92,7 @@ if ($_POST["action"] == 'setassujtva' && $user->rights->societe->creer)
     $societe->tva_assuj=$_POST['assujtva_value'];
 	$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET tva_assuj='".$_POST['assujtva_value']."' WHERE rowid='".$socid."'";
     $result = $db->query($sql);
-    if (! $result) dolibarr_print_error($result);
+    if (! $result) dol_print_error($result);
 }
 
 
@@ -151,7 +151,7 @@ if ($socid > 0)
 
 	$head = societe_prepare_head($objsoc);
 
-    dolibarr_fiche_head($head, 'customer', $langs->trans("ThirdParty"));
+    dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"));
 
 
     /*
@@ -274,7 +274,7 @@ if ($socid > 0)
     print '</td>';
     print '<td colspan="3">';
 		$amount_discount=$objsoc->getAvailableDiscounts();
-		if ($amount_discount < 0) dolibarr_print_error($db,$societe->error);
+		if ($amount_discount < 0) dol_print_error($db,$societe->error);
         if ($amount_discount > 0) print price($amount_discount).'&nbsp;'.$langs->trans("Currency".$conf->monnaie);
         else print $langs->trans("DiscountNone");
     print '</td>';
@@ -323,7 +323,7 @@ if ($socid > 0)
 	    }
 	    else
 	    {
-	        dolibarr_print_error($db);
+	        dol_print_error($db);
 	    }
 
 		print '</td>';
@@ -389,7 +389,7 @@ if ($socid > 0)
                 {
                     print " ".img_warning();
                 }
-                print '</td><td align="right" width="80">'.dolibarr_print_date($objp->dp,'day')."</td>\n";
+                print '</td><td align="right" width="80">'.dol_print_date($objp->dp,'day')."</td>\n";
                 print '<td align="right" width="120">'.price($objp->total_ht).'</td>';
                 print '<td align="right" nowrap="nowrap">'.$propal_static->LibStatut($objp->fk_statut,5).'</td></tr>';
                 $var=!$var;
@@ -398,7 +398,7 @@ if ($socid > 0)
             $db->free($resql);
         }
         else {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
     }
@@ -438,7 +438,7 @@ if ($socid > 0)
                 $var=!$var;
                 print "<tr $bc[$var]>";
                 print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n";
-                print '</td><td align="right" width="80">'.dolibarr_print_date($objp->dc,'day')."</td>\n";
+                print '</td><td align="right" width="80">'.dol_print_date($objp->dc,'day')."</td>\n";
                 print '<td align="right" width="120">'.price($objp->total_ht).'</td>';
                 print '<td align="right" width="100">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>';
                 $i++;
@@ -446,7 +446,7 @@ if ($socid > 0)
             $db->free($resql);
         }
         else {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
     }
@@ -491,7 +491,7 @@ if ($socid > 0)
                 $contrat->ref=$objp->ref?$objp->ref:$objp->id;
                 print $contrat->getNomUrl(1);
                 print "</td>\n";
-                print '<td align="right" width="80">'.dolibarr_print_date($objp->dc,'day')."</td>\n";
+                print '<td align="right" width="80">'.dol_print_date($objp->dc,'day')."</td>\n";
                 print '<td width="20">&nbsp;</td>';
                 print '<td align="right" nowrap="nowrap">';
                 $contrat->fetch_lignes();
@@ -503,7 +503,7 @@ if ($socid > 0)
             $db->free($resql);
         }
         else {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
     }
@@ -539,7 +539,7 @@ if ($socid > 0)
                 $objp = $db->fetch_object($resql);
                 print "<tr $bc[$var]>";
                 print '<td nowrap><a href="'.DOL_URL_ROOT."/fichinter/fiche.php?id=".$objp->id."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a>\n";
-                print "</td><td align=\"right\">".dolibarr_print_date($objp->di,'day')."</td>\n";
+                print "</td><td align=\"right\">".dol_print_date($objp->di,'day')."</td>\n";
                 print '</tr>';
                 $var=!$var;
                 $i++;
@@ -547,7 +547,7 @@ if ($socid > 0)
             $db->free($resql);
         }
         else {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
     }
@@ -587,7 +587,7 @@ if ($socid > 0)
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
     }
@@ -618,8 +618,8 @@ if ($socid > 0)
                 print "<tr $bc[$var]>";
                 print '<td><a href="'.DOL_URL_ROOT.'/chronodocs/fiche.php?id='.$obj->fichid.'">'.img_object($langs->trans("ShowChronodocs"),"generic")." ".$obj->ref.'</a></td>';
 
-                print "<td align=\"left\">".dolibarr_trunc($obj->title,30) ."</td>";
-				print "<td align=\"right\">".dolibarr_print_date($obj->dp,'day')."</td>\n";
+                print "<td align=\"left\">".dol_trunc($obj->title,30) ."</td>";
+				print "<td align=\"right\">".dol_print_date($obj->dp,'day')."</td>\n";
 				print "</tr>";
 
                 $i++;
@@ -698,7 +698,7 @@ if ($socid > 0)
 }
 else
 {
-    dolibarr_print_error($db,'Bad value for socid parameter');
+    dol_print_error($db,'Bad value for socid parameter');
 }
 
 $db->close();
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index d51e5f2f47f..d8e80c93e47 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -64,12 +64,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'add_bookmark')
 	$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$_GET["socid"]." AND fk_user=".$user->id;
 	if (! $db->query($sql) )
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$_GET["socid"].", ".$db->idate(mktime()).",".$user->id.");";
 	if (! $db->query($sql) )
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -163,7 +163,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
 				$obj = $db->fetch_object($resql);
 				$var=!$var;
 				print '<tr '.$bc[$var].'><td  nowrap="nowrap">'."<a href=\"".DOL_URL_ROOT."/comm/propal.php?propalid=".$obj->rowid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref.'</a></td>';
-				print '<td nowrap="nowrap"><a href="fiche.php?socid='.$obj->socid.'">'.dolibarr_trunc($obj->nom,18).'</a></td>';
+				print '<td nowrap="nowrap"><a href="fiche.php?socid='.$obj->socid.'">'.dol_trunc($obj->nom,18).'</a></td>';
 				print '<td align="right" nowrap="nowrap">'.price($obj->total_ht).'</td></tr>';
 				$i++;
 				$total += $obj->price;
@@ -215,7 +215,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
 				$var=!$var;
 				$obj = $db->fetch_object($resql);
 				print '<tr '.$bc[$var].'><td nowrap="nowrap"><a href="../commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>';
-				print '<td nowrap="nowrap"><a href="fiche.php?socid='.$obj->socid.'">'.dolibarr_trunc($obj->nom,18).'</a></td>';
+				print '<td nowrap="nowrap"><a href="fiche.php?socid='.$obj->socid.'">'.dol_trunc($obj->nom,18).'</a></td>';
 				print '<td align="right" nowrap="nowrap">'.price($obj->total_ttc).'</td></tr>';
 				$i++;
 				$total += $obj->total_ttc;
@@ -295,7 +295,7 @@ if ($user->rights->societe->lire)
 				if ($objp->client == 1) print $langs->trans("Customer");
 				if ($objp->client == 2) print $langs->trans("Prospect");
 				print "</td>";
-				print '<td align="right" nowrap>'.dolibarr_print_date($objp->datec,'day')."</td>";
+				print '<td align="right" nowrap>'.dol_print_date($objp->datec,'day')."</td>";
 				print '</tr>';
 				$i++;
 				$var=!$var;
@@ -360,7 +360,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // \todo A REF
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -423,9 +423,9 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
 
 				print "</td>";
 
-				print "<td align=\"left\"><a href=\"fiche.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company")." ".dolibarr_trunc($obj->nom,44)."</a></td>\n";
+				print "<td align=\"left\"><a href=\"fiche.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company")." ".dol_trunc($obj->nom,44)."</a></td>\n";
 				print "<td align=\"right\">";
-				print dolibarr_print_date($obj->dp,'day')."</td>\n";
+				print dol_print_date($obj->dp,'day')."</td>\n";
 				print "<td align=\"right\">".price($obj->total_ttc)."</td>";
 				print "<td align=\"center\" width=\"14\">".$propalstatic->LibStatut($obj->fk_statut,3)."</td>\n";
 				print "</tr>\n";
@@ -440,7 +440,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -500,9 +500,9 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
 
 			print '</td>';
 
-			print '<td align="left"><a href="fiche.php?socid='.$objp->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
+			print '<td align="left"><a href="fiche.php?socid='.$objp->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
 			print "<td align=\"right\">";
-			print dolibarr_print_date($objp->dp,'day')."</td>\n";
+			print dol_print_date($objp->dp,'day')."</td>\n";
 			print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
 			print "<td align=\"center\" width=\"14\">".$propalstatic->LibStatut($objp->fk_statut,3)."</td>\n";
 			print "</tr>\n";
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 87d4694a13c..70a010343c9 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -131,7 +131,7 @@ if ($_GET["action"] == 'delete')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -171,7 +171,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
 	 $head[$h][1] = $langs->trans("MailHistory");
 	 $h++;
 	 */
-	dolibarr_fiche_head($head, $hselected, $langs->trans("Mailing"));
+	dol_fiche_head($head, $hselected, $langs->trans("Mailing"));
 
 
 	print '<table class="border" width="100%">';
@@ -444,7 +444,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	print '</form>';
diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php
index c67b24068e7..58374cb50f6 100644
--- a/htdocs/comm/mailing/fiche.php
+++ b/htdocs/comm/mailing/fiche.php
@@ -105,7 +105,7 @@ if ($_POST["action"] == 'sendallconfirmed')
 
 		if ($mil->statut == 0)
 		{
-			dolibarr_print_error('','ErrorMailIsNotValidated');
+			dol_print_error('','ErrorMailIsNotValidated');
 			exit;
 		}
 
@@ -129,7 +129,7 @@ if ($_POST["action"] == 'sendallconfirmed')
 		$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
 		$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id;
 
-		dolibarr_syslog("fiche.php: select targets sql=".$sql, LOG_DEBUG);
+		dol_syslog("fiche.php: select targets sql=".$sql, LOG_DEBUG);
 		$resql=$db->query($sql);
 		if ($resql)
 		{
@@ -137,14 +137,14 @@ if ($_POST["action"] == 'sendallconfirmed')
 
 		    if ($num)
 		    {
-		        dolibarr_syslog("fiche.php: nb of targets = ".$num, LOG_DEBUG);
+		        dol_syslog("fiche.php: nb of targets = ".$num, LOG_DEBUG);
 
 		        // Positionne date debut envoi
 		        $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$id;
 		        $resql2=$db->query($sql);
 		        if (! $resql2)
 		        {
-		            dolibarr_print_error($db);
+		            dol_print_error($db);
 		        }
 
 		        // Boucle sur chaque adresse et envoie le mail
@@ -211,14 +211,14 @@ if ($_POST["action"] == 'sendallconfirmed')
 		                // Mail envoye avec succes
 		                $nbok++;
 
-				        dolibarr_syslog("mailing-send: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
+				        dol_syslog("mailing-send: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
 
 		                $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
 						$sql.=" SET statut=1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid;
 		                $resql2=$db->query($sql);
 		                if (! $resql2)
 		                {
-		                    dolibarr_print_error($db);
+		                    dol_print_error($db);
 		                }
 		            }
 		            else
@@ -226,14 +226,14 @@ if ($_POST["action"] == 'sendallconfirmed')
 		                // Mail en echec
 		                $nbko++;
 
-				        dolibarr_syslog("mailing-send: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
+				        dol_syslog("mailing-send: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
 
 		                $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
 						$sql.=" SET statut=-1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid;
 		                $resql2=$db->query($sql);
 		                if (! $resql2)
 		                {
-		                    dolibarr_print_error($db);
+		                    dol_print_error($db);
 		                }
 		            }
 
@@ -253,17 +253,17 @@ if ($_POST["action"] == 'sendallconfirmed')
 		    }
 
 		    $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$id;
-		    dolibarr_syslog("mailing-send: update global status sql=".$sql, LOG_DEBUG);
+		    dol_syslog("mailing-send: update global status sql=".$sql, LOG_DEBUG);
 		    $resql2=$db->query($sql);
 		    if (! $resql2)
 		    {
-		        dolibarr_print_error($db);
+		        dol_print_error($db);
 		    }
 		}
 		else
 		{
-		    dolibarr_syslog($db->error());
-		    dolibarr_print_error($db);
+		    dol_syslog($db->error());
+		    dol_print_error($db);
 		}
 		$message='';
 		$_GET["action"] = '';
@@ -378,7 +378,7 @@ if ($_POST["action"] == 'confirm_valide')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 	else
@@ -419,7 +419,7 @@ if ($_POST["action"] == 'confirm_reset')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 	else
@@ -521,7 +521,7 @@ else
         $head[$h][1] = $langs->trans("MailHistory");
         $h++;
 */
-        dolibarr_fiche_head($head, $hselected, $langs->trans("Mailing"));
+        dol_fiche_head($head, $hselected, $langs->trans("Mailing"));
 
         // Confirmation de la validation du mailing
         if ($_GET["action"] == 'valide')
@@ -586,7 +586,7 @@ else
             $uc->fetch();
             print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>'.$uc->getNomUrl(1).'</td>';
             print '<td>'.$langs->trans("Date").'</td>';
-            print '<td>'.dolibarr_print_date($mil->date_creat,"dayhour").'</td></tr>';
+            print '<td>'.dol_print_date($mil->date_creat,"dayhour").'</td></tr>';
 
             if ($mil->statut > 0)
             {
@@ -594,14 +594,14 @@ else
                 $uv->fetch();
                 print '<tr><td>'.$langs->trans("ValidatedBy").'</td><td>'.$uv->getNomUrl(1).'</td>';
                 print '<td>'.$langs->trans("Date").'</td>';
-                print '<td>'.dolibarr_print_date($mil->date_valid,"dayhour").'</td></tr>';
+                print '<td>'.dol_print_date($mil->date_valid,"dayhour").'</td></tr>';
             }
 
             if ($mil->statut > 1)
             {
                 print '<tr><td>'.$langs->trans("SentBy").'</td><td>'.$langs->trans("Unknown").'</td>';
                 print '<td>'.$langs->trans("Date").'</td>';
-                print '<td>'.dolibarr_print_date($mil->date_envoi,"dayhour").'</td></tr>';
+                print '<td>'.dol_print_date($mil->date_envoi,"dayhour").'</td></tr>';
             }
 
             // Sujet
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index e306d654cbc..73b0bdea375 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -122,7 +122,7 @@ while (($file = readdir($handle))!==false)
                     }
                     else
                     {
-                      dolibarr_print_error($db);
+                      dol_print_error($db);
                     }
                     print '</tr>';
                 }
@@ -170,8 +170,8 @@ if ($result)
 
 	  print "<tr $bc[$var]>";
 	  print '<td nowrap="nowrap"><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>';
-	  print '<td>'.dolibarr_trunc($obj->titre,38).'</td>';
-	  print '<td align="center">'.dolibarr_print_date($obj->date_creat,'day').'</td>';
+	  print '<td>'.dol_trunc($obj->titre,38).'</td>';
+	  print '<td align="center">'.dol_print_date($obj->date_creat,'day').'</td>';
 	  print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>';
 	  $mailstatic=new Mailing($db);
 	  print '<td align="right">'.$mailstatic->LibStatut($obj->statut,5).'</td>';
@@ -189,7 +189,7 @@ if ($result)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php
index ae8e7b550d6..144dc5ac299 100644
--- a/htdocs/comm/mailing/liste.php
+++ b/htdocs/comm/mailing/liste.php
@@ -112,7 +112,7 @@ if ($result)
       print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/fiche.php?id='.$obj->rowid.'">';
       print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).'</a></td>';
       print '<td>'.$obj->titre.'</td>';
-      print '<td align="center">'.dolibarr_print_date($obj->datec,'day').'</td>';
+      print '<td align="center">'.dol_print_date($obj->datec,'day').'</td>';
       print '<td align="center">'.$obj->nbemail.'</td>';
       print '<td align="right">'.$email->LibStatut($obj->statut,5).'</td>';
       print "</tr>\n";
@@ -123,7 +123,7 @@ if ($result)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/comm/mailing/mailing.class.php b/htdocs/comm/mailing/mailing.class.php
index 92f8ea56aa3..75d6b003e98 100644
--- a/htdocs/comm/mailing/mailing.class.php
+++ b/htdocs/comm/mailing/mailing.class.php
@@ -103,7 +103,7 @@ class Mailing extends CommonObject
 			$this->titre = $langs->trans("NoTitle");
 		}
 
-		dolibarr_syslog("Mailing::Create sql=".$sql);
+		dol_syslog("Mailing::Create sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -124,7 +124,7 @@ class Mailing extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Mailing::Create ".$this->error, LOG_ERR);
+			dol_syslog("Mailing::Create ".$this->error, LOG_ERR);
 			$this->db->rollback();
 			return -1;
 		}
@@ -143,7 +143,7 @@ class Mailing extends CommonObject
 		$sql .= " , email_from = '".$this->email_from."'";
 		$sql .= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Mailing::Update sql=".$sql);
+		dol_syslog("Mailing::Update sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -152,7 +152,7 @@ class Mailing extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Mailing::Update ".$this->error, LOG_ERR);
+			dol_syslog("Mailing::Update ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -174,7 +174,7 @@ class Mailing extends CommonObject
 		$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
 		$sql .= " WHERE m.rowid = ".$rowid;
 
-		dolibarr_syslog("Mailing.class::fetch sql=".$sql);
+		dol_syslog("Mailing.class::fetch sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -205,13 +205,13 @@ class Mailing extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog("Mailing::Fetch Erreur -1");
+				dol_syslog("Mailing::Fetch Erreur -1");
 				return -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog("Mailing::Fetch Erreur -2");
+			dol_syslog("Mailing::Fetch Erreur -2");
 			return -2;
 		}
 	}
@@ -310,7 +310,7 @@ class Mailing extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Mailing::Valid ".$this->error, LOG_ERR);
+			dol_syslog("Mailing::Valid ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -335,7 +335,7 @@ class Mailing extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Mailing::Valid ".$this->error, LOG_ERR);
+			dol_syslog("Mailing::Valid ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php
index 8c26eb1267a..ee4ab3caee8 100644
--- a/htdocs/comm/multiprix.php
+++ b/htdocs/comm/multiprix.php
@@ -82,7 +82,7 @@ if ($_socid > 0)
 
 	$head = societe_prepare_head($objsoc);
 
-	dolibarr_fiche_head($head, 'customer', $langs->trans("ThirdParty"));
+	dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"));
 
 
 	print '<form method="POST" action="multiprix.php?id='.$objsoc->id.'">';
@@ -146,7 +146,7 @@ if ($_socid > 0)
 			$obj = $db->fetch_object($resql);
 			$tag = !$tag;
 			print '<tr '.$bc[$tag].'>';
-			print '<td>'.dolibarr_print_date($obj->dc,"dayhour").'</td>';
+			print '<td>'.dol_print_date($obj->dc,"dayhour").'</td>';
 			print '<td>'.$obj->price_level.' </td>';
 			$userstatic->id=$obj->uid;
 			$userstatic->nom=$obj->login;
@@ -159,7 +159,7 @@ if ($_socid > 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 }
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 6d5df60a067..c84fe2bd0fd 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -179,15 +179,15 @@ if ($_POST['action'] == 'setecheance')
 {
 	$propal = new Propal($db);
 	$propal->fetch($_GET['propalid']);
-	$result=$propal->set_echeance($user,dolibarr_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']));
-	if ($result < 0) dolibarr_print_error($db,$propal->error);
+	$result=$propal->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']));
+	if ($result < 0) dol_print_error($db,$propal->error);
 }
 if ($_POST['action'] == 'setdate_livraison')
 {
 	$propal = new Propal($db);
 	$propal->fetch($_GET['propalid']);
-	$result=$propal->set_date_livraison($user,dolibarr_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']));
-	if ($result < 0) dolibarr_print_error($db,$propal->error);
+	$result=$propal->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']));
+	if ($result < 0) dol_print_error($db,$propal->error);
 }
 
 if ($_POST['action'] == 'setdeliveryadress' && $user->rights->propale->creer)
@@ -195,7 +195,7 @@ if ($_POST['action'] == 'setdeliveryadress' && $user->rights->propale->creer)
 	$propal = new Propal($db);
 	$propal->fetch($_GET['propalid']);
 	$result=$propal->set_adresse_livraison($user,$_POST['adresse_livraison_id']);
-	if ($result < 0) dolibarr_print_error($db,$propal->error);
+	if ($result < 0) dol_print_error($db,$propal->error);
 }
 
 // Positionne ref client
@@ -222,8 +222,8 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
 	{
 		if ($propal->fetch($_POST['copie_propal']) > 0)
 		{
-			$propal->datep = dolibarr_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
-			$propal->date_livraison = dolibarr_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
+			$propal->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+			$propal->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
 			$propal->adresse_livraison_id = $_POST['adresse_livraison_id'];
 			$propal->duree_validite = $_POST['duree_validite'];
 			$propal->cond_reglement_id = $_POST['cond_reglement_id'];
@@ -248,8 +248,8 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
 	}
 	else
 	{
-		$propal->datep = dolibarr_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
-		$propal->date_livraison = dolibarr_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
+		$propal->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+		$propal->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
 		$propal->adresse_livraison_id = $_POST['adresse_livraison_id'];
 		$propal->duree_validite = $_POST['duree_validite'];
 		$propal->cond_reglement_id = $_POST['cond_reglement_id'];
@@ -309,7 +309,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
 				$outputlangs->setDefaultLang($_REQUEST['lang_id']);
 			}
 			propale_pdf_create($db, $id, $_REQUEST['model'], $outputlangs);
-			dolibarr_syslog('Redirect to '.$_SERVER["PHP_SELF"].'?propalid='.$id);
+			dol_syslog('Redirect to '.$_SERVER["PHP_SELF"].'?propalid='.$id);
 			Header ('Location: '.$_SERVER["PHP_SELF"].'?propalid='.$id);
 			exit;
 		}
@@ -320,7 +320,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
 	}
 	else
 	{
-		dolibarr_print_error($db,$propal->error);
+		dol_print_error($db,$propal->error);
 		$db->rollback();
 		exit;
 	}
@@ -493,7 +493,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel'])
 
 						if ($error)
 						{
-							dolibarr_print_error($db);
+							dol_print_error($db);
 						}
 						else
 						{
@@ -524,21 +524,21 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel'])
 			{
 				$langs->load("other");
 				$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').' !</div>';
-				dolibarr_syslog('Recipient email is empty');
+				dol_syslog('Recipient email is empty');
 			}
 		}
 		else
 		{
 			$langs->load("other");
 			$mesg='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
-			dolibarr_syslog('Failed to read file: '.$file);
+			dol_syslog('Failed to read file: '.$file);
 		}
 	}
 	else
 	{
 		$langs->load("other");
 		$mesg='<div class="error">'.$langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal")).'</div>';
-		dolibarr_syslog('Impossible de lire les donnees de la facture. Le fichier propal n\'a peut-etre pas ete genere.');
+		dol_syslog('Impossible de lire les donnees de la facture. Le fichier propal n\'a peut-etre pas ete genere.');
 	}
 }
 
@@ -587,7 +587,7 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer)
 		}
 		else
 		{
-			dolibarr_print_error($db,$prop->error);
+			dol_print_error($db,$prop->error);
 		}
 	}
 }
@@ -603,7 +603,7 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
 		$ret=$propal->fetch($_POST['propalid']);
 		if ($ret < 0)
 		{
-			dolibarr_print_error($db,$propal->error);
+			dol_print_error($db,$propal->error);
 			exit;
 		}
 		$ret=$propal->fetch_client();
@@ -711,7 +711,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
 	$propal = new Propal($db);
 	if (! $propal->fetch($_POST['propalid']) > 0)
 	{
-		dolibarr_print_error($db,$propal->error);
+		dol_print_error($db,$propal->error);
 		exit;
 	}
 
@@ -776,7 +776,7 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
 	$result=propale_pdf_create($db, $propal->id, $propal->modelpdf, $outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 	else
@@ -895,7 +895,7 @@ if ($id > 0 || ! empty($ref))
 	$societe->fetch($propal->socid);
 
 	$head = propal_prepare_head($propal);
-	dolibarr_fiche_head($head, 'comm', $langs->trans('Proposal'));
+	dol_fiche_head($head, 'comm', $langs->trans('Proposal'));
 
 	// Clone confirmation
 	if ($_GET["action"] == 'clone')
@@ -1009,7 +1009,7 @@ if ($id > 0 || ! empty($ref))
 
 	// Dates
 	print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
-	print dolibarr_print_date($propal->date,'daytext');
+	print dol_print_date($propal->date,'daytext');
 	print '</td>';
 
 	if ($conf->projet->enabled) $rowspan++;
@@ -1040,7 +1040,7 @@ if ($id > 0 || ! empty($ref))
 	{
 		if ($propal->fin_validite)
 		{
-			print dolibarr_print_date($propal->fin_validite,'daytext');
+			print dol_print_date($propal->fin_validite,'daytext');
 			if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
 		}
 		else
@@ -1070,7 +1070,7 @@ if ($id > 0 || ! empty($ref))
 	}
 	else
 	{
-		print dolibarr_print_date($propal->date_livraison,'daytext');
+		print dol_print_date($propal->date_livraison,'daytext');
 	}
 	print '</td>';
 	print '</tr>';
@@ -1528,7 +1528,7 @@ if ($id > 0 || ! empty($ref))
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	/*
@@ -1829,7 +1829,7 @@ if ($id > 0 || ! empty($ref))
 					$var=!$var;
 					print '<tr '.$bc[$var].'><td>';
 					print '<a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$coms[$i]->id.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$coms[$i]->ref."</a></td>\n";
-					print '<td align="center">'.dolibarr_print_date($coms[$i]->date,'day').'</td>';
+					print '<td align="center">'.dol_print_date($coms[$i]->date,'day').'</td>';
 					print '<td align="right">'.price($coms[$i]->total_ttc).'</td>';
 					print '<td align="right">'.$coms[$i]->getLibStatut(3).'</td>';
 					print "</tr>\n";
@@ -2075,10 +2075,10 @@ else
 
 			// Date propale
 			print '<td align="center">';
-			$y = dolibarr_print_date($objp->dp,'%Y');
-			$m = dolibarr_print_date($objp->dp,'%m');
-			$mt= dolibarr_print_date($objp->dp,'%b');
-			$d = dolibarr_print_date($objp->dp,'%d');
+			$y = dol_print_date($objp->dp,'%Y');
+			$m = dol_print_date($objp->dp,'%m');
+			$mt= dol_print_date($objp->dp,'%b');
+			$d = dol_print_date($objp->dp,'%d');
 			print $d."\n";
 			print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'&amp;month='.$m.'">';
 			print $mt."</a>\n";
@@ -2088,7 +2088,7 @@ else
 			// Date fin validite
 			if ($objp->dfv)
 			{
-				print '<td align="center">'.dolibarr_print_date($objp->dfv,'day');
+				print '<td align="center">'.dol_print_date($objp->dfv,'day');
 				print '</td>';
 			}
 			else
@@ -2112,7 +2112,7 @@ else
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 $db->close();
diff --git a/htdocs/comm/propal/aideremise.php b/htdocs/comm/propal/aideremise.php
index a61dcec701c..a94e5f7ce5e 100644
--- a/htdocs/comm/propal/aideremise.php
+++ b/htdocs/comm/propal/aideremise.php
@@ -73,7 +73,7 @@ if ($_GET["propalid"])
   $head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?propalid='.$propal->id;
   $head[$h][1] = "Info";
 
-  dolibarr_fiche_head($head, $a, $societe->nom);
+  dol_fiche_head($head, $a, $societe->nom);
 
   $price = $propal->price + $propal->remise;
 
diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php
index 9c82a94a214..eb1ccd56b08 100644
--- a/htdocs/comm/propal/apercu.php
+++ b/htdocs/comm/propal/apercu.php
@@ -68,7 +68,7 @@ if ($_GET["propalid"] > 0)
 		$soc->fetch($propal->socid);
 
 		$head = propal_prepare_head($propal);
-		dolibarr_fiche_head($head, 'preview', $langs->trans('Proposal'));
+		dol_fiche_head($head, 'preview', $langs->trans('Proposal'));
 
 
 		/*
@@ -124,7 +124,7 @@ if ($_GET["propalid"] > 0)
 				// ligne
 				// partie Gauche
 				print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
-				print dolibarr_print_date($propal->date,'daytext');
+				print dol_print_date($propal->date,'daytext');
 				print '</td>';
 
 				// partie Droite sur $rowspan lignes
@@ -159,7 +159,7 @@ if ($_GET["propalid"] > 0)
 
 					print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$propal->ref.'.pdf</a></td>';
 					print '<td align="right">'.filesize($file). ' bytes</td>';
-					print '<td align="right">'.dolibarr_print_date(filemtime($file),'dayhour').'</td>';
+					print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>';
 					print '</tr>';
 
 					// Si fichier detail PDF existe
@@ -168,7 +168,7 @@ if ($_GET["propalid"] > 0)
 
 						print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepathdetail).'">'.$propal->ref.'-detail.pdf</a></td>';
 						print '<td align="right">'.filesize($filedetail). ' bytes</td>';
-						print '<td align="right">'.dolibarr_print_date(filemtime($filedetail),'dayhour').'</td>';
+						print '<td align="right">'.dol_print_date(filemtime($filedetail),'dayhour').'</td>';
 						print '</tr>';
 					}
 					print "</table>\n";
@@ -210,7 +210,7 @@ if ($_GET["propalid"] > 0)
 				print '</table>';
 			}
 		} else {
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	} else {
 	// Propal non trouv�e
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index e690c8651ba..f3cd5134621 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -92,12 +92,12 @@ if ($_POST["action"] == 'updateligne' && $user->rights->propale->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -117,12 +117,12 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->propale->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -139,7 +139,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->propale->creer)
 		exit;
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -173,7 +173,7 @@ if ($id > 0)
 
 
 		$head = propal_prepare_head($propal);
-		dolibarr_fiche_head($head, 'contact', $langs->trans("Proposal"));
+		dol_fiche_head($head, 'contact', $langs->trans("Proposal"));
 
 
 		/*
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 305e1f26627..4a12df9f6cc 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -125,7 +125,7 @@ if ($propalid > 0)
         $societe->fetch($propal->socid);
 
 		$head = propal_prepare_head($propal);
-		dolibarr_fiche_head($head, 'document', $langs->trans('Proposal'));
+		dol_fiche_head($head, 'document', $langs->trans('Proposal'));
 
 		
 		// Construit liste des fichiers
@@ -166,7 +166,7 @@ if ($propalid > 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 else
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index 49b0e20cca0..ad4fb299a34 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -54,7 +54,7 @@ $societe = new Societe($db);
 $societe->fetch($propal->socid);
 
 $head = propal_prepare_head($propal);
-dolibarr_fiche_head($head, 'info', $langs->trans('Proposal'));
+dol_fiche_head($head, 'info', $langs->trans('Proposal'));
 
 $propal->info($propal->id);
 
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index eb6ba741996..cd95ae9ca5f 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -107,7 +107,7 @@ if ($_GET['propalid'])
 		if ( $societe->fetch($propal->socid) )
 		{
 			$head = propal_prepare_head($propal);
-			dolibarr_fiche_head($head, 'note', $langs->trans('Proposal'));
+			dol_fiche_head($head, 'note', $langs->trans('Proposal'));
 
             print '<table class="border" width="100%">';
 
@@ -129,7 +129,7 @@ if ($_GET['propalid'])
     
 			// Date
             print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
-            print dolibarr_print_date($propal->date,'daytext');
+            print dol_print_date($propal->date,'daytext');
             print '</td>';
     		print '</tr>';
     		
@@ -138,7 +138,7 @@ if ($_GET['propalid'])
             print '<td>'.$langs->trans('DateEndPropal').'</td><td colspan="3">';
             if ($propal->fin_validite)
             {
-                print dolibarr_print_date($propal->fin_validite,'daytext');
+                print dol_print_date($propal->fin_validite,'daytext');
                 if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
             }
             else
diff --git a/htdocs/comm/propal/stats/month.php b/htdocs/comm/propal/stats/month.php
index dde41bd2848..4f604738b5d 100644
--- a/htdocs/comm/propal/stats/month.php
+++ b/htdocs/comm/propal/stats/month.php
@@ -125,7 +125,7 @@ $data = array();
 
 for ($i = 1 ; $i < 13 ; $i++)
 {
-  $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
+  $data[$i-1] = array(ucfirst(substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
 }
 
 if (!$user->rights->societe->client->voir || $user->societe_id)
diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php
index febba5ee10a..f8a2c3d72b2 100644
--- a/htdocs/comm/prospect/fiche.php
+++ b/htdocs/comm/prospect/fiche.php
@@ -62,7 +62,7 @@ if ($_POST["action"] == 'setprospectlevel' && $user->rights->societe->creer)
 	$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$_POST['prospect_level_id'];
 	$sql.= "' WHERE rowid='".$_GET["socid"]."'";
 	$result = $db->query($sql);
-	if (! $result) dolibarr_print_error($result);
+	if (! $result) dol_print_error($result);
 }
 
 
@@ -84,7 +84,7 @@ if ($socid > 0)
 	$result = $societe->fetch($socid);
 	if ($result < 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		exit;
 	}
 
@@ -93,7 +93,7 @@ if ($socid > 0)
 	 */
 	$head = societe_prepare_head($societe);
 
-	dolibarr_fiche_head($head, 'prospect', $langs->trans("ThirdParty"));
+	dol_fiche_head($head, 'prospect', $langs->trans("ThirdParty"));
 
 	print '<table width="100%" class="notopnoleftnoright">';
 	print '<tr><td valign="top" width="50%" class="notopnoleft">';
@@ -209,7 +209,7 @@ if ($socid > 0)
 				{
 					print " ".img_warning();
 				}
-				print "</td><td align=\"right\">".dolibarr_print_date($objp->dp,"day")."</td>\n";
+				print "</td><td align=\"right\">".dol_print_date($objp->dp,"day")."</td>\n";
 				print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
 				print "<td align=\"right\">".$propal_static->LibStatut($objp->fk_statut,5)."</td></tr>\n";
 				$i++;
@@ -218,7 +218,7 @@ if ($socid > 0)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print "</table>";
diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php
index f1b30c0ef41..0f6e48d72b8 100644
--- a/htdocs/comm/prospect/index.php
+++ b/htdocs/comm/prospect/index.php
@@ -198,7 +198,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
     
                 print "<td><a href=\"fiche.php?id=".$obj->socid."\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom."</a></td>\n";
                 print "<td align=\"right\">";
-                print dolibarr_print_date($obj->dp,'day')."</td>\n";
+                print dol_print_date($obj->dp,'day')."</td>\n";
                 print "<td align=\"right\">".price($obj->total_ttc)."</td></tr>\n";
                 $i++;
                 $total += $obj->price;
@@ -211,7 +211,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
     }
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/comm/prospect/prospects.php b/htdocs/comm/prospect/prospects.php
index 289278c8d78..725e053894a 100644
--- a/htdocs/comm/prospect/prospects.php
+++ b/htdocs/comm/prospect/prospects.php
@@ -96,7 +96,7 @@ else
 }
 
 // Select every potentiels, and note each potentiels which fit in search parameters
-dolibarr_syslog('prospects::prospects_prospect_level',LOG_DEBUG);
+dol_syslog('prospects::prospects_prospect_level',LOG_DEBUG);
 $sql = "SELECT code, label, sortorder, ".$sortwhere;
 $sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
 $sql.= " WHERE active > 0";
@@ -129,7 +129,7 @@ if ($resql)
 	// If no paramters was set, $search_levels will be empty
 	$search_levels = implode(',', $search_levels);
 }
-else dolibarr_print_error($db);
+else dol_print_error($db);
 
 // Load sale and categ filters
 $search_sale = isset($_GET["search_sale"])?$_GET["search_sale"]:$_POST["search_sale"];
@@ -309,7 +309,7 @@ if ($resql)
  		}
  		else
  		{
- 			dolibarr_print_error($db);
+ 			dol_print_error($db);
  		}
  		print '</select> &nbsp;  &nbsp;  &nbsp; ';
  	}
@@ -426,7 +426,7 @@ if ($resql)
 		print "<td>".$obj->ville."&nbsp;</td>";
 		print "<td align=\"center\">$obj->departement</td>";
 		// Creation date
-		print "<td align=\"center\">".dolibarr_print_date($obj->datec)."</td>";
+		print "<td align=\"center\">".dol_print_date($obj->datec)."</td>";
 		// Level
 		print "<td align=\"center\">";
 		print $prospectstatic->LibLevel($obj->fk_prospectlevel);
@@ -463,7 +463,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php
index fee032f93de..034aaead30d 100644
--- a/htdocs/comm/prospect/recap-prospect.php
+++ b/htdocs/comm/prospect/recap-prospect.php
@@ -59,7 +59,7 @@ if ($socid > 0)
      */
 	$head = societe_prepare_head($societe);
 
-    dolibarr_fiche_head($head, 'prospect', $langs->trans("ThirdParty"));
+    dol_fiche_head($head, 'prospect', $langs->trans("ThirdParty"));
 
 
     print "<table width=\"100%\">\n";
@@ -86,7 +86,7 @@ if ($socid > 0)
 }
 else
 {
-  	dolibarr_print_error($db);
+  	dol_print_error($db);
 }
 
 
diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php
index 7889ef3cb30..c1941cb871c 100644
--- a/htdocs/comm/recap-client.php
+++ b/htdocs/comm/recap-client.php
@@ -59,7 +59,7 @@ if ($socid > 0)
      */
 	$head = societe_prepare_head($societe);
 	
-    dolibarr_fiche_head($head, 'customer', $langs->trans("ThirdParty"));
+    dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"));
 
 
     print "<table width=\"100%\">\n";
@@ -86,7 +86,7 @@ if ($socid > 0)
 }
 else
 {
-  	dolibarr_print_error($db);
+  	dol_print_error($db);
 }
 
 
diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index cf878e209b0..97c77fc8966 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -88,7 +88,7 @@ if ($_socid > 0)
 	 */
 	$head = societe_prepare_head($objsoc);
 
-	dolibarr_fiche_head($head, 'relativediscount', $objsoc->nom);
+	dol_fiche_head($head, 'relativediscount', $objsoc->nom);
 
 
     /*
@@ -153,7 +153,7 @@ if ($_socid > 0)
 	    $obj = $db->fetch_object($resql);
 	    $tag = !$tag;
 	    print '<tr '.$bc[$tag].'>';
-	    print '<td>'.dolibarr_print_date($obj->dc,"dayhour").'</td>';
+	    print '<td>'.dol_print_date($obj->dc,"dayhour").'</td>';
 	    print '<td align="center">'.$obj->remise_client.' %</td>';
 	    print '<td align="left">'.$obj->note.'</td>';
 	    print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
@@ -165,7 +165,7 @@ if ($_socid > 0)
       }
     else
       {
-	dolibarr_print_error($db);
+	dol_print_error($db);
       }
 
 }
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 1d94133f35a..e638e2f94ea 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -117,7 +117,7 @@ if ($_socid > 0)
 	 */
 	$head = societe_prepare_head($objsoc);
 
-	dolibarr_fiche_head($head, 'absolutediscount', $objsoc->nom);
+	dol_fiche_head($head, 'absolutediscount', $objsoc->nom);
 
 
     print '<form method="POST" action="remx.php?id='.$objsoc->id.'">';
@@ -141,7 +141,7 @@ if ($_socid > 0)
     }
     else
     {
-    	dolibarr_print_error($db);
+    	dol_print_error($db);
     }
 
     print '<tr><td width="38%">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
@@ -208,7 +208,7 @@ if ($_socid > 0)
             $obj = $db->fetch_object($resql);
             $var = !$var;
             print "<tr $bc[$var]>";
-            print '<td>'.dolibarr_print_date($obj->dc,'dayhour').'</td>';
+            print '<td>'.dol_print_date($obj->dc,'dayhour').'</td>';
             print '<td>';
 			if ($obj->description == '(CREDIT_NOTE)')
 			{
@@ -238,7 +238,7 @@ if ($_socid > 0)
     }
     else
     {
-    	dolibarr_print_error($db);
+    	dol_print_error($db);
     }
 
     print '<br>';
@@ -327,7 +327,7 @@ if ($_socid > 0)
             $obj = array_shift($tab_sqlobj);
             $var = !$var;
             print "<tr $bc[$var]>";
-            print '<td>'.dolibarr_print_date($obj->dc,'dayhour').'</td>';
+            print '<td>'.dol_print_date($obj->dc,'dayhour').'</td>';
             print '<td>';
 			if ($obj->description == '(CREDIT_NOTE)')
 			{
@@ -356,7 +356,7 @@ if ($_socid > 0)
     }
     else
     {
-        print dolibarr_print_error($db);
+        print dol_print_error($db);
     }
 
 }
diff --git a/htdocs/comm/stats.php b/htdocs/comm/stats.php
index eb6e2372ab1..cb9dd0d2ad5 100644
--- a/htdocs/comm/stats.php
+++ b/htdocs/comm/stats.php
@@ -55,14 +55,14 @@ $msq = '' ;
 // Date de d�but du graphe
 $date_debut = time() ;
 $annees = "" ;
-if ($conf->global->SOCIETE_FISCAL_MONTH_START < dolibarr_date("m",time()) ){
+if ($conf->global->SOCIETE_FISCAL_MONTH_START < dol_date("m",time()) ){
 	// Si le mois actuel est plus grand, l'ann�e de d�part est l� m�me que l'ann�e actuelle
-	$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dolibarr_date("Y",time())) ;
-	$annees = dolibarr_date("Y",time()) ;
+	$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dol_date("Y",time())) ;
+	$annees = dol_date("Y",time()) ;
 } else {
 	// Sinon le d�but de l'ann�e comptable �tait l'ann�e d'avant
-	$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dolibarr_date("Y",time())-1) ;
-	$annees = (dolibarr_date("Y",time())-1).' - '.(dolibarr_date("Y",time())) ;
+	$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dol_date("Y",time())-1) ;
+	$annees = (dol_date("Y",time())-1).' - '.(dol_date("Y",time())) ;
 }
 
 /**********************************************
@@ -85,7 +85,7 @@ $recapMoisMR = array() ;
 if($result){
 	if($db->num_rows($result)>0){
 		while($obj = $db->fetch_object($result)){
-			if($obj->date != dolibarr_date("Ym",time())){
+			if($obj->date != dol_date("Ym",time())){
 				$recapAnneeCA[] = array( $obj->month, $obj->CAMois ) ;
 				$recapAnneeMR[] = array( $obj->month, $obj->MRMois ) ;
 			}else{
@@ -113,12 +113,12 @@ $graphfiles=array(
 		),
 		'recapMoisCA'         =>array(
 			'file' => 'recapMoisCA.png', 
-			'label' => $langs->trans('CAOrder').' '.$langs->trans('FromTo',dolibarr_date("01/m/Y",time()),dolibarr_date("d/m/Y",time())),
+			'label' => $langs->trans('CAOrder').' '.$langs->trans('FromTo',dol_date("01/m/Y",time()),dol_date("d/m/Y",time())),
 			'data' => $recapMoisCA
 		),
 		'recapMoisMR'=>array(
 			'file' => 'recapMoisMR.png', 
-			'label' => $langs->trans('MargeOrder').' '.$langs->trans('FromTo',dolibarr_date("01/m/Y",time()),dolibarr_date("d/m/Y",time())),
+			'label' => $langs->trans('MargeOrder').' '.$langs->trans('FromTo',dol_date("01/m/Y",time()),dol_date("d/m/Y",time())),
 			'data' => $recapMoisMR
 		)
 ) ;
@@ -151,7 +151,7 @@ if (! $mesg)
 			}
 			else
 			{
-				dolibarr_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
+				dol_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
 			}
 	}
 	
@@ -164,7 +164,7 @@ if (! $mesg)
  ************/
 // en-t�te
 if($mesg) print '<div class="error">'.$mesg.'</div>' ;
-dolibarr_fiche_head(array(array('stats.php',$langs->trans("Commercial"))), 0, $langs->trans("Stats"));
+dol_fiche_head(array(array('stats.php',$langs->trans("Commercial"))), 0, $langs->trans("Stats"));
 /*****************************
  * Rappel Infos du Commercial
  *****************************/
@@ -180,7 +180,7 @@ print '<table class="border" width="100%">
 	</tr>
 </table>' ;
 
-print "</div>" ; // Fin de dolibarr_fiche_head
+print "</div>" ; // Fin de dol_fiche_head
 
 /***************************
  * Affichage des Graphiques
@@ -189,7 +189,7 @@ print "</div>" ; // Fin de dolibarr_fiche_head
 foreach($graphfiles as $graph){
 	// donn�es
 	$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_comm&file='.urlencode($user->id .'/'.$graph['file']);
-	$generateOn = (file_exists($dir."/".$graph['file']))? $langs->trans("GeneratedOn",dolibarr_print_date(filemtime($dir."/".$graph['file']),"dayhour")) : "" ;
+	$generateOn = (file_exists($dir."/".$graph['file']))? $langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graph['file']),"dayhour")) : "" ;
 	
 	// html
 	print '<table class="border" style="float:left;margin:5px;width:48%;min-width:400px;">
diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php
index c52764dff2c..c1046f09923 100644
--- a/htdocs/commande/apercu.php
+++ b/htdocs/commande/apercu.php
@@ -80,7 +80,7 @@ if ($_GET["id"] > 0) {
 
 
 		$head = commande_prepare_head($commande);
-        dolibarr_fiche_head($head, 'preview', $langs->trans("CustomerOrder"));
+        dol_fiche_head($head, 'preview', $langs->trans("CustomerOrder"));
 
 
 		/*
@@ -161,7 +161,7 @@ if ($_GET["id"] > 0) {
 
 					print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
 					print '<td align="right">'.filesize($file). ' bytes</td>';
-					print '<td align="right">'.dolibarr_print_date(filemtime($file),'dayhour').'</td>';
+					print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>';
 					print '</tr>';
 
 					// Si fichier detail PDF existe
@@ -170,7 +170,7 @@ if ($_GET["id"] > 0) {
 
 						print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepathdetail).'">'.$commande->ref.'-detail.pdf</a></td>';
 						print '<td align="right">'.filesize($filedetail). ' bytes</td>';
-						print '<td align="right">'.dolibarr_print_date(filemtime($filedetail),'dayhour').'</td>';
+						print '<td align="right">'.dol_print_date(filemtime($filedetail),'dayhour').'</td>';
 						print '</tr>';
 					}
 					print "</table>\n";
@@ -220,7 +220,7 @@ if ($_GET["id"] > 0) {
 
 		        // Date
 		        print '<tr><td>'.$langs->trans("Date").'</td>';
-		        print "<td colspan=\"2\">".dolibarr_print_date($commande->date,"daytext")."</td>\n";
+		        print "<td colspan=\"2\">".dol_print_date($commande->date,"daytext")."</td>\n";
 		        print '</tr>';
 
 				// ligne 6
@@ -237,7 +237,7 @@ if ($_GET["id"] > 0) {
 				print '</table>';
 			}
 		} else {
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	} else {
 	// Commande non trouv�e
diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php
index 660194a69cc..6e522a91954 100644
--- a/htdocs/commande/commande.class.php
+++ b/htdocs/commande/commande.class.php
@@ -104,7 +104,7 @@ class Commande extends CommonObject
 	 */
 	function create_from_propale($user, $propale_id)
 	{
-		dolibarr_syslog("Commande::create_from_propale propale_id=$propale_id");
+		dol_syslog("Commande::create_from_propale propale_id=$propale_id");
 
 		$propal = new Propal($this->db);
 		$propal->fetch($propale_id);
@@ -181,7 +181,7 @@ class Commande extends CommonObject
 				}
 				else
 				{
-					dolibarr_print_error($db,"Commande::getNextNumRef ".$obj->error);
+					dol_print_error($db,"Commande::getNextNumRef ".$obj->error);
 					return "";
 				}
 			}
@@ -342,7 +342,7 @@ class Commande extends CommonObject
 		$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET fk_statut = 0";
 		$sql .= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Commande::set_draft sql=".$sql, LOG_DEBUG);
+		dol_syslog("Commande::set_draft sql=".$sql, LOG_DEBUG);
 		if ($this->db->query($sql))
 		{
 			// If stock is decremented on validate order, we must reincrement it
@@ -380,7 +380,7 @@ class Commande extends CommonObject
 		{
 			$this->error=$this->db->error();
 			$this->db->rollback();
-			dolibarr_syslog($this->error, LOG_ERR);
+			dol_syslog($this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -409,7 +409,7 @@ class Commande extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog($this->error, LOG_ERR);
+				dol_syslog($this->error, LOG_ERR);
 				return -1;
 			}
 		}
@@ -461,7 +461,7 @@ class Commande extends CommonObject
 			{
 				$this->error=$this->db->error();
 				$this->db->rollback();
-				dolibarr_syslog($this->error, LOG_ERR);
+				dol_syslog($this->error, LOG_ERR);
 				return -1;
 			}
 		}
@@ -478,13 +478,13 @@ class Commande extends CommonObject
 		// Nettoyage parametres
 		$this->brouillon = 1;		// On positionne en mode brouillon la commande
 
-		dolibarr_syslog("Commande::create");
+		dol_syslog("Commande::create");
 
 		// Verification parametres
 		if (! empty($conf->global->COMMANDE_REQUIRE_SOURCE) && $this->source < 0)
 		{
 			$this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Source"));
-			dolibarr_syslog("Commande::create ".$this->error, LOG_ERR);
+			dol_syslog("Commande::create ".$this->error, LOG_ERR);
 			return -1;
 		}
 		if (! $remise) $remise=0;
@@ -495,7 +495,7 @@ class Commande extends CommonObject
 		if ($result < 0)
 		{
 			$this->error="Failed to fetch company";
-			dolibarr_syslog("Commande::create ".$this->error, LOG_ERR);
+			dol_syslog("Commande::create ".$this->error, LOG_ERR);
 			return -2;
 		}
 
@@ -516,7 +516,7 @@ class Commande extends CommonObject
 		$sql.= " ".($this->remise_absolue>0?$this->remise_absolue:'NULL').",";
 		$sql.= " '".$this->remise_percent."')";
 
-		dolibarr_syslog("Commande::create sql=".$sql);
+		dol_syslog("Commande::create sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -551,7 +551,7 @@ class Commande extends CommonObject
 					if ($resql < 0)
 					{
 		    $this->error=$this->db->error;
-		    dolibarr_print_error($this->db);
+		    dol_print_error($this->db);
 		    break;
 					}
 	  	}
@@ -606,7 +606,7 @@ class Commande extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->db->rollback();
 			return -1;
 		}
@@ -637,7 +637,7 @@ class Commande extends CommonObject
 	 */
 	function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='')
 	{
-		dolibarr_syslog("Commande::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end", LOG_DEBUG);
+		dol_syslog("Commande::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end", LOG_DEBUG);
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
 
 		// Clean parameters
@@ -719,7 +719,7 @@ class Commande extends CommonObject
 				else
 				{
 					$this->error=$this->db->error();
-					dolibarr_syslog("Error sql=$sql, error=".$this->error);
+					dol_syslog("Error sql=$sql, error=".$this->error);
 					$this->db->rollback();
 					return -1;
 				}
@@ -832,7 +832,7 @@ class Commande extends CommonObject
 		if ($ref) $sql.= " WHERE c.ref='".$ref."'";
 		else $sql.= " WHERE c.rowid=".$id;
 
-		dolibarr_syslog("Commande::fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("Commande::fetch sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql) ;
 		if ($result)
 		{
@@ -902,14 +902,14 @@ class Commande extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog('Commande::Fetch Error rowid='.$rowid.' numrows=0 sql='.$sql);
+				dol_syslog('Commande::Fetch Error rowid='.$rowid.' numrows=0 sql='.$sql);
 				$this->error='Order with id '.$rowid.' not found sql='.$sql;
 				return -2;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('Commande::Fetch Error rowid='.$rowid.' Erreur dans fetch de la commande');
+			dol_syslog('Commande::Fetch Error rowid='.$rowid.' Erreur dans fetch de la commande');
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -1009,7 +1009,7 @@ class Commande extends CommonObject
 		if ($only_product) $sql .= ' AND p.fk_product_type = 0';
 		$sql .= ' ORDER BY l.rang';
 
-		dolibarr_syslog("Commande::fetch_lines sql=".$sql,LOG_DEBUG);
+		dol_syslog("Commande::fetch_lines sql=".$sql,LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -1059,7 +1059,7 @@ class Commande extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog('Commande::fetch_lines: Error '.$this->error);
+			dol_syslog('Commande::fetch_lines: Error '.$this->error);
 			return -3;
 		}
 	}
@@ -1102,7 +1102,7 @@ class Commande extends CommonObject
 		$sql.= ' GROUP BY cd.rowid, cd.fk_product';
 		//print $sql;
 
-		dolibarr_syslog("Commande::loadExpeditions sql=".$sql,LOG_DEBUG);
+		dol_syslog("Commande::loadExpeditions sql=".$sql,LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -1120,7 +1120,7 @@ class Commande extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Commande::loadExpeditions ".$this->error,LOG_ERR);
+			dol_syslog("Commande::loadExpeditions ".$this->error,LOG_ERR);
 			return -1;
 		}
 
@@ -1337,7 +1337,7 @@ class Commande extends CommonObject
 			$sql.= ' SET remise_absolue = '.$remise;
 			$sql.= ' WHERE rowid = '.$this->id.' AND fk_statut = 0 ;';
 
-			dolibarr_syslog("Commande::set_remise_absolue sql=$sql");
+			dol_syslog("Commande::set_remise_absolue sql=$sql");
 
 			if ($this->db->query($sql))
 	  {
@@ -1368,7 +1368,7 @@ class Commande extends CommonObject
 			$sql.= " SET date_livraison = ".($date_livraison ? $this->db->idate($date_livraison) : 'null');
 			$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
 
-			dolibarr_syslog("Commande::set_date_livraison sql=$sql",LOG_DEBUG);
+			dol_syslog("Commande::set_date_livraison sql=$sql",LOG_DEBUG);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -1378,7 +1378,7 @@ class Commande extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Commande::set_date_livraison ".$this->error,LOG_ERR);
+				dol_syslog("Commande::set_date_livraison ".$this->error,LOG_ERR);
 				return -1;
 			}
 		}
@@ -1409,7 +1409,7 @@ class Commande extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Commande::set_adresse_livraison Erreur SQL");
+				dol_syslog("Commande::set_adresse_livraison Erreur SQL");
 				return -1;
 			}
 		}
@@ -1476,7 +1476,7 @@ class Commande extends CommonObject
 	 */
 	function cond_reglement($cond_reglement_id)
 	{
-		dolibarr_syslog('Commande::cond_reglement('.$cond_reglement_id.')');
+		dol_syslog('Commande::cond_reglement('.$cond_reglement_id.')');
 		if ($this->statut >= 0)
 		{
 			$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
@@ -1489,14 +1489,14 @@ class Commande extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog('Commande::cond_reglement Erreur '.$sql.' - '.$this->db->error());
+				dol_syslog('Commande::cond_reglement Erreur '.$sql.' - '.$this->db->error());
 				$this->error=$this->db->error();
 				return -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('Commande::cond_reglement, etat commande incompatible');
+			dol_syslog('Commande::cond_reglement, etat commande incompatible');
 			$this->error='Etat commande incompatible '.$this->statut;
 			return -2;
 		}
@@ -1510,7 +1510,7 @@ class Commande extends CommonObject
 	 */
 	function mode_reglement($mode_reglement_id)
 	{
-		dolibarr_syslog('Commande::mode_reglement('.$mode_reglement_id.')');
+		dol_syslog('Commande::mode_reglement('.$mode_reglement_id.')');
 		if ($this->statut >= 0)
 		{
 			$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
@@ -1523,14 +1523,14 @@ class Commande extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog('Commande::mode_reglement Erreur '.$sql.' - '.$this->db->error());
+				dol_syslog('Commande::mode_reglement Erreur '.$sql.' - '.$this->db->error());
 				$this->error=$this->db->error();
 				return -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('Commande::mode_reglement, etat facture incompatible');
+			dol_syslog('Commande::mode_reglement, etat facture incompatible');
 			$this->error='Etat commande incompatible '.$this->statut;
 			return -2;
 		}
@@ -1546,7 +1546,7 @@ class Commande extends CommonObject
 	{
 		if ($user->rights->commande->creer)
 		{
-			dolibarr_syslog('Commande::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
+			dol_syslog('Commande::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
 
 			$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET ref_client = '.(empty($ref_client) ? 'NULL' : '\''.addslashes($ref_client).'\'');
 			$sql.= ' WHERE rowid = '.$this->id;
@@ -1558,7 +1558,7 @@ class Commande extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog('Commande::set_ref_client Erreur '.$this->error.' - '.$sql);
+				dol_syslog('Commande::set_ref_client Erreur '.$this->error.' - '.$sql);
 				return -2;
 			}
 		}
@@ -1591,7 +1591,7 @@ class Commande extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1612,7 +1612,7 @@ class Commande extends CommonObject
 	 */
 	function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='')
 	{
-		dolibarr_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $date_start, $date_end");
+		dol_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $date_start, $date_end");
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
 
 		if ($this->brouillon)
@@ -1994,7 +1994,7 @@ class Commande extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -2007,7 +2007,7 @@ class Commande extends CommonObject
 	{
 		global $user,$langs;
 
-		dolibarr_syslog("Commande::initAsSpecimen");
+		dol_syslog("Commande::initAsSpecimen");
 
 		// Charge tableau des id de societe socids
 		$socids = array();
@@ -2109,7 +2109,7 @@ class Commande extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -2223,7 +2223,7 @@ class CommandeLigne
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -2238,7 +2238,7 @@ class CommandeLigne
 
 		$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->id."';";
 
-		dolibarr_syslog("CommandeLigne::delete sql=".$sql);
+		dol_syslog("CommandeLigne::delete sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -2254,7 +2254,7 @@ class CommandeLigne
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("CommandeLigne::delete ".$this->error);
+			dol_syslog("CommandeLigne::delete ".$this->error);
 			return -1;
 		}
 	}
@@ -2268,7 +2268,7 @@ class CommandeLigne
 	{
 		global $langs, $conf, $user;
 
-		dolibarr_syslog("CommandeLigne::insert rang=".$this->rang);
+		dol_syslog("CommandeLigne::insert rang=".$this->rang);
 		$this->db->begin();
 
 		$rangtouse=$this->rang;
@@ -2285,7 +2285,7 @@ class CommandeLigne
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				$this->db->rollback();
 				return -1;
 			}
@@ -2328,7 +2328,7 @@ class CommandeLigne
 		else { $sql.='null'; }
 		$sql.= ')';
 
-		dolibarr_syslog("CommandeLigne::insert sql=$sql");
+		dol_syslog("CommandeLigne::insert sql=$sql");
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -2350,7 +2350,7 @@ class CommandeLigne
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("CommandeLigne::insert Error ".$this->error);
+			dol_syslog("CommandeLigne::insert Error ".$this->error);
 			$this->db->rollback();
 			return -2;
 		}
@@ -2372,7 +2372,7 @@ class CommandeLigne
 		$sql.= ",total_ttc='".price2num($this->total_ttc)."'";
 		$sql.= " WHERE rowid = ".$this->rowid;
 
-		dolibarr_syslog("CommandeLigne::update_total sql=$sql");
+		dol_syslog("CommandeLigne::update_total sql=$sql");
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -2383,7 +2383,7 @@ class CommandeLigne
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("CommandeLigne::update_total Error ".$this->error);
+			dol_syslog("CommandeLigne::update_total Error ".$this->error);
 			$this->db->rollback();
 			return -2;
 		}
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index 7ae753948a8..1ccc5688496 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -92,12 +92,12 @@ if ($_POST["action"] == 'updateligne' && $user->rights->commande->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -117,12 +117,12 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->commande->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -139,7 +139,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->commande->creer)
 		exit;
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -171,7 +171,7 @@ if ($id > 0 || ! empty($ref))
 
 
 		$head = commande_prepare_head($commande);
-		dolibarr_fiche_head($head, 'contact', $langs->trans("CustomerOrder"));
+		dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"));
 
 
 		/*
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index 2dae3cf5a39..22817576444 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -67,7 +67,7 @@ $ref= $_GET['ref'];
 $commande = new Commande($db);
 if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0) 
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
@@ -123,7 +123,7 @@ if ($id > 0 || ! empty($ref))
 	$societe->fetch($commande->socid);
 
 	$head = commande_prepare_head($commande);
-	dolibarr_fiche_head($head, 'documents', $langs->trans('CustomerOrder'));
+	dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'));
 
 
 	// Construit liste des fichiers
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 236029b1532..e047fde01dd 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -125,8 +125,8 @@ if ($_POST['action'] == 'classin')
 if ($_POST['action'] == 'add' && $user->rights->commande->creer)
 {
 	$datecommande='';
-	$datecommande  = dolibarr_mktime(12, 0, 0, $_POST['remonth'],  $_POST['reday'],  $_POST['reyear']);
-	$datelivraison = dolibarr_mktime(12, 0, 0, $_POST['liv_month'],$_POST['liv_day'],$_POST['liv_year']);
+	$datecommande  = dol_mktime(12, 0, 0, $_POST['remonth'],  $_POST['reday'],  $_POST['reyear']);
+	$datelivraison = dol_mktime(12, 0, 0, $_POST['liv_month'],$_POST['liv_day'],$_POST['liv_year']);
 
 	$commande = new Commande($db);
 	$commande->socid=$_POST['socid'];
@@ -226,7 +226,7 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->commande->creer)
 		}
 		else
 		{
-	  dolibarr_print_error($db,$com->error);
+	  dol_print_error($db,$com->error);
 		}
 	}
 }
@@ -234,7 +234,7 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->commande->creer)
 if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer)
 {
 	//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
-	$datelivraison=dolibarr_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
+	$datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
 
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
@@ -257,7 +257,7 @@ if ($_POST['action'] == 'setmode' && $user->rights->commande->creer)
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
 	$result=$commande->mode_reglement($_POST['mode_reglement_id']);
-	if ($result < 0) dolibarr_print_error($db,$commande->error);
+	if ($result < 0) dol_print_error($db,$commande->error);
 }
 
 if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
@@ -265,7 +265,7 @@ if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
 	$result=$commande->cond_reglement($_POST['cond_reglement_id']);
-	if ($result < 0) dolibarr_print_error($db,$commande->error);
+	if ($result < 0) dol_print_error($db,$commande->error);
 }
 
 if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->facture->creer)
@@ -295,15 +295,15 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
 		$ret=$commande->fetch($_POST['id']);
 		if ($ret < 0)
 		{
-			dolibarr_print_error($db,$commande->error);
+			dol_print_error($db,$commande->error);
 			exit;
 		}
 		$ret=$commande->fetch_client();
 
 		// Clean parameters
 		$suffixe = $_POST['idprod'] ? '_prod' : '';
-		$date_start=dolibarr_mktime(0, 0, 0, $_POST['date_start'.$suffixe.'month'], $_POST['date_start'.$suffixe.'day'], $_POST['date_start'.$suffixe.'year']);
-		$date_end=dolibarr_mktime(0, 0, 0, $_POST['date_end'.$suffixe.'month'], $_POST['date_end'.$suffixe.'day'], $_POST['date_end'.$suffixe.'year']);
+		$date_start=dol_mktime(0, 0, 0, $_POST['date_start'.$suffixe.'month'], $_POST['date_start'.$suffixe.'day'], $_POST['date_start'.$suffixe.'year']);
+		$date_end=dol_mktime(0, 0, 0, $_POST['date_end'.$suffixe.'month'], $_POST['date_end'.$suffixe.'day'], $_POST['date_end'.$suffixe.'year']);
 		$price_base_type = 'HT';
 
 		// Ecrase $pu par celui du produit
@@ -408,12 +408,12 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
 if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POST['save'] == $langs->trans('Save'))
 {
 	$commande = new Commande($db,'',$_POST['id']);
-	if (! $commande->fetch($_POST['id']) > 0) dolibarr_print_error($db);
+	if (! $commande->fetch($_POST['id']) > 0) dol_print_error($db);
 
 	// Clean parameters
 	$description=dol_htmlcleanlastbr($_POST['eldesc']);
-	$date_start=dolibarr_mktime(0, 0, 0, $_POST['date_start'.$suffixe.'month'], $_POST['date_start'.$suffixe.'day'], $_POST['date_start'.$suffixe.'year']);
-	$date_end=dolibarr_mktime(0, 0, 0, $_POST['date_end'.$suffixe.'month'], $_POST['date_end'.$suffixe.'day'], $_POST['date_end'.$suffixe.'year']);
+	$date_start=dol_mktime(0, 0, 0, $_POST['date_start'.$suffixe.'month'], $_POST['date_start'.$suffixe.'day'], $_POST['date_start'.$suffixe.'year']);
+	$date_end=dol_mktime(0, 0, 0, $_POST['date_end'.$suffixe.'month'], $_POST['date_end'.$suffixe.'day'], $_POST['date_end'.$suffixe.'year']);
 
 	// Define info_bits
 	$info_bits=0;
@@ -453,7 +453,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
 		}
 		else
 		{
-			dolibarr_print_error($db,$commande->error);
+			dol_print_error($db,$commande->error);
 			exit;
 		}
 	}
@@ -582,7 +582,7 @@ if ($_REQUEST['action'] == 'builddoc')	// In get or post
 	$result=commande_pdf_create($db, $commande->id, $commande->modelpdf, $outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 	else
@@ -746,7 +746,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel'])
 
 						if ($error)
 						{
-							dolibarr_print_error($db);
+							dol_print_error($db);
 						}
 						else
 						{
@@ -777,21 +777,21 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel'])
 				$langs->load("other");
 				$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').' !</div>';
 				$_GET["action"]='presend';
-				dolibarr_syslog('Recipient email is empty');
+				dol_syslog('Recipient email is empty');
 			}
 		}
 		else
 		{
 			$langs->load("other");
 			$mesg='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
-			dolibarr_syslog('Failed to read file: '.$file);
+			dol_syslog('Failed to read file: '.$file);
 		}
 	}
 	else
 	{
 		$langs->load("other");
 		$mesg='<div class="error">'.$langs->trans('ErrorFailedToReadEntity',$langs->trans("Invoice")).'</div>';
-		dolibarr_syslog('Impossible de lire les donnees de la facture. Le fichier facture n\'a peut-etre pas ete genere.');
+		dol_syslog('Impossible de lire les donnees de la facture. Le fichier facture n\'a peut-etre pas ete genere.');
 	}
 }
 
@@ -1083,7 +1083,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
 				}
 				else
 				{
-					dolibarr_print_error($db);
+					dol_print_error($db);
 				}
 
 				print '</table>';
@@ -1092,7 +1092,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 else
@@ -1122,7 +1122,7 @@ else
 			$author->fetch();
 
 			$head = commande_prepare_head($commande);
-			dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder"));
+			dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"));
 
 			/*
 			 * Confirmation de la suppression de la commande
@@ -1255,7 +1255,7 @@ else
 
 			// Date
 			print '<tr><td>'.$langs->trans('Date').'</td>';
-			print '<td colspan="2">'.dolibarr_print_date($commande->date,'daytext').'</td>';
+			print '<td colspan="2">'.dol_print_date($commande->date,'daytext').'</td>';
 			print '<td width="50%">'.$langs->trans('Source').' : '.$commande->getLabelSource();
 			if ($commande->source == 0 && $conf->propal->enabled && $commande->propale_id)
 			{
@@ -1286,7 +1286,7 @@ else
 			}
 			else
 			{
-				print $commande->date_livraison ? dolibarr_print_date($commande->date_livraison,'daytext') : '&nbsp;';
+				print $commande->date_livraison ? dol_print_date($commande->date_livraison,'daytext') : '&nbsp;';
 			}
 			print '</td>';
 			print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('NotePublic').' :<br>';
@@ -1661,7 +1661,7 @@ else
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 
 			/*
@@ -1992,7 +1992,7 @@ else
 							$var=!$var;
 							print '<tr '.$bc[$var].'>';
 							print '<td><a href="../compta/facture.php?facid='.$objp->rowid.'">'.img_object($langs->trans('ShowBill'),'bill').' '.$objp->facnumber.'</a></td>';
-							print '<td align="center">'.dolibarr_print_date($objp->df,'day').'</td>';
+							print '<td align="center">'.dol_print_date($objp->df,'day').'</td>';
 							print '<td align="right">'.$objp->total_ttc.'</td></tr>';
 							$i++;
 						}
@@ -2001,7 +2001,7 @@ else
 				}
 				else
 				{
-					dolibarr_print_error($db);
+					dol_print_error($db);
 				}
 				print '</td><td valign="top" width="50%">';
 
@@ -2074,7 +2074,7 @@ else
 		else
 		{
 			// Commande non trouvee
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 }
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 60bb9d2fd21..6d8da82a362 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -102,7 +102,7 @@ if ( $db->query($sql) )
 			print "<tr $bc[$var]>";
 			print '<td nowrap="nowrap">';
 			print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
-			print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).'</a></td></tr>';
+			print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
 			$i++;
 		}
 		print "</table><br>";
@@ -159,7 +159,7 @@ if ( $db->query($sql) )
 			print '</td></tr></table>';
 
 			print '</td>';
-			print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).'</a></td></tr>';
+			print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
 			$i++;
 		}
 	}
@@ -290,7 +290,7 @@ if ($resql)
 			print '</td>';
 
 			print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
-			print '<td>'.dolibarr_print_date($obj->datec).'</td>';
+			print '<td>'.dol_print_date($obj->datec).'</td>';
 			print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
 			print '</tr>';
 			$i++;
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index ec2f8b7b063..cce814102cb 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -50,7 +50,7 @@ $soc = new Societe($db, $commande->socid);
 $soc->fetch($commande->socid);
 
 $head = commande_prepare_head($commande);
-dolibarr_fiche_head($head, 'info', $langs->trans("CustomerOrder"));
+dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"));
 
 
 print '<table width="100%"><tr><td>';
diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php
index b436f5fb776..e8b4818c860 100644
--- a/htdocs/commande/liste.php
+++ b/htdocs/commande/liste.php
@@ -223,10 +223,10 @@ if ($resql)
 		print '<td>'.$objp->ref_client.'</td>';
 		
 		// Date
-		$y = dolibarr_print_date($objp->date_commande,'%Y');
-		$m = dolibarr_print_date($objp->date_commande,'%m');
-		$ml = dolibarr_print_date($objp->date_commande,'%B');
-		$d = dolibarr_print_date($objp->date_commande,'%d');
+		$y = dol_print_date($objp->date_commande,'%Y');
+		$m = dol_print_date($objp->date_commande,'%m');
+		$ml = dol_print_date($objp->date_commande,'%B');
+		$d = dol_print_date($objp->date_commande,'%d');
 		print '<td align="right">';
 		print $d;
 		print ' <a href="liste.php?year='.$y.'&amp;month='.$m.'">'.$ml.'</a>';
@@ -243,7 +243,7 @@ if ($resql)
 }
 else
 {
-	print dolibarr_print_error($db);
+	print dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index dc30f43ca14..2f63397adf2 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -50,7 +50,7 @@ $ref= $_GET['ref'];
 $commande = new Commande($db);
 if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0)
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
@@ -93,7 +93,7 @@ if ($id > 0 || ! empty($ref))
 
 	$head = commande_prepare_head($commande);
 
-	dolibarr_fiche_head($head, 'note', $langs->trans("CustomerOrder"));
+	dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"));
 
 	print '<table class="border" width="100%">';
 
diff --git a/htdocs/commande/stats/month.php b/htdocs/commande/stats/month.php
index f506caae1f3..d72cb9bf042 100644
--- a/htdocs/commande/stats/month.php
+++ b/htdocs/commande/stats/month.php
@@ -140,7 +140,7 @@ $data = array();
 
 for ($i = 1 ; $i < 13 ; $i++)
 {
-  $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
+  $data[$i-1] = array(ucfirst(substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
 }
 
 if (!$user->rights->societe->client->voir || $user->societe_id)
diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php
index aad56a340a4..a69bf05a834 100644
--- a/htdocs/commonobject.class.php
+++ b/htdocs/commonobject.class.php
@@ -17,45 +17,45 @@
  */
 
 /**
-        \file       htdocs/commonobject.class.php
-        \ingroup    core
-        \brief      Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...)
-        \version    $Id$
-*/
+ \file       htdocs/commonobject.class.php
+ \ingroup    core
+ \brief      Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...)
+ \version    $Id$
+ */
 
 
 /**
-		\class 		CommonObject
-        \brief 		Classe mere pour h�ritage des classes metiers
-*/
+ \class 		CommonObject
+ \brief 		Classe mere pour h�ritage des classes metiers
+ */
 
 class CommonObject
 {
 
 	/**
-	 *      \brief      Ajoute un contact associ� au l'entit� d�finie dans $this->element
-     *      \param      fk_socpeople        Id du contact a ajouter
+	 *      \brief      Ajoute un contact associe au l'entite definie dans $this->element
+	 *      \param      fk_socpeople        Id du contact a ajouter
 	 *   	\param 		type_contact 		Type de contact (code ou id)
-     *      \param      source              external=Contact externe (llx_socpeople), internal=Contact interne (llx_user)
-     *      \return     int                 <0 si erreur, >0 si ok
-     */
+	 *      \param      source              external=Contact externe (llx_socpeople), internal=Contact interne (llx_user)
+	 *      \return     int                 <0 si erreur, >0 si ok
+	 */
 	function add_contact($fk_socpeople, $type_contact, $source='external')
 	{
 		global $langs;
 
-        dolibarr_syslog("CommonObject::add_contact $fk_socpeople, $type_contact, $source");
+		dol_syslog("CommonObject::add_contact $fk_socpeople, $type_contact, $source");
 
 		// V�rification parametres
 		if ($fk_socpeople <= 0)
 		{
 			$this->error=$langs->trans("ErrorWrongValueForParameter","1");
-			dolibarr_syslog("CommonObject::add_contact ".$this->error,LOG_ERR);
+			dol_syslog("CommonObject::add_contact ".$this->error,LOG_ERR);
 			return -1;
 		}
 		if (! $type_contact)
 		{
 			$this->error=$langs->trans("ErrorWrongValueForParameter","2");
-			dolibarr_syslog("CommonObject::add_contact ".$this->error,LOG_ERR);
+			dol_syslog("CommonObject::add_contact ".$this->error,LOG_ERR);
 			return -2;
 		}
 
@@ -80,24 +80,24 @@ class CommonObject
 			}
 		}
 
-        $datecreate = time();
+		$datecreate = time();
 
-        // Insertion dans la base
-        $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
-        $sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
-        $sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
+		// Insertion dans la base
+		$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
+		$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
+		$sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
 		$sql.= $this->db->idate($datecreate);
 		$sql.= ", 4, '". $id_type_contact . "' ";
-        $sql.= ")";
-		dolibarr_syslog("CommonObject::add_contact sql=".$sql);
+		$sql.= ")";
+		dol_syslog("CommonObject::add_contact sql=".$sql);
 
 		$resql=$this->db->query($sql);
 		if ($resql)
-        {
-            return 1;
-        }
-        else
-        {
+		{
+			return 1;
+		}
+		else
+		{
 			if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
 			{
 				$this->error=$this->db->errno();
@@ -106,287 +106,287 @@ class CommonObject
 			else
 			{
 				$this->error=$this->db->error()." - $sql";
-				dolibarr_syslog($this->error,LOG_ERR);
+				dol_syslog($this->error,LOG_ERR);
 				return -1;
 			}
-        }
+		}
 	}
 
-    /**
+	/**
 	 *      \brief      Mise a jour du statut d'un contact
-     *      \param      rowid               La reference du lien contact-entit�
-     * 		\param		statut	            Le nouveau statut
-     *      \param      type_contact_id     Description du type de contact
-     *      \return     int                 <0 si erreur, =0 si ok
-     */
+	 *      \param      rowid               La reference du lien contact-entit�
+	 * 		\param		statut	            Le nouveau statut
+	 *      \param      type_contact_id     Description du type de contact
+	 *      \return     int                 <0 si erreur, =0 si ok
+	 */
 	function update_contact($rowid, $statut, $type_contact_id)
 	{
-        // Insertion dans la base
-        $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
-        $sql.= " statut = ".$statut.",";
-        $sql.= " fk_c_type_contact = '".$type_contact_id ."'";
-        $sql.= " where rowid = ".$rowid;
-        // Retour
-        if (  $this->db->query($sql) )
-        {
-            return 0;
-        }
-        else
-        {
-            dolibarr_print_error($this->db);
-            return -1;
-        }
-	 }
+		// Insertion dans la base
+		$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
+		$sql.= " statut = ".$statut.",";
+		$sql.= " fk_c_type_contact = '".$type_contact_id ."'";
+		$sql.= " where rowid = ".$rowid;
+		// Retour
+		if (  $this->db->query($sql) )
+		{
+			return 0;
+		}
+		else
+		{
+			dol_print_error($this->db);
+			return -1;
+		}
+	}
 
 	/**
-     *    \brief      Supprime une ligne de contact
-     *    \param      rowid			La reference du contact
-     *    \return     statur        >0 si ok, <0 si ko
-     */
-    function delete_contact($rowid)
-    {
-        $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
-        $sql.= " WHERE rowid =".$rowid;
-
-		dolibarr_syslog("CommonObject::delete_contact sql=".$sql);
-        if ($this->db->query($sql))
-        {
-            return 1;
-        }
-        else
-        {
+	 *    \brief      Supprime une ligne de contact
+	 *    \param      rowid			La reference du contact
+	 *    \return     statur        >0 si ok, <0 si ko
+	 */
+	function delete_contact($rowid)
+	{
+		$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
+		$sql.= " WHERE rowid =".$rowid;
+
+		dol_syslog("CommonObject::delete_contact sql=".$sql);
+		if ($this->db->query($sql))
+		{
+			return 1;
+		}
+		else
+		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("CommonObject::delete_contact error=".$this->error, LOG_ERR);
-            return -1;
-        }
-    }
-
-    /**
-     *    \brief      R�cup�re les lignes de contact de l'objet
-     *    \param      statut        Statut des lignes detail � r�cup�rer
-     *    \param      source        Source du contact external (llx_socpeople) ou internal (llx_user)
-     *    \return     array         Tableau des rowid des contacts
-     */
-    function liste_contact($statut=-1,$source='external')
-    {
-        global $langs;
-
-        $tab=array();
-
-        $sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id,";
-        if ($source == 'internal') $sql.=" '-1' as socid,";
-        if ($source == 'external') $sql.=" t.fk_soc as socid,";
-        $sql.=" t.name as nom,";
-        $sql.= "tc.source, tc.element, tc.code, tc.libelle";
-        $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc,";
-        $sql.= " ".MAIN_DB_PREFIX."element_contact ec";
-        if ($source == 'internal') $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."user t on ec.fk_socpeople = t.rowid";
-        if ($source == 'external') $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."socpeople t on ec.fk_socpeople = t.rowid";
-        $sql.= " WHERE ec.element_id =".$this->id;
-        $sql.= " AND ec.fk_c_type_contact=tc.rowid";
-        $sql.= " AND tc.element='".$this->element."'";
-        if ($source == 'internal') $sql.= " AND tc.source = 'internal'";
-        if ($source == 'external') $sql.= " AND tc.source = 'external'";
-        $sql.= " AND tc.active=1";
-        if ($statut >= 0) $sql.= " AND ec.statut = '".$statut."'";
-        $sql.=" ORDER BY t.name ASC";
-
-		dolibarr_syslog("CommonObject::liste_contact sql=".$sql);
-        $resql=$this->db->query($sql);
-        if ($resql)
-        {
-            $num=$this->db->num_rows($resql);
-            $i=0;
-            while ($i < $num)
-            {
-                $obj = $this->db->fetch_object($resql);
-
-                $transkey="TypeContact_".$obj->element."_".$obj->source."_".$obj->code;
-                $libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
-                $tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,'nom'=>$obj->nom,
+			dol_syslog("CommonObject::delete_contact error=".$this->error, LOG_ERR);
+			return -1;
+		}
+	}
+
+	/**
+	 *    \brief      R�cup�re les lignes de contact de l'objet
+	 *    \param      statut        Statut des lignes detail � r�cup�rer
+	 *    \param      source        Source du contact external (llx_socpeople) ou internal (llx_user)
+	 *    \return     array         Tableau des rowid des contacts
+	 */
+	function liste_contact($statut=-1,$source='external')
+	{
+		global $langs;
+
+		$tab=array();
+
+		$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id,";
+		if ($source == 'internal') $sql.=" '-1' as socid,";
+		if ($source == 'external') $sql.=" t.fk_soc as socid,";
+		$sql.=" t.name as nom,";
+		$sql.= "tc.source, tc.element, tc.code, tc.libelle";
+		$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc,";
+		$sql.= " ".MAIN_DB_PREFIX."element_contact ec";
+		if ($source == 'internal') $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."user t on ec.fk_socpeople = t.rowid";
+		if ($source == 'external') $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."socpeople t on ec.fk_socpeople = t.rowid";
+		$sql.= " WHERE ec.element_id =".$this->id;
+		$sql.= " AND ec.fk_c_type_contact=tc.rowid";
+		$sql.= " AND tc.element='".$this->element."'";
+		if ($source == 'internal') $sql.= " AND tc.source = 'internal'";
+		if ($source == 'external') $sql.= " AND tc.source = 'external'";
+		$sql.= " AND tc.active=1";
+		if ($statut >= 0) $sql.= " AND ec.statut = '".$statut."'";
+		$sql.=" ORDER BY t.name ASC";
+
+		dol_syslog("CommonObject::liste_contact sql=".$sql);
+		$resql=$this->db->query($sql);
+		if ($resql)
+		{
+			$num=$this->db->num_rows($resql);
+			$i=0;
+			while ($i < $num)
+			{
+				$obj = $this->db->fetch_object($resql);
+
+				$transkey="TypeContact_".$obj->element."_".$obj->source."_".$obj->code;
+				$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
+				$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,'nom'=>$obj->nom,
                                'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut);
-                $i++;
-            }
-            return $tab;
-        }
-        else
-        {
-            $this->error=$this->db->error();
-            dolibarr_print_error($this->db);
-            return -1;
-        }
-    }
-
-	 /**
-     *    \brief      Le d�tail d'un contact
-     *    \param      rowid      L'identifiant du contact
-     *    \return     object     L'objet construit par DoliDb.fetch_object
-     */
- 	function detail_contact($rowid)
-    {
-        $sql = "SELECT ec.datecreate, ec.statut, ec.fk_socpeople, ec.fk_c_type_contact,";
-        $sql.= " tc.code, tc.libelle,";
-		    $sql.= " s.fk_soc";
-        $sql.= " FROM (".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc)";
-        $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as s ON ec.fk_socpeople=s.rowid";	// Si contact de type external, alors il est li� � une societe
-        $sql.= " WHERE ec.rowid =".$rowid;
-        $sql.= " AND ec.fk_c_type_contact=tc.rowid";
-        $sql.= " AND tc.element = '".$this->element."'";
-
-        $resql=$this->db->query($sql);
-        if ($resql)
-        {
-            $obj = $this->db->fetch_object($resql);
-            return $obj;
-        }
-        else
-        {
-            $this->error=$this->db->error();
-            dolibarr_print_error($this->db);
-            return null;
-        }
-    }
-
-    /**
-     *      \brief      La liste des valeurs possibles de type de contacts
-     *      \param      source      internal ou externam
-     *      \return     array       La liste des natures
-     */
- 	function liste_type_contact($source)
-    {
-        global $langs;
-
-  		$tab = array();
-
-        $sql = "SELECT distinct tc.rowid, tc.code, tc.libelle";
-        $sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc";
-        $sql.= " WHERE element='".$this->element."'";
-        $sql.= " AND source='".$source."'";
-        $sql.= " ORDER by tc.code";
-
-        $resql=$this->db->query($sql);
-        if ($resql)
-        {
-            $num=$this->db->num_rows($resql);
-            $i=0;
-            while ($i < $num)
-            {
-                $obj = $this->db->fetch_object($resql);
-
-                $transkey="TypeContact_".$this->element."_".$source."_".$obj->code;
-                $libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
-                $tab[$obj->rowid]=$libelle_type;
-                $i++;
-            }
-            return $tab;
-        }
-        else
-        {
-            $this->error=$this->db->error();
-//            dolibarr_print_error($this->db);
-            return null;
-        }
-    }
-
-    /**
-     *      \brief      Retourne id des contacts d'une source et d'un type actif donn�
-     *                  Exemple: contact client de facturation ('external', 'BILLING')
-     *                  Exemple: contact client de livraison ('external', 'SHIPPING')
-     *                  Exemple: contact interne suivi paiement ('internal', 'SALESREPFOLL')
+				$i++;
+			}
+			return $tab;
+		}
+		else
+		{
+			$this->error=$this->db->error();
+			dol_print_error($this->db);
+			return -1;
+		}
+	}
+
+	/**
+	 *    \brief      Le detail d'un contact
+	 *    \param      rowid      L'identifiant du contact
+	 *    \return     object     L'objet construit par DoliDb.fetch_object
+	 */
+	function detail_contact($rowid)
+	{
+		$sql = "SELECT ec.datecreate, ec.statut, ec.fk_socpeople, ec.fk_c_type_contact,";
+		$sql.= " tc.code, tc.libelle,";
+		$sql.= " s.fk_soc";
+		$sql.= " FROM (".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc)";
+		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as s ON ec.fk_socpeople=s.rowid";	// Si contact de type external, alors il est li� � une societe
+		$sql.= " WHERE ec.rowid =".$rowid;
+		$sql.= " AND ec.fk_c_type_contact=tc.rowid";
+		$sql.= " AND tc.element = '".$this->element."'";
+
+		$resql=$this->db->query($sql);
+		if ($resql)
+		{
+			$obj = $this->db->fetch_object($resql);
+			return $obj;
+		}
+		else
+		{
+			$this->error=$this->db->error();
+			dol_print_error($this->db);
+			return null;
+		}
+	}
+
+	/**
+	 *      \brief      La liste des valeurs possibles de type de contacts
+	 *      \param      source      internal ou externam
+	 *      \return     array       La liste des natures
+	 */
+	function liste_type_contact($source)
+	{
+		global $langs;
+
+		$tab = array();
+
+		$sql = "SELECT distinct tc.rowid, tc.code, tc.libelle";
+		$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc";
+		$sql.= " WHERE element='".$this->element."'";
+		$sql.= " AND source='".$source."'";
+		$sql.= " ORDER by tc.code";
+
+		$resql=$this->db->query($sql);
+		if ($resql)
+		{
+			$num=$this->db->num_rows($resql);
+			$i=0;
+			while ($i < $num)
+			{
+				$obj = $this->db->fetch_object($resql);
+
+				$transkey="TypeContact_".$this->element."_".$source."_".$obj->code;
+				$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
+				$tab[$obj->rowid]=$libelle_type;
+				$i++;
+			}
+			return $tab;
+		}
+		else
+		{
+			$this->error=$this->db->error();
+			//            dol_print_error($this->db);
+			return null;
+		}
+	}
+
+	/**
+	 *      \brief      Retourne id des contacts d'une source et d'un type actif donn�
+	 *                  Exemple: contact client de facturation ('external', 'BILLING')
+	 *                  Exemple: contact client de livraison ('external', 'SHIPPING')
+	 *                  Exemple: contact interne suivi paiement ('internal', 'SALESREPFOLL')
 	 *		\param		source		'external' or 'internal'
 	 *		\param		code		'BILLING', 'SHIPPING', 'SALESREPFOLL', ...
-     *      \return     array       Liste des id contacts
-     */
-    function getIdContact($source,$code)
-    {
-        $result=array();
-        $i=0;
-
-        $sql = "SELECT ec.fk_socpeople";
-        $sql.= " FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
-        $sql.= " WHERE ec.element_id = ".$this->id;
-        $sql.= " AND ec.fk_c_type_contact=tc.rowid";
-        $sql.= " AND tc.element = '".$this->element."'";
-        $sql.= " AND tc.source = '".$source."'";
-        $sql.= " AND tc.code = '".$code."'";
-        $sql.= " AND tc.active = 1";
-
-		dolibarr_syslog("CommonObject::getIdContact sql=".$sql);
-        $resql=$this->db->query($sql);
-        if ($resql)
-        {
-            while ($obj = $this->db->fetch_object($resql))
-            {
-                $result[$i]=$obj->fk_socpeople;
-                $i++;
-            }
-        }
-        else
-        {
-            $this->error=$this->db->error();
-			dolibarr_syslog("CommonObject::getIdContact ".$this->error, LOG_ERR);
-            return null;
-        }
-
-        return $result;
-    }
-
-    /**
-    *		\brief      Charge le contact d'id $id dans this->contact
-    *		\param      contactid          Id du contact
-	*		\return		int			<0 if KO, >0 if OK
-    */
-    function fetch_contact($contactid)
-    {
+	 *      \return     array       Liste des id contacts
+	 */
+	function getIdContact($source,$code)
+	{
+		$result=array();
+		$i=0;
+
+		$sql = "SELECT ec.fk_socpeople";
+		$sql.= " FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
+		$sql.= " WHERE ec.element_id = ".$this->id;
+		$sql.= " AND ec.fk_c_type_contact=tc.rowid";
+		$sql.= " AND tc.element = '".$this->element."'";
+		$sql.= " AND tc.source = '".$source."'";
+		$sql.= " AND tc.code = '".$code."'";
+		$sql.= " AND tc.active = 1";
+
+		dol_syslog("CommonObject::getIdContact sql=".$sql);
+		$resql=$this->db->query($sql);
+		if ($resql)
+		{
+			while ($obj = $this->db->fetch_object($resql))
+			{
+				$result[$i]=$obj->fk_socpeople;
+				$i++;
+			}
+		}
+		else
+		{
+			$this->error=$this->db->error();
+			dol_syslog("CommonObject::getIdContact ".$this->error, LOG_ERR);
+			return null;
+		}
+
+		return $result;
+	}
+
+	/**
+	 *		\brief      Charge le contact d'id $id dans this->contact
+	 *		\param      contactid          Id du contact
+	 *		\return		int			<0 if KO, >0 if OK
+	 */
+	function fetch_contact($contactid)
+	{
 		require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
 		$contact = new Contact($this->db);
 		$result=$contact->fetch($contactid);
 		$this->contact = $contact;
 		return $result;
-    }
-
-    /**
-     *    	\brief      Charge le tiers d'id $this->socid dans this->client
-	*		\return		int			<0 if KO, >0 if OK
-     */
-    function fetch_client()
-    {
-        $client = new Societe($this->db);
-        $result=$client->fetch($this->socid);
-        $this->client = $client;
+	}
+
+	/**
+	 *    	\brief      Charge le tiers d'id $this->socid dans this->client
+	 *		\return		int			<0 if KO, >0 if OK
+	 */
+	function fetch_client()
+	{
+		$client = new Societe($this->db);
+		$result=$client->fetch($this->socid);
+		$this->client = $client;
 		return $result;
-    }
-
-    /**
-    *		\brief      Charge le projet d'id $this->projet_id dans this->projet
-	*		\return		int			<0 if KO, >0 if OK
-    */
-    function fetch_projet()
-    {
-        $projet = new Project($this->db);
-        $result=$projet->fetch($this->projet_id);
-        $this->projet = $projet;
+	}
+
+	/**
+	 *		\brief      Charge le projet d'id $this->projet_id dans this->projet
+	 *		\return		int			<0 if KO, >0 if OK
+	 */
+	function fetch_projet()
+	{
+		$projet = new Project($this->db);
+		$result=$projet->fetch($this->projet_id);
+		$this->projet = $projet;
 		return $result;
-    }
+	}
 
 	/**
-    *		\brief      Charge le user d'id userid dans this->user
-    *		\param      userid 		Id du contact
-	*		\return		int			<0 if KO, >0 if OK
-    */
-    function fetch_user($userid)
-    {
+	 *		\brief      Charge le user d'id userid dans this->user
+	 *		\param      userid 		Id du contact
+	 *		\return		int			<0 if KO, >0 if OK
+	 */
+	function fetch_user($userid)
+	{
 		$user = new User($this->db, $userid);
 		$result=$user->fetch();
 		$this->user = $user;
 		return $result;
-    }
+	}
 
 	/**
-	*		\brief      Charge l'adresse de livraison d'id $this->adresse_livraison_id dans this->deliveryaddress
-	*		\param      userid 		Id du contact
-	*		\return		int			<0 if KO, >0 if OK
-	*/
+	 *		\brief      Charge l'adresse de livraison d'id $this->adresse_livraison_id dans this->deliveryaddress
+	 *		\param      userid 		Id du contact
+	 *		\return		int			<0 if KO, >0 if OK
+	 */
 	function fetch_adresse_livraison($deliveryaddressid)
 	{
 		$address = new Societe($this->db);
@@ -397,16 +397,16 @@ class CommonObject
 
 
 	/**
-	*      \brief      Load properties id_previous and id_next
-	*      \param      filter		Optional filter
-    *	   \param      fieldid   	Nom du champ a utiliser pour select next et previous
-	*      \return     int         	<0 if KO, >0 if OK
-	*/
+	 *      \brief      Load properties id_previous and id_next
+	 *      \param      filter		Optional filter
+	 *	   \param      fieldid   	Nom du champ a utiliser pour select next et previous
+	 *      \return     int         	<0 if KO, >0 if OK
+	 */
 	function load_previous_next_ref($filter='',$fieldid)
 	{
 		if (! $this->table_element)
 		{
-			dolibarr_syslog("CommonObject::load_previous_next was called on objet with property table_element not defined", LOG_ERR);
+			dol_syslog("CommonObject::load_previous_next was called on objet with property table_element not defined", LOG_ERR);
 			return -1;
 		}
 
@@ -446,36 +446,36 @@ class CommonObject
 	}
 
 
-  /**
-   *      \brief      On r�cup�re les id de liste_contact
-   *      \param      source      Source du contact external (llx_socpeople) ou internal (llx_user)
-   *      \return     array
-   */
-   function getListContactId($source='external')
-   {
-   	 $contactAlreadySelected = array();
-   	 $tab = $this->liste_contact(-1,$source);
-   	 $num=sizeof($tab);
-   	 $i = 0;
-   	 while ($i < $num)
-   	 {
-   	 	 $contactAlreadySelected[$i] = $tab[$i]['id'];
-   	 	 $i++;
-   	 }
-   	 return $contactAlreadySelected;
-   	}
+	/**
+	 *      \brief      On r�cup�re les id de liste_contact
+	 *      \param      source      Source du contact external (llx_socpeople) ou internal (llx_user)
+	 *      \return     array
+	 */
+	function getListContactId($source='external')
+	{
+		$contactAlreadySelected = array();
+		$tab = $this->liste_contact(-1,$source);
+		$num=sizeof($tab);
+		$i = 0;
+		while ($i < $num)
+		{
+			$contactAlreadySelected[$i] = $tab[$i]['id'];
+			$i++;
+		}
+		return $contactAlreadySelected;
+	}
 
 
 	/**
-	*	\brief     	Link ekement with a project
-	*	\param     	projid		Project id to link element to
-	*	\return		int			<0 if KO, >0 if OK
-	*/
+	 *	\brief     	Link ekement with a project
+	 *	\param     	projid		Project id to link element to
+	 *	\return		int			<0 if KO, >0 if OK
+	 */
 	function setProject($projid)
 	{
 		if (! $this->table_element)
 		{
-			dolibarr_syslog("CommonObject::setProject was called on objet with property table_element not defined",LOG_ERR);
+			dol_syslog("CommonObject::setProject was called on objet with property table_element not defined",LOG_ERR);
 			return -1;
 		}
 
@@ -484,30 +484,30 @@ class CommonObject
 		else $sql.= ' SET fk_projet = NULL';
 		$sql.= ' WHERE rowid = '.$this->id;
 
-		dolibarr_syslog("CommonObject::set_project sql=".$sql);
+		dol_syslog("CommonObject::set_project sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			return 1;
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
 
 
 	/**
-	*		\brief		Set last model used by doc generator
-	*		\param		user		User object that make change
-	*		\param		modelpdf	Modele name
-	*		\return		int			<0 if KO, >0 if OK
-	*/
+	 *		\brief		Set last model used by doc generator
+	 *		\param		user		User object that make change
+	 *		\param		modelpdf	Modele name
+	 *		\return		int			<0 if KO, >0 if OK
+	 */
 	function setDocModel($user, $modelpdf)
 	{
 		if (! $this->table_element)
 		{
-			dolibarr_syslog("CommonObject::setDocModel was called on objet with property table_element not defined",LOG_ERR);
+			dol_syslog("CommonObject::setDocModel was called on objet with property table_element not defined",LOG_ERR);
 			return -1;
 		}
 
@@ -517,7 +517,7 @@ class CommonObject
 		// if ($this->element == 'facture') $sql.= " AND fk_statut < 2";
 		// if ($this->element == 'propal')  $sql.= " AND fk_statut = 0";
 
-		dolibarr_syslog("CommonObject::setDocModel sql=".$sql);
+		dol_syslog("CommonObject::setDocModel sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -526,26 +526,26 @@ class CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
 
 
 	/**
-	*      \brief      Stocke un num�ro de rang pour toutes les lignes de
-	*                  detail d'une facture qui n'en ont pas.
-	*/
+	 *      \brief      Stocke un num�ro de rang pour toutes les lignes de
+	 *                  detail d'une facture qui n'en ont pas.
+	 */
 	function line_order()
 	{
 		if (! $this->table_element_line)
 		{
-			dolibarr_syslog("CommonObject::line_order was called on objet with property table_element_line not defined",LOG_ERR);
+			dol_syslog("CommonObject::line_order was called on objet with property table_element_line not defined",LOG_ERR);
 			return -1;
 		}
 		if (! $this->fk_element)
 		{
-			dolibarr_syslog("CommonObject::line_order was called on objet with property fk_element not defined",LOG_ERR);
+			dol_syslog("CommonObject::line_order was called on objet with property fk_element not defined",LOG_ERR);
 			return -1;
 		}
 
@@ -581,7 +581,7 @@ class CommonObject
 				$sql.= ' WHERE rowid = '.$li[$i];
 				if (!$this->db->query($sql) )
 				{
-					dolibarr_syslog($this->db->error());
+					dol_syslog($this->db->error());
 				}
 			}
 		}
@@ -612,12 +612,12 @@ class CommonObject
 				$sql.= ' WHERE rowid = '.$rowid;
 				if (! $this->db->query($sql) )
 				{
-					dolibarr_print_error($this->db);
+					dol_print_error($this->db);
 				}
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 			}
 		}
 	}
@@ -657,26 +657,26 @@ class CommonObject
 				$sql.= ' WHERE rowid = '.$rowid;
 				if (! $this->db->query($sql) )
 				{
-					dolibarr_print_error($this->db);
+					dol_print_error($this->db);
 				}
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 			}
 		}
 	}
 
 	/**
-	*    \brief      Update private note of element
-	*    \param      note			New value for note
-	*    \return     int         	<0 if KO, >0 if OK
-	*/
+	 *    \brief      Update private note of element
+	 *    \param      note			New value for note
+	 *    \return     int         	<0 if KO, >0 if OK
+	 */
 	function update_note($note)
 	{
 		if (! $this->table_element)
 		{
-			dolibarr_syslog("CommonObject::update_note was called on objet with property table_element not defined", LOG_ERR);
+			dol_syslog("CommonObject::update_note was called on objet with property table_element not defined", LOG_ERR);
 			return -1;
 		}
 
@@ -685,7 +685,7 @@ class CommonObject
 		else $sql.= " SET note = '".addslashes($note)."'";
 		$sql.= " WHERE rowid =". $this->id;
 
-		dolibarr_syslog("CommonObject::update_note sql=".$sql, LOG_DEBUG);
+		dol_syslog("CommonObject::update_note sql=".$sql, LOG_DEBUG);
 		if ($this->db->query($sql))
 		{
 			$this->note = $note;
@@ -694,21 +694,21 @@ class CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("CommonObject::update_note error=".$this->error, LOG_ERR);
+			dol_syslog("CommonObject::update_note error=".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
 
 	/**
-	*    \brief      Update public note of element
-	*    \param      note_public	New value for note
-	*    \return     int         	<0 if KO, >0 if OK
-	*/
+	 *    \brief      Update public note of element
+	 *    \param      note_public	New value for note
+	 *    \return     int         	<0 if KO, >0 if OK
+	 */
 	function update_note_public($note_public)
 	{
 		if (! $this->table_element)
 		{
-			dolibarr_syslog("CommonObject::update_note_public was called on objet with property table_element not defined",LOG_ERR);
+			dol_syslog("CommonObject::update_note_public was called on objet with property table_element not defined",LOG_ERR);
 			return -1;
 		}
 
@@ -716,7 +716,7 @@ class CommonObject
 		$sql.= " SET note_public = '".addslashes($note_public)."'";
 		$sql.= " WHERE rowid =". $this->id;
 
-		dolibarr_syslog("CommonObject::update_note_public sql=".$sql);
+		dol_syslog("CommonObject::update_note_public sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			$this->note_public = $note_public;
@@ -730,9 +730,9 @@ class CommonObject
 	}
 
 	/**
-    *	 \brief     	Update total_ht, total_ttc and total_vat for an object (sum of lines)
-    *	 \return		int			<0 si ko, >0 si ok
-	*/
+	 *	 \brief     	Update total_ht, total_ttc and total_vat for an object (sum of lines)
+	 *	 \return		int			<0 si ko, >0 si ok
+	 */
 	function update_price()
 	{
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
@@ -747,7 +747,7 @@ class CommonObject
 		$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line;
 		$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
 
-		dolibarr_syslog("CommonObject::update_price sql=".$sql);
+		dol_syslog("CommonObject::update_price sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -785,7 +785,7 @@ class CommonObject
 			$sql .= ' WHERE rowid = '.$this->id;
 
 			//print "xx".$sql;
-			dolibarr_syslog("CommonObject::update_price sql=".$sql);
+			dol_syslog("CommonObject::update_price sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -794,14 +794,14 @@ class CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("CommonObject::update_price error=".$this->error,LOG_ERR);
+				dol_syslog("CommonObject::update_price error=".$this->error,LOG_ERR);
 				return -1;
 			}
 		}
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("CommonObject::update_price error=".$this->error,LOG_ERR);
+			dol_syslog("CommonObject::update_price error=".$this->error,LOG_ERR);
 			return -1;
 		}
 	}
diff --git a/htdocs/companybankaccount.class.php b/htdocs/companybankaccount.class.php
index 81df314c1a0..72b35e4e57c 100644
--- a/htdocs/companybankaccount.class.php
+++ b/htdocs/companybankaccount.class.php
@@ -126,7 +126,7 @@ class CompanyBankAccount
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
@@ -167,7 +167,7 @@ class CompanyBankAccount
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php
index a4bac6c2f0a..4092f39eae9 100644
--- a/htdocs/compta/bank/account.class.php
+++ b/htdocs/compta/bank/account.class.php
@@ -110,7 +110,7 @@ class Account extends CommonObject
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (fk_bank, url_id, url, label, type)";
 		$sql .= " VALUES ('".$line_id."', '".$url_id."', '".$url."', '".addslashes($label)."', '".$type."')";
 
-		dolibarr_syslog("Account::add_url_line sql=".$sql);
+		dol_syslog("Account::add_url_line sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			$rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_url");
@@ -235,7 +235,7 @@ class Account extends CommonObject
 		$sql.= " ".($banque?"'".addslashes($banque)."'":"null");
 		$sql.= ")";
 
-		dolibarr_syslog("Account::addline sql=".$sql);
+		dol_syslog("Account::addline sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			$rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank");
@@ -256,7 +256,7 @@ class Account extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Account::addline ".$this->error, LOG_ERR);
+			dol_syslog("Account::addline ".$this->error, LOG_ERR);
 			$this->db->rollback();
 			return -2;
 		}
@@ -294,7 +294,7 @@ class Account extends CommonObject
 		$sql.= "'".addslashes($this->comment)."'";
 		$sql.= ")";
 
-		dolibarr_syslog("Account::create sql=".$sql);
+		dol_syslog("Account::create sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -315,12 +315,12 @@ class Account extends CommonObject
 			if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
 			{
 				$this->error=$langs->trans("ErrorBankLabelAlreadyExists");
-				dolibarr_syslog($this->error);
+				dol_syslog($this->error);
 				return -1;
 			}
 			else {
 				$this->error=$this->db->error()." sql=".$sql;
-				dolibarr_syslog($this->error);
+				dol_syslog($this->error);
 				return -2;
 			}
 		}
@@ -342,7 +342,7 @@ class Account extends CommonObject
 		if (! $this->ref)
 		{
 			$this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Ref"));
-			dolibarr_syslog("Account::update ".$this->error);
+			dol_syslog("Account::update ".$this->error);
 			return -1;
 		}
 		if (! $this->label) $this->label = "???";
@@ -366,7 +366,7 @@ class Account extends CommonObject
 
 		$sql .= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Account::update sql=".$sql);
+		dol_syslog("Account::update sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -375,7 +375,7 @@ class Account extends CommonObject
 		else
 		{
 			$this->error=$this->db.' sql='.$sql;
-			dolibarr_print_error($this->error);
+			dol_print_error($this->error);
 			return -1;
 		}
 	}
@@ -393,7 +393,7 @@ class Account extends CommonObject
 		// Chargement librairie pour acces fonction controle RIB
 		require_once(DOL_DOCUMENT_ROOT.'/lib/bank.lib.php');
 
-		dolibarr_syslog("Account::update_bban $this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban");
+		dol_syslog("Account::update_bban $this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban");
 
 		// Check parameters
 		if (! $this->ref)
@@ -415,7 +415,7 @@ class Account extends CommonObject
 		$sql .= ",adresse_proprio = '".addslashes($this->adresse_proprio)."'";
 		$sql .= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Account::update_bban sql=$sql");
+		dol_syslog("Account::update_bban sql=$sql");
 
 		$result = $this->db->query($sql);
 		if ($result)
@@ -425,7 +425,7 @@ class Account extends CommonObject
 		else
 		{
 			$this->error=$this->db.' sql='.$sql;
-			dolibarr_print_error($this->error);
+			dol_print_error($this->error);
 			return -1;
 		}
 	}
@@ -447,7 +447,7 @@ class Account extends CommonObject
 		if ($id)  $sql.= " WHERE rowid  = ".$id;
 		if ($ref) $sql.= " WHERE ref = '".addslashes($ref)."'";
 
-		dolibarr_syslog("Account::fetch sql=".$sql);
+		dol_syslog("Account::fetch sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -493,7 +493,7 @@ class Account extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -507,13 +507,13 @@ class Account extends CommonObject
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_account";
 		$sql .= " WHERE rowid  = ".$this->rowid;
 
-		dolibarr_syslog("Account::delete sql=".$sql);
+		dol_syslog("Account::delete sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result) {
 			return 1;
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -590,7 +590,7 @@ class Account extends CommonObject
 			if ($obj->nb <= 1) $can_be_deleted=true;    // Juste le solde
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $can_be_deleted;
 	}
@@ -650,7 +650,7 @@ class Account extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
@@ -677,7 +677,7 @@ class Account extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
@@ -717,7 +717,7 @@ class Account extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -834,7 +834,7 @@ class AccountLine
 		$sql.= " FROM ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba";
 		$sql.= " WHERE b.fk_account = ba.rowid AND b.rowid  = ".$rowid;
 
-		dolibarr_syslog("AccountLine::fetch sql=".$sql);
+		dol_syslog("AccountLine::fetch sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -870,7 +870,7 @@ class AccountLine
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -895,17 +895,17 @@ class AccountLine
 		$this->db->begin();
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".$this->rowid;
-		dolibarr_syslog("AccountLine::delete sql=".$sql);
+		dol_syslog("AccountLine::delete sql=".$sql);
 		$result = $this->db->query($sql);
 		if (! $result) $nbko++;
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$this->rowid;
-		dolibarr_syslog("AccountLine::delete sql=".$sql);
+		dol_syslog("AccountLine::delete sql=".$sql);
 		$result = $this->db->query($sql);
 		if (! $result) $nbko++;
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$this->rowid;
-		dolibarr_syslog("AccountLine::delete sql=".$sql);
+		dol_syslog("AccountLine::delete sql=".$sql);
 		$result = $this->db->query($sql);
 		if (! $result) $nbko++;
 
@@ -1036,7 +1036,7 @@ class AccountLine
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index 10c40200ebd..0f97d1692ed 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -75,7 +75,7 @@ if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]) && $user-
         $amount = - price2num($_POST["debit"]);
     }
 
-    $dateop = dolibarr_mktime(12,0,0,$_POST["opmonth"],$_POST["opday"],$_POST["opyear"]);
+    $dateop = dol_mktime(12,0,0,$_POST["opmonth"],$_POST["opday"],$_POST["opyear"]);
     $operation=$_POST["operation"];
     $num_chq=$_POST["num_chq"];
     $label=$_POST["label"];
@@ -96,7 +96,7 @@ if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]) && $user-
 	    }
 	    else
 	    {
-	        dolibarr_print_error($db,$acct->error);
+	        dol_print_error($db,$acct->error);
 	    }
 	}
 	else
@@ -209,7 +209,7 @@ if ($account || $_GET["ref"])
 	$sql.= " WHERE b.fk_account=".$acct->id;
 	$sql.= $sql_rech;
 
-	dolibarr_syslog("account.php count transactions - sql=".$sql);
+	dol_syslog("account.php count transactions - sql=".$sql);
 	$result=$db->query($sql);
 	if ($result)
 	{
@@ -229,7 +229,7 @@ if ($account || $_GET["ref"])
 		$db->free($result);
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	if ($page > 0)
@@ -249,7 +249,7 @@ if ($account || $_GET["ref"])
 
 	// Onglets
 	$head=bank_prepare_head($acct);
-	dolibarr_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0);
+	dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0);
 
 	print '<table class="border" width="100%">';
 
@@ -439,7 +439,7 @@ if ($account || $_GET["ref"])
 	$sql.= " ORDER BY b.datev ASC";
 	$sql.= $db->plimit($limitsql, 0);
 
-	dolibarr_syslog("account.php get transactions - sql=".$sql);
+	dol_syslog("account.php get transactions - sql=".$sql);
 	$result = $db->query($sql);
 	if ($result)
 	{
@@ -470,9 +470,9 @@ if ($account || $_GET["ref"])
 
 	            print "<tr $bc[$var]>";
 
-	            print "<td nowrap>".dolibarr_print_date($objp->do,"day")."</td>\n";
+	            print "<td nowrap>".dol_print_date($objp->do,"day")."</td>\n";
 
-	            print "<td nowrap>&nbsp;".dolibarr_print_date($objp->dv,"day")."</td>\n";
+	            print "<td nowrap>&nbsp;".dol_print_date($objp->dv,"day")."</td>\n";
 
 	            print "<td nowrap>&nbsp;".$langs->trans($objp->fk_type)." ".($objp->num_chq?$objp->num_chq:"")."</td>\n";
 
@@ -498,7 +498,7 @@ if ($account || $_GET["ref"])
 					}
 					else
 					{
-		            	print dolibarr_trunc($objp->label,60);
+		            	print dol_trunc($objp->label,60);
 		            }
 	            }
 
@@ -671,7 +671,7 @@ if ($account || $_GET["ref"])
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index 05f8762ce20..5e4c9e94146 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -90,7 +90,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $sql = "SELECT sum(f.amount), date_format(f.dateo,'%Y-%m') as dm";
@@ -112,13 +112,13 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
 // Onglets
 $head=bank_prepare_head($acct);
-dolibarr_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0);
+dol_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0);
 
 $title=$langs->trans("FinancialAccount")." : ".$acct->label;
 $lien=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?account=".$acct->id."&year_start=".($year_start-1)."'>".img_previous()."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$acct->id."&year_start=".($year_start+1)."'>".img_next()."</a>":"");
@@ -192,7 +192,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
 {
 	$var=!$var;
 	print '<tr '.$bc[$var].'>';
-	print "<td>".dolibarr_print_date(dolibarr_mktime(1,1,1,$mois,1,2000),"%B")."</td>";
+	print "<td>".dol_print_date(dol_mktime(1,1,1,$mois,1,2000),"%B")."</td>";
 	for ($annee = $year_start ; $annee <= $year_end ; $annee++)
 	{
 		$case = sprintf("%04s-%02s",$annee,$mois);
@@ -245,7 +245,7 @@ if ($resql)
 	if ($obj) $balance=$obj->total;
 }
 else {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print '<tr class="liste_total"><td><b>'.$langs->trans("CurrentBalance")."</b></td>";
 print '<td colspan="'.($nbcol).'" align="right">'.price($balance).'</td>';
diff --git a/htdocs/compta/bank/bankcateg.class.php b/htdocs/compta/bank/bankcateg.class.php
index 92f989ca9ed..c7e230fac2c 100644
--- a/htdocs/compta/bank/bankcateg.class.php
+++ b/htdocs/compta/bank/bankcateg.class.php
@@ -97,7 +97,7 @@ class BankCateg // extends CommonObject
 
 		$this->db->begin();
 		
-	   	dolibarr_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
+	   	dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
         
@@ -124,7 +124,7 @@ class BankCateg // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
@@ -155,7 +155,7 @@ class BankCateg // extends CommonObject
         $sql.= " FROM ".MAIN_DB_PREFIX."bank_categ as t";
         $sql.= " WHERE t.rowid = ".$id;
     
-    	dolibarr_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
+    	dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -176,7 +176,7 @@ class BankCateg // extends CommonObject
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
+            dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -212,7 +212,7 @@ class BankCateg // extends CommonObject
 
 		$this->db->begin();
         
-		dolibarr_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
+		dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
         
@@ -237,7 +237,7 @@ class BankCateg // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
@@ -267,7 +267,7 @@ class BankCateg // extends CommonObject
 	
 		$this->db->begin();
 		
-		dolibarr_syslog(get_class($this)."::delete sql=".$sql);
+		dol_syslog(get_class($this)."::delete sql=".$sql);
 		$resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
 		
@@ -292,7 +292,7 @@ class BankCateg // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php
index 5f3b6bfd4d9..a2e89084809 100644
--- a/htdocs/compta/bank/bankid_fr.php
+++ b/htdocs/compta/bank/bankid_fr.php
@@ -112,7 +112,7 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
 		*/
 	// Onglets
 	$head=bank_prepare_head($account);
-	dolibarr_fiche_head($head, 'bankid', $langs->trans("FinancialAccount"));
+	dol_fiche_head($head, 'bankid', $langs->trans("FinancialAccount"));
 
 	/*
 		* Confirmation de la suppression
diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php
index 6e40d5362ef..359ae48329c 100644
--- a/htdocs/compta/bank/budget.php
+++ b/htdocs/compta/bank/budget.php
@@ -85,7 +85,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print "</table>";
 
diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php
index b711311e91e..1018fd19ac8 100644
--- a/htdocs/compta/bank/categ.php
+++ b/htdocs/compta/bank/categ.php
@@ -43,7 +43,7 @@ if ($_POST["action"] == 'add')
 
 		if (!$result)
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 }
@@ -60,7 +60,7 @@ if ( $_REQUEST['action'] == 'delete' )
 
 		if (!$result)
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 }
diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php
index e00f60bc9ee..f0a50c8cf6c 100644
--- a/htdocs/compta/bank/fiche.php
+++ b/htdocs/compta/bank/fiche.php
@@ -52,7 +52,7 @@ if ($_POST["action"] == 'add')
     $account->account_number  = trim($_POST["account_number"]);
     
     $account->solde           = $_POST["solde"];
-    $account->date_solde      = dolibarr_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+    $account->date_solde      = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 
     $account->currency_code   = trim($_POST["account_currency_code"]);
     $account->country_code    = trim($_POST["account_country_code"]);
@@ -275,7 +275,7 @@ else
 
 		// Onglets
 		$head=bank_prepare_head($account);
-		dolibarr_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"));
+		dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"));
 	
 		/*
 		* Confirmation de la suppression
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index 0279ffc052a..9ad632ff1c9 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -54,9 +54,9 @@ if (! empty($_GET["lib"])) $conf->global->MAIN_GRAPH_LIBRARY=$_GET["lib"];
 
 
 $datetime = time();
-$year = dolibarr_print_date($datetime, "%Y");
-$month = dolibarr_print_date($datetime, "%m");
-$day = dolibarr_print_date($datetime, "%d");
+$year = dol_print_date($datetime, "%Y");
+$month = dol_print_date($datetime, "%m");
+$day = dol_print_date($datetime, "%d");
 if (! empty($_GET["year"]))  $year=sprintf("%04d",$_GET["year"]);
 if (! empty($_GET["month"])) $month=sprintf("%02d",$_GET["month"]);
 
@@ -100,10 +100,10 @@ else
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	$log="graph.php: min=".$min." max=".$max;
-	dolibarr_syslog($log);
+	dol_syslog($log);
 
 
 	// Tableau 1
@@ -135,7 +135,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		// Calcul de $solde avant le debut du graphe
@@ -153,7 +153,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		// Chargement de labels et datas pour tableau 1
@@ -162,7 +162,7 @@ else
 		$datamin = array();
 
 		$subtotal = 0;
-		$day = dolibarr_mktime(12,0,0,$month,1,$year);
+		$day = dol_mktime(12,0,0,$month,1,$year);
 		$textdate = strftime("%Y%m%d",$day);
 		$xyear = substr($textdate,0,4);
 		$xday = substr($textdate,6,2);
@@ -261,7 +261,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		// Calcul de $solde avant le debut du graphe
@@ -279,7 +279,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		// Chargement de labels et datas pour tableau 2
@@ -289,7 +289,7 @@ else
 
 		$subtotal = 0;
 		$now = time();
-		$day = dolibarr_mktime(12,0,0,1,1,$year);
+		$day = dol_mktime(12,0,0,1,1,$year);
 		$textdate = strftime("%Y%m%d",$day);
 		$xyear = substr($textdate,0,4);
 		$xday = substr($textdate,6,2);
@@ -309,7 +309,7 @@ else
 			$datamin[$i] = $acct->min_desired;
 			if ($xday == '15')
 			{
-				$labels[$i] = dolibarr_print_date($day,"%b");
+				$labels[$i] = dol_print_date($day,"%b");
 			}
 			$day += 86400;
 			$textdate = strftime("%Y%m%d",$day);
@@ -378,7 +378,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		// Calcul de $solde avant le debut du graphe
@@ -481,7 +481,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 		$sql = "SELECT date_format(datev,'%d'), sum(amount)";
 		$sql .= " FROM ".MAIN_DB_PREFIX."bank";
@@ -503,7 +503,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 
@@ -579,7 +579,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 		$sql = "SELECT date_format(datev,'%m'), sum(amount)";
 		$sql .= " FROM ".MAIN_DB_PREFIX."bank";
@@ -599,7 +599,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 
@@ -611,7 +611,7 @@ else
 		{
 			$data_credit[$i] = isset($credits[substr("0".($i+1),-2)]) ? $credits[substr("0".($i+1),-2)] : 0;
 			$data_debit[$i] = isset($debits[substr("0".($i+1),-2)]) ? $debits[substr("0".($i+1),-2)] : 0;
-			$labels[$i] = dolibarr_print_date(dolibarr_mktime(12,0,0,$i+1,1,2000),"%b");
+			$labels[$i] = dol_print_date(dol_mktime(12,0,0,$i+1,1,2000),"%b");
 			$datamin[$i] = $acct->min_desired;
 		}
 
@@ -650,7 +650,7 @@ else
 
 // Onglets
 $head=bank_prepare_head($acct);
-dolibarr_fiche_head($head,'graph',$langs->trans("FinancialAccount"),0);
+dol_fiche_head($head,'graph',$langs->trans("FinancialAccount"),0);
 
 if ($mesg) print $mesg.'<br>';
 
diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php
index 89563dd2fcd..87de14ce12f 100644
--- a/htdocs/compta/bank/info.php
+++ b/htdocs/compta/bank/info.php
@@ -55,7 +55,7 @@ $hselected = $h;
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("LineRecord"));
+dol_fiche_head($head, $hselected, $langs->trans("LineRecord"));
 
 print '<table width="100%"><tr><td>';
 dol_print_object_info($line);
diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php
index 7754e26b9be..0f682cd6f18 100644
--- a/htdocs/compta/bank/ligne.php
+++ b/htdocs/compta/bank/ligne.php
@@ -63,7 +63,7 @@ if ($_POST["action"] == 'confirm_delete_categ' && $_POST["confirm"] == "yes")
 	$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_GET["cat1"];
 	if (! $db->query($sql))
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -72,13 +72,13 @@ if ($_POST["action"] == 'class')
 	$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = $rowid AND fk_categ = ".$_POST["cat1"];
 	if (! $db->query($sql))
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES (".$_GET["rowid"].", ".$_POST["cat1"].")";
 	if (! $db->query($sql))
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -114,7 +114,7 @@ if ($_POST["action"] == "update")
 	else
 	{
 		$db->rollback();
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -156,7 +156,7 @@ if ($user->rights->banque->consolidate && $_POST["action"] == 'num_releve')
 	else
 	{
 		$db->rollback();
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -200,7 +200,7 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$_GET["rowid"];
 $head[$h][1] = $langs->trans("Info");
 $h++;
 
-dolibarr_fiche_head($head, $hselected, $langs->trans('LineRecord'));
+dol_fiche_head($head, $hselected, $langs->trans('LineRecord'));
 
 
 $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,";
@@ -279,7 +279,7 @@ if ($result)
 		else
 		{
 			print '<td colspan="4">';
-			print dolibarr_print_date($objp->do);
+			print dol_print_date($objp->do);
 		}
 		print '</td></tr>';
 
@@ -300,7 +300,7 @@ if ($result)
 		else
 		{
 			print '<td colspan="4">';
-			print dolibarr_print_date($objp->dv,"day");
+			print dol_print_date($objp->dv,"day");
 			print '</td>';
 		}
 		print "</tr>";
diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php
index 3f3f19d6e45..1dc10c8dd31 100644
--- a/htdocs/compta/bank/rappro.php
+++ b/htdocs/compta/bank/rappro.php
@@ -81,7 +81,7 @@ if ($_GET["action"] == 'del')
 	$result=$accline->delete();
     if ($result < 0)
 	{
-        dolibarr_print_error($db,$accline->error);
+        dol_print_error($db,$accline->error);
     }
 }
 
@@ -159,7 +159,7 @@ if ($resql)
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 
     print '<table class="border" width="100%">';
@@ -188,13 +188,13 @@ if ($resql)
         print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">";
 
         // Date op
-        print '<td align="center" nowrap="nowrap">'.dolibarr_print_date($objp->do,"day").'</td>';
+        print '<td align="center" nowrap="nowrap">'.dol_print_date($objp->do,"day").'</td>';
         
         // Date value
 		if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
 		{
 			print '<td align="center" nowrap="nowrap">';
-			print dolibarr_print_date($objp->dv,"day");
+			print dol_print_date($objp->dv,"day");
 			print ' &nbsp; ';
 			print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$_GET["account"].'&amp;rowid='.$objp->rowid.'">';
 			print img_edit_remove() . "</a> ";
@@ -205,7 +205,7 @@ if ($resql)
 		else
 		{
 			print '<td align="center">';
-			print dolibarr_print_date($objp->dv,"day");
+			print dol_print_date($objp->dv,"day");
 			print '</td>';
 		}
         
@@ -255,7 +255,7 @@ if ($resql)
             elseif ($links[$key]['type']=='company') {
                 print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
                 print img_object($langs->trans('ShowCustomer'),'company').' ';
-                print dolibarr_trunc($links[$key]['label'],24);
+                print dol_trunc($links[$key]['label'],24);
                 print '</a>';
                 $newline=0;
             }
@@ -369,7 +369,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index affa50ee225..b4ea48a5125 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -99,7 +99,7 @@ if (! isset($_GET["num"]))
 
 		// Onglets
 		$head=bank_prepare_head($acct);
-		dolibarr_fiche_head($head,'statement',$langs->trans("FinancialAccount"),0);
+		dol_fiche_head($head,'statement',$langs->trans("FinancialAccount"),0);
 
 		print '<table class="border" width="100%">';
 
@@ -146,7 +146,7 @@ if (! isset($_GET["num"]))
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 else
@@ -264,13 +264,13 @@ else
 			print "<tr $bc[$var]>";
 
 			// Date operation
-			print '<td nowrap="nowrap" align="center">'.dolibarr_print_date($objp->do,"day").'</td>';
+			print '<td nowrap="nowrap" align="center">'.dol_print_date($objp->do,"day").'</td>';
 
 			// Date de valeur
 			print '<td align="center" valign="center" nowrap="nowrap">';
 			print '<a href="releve.php?action=dvprev&amp;num='.$num.'&amp;account='.$_GET["account"].'&amp;dvid='.$objp->rowid.'">';
 			print img_previous().'</a> ';
-			print dolibarr_print_date($objp->dv,"day") .' ';
+			print dol_print_date($objp->dv,"day") .' ';
 			print '<a href="releve.php?action=dvnext&amp;num='.$num.'&amp;account='.$_GET["account"].'&amp;dvid='.$objp->rowid.'">';
 			print img_next().'</a>';
 			print "</td>\n";
@@ -313,7 +313,7 @@ else
 				elseif ($links[$key]['type']=='company') {
 					print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$links[$key]['url_id'].'">';
 					print img_object($langs->trans('ShowCustomer'),'company').' ';
-					print dolibarr_trunc($links[$key]['label'],24);
+					print dol_trunc($links[$key]['label'],24);
 					print '</a>';
 					$newline=0;
 				}
@@ -374,7 +374,7 @@ else
 				}
 				else
 				{
-					dolibarr_print_error($db);
+					dol_print_error($db);
 				}
 			}
 
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index 47772ab380b..a66f3a68f31 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -181,13 +181,13 @@ if ($resql)
 		print '</td>';
 
 		// Date
-		print '<td align="left" nowrap="nowrap">'.dolibarr_print_date($db->jdate($objp->do),"day")." &nbsp; </td>\n";
+		print '<td align="left" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")." &nbsp; </td>\n";
 
 		print "<td><a href=\"ligne.php?rowid=$objp->rowid&amp;account=$objp->fk_account\">";
 		$reg=array();
 		eregi('\((.+)\)',$objp->label,$reg);	// Si texte entour� de parenth�e on tente recherche de traduction
 		if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
-		else print dolibarr_trunc($objp->label,40);
+		else print dol_trunc($objp->label,40);
 		print "</a>&nbsp;";
 
 		// Third party
@@ -234,7 +234,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 // Si acc�s issu d'une recherche et rien de trouv�
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index 557f6d0a4d9..eace637a5d6 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -87,7 +87,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 	 */
 	// Onglets
 	$head=bank_prepare_head($acct);
-	dolibarr_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0);
+	dol_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0);
 
 	print '<table class="border" width="100%">';
 
@@ -293,7 +293,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 			$solde += $total_ttc;
 
 			print "<tr $bc[$var]>";
-			print '<td>'.dolibarr_print_date($obj->dlr,"day")."</td>";
+			print '<td>'.dol_print_date($obj->dlr,"day")."</td>";
 			print "<td>".$ref."</td>";
 			print "<td>".$refcomp."</td>";
 			if ($obj->total_ttc < 0) { print "<td align=\"right\">".price($total_ttc)."</td><td>&nbsp;</td>"; };
@@ -305,7 +305,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	// Solde actuel
diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php
index 1e15f017fd7..edc13845d41 100644
--- a/htdocs/compta/bank/virement.php
+++ b/htdocs/compta/bank/virement.php
@@ -41,7 +41,7 @@ if ($_POST["action"] == 'add')
 	$langs->load("errors");
 	
 	$mesg='';
-	$dateo = dolibarr_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+	$dateo = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 	$label = $_POST["label"];
 	$amount= $_POST["amount"];
 
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index 0d3a105fc5a..00475c92fe7 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -104,7 +104,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print '</table>';
 
@@ -147,7 +147,7 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
 	        $obj = $db->fetch_object($result);
 	        $var=!$var;
 	        print "<tr $bc[$var]>";
-	        print '<td align="left">'.dolibarr_print_date($obj->dm,'day')."</td>\n";
+	        print '<td align="left">'.dol_print_date($obj->dm,'day')."</td>\n";
 	        print "<td>".$obj->label."</td>\n";
 	        $total = $total + $obj->amount;
 	        
@@ -164,7 +164,7 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
 	}
 	else
 	{
-	    dolibarr_print_error($db);
+	    dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php
index 090ba11bd1a..abca12b441e 100644
--- a/htdocs/compta/clients.php
+++ b/htdocs/compta/clients.php
@@ -202,7 +202,7 @@ if ($result)
 		print '<td>'.$obj->ville.'&nbsp;</td>';
 		print '<td align="left">'.$obj->code_client.'&nbsp;</td>';
 		print '<td align="left">'.$obj->code_compta.'&nbsp;</td>';
-		print '<td align="right">'.dolibarr_print_date($obj->datec).'</td>';
+		print '<td align="right">'.dol_print_date($obj->datec).'</td>';
 		print "</tr>\n";
 		$i++;
 	}
@@ -214,7 +214,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php
index 1de23104603..01ac0e1f4c6 100644
--- a/htdocs/compta/commande/fiche.php
+++ b/htdocs/compta/commande/fiche.php
@@ -70,7 +70,7 @@ if ($_POST['action'] == 'set_ref_client' && $user->rights->commande->creer)
 if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer)
 {
 	//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
-	$datelivraison=dolibarr_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
+	$datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
 
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
@@ -93,7 +93,7 @@ if ($_POST['action'] == 'setmode' && $user->rights->commande->creer)
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
 	$result=$commande->mode_reglement($_POST['mode_reglement_id']);
-	if ($result < 0) dolibarr_print_error($db,$commande->error);
+	if ($result < 0) dol_print_error($db,$commande->error);
 }
 
 if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
@@ -101,7 +101,7 @@ if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
 	$result=$commande->cond_reglement($_POST['cond_reglement_id']);
-	if ($result < 0) dolibarr_print_error($db,$commande->error);
+	if ($result < 0) dol_print_error($db,$commande->error);
 }
 
 
@@ -129,7 +129,7 @@ if ($id > 0 || ! empty($ref))
 		$author->fetch();
 
 		$head = commande_prepare_head($commande);
-		dolibarr_fiche_head($head, 'accountancy', $langs->trans("CustomerOrder"));
+		dol_fiche_head($head, 'accountancy', $langs->trans("CustomerOrder"));
 
 		/*
 		 *   Commande
@@ -205,7 +205,7 @@ if ($id > 0 || ! empty($ref))
 
 		// Date
 		print '<tr><td>'.$langs->trans('Date').'</td>';
-		print '<td colspan="2">'.dolibarr_print_date($commande->date,'daytext').'</td>';
+		print '<td colspan="2">'.dol_print_date($commande->date,'daytext').'</td>';
 		print '<td width="50%">'.$langs->trans('Source').' : '.$commande->getLabelSource();
 		if ($commande->source == 0 && $conf->propal->enabled)
 		{
@@ -236,7 +236,7 @@ if ($id > 0 || ! empty($ref))
 		}
 		else
 		{
-			print dolibarr_print_date($commande->date_livraison,'daytext');
+			print dol_print_date($commande->date_livraison,'daytext');
 		}
 		print '</td>';
 		print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('NotePublic').' :<br>';
@@ -468,7 +468,7 @@ if ($id > 0 || ! empty($ref))
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print '</table>';
@@ -543,7 +543,7 @@ if ($id > 0 || ! empty($ref))
 					$var=!$var;
 					print "<tr $bc[$var]>";
 					print '<td><a href="../facture.php?facid='.$objp->rowid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->facnumber.'</a></td>';
-					print '<td align="center">'.dolibarr_print_date($objp->df).'</td>';
+					print '<td align="center">'.dol_print_date($objp->df).'</td>';
 					print '<td align="right">'.$objp->total_ttc.'</td></tr>';
 					$i++;
 				}
@@ -552,7 +552,7 @@ if ($id > 0 || ! empty($ref))
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print '</td><td valign="top" width="50%">';
diff --git a/htdocs/compta/commande/liste.php b/htdocs/compta/commande/liste.php
index d0194da62b0..c0773de49b4 100644
--- a/htdocs/compta/commande/liste.php
+++ b/htdocs/compta/commande/liste.php
@@ -166,10 +166,10 @@ if ($resql)
         print "</td>";
 
         print "<td align=\"center\">";
-        $y = dolibarr_print_date($objp->date_commande,"%Y");
-        $m = dolibarr_print_date($objp->date_commande,"%m");
-        $mt = dolibarr_print_date($objp->date_commande,"%b");
-        $d = dolibarr_print_date($objp->date_commande,"%d");
+        $y = dol_print_date($objp->date_commande,"%Y");
+        $m = dol_print_date($objp->date_commande,"%m");
+        $mt = dol_print_date($objp->date_commande,"%b");
+        $d = dol_print_date($objp->date_commande,"%d");
         print $d."\n";
         print " <a href=\"liste.php?year=$y&amp;month=$m\">";
         print $mt."</a>\n";
@@ -190,7 +190,7 @@ if ($resql)
 }
 else
 {
-    print dolibarr_print_error($db);
+    print dol_print_error($db);
 }
 
 
diff --git a/htdocs/compta/comptacompte.class.php b/htdocs/compta/comptacompte.class.php
index 3cd4328196d..a0bf2840dba 100644
--- a/htdocs/compta/comptacompte.class.php
+++ b/htdocs/compta/comptacompte.class.php
@@ -84,31 +84,31 @@ class ComptaCompte
 		      else
 			{
 			  $result = -2;
-			  dolibarr_syslog("ComptaCompte::Create Erreur $result lecture ID");
+			  dol_syslog("ComptaCompte::Create Erreur $result lecture ID");
 			}
 		    }
 		  else
 		    {
 		      $result = -1;
-		      dolibarr_syslog("ComptaCompte::Create Erreur $result INSERT Mysql");
+		      dol_syslog("ComptaCompte::Create Erreur $result INSERT Mysql");
 		    }
 		}
 	      else
 		{
 		  $result = -3;
-		  dolibarr_syslog("ComptaCompte::Create Erreur $result SELECT Mysql");
+		  dol_syslog("ComptaCompte::Create Erreur $result SELECT Mysql");
 		}
 	    }
 	  else
 	    {
 	      $result = -5;
-	      dolibarr_syslog("ComptaCompte::Create Erreur $result SELECT Mysql");
+	      dol_syslog("ComptaCompte::Create Erreur $result SELECT Mysql");
 	    }
 	}
       else
 	{
 	  $result = -4;
-	  dolibarr_syslog("ComptaCompte::Create Erreur  $result Valeur Manquante");
+	  dol_syslog("ComptaCompte::Create Erreur  $result Valeur Manquante");
 	}
 
       return $result;
diff --git a/htdocs/compta/deplacement/deplacement.class.php b/htdocs/compta/deplacement/deplacement.class.php
index b07b8a9987d..b588b00d447 100644
--- a/htdocs/compta/deplacement/deplacement.class.php
+++ b/htdocs/compta/deplacement/deplacement.class.php
@@ -80,7 +80,7 @@ class Deplacement extends CommonObject
 		$sql.= " (datec, fk_user_author, fk_user, type)";
 		$sql.= " VALUES (".$this->db->idate(mktime()).", ".$user->id.", ".$this->fk_user.", '".$this->type."')";
 
-		dolibarr_syslog("Deplacement::create sql=".$sql, LOG_DEBUG);
+		dol_syslog("Deplacement::create sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -138,7 +138,7 @@ class Deplacement extends CommonObject
 		$sql .= " , fk_soc = ".($this->socid > 0?$this->socid:'null');
 		$sql .= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("Deplacement::update sql=".$sql, LOG_DEBUG);
+		dol_syslog("Deplacement::update sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -160,7 +160,7 @@ class Deplacement extends CommonObject
 		$sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
 		$sql.= " WHERE rowid = ".$id;
 
-		dolibarr_syslog("Deplacement::fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("Deplacement::fetch sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql) ;
 		if ( $result )
 		{
diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php
index 4c22a2d0487..988e66baa00 100644
--- a/htdocs/compta/deplacement/fiche.php
+++ b/htdocs/compta/deplacement/fiche.php
@@ -52,7 +52,7 @@ if ($_POST["action"] == 'add' && $user->rights->deplacement->creer)
 	{
 		$deplacement = new Deplacement($db);
 
-		$deplacement->date = dolibarr_mktime(12, 0, 0,
+		$deplacement->date = dol_mktime(12, 0, 0,
 		$_POST["remonth"],
 		$_POST["reday"],
 		$_POST["reyear"]);
@@ -89,7 +89,7 @@ if ($_POST["action"] == 'update' && $user->rights->deplacement->creer)
 		$deplacement = new Deplacement($db);
 		$result = $deplacement->fetch($_POST["id"]);
 
-		$deplacement->date = dolibarr_mktime(12, 0 , 0,
+		$deplacement->date = dol_mktime(12, 0 , 0,
 		$_POST["remonth"],
 		$_POST["reday"],
 		$_POST["reyear"]);
@@ -183,7 +183,7 @@ else
 				$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
 				$head[$h][1] = $langs->trans("Card");
 
-				dolibarr_fiche_head($head, $hselected, $langs->trans("TripCard"));
+				dol_fiche_head($head, $hselected, $langs->trans("TripCard"));
 
 				print "<form name='update' action=\"fiche.php\" method=\"post\">\n";
 				print '<input type="hidden" name="action" value="update">';
@@ -230,7 +230,7 @@ else
 				$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
 				$head[$h][1] = $langs->trans("Card");
 
-				dolibarr_fiche_head($head, $hselected, $langs->trans("TripCard"));
+				dol_fiche_head($head, $hselected, $langs->trans("TripCard"));
 
 				/*
 				 * Confirmation de la suppression du d�placement
@@ -268,7 +268,7 @@ else
 				print '</td></tr>';
 				
 				print '<tr><td>'.$langs->trans("Date").'</td><td>';
-				print dolibarr_print_date($deplacement->date);
+				print dol_print_date($deplacement->date);
 				print '</td></tr>';
 				
 				print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td>'.$deplacement->km.'</td></tr>';
@@ -281,7 +281,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 }
diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php
index 517beb81dfa..4638173502e 100644
--- a/htdocs/compta/deplacement/index.php
+++ b/htdocs/compta/deplacement/index.php
@@ -108,7 +108,7 @@ if ($resql)
       print "<tr $bc[$var]>";
       print '<td><a href="fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$objp->rowid.'</a></td>';
       print '<td>'.$langs->trans($objp->type).'</td>';
-      print '<td>'.dolibarr_print_date($objp->dd,'day').'</td>';
+      print '<td>'.dol_print_date($objp->dd,'day').'</td>';
       if ($objp->socid) print '<td>'.$soc->getNomUrl(1).'</td>';
       else print '<td>&nbsp;</td>';
       print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$objp->firstname.' '.$objp->name.'</a></td>';
@@ -123,7 +123,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 $db->close();
 
diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php
index 1c29b2967fd..efa2f8e6291 100644
--- a/htdocs/compta/dons/fiche.php
+++ b/htdocs/compta/dons/fiche.php
@@ -178,7 +178,7 @@ if ($_REQUEST['action'] == 'builddoc')
 	$result=don_create($db, $donation->id, '', $donation->modelpdf, $outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 	else
@@ -273,7 +273,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
 	$hselected=$h;
 	$h++;
 
-	dolibarr_fiche_head($head, $hselected, $langs->trans("Ref"));
+	dol_fiche_head($head, $hselected, $langs->trans("Ref"));
 
 	print '<form name="update" action="fiche.php" method="post">';
 	print '<table class="border" width="100%">';
@@ -317,7 +317,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 		print "</select><br>";
 		print "</td></tr>\n";
@@ -373,7 +373,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
 	$hselected=$h;
 	$h++;
 
-	dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").": ".$_GET["rowid"]);
+	dol_fiche_head($head, $hselected, $langs->trans("Ref").": ".$_GET["rowid"]);
 
 	print "<form action=\"fiche.php\" method=\"post\">";
 	print '<table class="border" width="100%">';
@@ -386,7 +386,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
 
 	// Date
 	print "<tr><td>".$langs->trans("Date")."</td><td>";
-	print dolibarr_print_date($don->date,"day");
+	print dol_print_date($don->date,"day");
 	print "</td>";
 
 	$nbrows=12;
diff --git a/htdocs/compta/dons/index.php b/htdocs/compta/dons/index.php
index 64771d3d02d..1f62547fc75 100644
--- a/htdocs/compta/dons/index.php
+++ b/htdocs/compta/dons/index.php
@@ -63,7 +63,7 @@ if ($result)
     }
   $db->free($result);
 } else {
-    dolibarr_print_error($db);   
+    dol_print_error($db);   
 }
 
 print_fiche_titre($langs->trans("DonationsArea"));
diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php
index 17317ed3e26..abc3fd1c052 100644
--- a/htdocs/compta/dons/liste.php
+++ b/htdocs/compta/dons/liste.php
@@ -108,7 +108,7 @@ if ($result)
       print "<td>".stripslashes($objp->prenom)."</td>\n";
       print "<td>".stripslashes($objp->nom)."</td>\n";
       print "<td>".stripslashes($objp->societe)."</td>\n";
-      print '<td align="center">'.dolibarr_print_date($objp->datedon).'</td>';
+      print '<td align="center">'.dol_print_date($objp->datedon).'</td>';
       if ($conf->projet->enabled) {
           print "<td>$objp->projet</td>\n";
       }
@@ -122,7 +122,7 @@ if ($result)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/compta/dons/stats.php b/htdocs/compta/dons/stats.php
index 0dab88c86ea..18330a813b1 100644
--- a/htdocs/compta/dons/stats.php
+++ b/htdocs/compta/dons/stats.php
@@ -75,7 +75,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/compta/export/liste.php b/htdocs/compta/export/liste.php
index d873a9d4af3..f25ae417f5e 100644
--- a/htdocs/compta/export/liste.php
+++ b/htdocs/compta/export/liste.php
@@ -89,7 +89,7 @@ if ($result)
 		print "<tr $bc[$var]>";
 
 		print '<td>'.$obj->ref.'</td>';
-		print '<td>'.dolibarr_print_date($obj->date_export,"dayhour").'</td>';
+		print '<td>'.dol_print_date($obj->date_export,"dayhour").'</td>';
 		print '<td><a href="index.php?action=export&amp;id='.$obj->rowid.'">'.$langs->trans("ReBuild").'</a></td>';
 		print "</tr>\n";
 		$i++;
@@ -99,7 +99,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/export/modules/compta.export.class.php b/htdocs/compta/export/modules/compta.export.class.php
index 9c92c82b091..092224d68b7 100644
--- a/htdocs/compta/export/modules/compta.export.class.php
+++ b/htdocs/compta/export/modules/compta.export.class.php
@@ -58,7 +58,7 @@ class ComptaExport
   {
     global $langs;
     
-    dolibarr_syslog("ComptaExport::ReadLines id=".$id);
+    dol_syslog("ComptaExport::ReadLines id=".$id);
     
     $error = 0;
     
@@ -134,7 +134,7 @@ class ComptaExport
   
   function ReadLinesPayment($id=0)
   {
-    dolibarr_syslog("ComptaExport::ReadLinesPayment id=".$id);
+    dol_syslog("ComptaExport::ReadLinesPayment id=".$id);
     $error = 0;
     
     $sql = "SELECT p.rowid as paymentid, f.facnumber";
@@ -209,13 +209,13 @@ class ComptaExport
   {
     $error = 0;
 
-    dolibarr_syslog("ComptaExport::Export");
+    dol_syslog("ComptaExport::Export");
 
     $error += $this->ReadLines($id);
     $error += $this->ReadLinesPayment($id);
 
-    dolibarr_syslog("ComptaExport::Export Lignes de factures  : ".sizeof($this->linec));
-    dolibarr_syslog("ComptaExport::Export Lignes de paiements : ".sizeof($this->linep));
+    dol_syslog("ComptaExport::Export Lignes de factures  : ".sizeof($this->linec));
+    dol_syslog("ComptaExport::Export Lignes de paiements : ".sizeof($this->linep));
 
     if (!$error && (sizeof($this->linec) > 0 || sizeof($this->linep) > 0))
       {
diff --git a/htdocs/compta/export/modules/compta.export.poivre.class.php b/htdocs/compta/export/modules/compta.export.poivre.class.php
index c6d91d99a8b..47489d5af47 100644
--- a/htdocs/compta/export/modules/compta.export.poivre.class.php
+++ b/htdocs/compta/export/modules/compta.export.poivre.class.php
@@ -57,8 +57,8 @@ class ComptaExportPoivre extends ComptaExport
    */
   function Agregate($line_in)
   {
-    dolibarr_syslog("ComptaExportPoivre::Agregate");
-    dolibarr_syslog("ComptaExportPoivre::Agregate " . sizeof($line_in) . " lignes en entr�es");
+    dol_syslog("ComptaExportPoivre::Agregate");
+    dol_syslog("ComptaExportPoivre::Agregate " . sizeof($line_in) . " lignes en entr�es");
     $i = 0;
     $j = 0;
     $n = sizeof($line_in);
@@ -84,7 +84,7 @@ class ComptaExportPoivre extends ComptaExport
 	  }	
         }
     
-    dolibarr_syslog("ComptaExportPoivre::Agregate " . sizeof($this->line_out) . " lignes en sorties");
+    dol_syslog("ComptaExportPoivre::Agregate " . sizeof($this->line_out) . " lignes en sorties");
     
     return 0;
   }
@@ -96,8 +96,8 @@ class ComptaExportPoivre extends ComptaExport
   {
     $error = 0;
     
-    dolibarr_syslog("ComptaExportPoivre::Export");
-    dolibarr_syslog("ComptaExportPoivre::Export " . sizeof($linec) . " lignes en entr�es");
+    dol_syslog("ComptaExportPoivre::Export");
+    dol_syslog("ComptaExportPoivre::Export " . sizeof($linec) . " lignes en entr�es");
     
     $this->Agregate($linec);
     
@@ -118,7 +118,7 @@ class ComptaExportPoivre extends ComptaExport
 	else
 	  {
 	    $error++;
-	    dolibarr_syslog("ComptaExportPoivre::Export Erreur Select");
+	    dol_syslog("ComptaExportPoivre::Export Erreur Select");
 	  }
 	
 	
@@ -136,7 +136,7 @@ class ComptaExportPoivre extends ComptaExport
 	    else
 	      {
 		$error++;
-		dolibarr_syslog("ComptaExportPoivre::Export Erreur INSERT");
+		dol_syslog("ComptaExportPoivre::Export Erreur INSERT");
 	      }
 	  }
       }
@@ -157,14 +157,14 @@ class ComptaExportPoivre extends ComptaExport
 	else
 	  {
 	    $error++;
-	    dolibarr_syslog("ComptaExportPoivre::Export Erreur Select");
+	    dol_syslog("ComptaExportPoivre::Export Erreur Select");
 	  }
       }
     
     
     if (!$error)
       {
-	dolibarr_syslog("ComptaExportPoivre::Export ref : ".$this->ref);
+	dol_syslog("ComptaExportPoivre::Export ref : ".$this->ref);
 	
 	$fxname = $dir . "/".$this->ref.".xls";
 	
@@ -358,12 +358,12 @@ class ComptaExportPoivre extends ComptaExport
     if (!$error)
       {
 	$this->db->commit();
-	dolibarr_syslog("ComptaExportPoivre::Export COMMIT");
+	dol_syslog("ComptaExportPoivre::Export COMMIT");
       }
     else
       {
 	$this->db->rollback();
-	dolibarr_syslog("ComptaExportPoivre::Export ROLLBACK");
+	dol_syslog("ComptaExportPoivre::Export ROLLBACK");
       }
     
     return 0;
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 9c1494489d1..4d19d4a4d05 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -218,25 +218,25 @@ if ($_POST['action'] == 'setmode')
 	$facture = new Facture($db);
 	$facture->fetch($_GET['facid']);
 	$result=$facture->mode_reglement($_POST['mode_reglement_id']);
-	if ($result < 0) dolibarr_print_error($facture->db,$facture->error);
+	if ($result < 0) dol_print_error($facture->db,$facture->error);
 }
 
 if ($_POST['action'] == 'setpaymentterm')
 {
 	$facture = new Facture($db);
 	$facture->fetch($_GET['facid']);
-	$date_lim_reglement=dolibarr_mktime(12,0,0,$_POST['paymenttermmonth'],$_POST['paymenttermday'],$_POST['paymenttermyear']);
+	$date_lim_reglement=dol_mktime(12,0,0,$_POST['paymenttermmonth'],$_POST['paymenttermday'],$_POST['paymenttermyear']);
 	$result=$facture->cond_reglement($facture->cond_reglement_id,$date_lim_reglement);
-	if ($result < 0) dolibarr_print_error($facture->db,$facture->error);
+	if ($result < 0) dol_print_error($facture->db,$facture->error);
 }
 
 if ($_POST['action'] == 'setinvoicedate')
 {
 	$facture = new Facture($db);
 	$facture->fetch($_GET['facid']);
-	$facture->date=dolibarr_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
+	$facture->date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
 	$result=$facture->update($user);
-	if ($result < 0) dolibarr_print_error($facture->db,$facture->error);
+	if ($result < 0) dol_print_error($facture->db,$facture->error);
 }
 
 if ($_POST['action'] == 'setconditions')
@@ -244,7 +244,7 @@ if ($_POST['action'] == 'setconditions')
 	$facture = new Facture($db);
 	$facture->fetch($_GET['facid']);
 	$result=$facture->cond_reglement($_POST['cond_reglement_id']);
-	if ($result < 0) dolibarr_print_error($facture->db,$facture->error);
+	if ($result < 0) dol_print_error($facture->db,$facture->error);
 }
 
 if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->facture->creer)
@@ -273,7 +273,7 @@ if ($_POST['action'] == "setabsolutediscount" && $user->rights->facture->creer)
 		}
 		else
 		{
-			dolibarr_print_error($db,$fac->error);
+			dol_print_error($db,$fac->error);
 		}
 	}
 	if (! empty($_POST["remise_id_for_payment"]))
@@ -491,7 +491,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
 	// Replacement invoice
 	if ($_POST['type'] == 1)
 	{
-		$datefacture = dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+		$datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 		if (empty($datefacture))
 		{
 			$error=1;
@@ -537,7 +537,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
 			$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("CorrectInvoice")).'</div>';
 		}
 
-		$datefacture = dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+		$datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 		if (empty($datefacture))
 		{
 			$error=1;
@@ -547,7 +547,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
 		if (! $error)
 		{
 			// Si facture avoir
-			$datefacture = dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+			$datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 
 			//$result=$facture->fetch($_POST['fac_avoir']);
 
@@ -575,7 +575,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
 	if ($_POST['type'] == 0 && $_POST['fac_rec'] > 0)
 	{
 		// Si facture r�currente
-		$datefacture = dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+		$datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 
 		$facture->socid 		 = $_POST['socid'];
 		$facture->type           = $_POST['type'];
@@ -595,7 +595,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
 
 	if ($_POST['type'] == 0 && $_POST['fac_rec'] <= 0)
 	{
-		$datefacture = dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+		$datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 		if (empty($datefacture))
 		{
 			$error=1;
@@ -627,8 +627,8 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
 				{
 					if ($_POST['idprod'.$i])
 					{
-						$startday=dolibarr_mktime(12, 0 , 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']);
-						$endday=dolibarr_mktime(12, 0 , 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']);
+						$startday=dol_mktime(12, 0 , 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']);
+						$endday=dol_mktime(12, 0 , 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']);
 						$facture->add_product($_POST['idprod'.$i], $_POST['qty'.$i], $_POST['remise_percent'.$i], $startday, $endday);
 					}
 				}
@@ -840,7 +840,7 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
 		$ret=$fac->fetch($_POST['facid']);
 		if ($ret < 0)
 		{
-			dolibarr_print_error($db,$fac->error);
+			dol_print_error($db,$fac->error);
 			exit;
 		}
 		$ret=$fac->fetch_client();
@@ -955,7 +955,7 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
 if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST['save'] == $langs->trans('Save'))
 {
 	$fac = new Facture($db,'',$_POST['facid']);
-	if (! $fac->fetch($_POST['facid']) > 0) dolibarr_print_error($db);
+	if (! $fac->fetch($_POST['facid']) > 0) dol_print_error($db);
 
 	$date_start='';
 	$date_end='';
@@ -1205,7 +1205,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
 
 						if ($error)
 						{
-							dolibarr_print_error($db);
+							dol_print_error($db);
 						}
 						else
 						{
@@ -1236,21 +1236,21 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
 			{
 				$langs->load("other");
 				$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').'</div>';
-				dolibarr_syslog('Recipient email is empty');
+				dol_syslog('Recipient email is empty');
 			}
 		}
 		else
 		{
 			$langs->load("other");
 			$mesg='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
-			dolibarr_syslog('Failed to read file: '.$file);
+			dol_syslog('Failed to read file: '.$file);
 		}
 	}
 	else
 	{
 		$langs->load("other");
 		$mesg='<div class="error">'.$langs->trans('ErrorFailedToReadEntity',$langs->trans("Invoice")).'</div>';
-		dolibarr_syslog('Impossible de lire les donn�es de la facture. Le fichier facture n\'a peut-�tre pas �t� g�n�r�.');
+		dol_syslog('Impossible de lire les donn�es de la facture. Le fichier facture n\'a peut-�tre pas �t� g�n�r�.');
 	}
 }
 
@@ -1276,7 +1276,7 @@ if ($_REQUEST['action'] == 'builddoc')	// En get ou en post
 	$result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 	else
@@ -1424,7 +1424,7 @@ if ($_GET['action'] == 'create')
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 		}
 	}
@@ -1440,7 +1440,7 @@ if ($_GET['action'] == 'create')
 	$facids=$facturestatic->list_replacable_invoices($soc->id);
 	if ($facids < 0)
 	{
-		dolibarr_print_error($db,$facturestatic);
+		dol_print_error($db,$facturestatic);
 		exit;
 	}
 	$options="";
@@ -1456,7 +1456,7 @@ if ($_GET['action'] == 'create')
 	$facids=$facturestatic->list_qualified_avoir_invoices($soc->id);
 	if ($facids < 0)
 	{
-		dolibarr_print_error($db,$facturestatic);
+		dol_print_error($db,$facturestatic);
 		exit;
 	}
 	$optionsav="";
@@ -1836,7 +1836,7 @@ if ($_GET['action'] == 'create')
 					}
 					else
 					{
-						print dolibarr_trunc($objp->description,60);
+						print dol_trunc($objp->description,60);
 					}
 				}
 				print '</td>';
@@ -1854,7 +1854,7 @@ if ($_GET['action'] == 'create')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print '</table>';
@@ -1915,7 +1915,7 @@ else
 
 			$head = facture_prepare_head($fac);
 
-			dolibarr_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'));
+			dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'));
 
 			// Confirmation de la conversion de l'avoir en reduc
 			if ($_GET['action'] == 'converttoreduc')
@@ -2076,7 +2076,7 @@ else
 			}
 			if ($result < 0)
 			{
-				dolibarr_print_error('',$discount->error);
+				dol_print_error('',$discount->error);
 			}
 			print $html->showrefnav($fac,'ref','',1,'facnumber','ref',$morehtmlref);
 			print '</td></tr>';
@@ -2209,7 +2209,7 @@ else
 				}
 				else
 				{
-					print dolibarr_print_date($fac->date,'daytext');
+					print dol_print_date($fac->date,'daytext');
 				}
 			}
 			else
@@ -2259,7 +2259,7 @@ else
 						$var=!$var;
 						print '<tr '.$bc[$var].'><td>';
 						print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' ';
-						print dolibarr_print_date($objp->dp,'day').'</a></td>';
+						print dol_print_date($objp->dp,'day').'</a></td>';
 						print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
 						print '<td align="right">'.price($objp->amount).'</td>';
 						print '<td>&nbsp;</td>';
@@ -2304,7 +2304,7 @@ else
 					}
 					else
 					{
-						dolibarr_print_error($db);
+						dol_print_error($db);
 					}
 
 					// Pay� partiellement 'escompte'
@@ -2359,7 +2359,7 @@ else
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 
 			print '</td></tr>';
@@ -2380,7 +2380,7 @@ else
 				}
 				else
 				{
-					print dolibarr_print_date($fac->date_lim_reglement,'daytext');
+					print dol_print_date($fac->date_lim_reglement,'daytext');
 					if ($fac->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $fac->paye && $fac->statut == 1 && ! $fac->am) print img_warning($langs->trans('Late'));
 				}
 			}
@@ -2759,7 +2759,7 @@ else
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 
 			/*
@@ -3111,7 +3111,7 @@ else
 				$sql .= ", ".MAIN_DB_PREFIX."fa_pr as fp";
 				$sql .= " WHERE fp.fk_propal = p.rowid AND fp.fk_facture = ".$fac->id;
 
-				dolibarr_syslog("facture.php: sql=".$sql);
+				dol_syslog("facture.php: sql=".$sql);
 				$resql = $db->query($sql);
 				if ($resql)
 				{
@@ -3138,7 +3138,7 @@ else
 							print '<tr '.$bc[$var].'>';
 							print '<td><a href="propal.php?propalid='.$objp->propalid.'">'.img_object($langs->trans('ShowPropal'),'propal').' '.$objp->ref.'</a></td>';
 							print '<td>'.$objp->ref_client.'</td>';
-							print '<td align="center">'.dolibarr_print_date($objp->dp,'day').'</td>';
+							print '<td align="center">'.dol_print_date($objp->dp,'day').'</td>';
 							print '<td align="right">'.price($objp->total_ht).'</td>';
 							print '</tr>';
 							$total = $total + $objp->total_ht;
@@ -3154,7 +3154,7 @@ else
 				}
 				else
 				{
-					dolibarr_print_error($db);
+					dol_print_error($db);
 				}
 
 				/*
@@ -3191,7 +3191,7 @@ else
 								print '<tr '.$bc[$var].'><td>';
 								print '<a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowOrder'), 'order').' '.$objp->ref."</a></td>\n";
 								print '<td>'.$objp->ref_client.'</td>';
-								print '<td align="center">'.dolibarr_print_date($objp->date_commande,'day').'</td>';
+								print '<td align="center">'.dol_print_date($objp->date_commande,'day').'</td>';
 								print '<td align="right">'.price($objp->total_ht).'</td>';
 								print "</tr>\n";
 								$total = $total + $objp->total_ht;
@@ -3207,7 +3207,7 @@ else
 					}
 					else
 					{
-						dolibarr_print_error($db);
+						dol_print_error($db);
 					}
 				}
 
@@ -3243,7 +3243,7 @@ else
 					$result=facture_pdf_create($db, $fac->id, '', $_REQUEST['model'], $outputlangs);
 					if ($result <= 0)
 					{
-						dolibarr_print_error($db,$result);
+						dol_print_error($db,$result);
 						exit;
 					}
 				}
@@ -3310,7 +3310,7 @@ else
 					$result=facture_pdf_create($db, $fac->id, '', $_REQUEST['model'], $outputlangs);
 					if ($result <= 0)
 					{
-						dolibarr_print_error($db,$result);
+						dol_print_error($db,$result);
 						exit;
 					}
 				}
@@ -3359,7 +3359,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db,$fac->error);
+			dol_print_error($db,$fac->error);
 		}
 	}
 	else
@@ -3553,10 +3553,10 @@ else
 
 					if ($objp->df > 0)
 					{
-						$y = dolibarr_print_date($objp->df,'%Y');
-						$m = dolibarr_print_date($objp->df,'%m');
-						$mt = dolibarr_print_date($objp->df,'%b');
-						$d = dolibarr_print_date($objp->df,'%d');
+						$y = dol_print_date($objp->df,'%Y');
+						$m = dol_print_date($objp->df,'%m');
+						$mt = dol_print_date($objp->df,'%b');
+						$d = dol_print_date($objp->df,'%d');
 						print '<td align="center" nowrap>';
 						print $d;
 						print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'&amp;month='.$m.'">';
@@ -3568,7 +3568,7 @@ else
 					{
 						print '<td align="center"><b>!!!</b></td>';
 					}
-					print '<td><a href="fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dolibarr_trunc($objp->nom,48).'</a></td>';
+					print '<td><a href="fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dol_trunc($objp->nom,48).'</a></td>';
 					print '<td align="right">'.price($objp->total).'</td>';
 					print '<td align="right">'.price($objp->total_ttc).'</td>';
 					print '<td align="right">'.price($objp->am).'</td>';
@@ -3604,7 +3604,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 }
diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php
index 04ae706134f..3b91b86a2f3 100644
--- a/htdocs/compta/facture/apercu.php
+++ b/htdocs/compta/facture/apercu.php
@@ -79,7 +79,7 @@ if ($_GET["facid"] > 0)
         }
         
 		$head = facture_prepare_head($fac);
-        dolibarr_fiche_head($head, 'preview', $langs->trans("InvoiceCustomer"));
+        dol_fiche_head($head, 'preview', $langs->trans("InvoiceCustomer"));
 
 
         /*
@@ -98,8 +98,8 @@ if ($_GET["facid"] > 0)
 
         // Dates
         print '<tr><td>'.$langs->trans("Date").'</td>';
-        print '<td colspan="3">'.dolibarr_print_date($fac->date,"daytext").'</td>';
-        print '<td>'.$langs->trans("DateMaxPayment").'</td><td>' . dolibarr_print_date($fac->date_lim_reglement,"daytext");
+        print '<td colspan="3">'.dol_print_date($fac->date,"daytext").'</td>';
+        print '<td>'.$langs->trans("DateMaxPayment").'</td><td>' . dol_print_date($fac->date_lim_reglement,"daytext");
         if ($fac->paye == 0 && $fac->date_lim_reglement < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late"));
         print "</td></tr>";
 
@@ -163,7 +163,7 @@ if ($_GET["facid"] > 0)
 
             print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepath).'">'.$fac->ref.'.pdf</a></td>';
             print '<td align="right">'.filesize($file). ' bytes</td>';
-            print '<td align="right">'.dolibarr_print_date(filemtime($file),'dayhour').'</td>';
+            print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>';
             print '</tr>';
 
             // Si fichier detail PDF existe
@@ -173,7 +173,7 @@ if ($_GET["facid"] > 0)
 
                 print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$fac->ref.'-detail.pdf</a></td>';
                 print '<td align="right">'.filesize($filedetail). ' bytes</td>';
-                print '<td align="right">'.dolibarr_print_date(filemtime($filedetail),"%d %b %Y %H:%M:%S").'</td>';
+                print '<td align="right">'.dol_print_date(filemtime($filedetail),"%d %b %Y %H:%M:%S").'</td>';
                 print '</tr>';
             }
 
diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php
index fdc2d1cf35b..de4a435cb3b 100644
--- a/htdocs/compta/facture/contact.php
+++ b/htdocs/compta/facture/contact.php
@@ -90,12 +90,12 @@ if ($_POST["action"] == 'updateligne' && $user->rights->facture->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -115,12 +115,12 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->facture->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -137,7 +137,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->facture->creer)
 		exit;
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -165,7 +165,7 @@ if ($id > 0)
 
 		$head = facture_prepare_head($facture);
 
-		dolibarr_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'));
+		dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'));
 
 		/*
 		 *   Facture synthese pour rappel
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index 06e4896cf3a..106b92a697b 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -125,7 +125,7 @@ if ($facid > 0)
 		$societe->fetch($facture->socid);
 
 		$head = facture_prepare_head($facture);
-		dolibarr_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'));
+		dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'));
 
 
 		// Construit liste des fichiers
@@ -166,7 +166,7 @@ if ($facid > 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 else
diff --git a/htdocs/compta/facture/facture-rec.class.php b/htdocs/compta/facture/facture-rec.class.php
index 6ba2c1e06df..9abc4785ebd 100644
--- a/htdocs/compta/facture/facture-rec.class.php
+++ b/htdocs/compta/facture/facture-rec.class.php
@@ -161,7 +161,7 @@ class FactureRec extends Facture
 	*/
 	function fetch($rowid, $societe_id=0)
 	{
-		dolibarr_syslog("Facture::Fetch rowid=".$rowid.", societe_id=".$societe_id, LOG_DEBUG);
+		dol_syslog("Facture::Fetch rowid=".$rowid.", societe_id=".$societe_id, LOG_DEBUG);
 
 		$sql = 'SELECT f.titre,f.fk_soc,f.amount,f.tva,f.total,f.total_ttc,f.remise_percent,f.remise_absolue,f.remise';
 		$sql.= ','.$this->db->pdate('f.date_lim_reglement').' as dlr';
@@ -248,7 +248,7 @@ class FactureRec extends Facture
 				if ($result < 0)
 				{
 					$this->error=$this->db->error();
-					dolibarr_syslog('Facture::Fetch Error '.$this->error);
+					dol_syslog('Facture::Fetch Error '.$this->error);
 					return -3;
 				}
 				return 1;
@@ -256,14 +256,14 @@ class FactureRec extends Facture
 			else
 			{
 				$this->error='Bill with id '.$rowid.' not found sql='.$sql;
-				dolibarr_syslog('Facture::Fetch Error '.$this->error);
+				dol_syslog('Facture::Fetch Error '.$this->error);
 				return -2;
 			}
 		}
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog('Facture::Fetch Error '.$this->error);
+			dol_syslog('Facture::Fetch Error '.$this->error);
 			return -1;
 		}
 	}
@@ -283,7 +283,7 @@ class FactureRec extends Facture
 		$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
 		$sql.= ' WHERE l.fk_facture = '.$this->id;
 
-		dolibarr_syslog('Facture::fetch_lines', LOG_DEBUG);
+		dol_syslog('Facture::fetch_lines', LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -328,7 +328,7 @@ class FactureRec extends Facture
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog('Facture::fetch_lines: Error '.$this->error);
+			dol_syslog('Facture::fetch_lines: Error '.$this->error);
 			return -3;
 		}
 	}
@@ -408,7 +408,7 @@ class FactureRec extends Facture
 			$sql .= ",'".price2num($total_tva)."'";
 			$sql .= ",'".price2num($total_ttc)."') ;";
 
-			dolibarr_syslog("Facture-rec::addline sql=".$sql, LOG_DEBUG);
+			dol_syslog("Facture-rec::addline sql=".$sql, LOG_DEBUG);
 			if ($this->db->query( $sql))
 			{
 				$this->id=$facid;	// \TODO A virer
@@ -418,7 +418,7 @@ class FactureRec extends Facture
 			else
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("Facture-rec::addline sql=".$this->error, LOG_ERR);
+				dol_syslog("Facture-rec::addline sql=".$this->error, LOG_ERR);
 				return -1;
 			}
 		}
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 7439c19e287..a9c5280c589 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -474,7 +474,7 @@ else
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index bd1dce3577f..67321b5c2db 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -100,7 +100,7 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
 		if ($option=='late') $filename.='_'.strtolower(sanitizeFileName($langs->transnoentities("Late")));
 		if ($pagecount)
 		{
-			$file=$diroutputpdf.'/'.$filename.'_'.dolibarr_print_date(mktime(),'dayhourlog').'.pdf';
+			$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date(mktime(),'dayhourlog').'.pdf';
 			$pdf->Output($file);
 			if (! empty($conf->global->MAIN_UMASK))
 				@chmod($file, octdec($conf->global->MAIN_UMASK));
@@ -346,10 +346,10 @@ if ($result)
 
 			print "</td>\n";
 
-			print "<td nowrap align=\"center\">".dolibarr_print_date($objp->df)."</td>\n";
-			print "<td nowrap align=\"center\">".dolibarr_print_date($objp->datelimite)."</td>\n";
+			print "<td nowrap align=\"center\">".dol_print_date($objp->df)."</td>\n";
+			print "<td nowrap align=\"center\">".dol_print_date($objp->datelimite)."</td>\n";
 
-			print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).'</a></td>';
+			print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,32).'</a></td>';
 
 			print "<td align=\"right\">".price($objp->total_ht)."</td>";
 			print "<td align=\"right\">".price($objp->total_ttc)."</td>";
diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php
index 4aaf1ff2b1b..b8d648bbe02 100644
--- a/htdocs/compta/facture/info.php
+++ b/htdocs/compta/facture/info.php
@@ -46,7 +46,7 @@ $soc = new Societe($db, $fac->socid);
 $soc->fetch($fac->socid);
 
 $head = facture_prepare_head($fac);
-dolibarr_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"));
+dol_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"));
 
 
 print '<table width="100%"><tr><td>';
diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php
index c25b99ffa2b..11023885a9b 100644
--- a/htdocs/compta/facture/note.php
+++ b/htdocs/compta/facture/note.php
@@ -99,7 +99,7 @@ if ($_GET["facid"])
     $soc->fetch($fac->socid);
 
     $head = facture_prepare_head($fac);
-    dolibarr_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"));
+    dol_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"));
 
 
     print '<table class="border" width="100%">';
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index 20b0efcc68c..a1d3c64b927 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -115,7 +115,7 @@ if ($_GET["facid"] > 0)
 		}
 
 		$head = facture_prepare_head($fac);
-		dolibarr_fiche_head($head, 'standingorders', $langs->trans('InvoiceCustomer'));
+		dol_fiche_head($head, 'standingorders', $langs->trans('InvoiceCustomer'));
 
 		/*
 		 *   Facture
@@ -135,8 +135,8 @@ if ($_GET["facid"] > 0)
 
 		// Dates
 		print '<tr><td>'.$langs->trans("Date").'</td>';
-		print '<td colspan="3">'.dolibarr_print_date($fac->date,"daytext").'</td>';
-		print '<td>'.$langs->trans("DateMaxPayment").'</td><td>' . dolibarr_print_date($fac->date_lim_reglement,"daytext");
+		print '<td colspan="3">'.dol_print_date($fac->date,"daytext").'</td>';
+		print '<td>'.$langs->trans("DateMaxPayment").'</td><td>' . dol_print_date($fac->date_lim_reglement,"daytext");
 		if ($fac->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $fac->paye && $fac->statut == 1 && ! $fac->am) print img_warning($langs->trans("Late"));
 		print "</td></tr>";
 
@@ -223,7 +223,7 @@ if ($_GET["facid"] > 0)
 				$var=!$var;
 
 				print "<tr $bc[$var]>";
-				print '<td align="left">'.dolibarr_print_date($obj->date_demande,'day')."</td>\n";
+				print '<td align="left">'.dol_print_date($obj->date_demande,'day')."</td>\n";
 				print '<td align="center">En attente de traitement</td>';
 				print '<td align="center">'.price($obj->amount).'</td>';
 				print '<td align="center">-</td>';
@@ -241,7 +241,7 @@ if ($_GET["facid"] > 0)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		$sql = "SELECT pfd.rowid, pfd.traite,".$db->pdate("pfd.date_demande")." as date_demande";
@@ -268,9 +268,9 @@ if ($_GET["facid"] > 0)
 
 				print "<tr $bc[$var]>";
 
-				print '<td align="center">'.dolibarr_print_date($obj->date_demande)."</td>\n";
+				print '<td align="center">'.dol_print_date($obj->date_demande)."</td>\n";
 
-				print '<td align="center">'.dolibarr_print_date($obj->date_traite)."</td>\n";
+				print '<td align="center">'.dol_print_date($obj->date_traite)."</td>\n";
 
 				print '<td align="center">'.price($obj->amount).'</td>';
 
@@ -291,7 +291,7 @@ if ($_GET["facid"] > 0)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print "</table>";
diff --git a/htdocs/compta/facture/stats/month.php b/htdocs/compta/facture/stats/month.php
index 82907b53649..822d697a163 100644
--- a/htdocs/compta/facture/stats/month.php
+++ b/htdocs/compta/facture/stats/month.php
@@ -124,7 +124,7 @@ $data = array();
 
 for ($i = 1 ; $i < 13 ; $i++)
 {
-  $data[$i-1] = array(ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
+  $data[$i-1] = array(ucfirst(substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
 }
 
 $filename_avg = $dir."/invoicesaverage-".$year.".png";
diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php
index aa875d13d04..c11027955c0 100644
--- a/htdocs/compta/fiche.php
+++ b/htdocs/compta/fiche.php
@@ -86,7 +86,7 @@ if ($socid > 0)
     $societe->fetch($socid, $to);  // si $to='next' ajouter " AND s.rowid > $socid ORDER BY idp ASC LIMIT 1";
 	if ($societe->id <= 0)
 	{
-		dolibarr_print_error($db,$societe->error);
+		dol_print_error($db,$societe->error);
 	}
 
 	/*
@@ -94,7 +94,7 @@ if ($socid > 0)
 	 */
 	$head = societe_prepare_head($societe);
 
-	dolibarr_fiche_head($head, 'compta', $langs->trans("ThirdParty"));
+	dol_fiche_head($head, 'compta', $langs->trans("ThirdParty"));
 
 
     print '<table width="100%" class="notopnoleftnoright">';
@@ -193,7 +193,7 @@ if ($socid > 0)
         print '</td>';
         print '<td colspan="3">';
 		$amount_discount=$societe->getAvailableDiscounts();
-		if ($amount_discount < 0) dolibarr_print_error($db,$societe->error);
+		if ($amount_discount < 0) dol_print_error($db,$societe->error);
         if ($amount_discount > 0) print price($amount_discount).'&nbsp;'.$langs->trans("Currency".$conf->monnaie);
         else print $langs->trans("DiscountNone");
         print '</td>';
@@ -266,7 +266,7 @@ if ($socid > 0)
                 print '</td>';
                 if ($objp->df > 0)
                 {
-                    print "<td align=\"right\">".dolibarr_print_date($objp->df)."</td>\n";
+                    print "<td align=\"right\">".dol_print_date($objp->df)."</td>\n";
                 }
                 else
                 {
@@ -282,7 +282,7 @@ if ($socid > 0)
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
     }
@@ -318,14 +318,14 @@ if ($socid > 0)
                 print "<tr $bc[$var]>";
                 print '<td><a href="../projet/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowProject"),"project")." ".$obj->title.'</a></td>';
 
-                print "<td align=\"right\">".dolibarr_print_date($obj->do,"day") ."</td></tr>";
+                print "<td align=\"right\">".dol_print_date($obj->do,"day") ."</td></tr>";
                 $i++;
             }
             $db->free();
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
     }
@@ -385,7 +385,7 @@ if ($socid > 0)
 }
 else
 {
-    dolibarr_print_error($db,'Bad value for socid parameter');
+    dol_print_error($db,'Bad value for socid parameter');
 }
 $db->close();
 
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index fa232644ffe..3bbf46c1e93 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -19,11 +19,11 @@
  */
 
 /**
-      \file       htdocs/compta/index.php
-      \ingroup    compta
-      \brief      Page accueil zone comptabilit�
-      \version    $Id$
-*/
+ \file       htdocs/compta/index.php
+ \ingroup    compta
+ \brief      Page accueil zone comptabilit�
+ \version    $Id$
+ */
 
 require("./pre.inc.php");
 require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
@@ -48,8 +48,8 @@ if ($conf->commande->enabled) $langs->load("orders");
 $socid='';
 if ($user->societe_id > 0)
 {
-  $action = '';
-  $socid = $user->societe_id;
+	$action = '';
+	$socid = $user->societe_id;
 }
 
 
@@ -59,22 +59,22 @@ if ($user->societe_id > 0)
 
 if (isset($_GET["action"]) && $_GET["action"] == 'add_bookmark')
 {
-  $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socid." AND fk_user=".$user->id;
-  if (! $db->query($sql) )
-    {
-      dolibarr_print_error($db);
-    }
-  $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$socid.", ".$db->idate(mktime()).",".$user->id.");";
-  if (! $db->query($sql) )
-    {
-      dolibarr_print_error($db);
-    }
+	$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socid." AND fk_user=".$user->id;
+	if (! $db->query($sql) )
+	{
+		dol_print_error($db);
+	}
+	$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$socid.", ".$db->idate(mktime()).",".$user->id.");";
+	if (! $db->query($sql) )
+	{
+		dol_print_error($db);
+	}
 }
 
 if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark')
 {
-  $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"];
-  $result = $db->query($sql);
+	$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"];
+	$result = $db->query($sql);
 }
 
 
@@ -197,7 +197,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -270,7 +270,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -279,58 +279,58 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
  */
 if ($conf->tax->enabled)
 {
-    if ($user->societe_id == 0)
-    {
+	if ($user->societe_id == 0)
+	{
 		$chargestatic=new ChargeSociales($db);
 
-        $sql = "SELECT c.rowid, c.amount, ".$db->pdate("c.date_ech")." as date_ech,";
+		$sql = "SELECT c.rowid, c.amount, ".$db->pdate("c.date_ech")." as date_ech,";
 		$sql.= " cc.libelle";
-        $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as c, ".MAIN_DB_PREFIX."c_chargesociales as cc";
-        $sql.= " WHERE c.fk_type = cc.id AND c.paye=0";
+		$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as c, ".MAIN_DB_PREFIX."c_chargesociales as cc";
+		$sql.= " WHERE c.fk_type = cc.id AND c.paye=0";
 
-        $resql = $db->query($sql);
-        if ( $resql )
-        {
-            $var = false;
+		$resql = $db->query($sql);
+		if ( $resql )
+		{
+			$var = false;
 			$num = $db->num_rows($resql);
 
 			print '<table class="noborder" width="100%">';
 			print '<tr class="liste_titre">';
 			print '<td colspan="2">'.$langs->trans("ContributionsToPay").($num?' ('.$num.')':'').'</td></tr>';
-            if ($num)
-            {
-                $i = 0;
-                $tot_ttc=0;
-                while ($i < $num)
-                {
-                    $obj = $db->fetch_object($resql);
-                    print "<tr $bc[$var]>";
+			if ($num)
+			{
+				$i = 0;
+				$tot_ttc=0;
+				while ($i < $num)
+				{
+					$obj = $db->fetch_object($resql);
+					print "<tr $bc[$var]>";
 					$chargestatic->id=$obj->rowid;
-                    $chargestatic->lib=$obj->libelle;
-                    print '<td>'.$chargestatic->getNomUrl(1).'</td>';
-                    print '<td align="right">'.price($obj->amount).'</td>';
-                    print '</tr>';
-                    $tot_ttc+=$obj->amount;
-                    $var = !$var;
-                    $i++;
-                }
-
-                print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
-                print '<td align="right">'.price($tot_ttc).'</td>';
-                print '</tr>';
-            }
+					$chargestatic->lib=$obj->libelle;
+					print '<td>'.$chargestatic->getNomUrl(1).'</td>';
+					print '<td align="right">'.price($obj->amount).'</td>';
+					print '</tr>';
+					$tot_ttc+=$obj->amount;
+					$var = !$var;
+					$i++;
+				}
+
+				print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
+				print '<td align="right">'.price($tot_ttc).'</td>';
+				print '</tr>';
+			}
 			else
 			{
 				print '<tr colspan="2" '.$bc[$var].'><td>'.$langs->trans("None").'</td></tr>';
 			}
 			print "</table><br>";
-            $db->free($resql);
-        }
-        else
-        {
-            dolibarr_print_error($db);
-        }
-    }
+			$db->free($resql);
+		}
+		else
+		{
+			dol_print_error($db);
+		}
+	}
 }
 
 
@@ -384,12 +384,12 @@ if ($user->societe->enabled && $user->rights->societe->lire)
 				$var=!$var;
 				print '<tr '.$bc[$var].'>';
 				print '<td>'.$customerstatic->getNomUrl(1).'</td>';
-				print '<td align="right">'.dolibarr_print_date($objp->dc,'day').'</td>';
+				print '<td align="right">'.dol_print_date($objp->dc,'day').'</td>';
 				print '</tr>';
 
 				$i++;
 			}
-			
+
 		}
 		else
 		{
@@ -444,12 +444,12 @@ if ($user->fournisseur->enabled && $user->rights->societe->lire)
 				$customerstatic->nom=$objp->nom;
 				print '<tr '.$bc[$var].'>';
 				print '<td>'.$customerstatic->getNomUrl(1).'</td>';
-				print '<td align="right">'.dolibarr_print_date($objp->dc,'day').'</td>';
+				print '<td align="right">'.dol_print_date($objp->dc,'day').'</td>';
 				print '</tr>';
 				$var=!$var;
 				$i++;
 			}
-			
+
 		}
 		else
 		{
@@ -458,7 +458,7 @@ if ($user->fournisseur->enabled && $user->rights->societe->lire)
 		print '</table><br>';
 	}
 }
-	
+
 /*
  * Commandes clients � facturer
  */
@@ -491,7 +491,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
 	{
 		$var=false;
 		$num = $db->num_rows($resql);
-		
+
 		if ($num)
 		{
 			$i = 0;
@@ -509,10 +509,10 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
 				$obj = $db->fetch_object($resql);
 				print "<tr $bc[$var]>";
 				print '<td nowrap="nowrap">';
-				
+
 				$commandestatic->id=$obj->rowid;
 				$commandestatic->ref=$obj->ref;
-				
+
 				print '<table class="nobordernopadding"><tr class="nocellnopadd">';
 				print '<td width="100" class="nobordernopadding" nowrap="nowrap">';
 				print $commandestatic->getNomUrl(1);
@@ -526,11 +526,11 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
 				$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
 				print '</td></tr></table>';
-				
+
 				print '</td>';
 
 				print '<td align="left"><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';
-				print '<a href="fiche.php?socid='.$obj->socid.'">'.dolibarr_trunc($obj->nom,44).'</a></td>';
+				print '<a href="fiche.php?socid='.$obj->socid.'">'.dol_trunc($obj->nom,44).'</a></td>';
 				if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
 				print '<td align="right">'.price($obj->total_ttc).'</td>';
 				print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
@@ -556,7 +556,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -604,7 +604,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 
 				print '<tr '.$bc[$var].'>';
 				print '<td nowrap="nowrap">';
-				
+
 				print '<table class="nobordernopadding"><tr class="nocellnopadd">';
 				print '<td width="100" class="nobordernopadding" nowrap="nowrap">';
 				$facturestatic->ref=$obj->facnumber;
@@ -621,9 +621,9 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 				$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
 				$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
 				print '</td></tr></table>';
-				
+
 				print '</td>';
-				print '<td align="left"><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCustomer"),"company").' '.dolibarr_trunc($obj->nom,44).'</a></td>';
+				print '<td align="left"><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCustomer"),"company").' '.dol_trunc($obj->nom,44).'</a></td>';
 				if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total).'</td>';
 				print '<td align="right">'.price($obj->total_ttc).'</td>';
 				print '<td align="right">'.price($obj->am).'</td>';
@@ -655,7 +655,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -704,7 +704,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 				$facstatic->id=$obj->rowid;
 				print $facstatic->getNomUrl(1,'');
 				print '</td>';
-				print '<td><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"),"company").' '.dolibarr_trunc($obj->nom,44).'</a></td>';
+				print '<td><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"),"company").' '.dol_trunc($obj->nom,44).'</a></td>';
 				if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
 				print '<td align="right">'.price($obj->total_ttc).'</td>';
 				print '<td align="right">'.price($obj->am).'</td>';
@@ -734,7 +734,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -744,22 +744,22 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 $resql = 0;
 if ($resql)
 {
-  print '<table class="noborder" width="100%">';
-  print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("TasksToDo").'</td>';
-  print "</tr>\n";
-  $var = True;
-  $i = 0;
-  while ($i < $db->num_rows($resql))
-    {
-      $obj = $db->fetch_object($resql);
-      $var=!$var;
-
-      print "<tr $bc[$var]><td>".dolibarr_print_date($obj->da,"day")."</td>";
-      print "<td><a href=\"action/fiche.php\">$obj->libelle $obj->label</a></td></tr>";
-      $i++;
-    }
-  $db->free($resql);
-  print "</table><br>";
+	print '<table class="noborder" width="100%">';
+	print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("TasksToDo").'</td>';
+	print "</tr>\n";
+	$var = True;
+	$i = 0;
+	while ($i < $db->num_rows($resql))
+	{
+		$obj = $db->fetch_object($resql);
+		$var=!$var;
+
+		print "<tr $bc[$var]><td>".dol_print_date($obj->da,"day")."</td>";
+		print "<td><a href=\"action/fiche.php\">$obj->libelle $obj->label</a></td></tr>";
+		$i++;
+	}
+	$db->free($resql);
+	print "</table><br>";
 }
 
 print '</td></tr>';
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index c044730ce29..edba3008c3e 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -53,7 +53,7 @@ if ($_POST['action'] == 'add_paiement' || $_POST['action'] == 'confirm_paiement'
 {
 	$error = 0;
 
-	$datepaye = dolibarr_mktime(12, 0 , 0,
+	$datepaye = dol_mktime(12, 0 , 0,
 	$_POST['remonth'],
 	$_POST['reday'],
 	$_POST['reyear']);
@@ -130,7 +130,7 @@ if ($_POST['action'] == 'add_paiement')
  */
 if ($_POST['action'] == 'confirm_paiement' && $_POST['confirm'] == 'yes')
 {
-	$datepaye = dolibarr_mktime(12, 0 , 0,
+	$datepaye = dol_mktime(12, 0 , 0,
 	$_POST['remonth'],
 	$_POST['reday'],
 	$_POST['reyear']);
@@ -280,7 +280,7 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
 
 		// Date payment
 		print '<tr><td>'.$langs->trans('Date').'</td><td>';
-		$datepayment = dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+		$datepayment = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 		$datepayment= ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0) : $datepayment);
 		$html->select_date($datepayment,'','','',0,"add_paiement");
 		print '</td>';
@@ -385,7 +385,7 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
 					print "</td>\n";
 
 					// Date
-					print '<td align="center">'.dolibarr_print_date($objp->df,'day')."</td>\n";
+					print '<td align="center">'.dol_print_date($objp->df,'day')."</td>\n";
 
 					// Prix
 					print '<td align="right">'.price($objp->total_ttc).'</td>';
@@ -441,7 +441,7 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 
@@ -523,7 +523,7 @@ if (! $_GET['action'] && ! $_POST['action'])
 			$var=!$var;
 			print '<tr '.$bc[$var].'>';
 			print '<td><a href="facture.php?facid='.$objp->facid.'">'.$objp->facnumber."</a></td>\n";
-			print '<td>'.dolibarr_print_date($objp->dp)."</td>\n";
+			print '<td>'.dol_print_date($objp->dp)."</td>\n";
 			print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
 			print '<td align="right">'.price($objp->amount).'</td><td>&nbsp;</td>';
 			print '</tr>';
diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php
index 825a34993b9..8fc80493b45 100644
--- a/htdocs/compta/paiement/avalider.php
+++ b/htdocs/compta/paiement/avalider.php
@@ -96,7 +96,7 @@ if ($resql)
         $var=!$var;
         print "<tr $bc[$var]>";
         print '<td>'.'<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>';
-        print '<td width="80" align="center">'.dolibarr_print_date($objp->dp,'day')."</td>\n";
+        print '<td width="80" align="center">'.dol_print_date($objp->dp,'day')."</td>\n";
         print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
         print '<td align="right">'.price($objp->amount).'</td>';
         print '<td align="center">';
diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php
index ac5266e82df..b290ca56e77 100644
--- a/htdocs/compta/paiement/cheque/fiche.php
+++ b/htdocs/compta/paiement/cheque/fiche.php
@@ -137,7 +137,7 @@ if ($_POST['action'] == 'builddoc' && $user->rights->banque)
 	$result = $remisecheque->GeneratePdf($_POST["model"], $outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$remisecheque->error);
+		dol_print_error($db,$remisecheque->error);
 		exit;
 	}
 	else
@@ -165,7 +165,7 @@ if ($_GET['action'] == 'new')
 	$hselected = $h;
 	$h++;
 
-	dolibarr_fiche_head($head, $hselected, $langs->trans("Cheques"));
+	dol_fiche_head($head, $hselected, $langs->trans("Cheques"));
 }
 else
 {
@@ -190,7 +190,7 @@ else
 	//  $head[$h][1] = $langs->trans("Info");
 	//  $h++;
 
-	dolibarr_fiche_head($head, $hselected, $langs->trans("Cheques"));
+	dol_fiche_head($head, $hselected, $langs->trans("Cheques"));
 
 	/*
 	 * Confirmation de la suppression du bordereau
@@ -223,7 +223,7 @@ if ($_GET['action'] == 'new')
 	$now=time();
 
 	print '<table class="border" width="100%">';
-	print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dolibarr_print_date($now,'day').'</td></tr>';
+	print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dol_print_date($now,'day').'</td></tr>';
 	print '</table><br />';
 
 	$sql = "SELECT ba.rowid as bid, ".$db->pdate("b.dateo")." as date,";
@@ -278,7 +278,7 @@ if ($_GET['action'] == 'new')
 			$accounts[$objp->bid] += 1;
 
 			print "<tr ".$bc[$var].">";
-			print '<td width="120">'.dolibarr_print_date($value["date"],'day').'</td>';
+			print '<td width="120">'.dol_print_date($value["date"],'day').'</td>';
 			print '<td>'.$value["numero"]."</td>\n";
 			print '<td>'.$value["emetteur"]."</td>\n";
 			print '<td>'.$value["banque"]."</td>\n";
@@ -318,7 +318,7 @@ else
 	print "</td>";
 	print "</tr>\n";
 
-	print '<tr><td>'.$langs->trans('DateCreation').'</td><td colspan="2">'.dolibarr_print_date($remisecheque->date_bordereau,'day').'</td></tr>';
+	print '<tr><td>'.$langs->trans('DateCreation').'</td><td colspan="2">'.dol_print_date($remisecheque->date_bordereau,'day').'</td></tr>';
 
 	print '<tr><td>'.$langs->trans('Account').'</td><td colspan="2">';
 	print $accountstatic->getNomUrl(1);
@@ -374,8 +374,8 @@ else
 			print "<tr $bc[$var]>";
 			print '<td align="center" width="24">'.$i.'</td>';
 			print '<td align="center">'.($objp->num_chq?$objp->num_chq:'&nbsp;').'</td>';
-			print '<td>'.dolibarr_trunc($objp->emetteur,24).'</td>';
-			print '<td>'.dolibarr_trunc($objp->banque,24).'</td>';
+			print '<td>'.dol_trunc($objp->emetteur,24).'</td>';
+			print '<td>'.dol_trunc($objp->banque,24).'</td>';
 			print '<td align="right">'.price($objp->amount).'</td>';
 			print '<td align="center">';
 			$accountlinestatic->rowid=$objp->rowid;
@@ -388,7 +388,7 @@ else
 				print '&nbsp;';
 			}
 			print '</td>';
-			print '<td align="center">'.dolibarr_print_date($objp->datec,'day').'</td>';
+			print '<td align="center">'.dol_print_date($objp->datec,'day').'</td>';
 			if($remisecheque->statut == 0)
 			{
 				print '<td align="right"><a href="fiche.php?id='.$remisecheque->id.'&amp;action=remove&amp;lineid='.$objp->rowid.'">'.img_delete().'</a></td>';
@@ -405,7 +405,7 @@ else
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 }
diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php
index 2d550eccc4a..3377f29e061 100644
--- a/htdocs/compta/paiement/cheque/index.php
+++ b/htdocs/compta/paiement/cheque/index.php
@@ -79,7 +79,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
@@ -123,7 +123,7 @@ if ($resql)
 		print "<tr $bc[$var]>\n";
 
 		print '<td>'.$checkdepositstatic->getNomUrl(1).'</td>';
-		print '<td>'.dolibarr_print_date($objp->db,'day').'</td>';
+		print '<td>'.dol_print_date($objp->db,'day').'</td>';
 		print '<td>'.$accountstatic->getNomUrl(1).'</td>';
 		print '<td align="right">'.$objp->nbcheque.'</td>';
 		print '<td align="right">'.price($objp->amount).'</td>';
@@ -136,7 +136,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 print "</td></tr>\n";
diff --git a/htdocs/compta/paiement/cheque/liste.php b/htdocs/compta/paiement/cheque/liste.php
index e24f352d35b..deee749cce5 100644
--- a/htdocs/compta/paiement/cheque/liste.php
+++ b/htdocs/compta/paiement/cheque/liste.php
@@ -116,7 +116,7 @@ if ($resql)
 		print '</td>';
 
         // Date
-        print '<td align="center">'.dolibarr_print_date($objp->dp,'day').'</td>';
+        print '<td align="center">'.dol_print_date($objp->dp,'day').'</td>';
 
         // Banque
         print '<td>';
@@ -141,7 +141,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/paiement/cheque/remisecheque.class.php b/htdocs/compta/paiement/cheque/remisecheque.class.php
index fec22a33ba5..e3277b99061 100644
--- a/htdocs/compta/paiement/cheque/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/remisecheque.class.php
@@ -72,7 +72,7 @@ class RemiseCheque extends CommonObject
 		if ($id)  $sql.= " WHERE bc.rowid = ".$id;
 		if ($ref) $sql.= " WHERE bc.number = '".addslashes($ref)."'";
 
-		dolibarr_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -124,7 +124,7 @@ class RemiseCheque extends CommonObject
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."bordereau_cheque (datec, date_bordereau, fk_user_author, fk_bank_account, amount, number, nbcheque)";
 		$sql.= " VALUES (".$this->db->idate(mktime()).",".$this->db->idate(mktime()).",".$user->id.",".$account_id.",0,0,0)";
 
-		dolibarr_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
+		dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ( $resql )
 		{
@@ -132,7 +132,7 @@ class RemiseCheque extends CommonObject
 			if ($this->id == 0)
 			{
 				$this->errno = -1024;
-				dolibarr_syslog("Remisecheque::Create Erreur Lecture ID ($this->errno)", LOG_ERR);
+				dol_syslog("Remisecheque::Create Erreur Lecture ID ($this->errno)", LOG_ERR);
 			}
 
 			if ($this->id > 0 && $this->errno == 0)
@@ -141,12 +141,12 @@ class RemiseCheque extends CommonObject
 				$sql.= " SET number='(PROV".$this->id.")'";
 				$sql.= " WHERE rowid='".$this->id."';";
 
-				dolibarr_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
+				dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
 				$resql = $this->db->query($sql);
 				if (! $resql)
 				{
 					$this->errno = -1025;
-					dolibarr_syslog("RemiseCheque::Create ERREUR UPDATE ($this->errno)", LOG_ERR);
+					dol_syslog("RemiseCheque::Create ERREUR UPDATE ($this->errno)", LOG_ERR);
 				}
 			}
 
@@ -159,7 +159,7 @@ class RemiseCheque extends CommonObject
 				$sql.= " AND b.fk_bordereau = 0 AND b.fk_account='".$account_id."'";
 				$sql.= " LIMIT 40"; // On limite a 40 pour ne g�n�rer des PDF que d'une page
 
-				dolibarr_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
+				dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
 				$resql = $this->db->query($sql);
 				if ($resql)
 				{
@@ -172,7 +172,7 @@ class RemiseCheque extends CommonObject
 				else
 				{
 					$this->errno = -1026;
-					dolibarr_syslog("RemiseCheque::Create Error ($this->errno)", LOG_ERR);
+					dol_syslog("RemiseCheque::Create Error ($this->errno)", LOG_ERR);
 				}
 			}
 
@@ -184,12 +184,12 @@ class RemiseCheque extends CommonObject
 					$sql.= " SET fk_bordereau = ".$this->id;
 					$sql.= " WHERE rowid = ".$lineid;
 
-					dolibarr_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
+					dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
 					$resql = $this->db->query($sql);
 					if (!$resql)
 					{
 						$this->errno = -18;
-						dolibarr_syslog("RemiseCheque::Create Error update bank ($this->errno)", LOG_ERR);
+						dol_syslog("RemiseCheque::Create Error update bank ($this->errno)", LOG_ERR);
 					}
 				}
 			}
@@ -199,7 +199,7 @@ class RemiseCheque extends CommonObject
 				if ($this->UpdateAmount() <> 0)
 				{
 					$this->errno = -1027;
-					dolibarr_syslog("RemiseCheque::Create ERREUR ($this->errno)");
+					dol_syslog("RemiseCheque::Create ERREUR ($this->errno)");
 				}
 			}
 		}
@@ -208,7 +208,7 @@ class RemiseCheque extends CommonObject
 			$result = -1;
 			$this->error=$this->db->lasterror();
 			$this->errno=$this->db->lasterrno();
-			dolibarr_syslog("RemiseCheque::Create Erreur $result INSERT Mysql");
+			dol_syslog("RemiseCheque::Create Erreur $result INSERT Mysql");
 		}
 
 
@@ -220,7 +220,7 @@ class RemiseCheque extends CommonObject
 		else
 		{
 			$this->db->rollback();
-			dolibarr_syslog("RemiseCheque::Create ROLLBACK ($this->errno)");
+			dol_syslog("RemiseCheque::Create ROLLBACK ($this->errno)");
 			return $this->errno;
 		}
 
@@ -246,7 +246,7 @@ class RemiseCheque extends CommonObject
 			if ($num <> 1)
 	  {
 	  	$this->errno = -2;
-	  	dolibarr_syslog("Remisecheque::Delete Erreur Lecture ID ($this->errno)");
+	  	dol_syslog("Remisecheque::Delete Erreur Lecture ID ($this->errno)");
 	  }
 
 	  if ( $this->errno === 0)
@@ -258,7 +258,7 @@ class RemiseCheque extends CommonObject
 	  	if (!$resql)
 	  	{
 	  		$this->errno = -1028;
-	  		dolibarr_syslog("RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
+	  		dol_syslog("RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
 	  	}
 	  }
 		}
@@ -270,7 +270,7 @@ class RemiseCheque extends CommonObject
 		else
 		{
 			$this->db->rollback();
-			dolibarr_syslog("RemiseCheque::Delete ROLLBACK ($this->errno)");
+			dol_syslog("RemiseCheque::Delete ROLLBACK ($this->errno)");
 		}
 
 		return $this->errno;
@@ -296,7 +296,7 @@ class RemiseCheque extends CommonObject
 			$sql.= " SET statut=1, number='".$num."'";
 			$sql .= " WHERE rowid = $this->id AND statut=0;";
 
-			dolibarr_syslog("RemiseCheque::Validate sql=".$sql, LOG_DEBUG);
+			dol_syslog("RemiseCheque::Validate sql=".$sql, LOG_DEBUG);
 			$resql = $this->db->query($sql);
 			if ( $resql )
 			{
@@ -309,13 +309,13 @@ class RemiseCheque extends CommonObject
 				else
 				{
 					$this->errno = -1029;
-					dolibarr_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR);
+					dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR);
 				}
 			}
 			else
 			{
 				$this->errno = -1033;
-				dolibarr_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR);
+				dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR);
 			}
 		}
 
@@ -327,7 +327,7 @@ class RemiseCheque extends CommonObject
 		else
 		{
 			$this->db->rollback();
-			dolibarr_syslog("RemiseCheque::Validate ".$this->errno, LOG_ERR);
+			dol_syslog("RemiseCheque::Validate ".$this->errno, LOG_ERR);
 		}
 
 		return $this->errno;
@@ -346,7 +346,7 @@ class RemiseCheque extends CommonObject
 		// We use +0 to convert varchar to number
 		$sql = "SELECT MAX(number+0) FROM ".MAIN_DB_PREFIX."bordereau_cheque";
 
-		dolibarr_syslog("Remisecheque::getNextNumber sql=".$sql);
+		dol_syslog("Remisecheque::getNextNumber sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -357,7 +357,7 @@ class RemiseCheque extends CommonObject
 		else
 		{
 			$this->errno = -1034;
-			dolibarr_syslog("Remisecheque::Validate Erreur SELECT ($this->errno)", LOG_ERR);
+			dol_syslog("Remisecheque::Validate Erreur SELECT ($this->errno)", LOG_ERR);
 		}
 
 		$num++;
@@ -396,7 +396,7 @@ class RemiseCheque extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -414,7 +414,7 @@ class RemiseCheque extends CommonObject
 		
 		if (empty($model)) $model='blochet';
 		
-		dolibarr_syslog("RemiseCheque::GeneratePdf model=".$model, LOG_DEBUG);
+		dol_syslog("RemiseCheque::GeneratePdf model=".$model, LOG_DEBUG);
 
 		$dir=DOL_DOCUMENT_ROOT ."/includes/modules/cheque/pdf/";
 
@@ -435,7 +435,7 @@ class RemiseCheque extends CommonObject
 			$sql.= " AND bc.rowid = ".$this->id;
 			$sql.= " ORDER BY b.emetteur ASC, b.rowid ASC;";
 
-			dolibarr_syslog("RemiseCheque::GeneratePdf sql=".$sql, LOG_DEBUG);
+			dol_syslog("RemiseCheque::GeneratePdf sql=".$sql, LOG_DEBUG);
 			$result = $this->db->query($sql);
 			if ($result)
 			{
@@ -471,8 +471,8 @@ class RemiseCheque extends CommonObject
 			else
 			{
 				$outputlangs->charset_output=$sav_charset_output;
-				dolibarr_syslog("Error");
-				dolibarr_print_error($db,$pdf->pdferror());
+				dol_syslog("Error");
+				dol_print_error($db,$pdf->pdferror());
 				return 0;
 			}
 		}
@@ -516,13 +516,13 @@ class RemiseCheque extends CommonObject
 	  if (!$resql)
 	  {
 	  	$this->errno = -1030;
-	  	dolibarr_syslog("RemiseCheque::UpdateAmount ERREUR UPDATE ($this->errno)");
+	  	dol_syslog("RemiseCheque::UpdateAmount ERREUR UPDATE ($this->errno)");
 	  }
 		}
 		else
 		{
 			$this->errno = -1031;
-			dolibarr_syslog("RemiseCheque::UpdateAmount ERREUR SELECT ($this->errno)");
+			dol_syslog("RemiseCheque::UpdateAmount ERREUR SELECT ($this->errno)");
 		}
 
 		if ($this->errno === 0)
@@ -532,7 +532,7 @@ class RemiseCheque extends CommonObject
 		else
 		{
 			$this->db->rollback();
-			dolibarr_syslog("RemiseCheque::UpdateAmount ROLLBACK ($this->errno)");
+			dol_syslog("RemiseCheque::UpdateAmount ROLLBACK ($this->errno)");
 		}
 
 		return $this->errno;
@@ -560,7 +560,7 @@ class RemiseCheque extends CommonObject
 	  else
 	  {
 	  	$this->errno = -1032;
-	  	dolibarr_syslog("RemiseCheque::RemoveCheck ERREUR UPDATE ($this->errno)");
+	  	dol_syslog("RemiseCheque::RemoveCheck ERREUR UPDATE ($this->errno)");
 	  }
 		}
 		return 0;
diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php
index e668e259fcb..0495fa8ca95 100644
--- a/htdocs/compta/paiement/fiche.php
+++ b/htdocs/compta/paiement/fiche.php
@@ -110,7 +110,7 @@ $paiement = new Paiement($db);
 $result=$paiement->fetch($_GET['id']);
 if ($result <= 0)
 {
-	dolibarr_print_error($db,'Payement '.$_GET['id'].' not found in database');
+	dol_print_error($db,'Payement '.$_GET['id'].' not found in database');
 	exit;
 }
 
@@ -128,7 +128,7 @@ $head[$h][1] = $langs->trans("Info");
 $h++;      
 
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
+dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
 
 /*
  * Confirmation de la suppression du paiement
@@ -159,7 +159,7 @@ print '<table class="border" width="100%">';
 print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';
 
 // Date
-print '<tr><td valign="top" width="120">'.$langs->trans('Date').'</td><td colspan="3">'.dolibarr_print_date($paiement->date,'day').'</td></tr>';
+print '<tr><td valign="top" width="120">'.$langs->trans('Date').'</td><td colspan="3">'.dol_print_date($paiement->date,'day').'</td></tr>';
 
 // Mode
 print '<tr><td valign="top">'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("PaymentType".$paiement->type_code).'</td></tr>';
@@ -253,7 +253,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);   
+	dol_print_error($db);   
 }
 
 print '</div>';
diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php
index f9e80ba1cc0..1719160c863 100644
--- a/htdocs/compta/paiement/info.php
+++ b/htdocs/compta/paiement/info.php
@@ -55,7 +55,7 @@ $hselected = $h;
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
+dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
 
 print '<table class="border" width="100%">';
 
diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php
index 6c59afb2501..80415b31bf2 100644
--- a/htdocs/compta/paiement/liste.php
+++ b/htdocs/compta/paiement/liste.php
@@ -159,7 +159,7 @@ if ($resql)
 		print $paymentstatic->getNomUrl(1);
 		print '</td>';
 
-		print '<td align="center">'.dolibarr_print_date($objp->dp,'day').'</td>';
+		print '<td align="center">'.dol_print_date($objp->dp,'day').'</td>';
 
 		// Company
 		print '<td>';
@@ -202,7 +202,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php
index 3cc96c8f9f1..032cdd6e5cc 100644
--- a/htdocs/compta/paiement/rapport.php
+++ b/htdocs/compta/paiement/rapport.php
@@ -70,8 +70,8 @@ if ($_POST["action"] == 'gen')
 	else
 	{
 		$outputlangs->charset_output=$sav_charset_output;
-		dolibarr_syslog("Erreur dans commande_pdf_create");
-		dolibarr_print_error($db,$obj->pdferror());
+		dol_syslog("Erreur dans commande_pdf_create");
+		dol_print_error($db,$obj->pdferror());
 	}
 
 	$year = $_POST["reyear"];
@@ -98,11 +98,11 @@ for ($month = 1 ; $month < 13 ; $month++)
 {
 	if ($month == $cmonth)
 	{
-		print "<option value=\"$month\" selected=\"true\">" . dolibarr_print_date(mktime(0,0,0,$month),"%B");
+		print "<option value=\"$month\" selected=\"true\">" . dol_print_date(mktime(0,0,0,$month),"%B");
 	}
 	else
 	{
-		print "<option value=\"$month\">" . dolibarr_print_date(mktime(0,0,0,$month),"%B");
+		print "<option value=\"$month\">" . dol_print_date(mktime(0,0,0,$month),"%B");
 	}
 }
 print "</select>";
@@ -171,7 +171,7 @@ if ($year)
 	  	$relativepath = $year.'/'.$file;
 	  	print "<tr $bc[$var]>".'<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
 	  	print '<td align="right">'.filesize($tfile). ' '.$langs->trans("Bytes").'</td>';
-	  	print '<td align="right">'.dolibarr_print_date(filemtime($tfile),"dayhour").'</td></tr>';
+	  	print '<td align="right">'.dol_print_date(filemtime($tfile),"dayhour").'</td></tr>';
 	  }
 		}
 		print '</table>';
diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php
index 52dae0b469e..b9c7586ddc6 100755
--- a/htdocs/compta/paiement_charge.php
+++ b/htdocs/compta/paiement_charge.php
@@ -51,7 +51,7 @@ if ($_POST["action"] == 'add_paiement')
 		exit;
 	}
 
-    $datepaye = dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+    $datepaye = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 	
     if (! $_POST["paiementtype"] > 0)
     {
@@ -182,9 +182,9 @@ if ($_GET["action"] == 'create')
       print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2">';
       print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid.'">'.$chid.'</a></td></tr>';
 	  print '<tr><td>'.$langs->trans("Type")."</td><td colspan=\"2\">".$charge->type_libelle."</td></tr>\n";
-	  print '<tr><td>'.$langs->trans("Period")."</td><td colspan=\"2\">".dolibarr_print_date($charge->periode,'day')."</td></tr>\n";
+	  print '<tr><td>'.$langs->trans("Period")."</td><td colspan=\"2\">".dol_print_date($charge->periode,'day')."</td></tr>\n";
 	  print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$charge->lib."</td></tr>\n";
-	  print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dolibarr_print_date($charge->date_ech,'day')."</td></tr>\n";
+	  print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dol_print_date($charge->date_ech,'day')."</td></tr>\n";
 
       print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
 	  
@@ -260,7 +260,7 @@ if ($_GET["action"] == 'create')
 		      
 		      if ($objp->date_ech > 0)
 			{
-			  print "<td align=\"left\">".dolibarr_print_date($objp->date_ech,'day')."</td>\n";
+			  print "<td align=\"left\">".dol_print_date($objp->date_ech,'day')."</td>\n";
 			}
 		      else
 			{
diff --git a/htdocs/compta/param/comptes/liste.php b/htdocs/compta/param/comptes/liste.php
index a36bb855438..90507df71c3 100644
--- a/htdocs/compta/param/comptes/liste.php
+++ b/htdocs/compta/param/comptes/liste.php
@@ -109,7 +109,7 @@ if ($resql)
       print '<td>'.$obj->numero.'</td>'."\n";
       print '<td>'.$obj->intitule.'</td>';
       print '<td align="right" width="100">';
-      print dolibarr_print_date($obj->dc);
+      print dol_print_date($obj->dc);
 
       print '</td>';
       print "</tr>\n";
@@ -120,7 +120,7 @@ if ($resql)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/bon-prelevement.class.php b/htdocs/compta/prelevement/bon-prelevement.class.php
index d0fe39b2e68..5e0ef0d52de 100644
--- a/htdocs/compta/prelevement/bon-prelevement.class.php
+++ b/htdocs/compta/prelevement/bon-prelevement.class.php
@@ -104,19 +104,19 @@ class BonPrelevement extends CommonObject
                 else
                 {
                     $result = -1;
-                    dolibarr_syslog("BonPrelevement::AddFacture Erreur $result");
+                    dol_syslog("BonPrelevement::AddFacture Erreur $result");
                 }
             }
             else
             {
                 $result = -2;
-                dolibarr_syslog("BonPrelevement::AddFacture Erreur $result");
+                dol_syslog("BonPrelevement::AddFacture Erreur $result");
             }
         }
         else
         {
             $result = -3;
-            dolibarr_syslog("BonPrelevement::AddFacture Erreur $result");
+            dol_syslog("BonPrelevement::AddFacture Erreur $result");
         }
 
         return $result;
@@ -175,7 +175,7 @@ class BonPrelevement extends CommonObject
             }
             else
             {
-                dolibarr_syslog("BonPrelevement::AddLigne Erreur -2");
+                dol_syslog("BonPrelevement::AddLigne Erreur -2");
                 $result = -2;
             }
 
@@ -213,7 +213,7 @@ class BonPrelevement extends CommonObject
         $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
         $sql .= " WHERE p.rowid=".$rowid;
 
-        dolibarr_syslog("Bon-prelevement::fetch sql=".$sql, LOG_DEBUG);
+        dol_syslog("Bon-prelevement::fetch sql=".$sql, LOG_DEBUG);
         $result=$this->db->query($sql);
         if ($result)
         {
@@ -243,14 +243,14 @@ class BonPrelevement extends CommonObject
             }
             else
             {
-                dolibarr_syslog("BonPrelevement::Fetch Erreur aucune ligne retourn�e");
+                dol_syslog("BonPrelevement::Fetch Erreur aucune ligne retourn�e");
                 return -1;
             }
         }
         else
         {
-            dolibarr_syslog("BonPrelevement::Fetch Erreur ");
-            dolibarr_syslog($sql);
+            dol_syslog("BonPrelevement::Fetch Erreur ");
+            dol_syslog($sql);
             return -2;
         }
     }
@@ -274,7 +274,7 @@ class BonPrelevement extends CommonObject
             $result=$this->db->query($sql);
             if (! $result)
             {
-                dolibarr_syslog("bon-prelevement::set_credite Erreur 1");
+                dol_syslog("bon-prelevement::set_credite Erreur 1");
                 $error++;
             }
 
@@ -286,7 +286,7 @@ class BonPrelevement extends CommonObject
                 for ($i = 0 ; $i < sizeof($facs) ; $i++)
                 {
                     /* Tag la facture comme impay�e */
-                    dolibarr_syslog("BonPrelevement::set_credite set_payed fac ".$facs[$i]);
+                    dol_syslog("BonPrelevement::set_credite set_payed fac ".$facs[$i]);
                     $fac = new Facture($this->db);
                     $fac->fetch($facs[$i]);
                     $result = $fac->set_payed($user);
@@ -302,7 +302,7 @@ class BonPrelevement extends CommonObject
 
                 if (! $this->db->query($sql))
                 {
-                    dolibarr_syslog("BonPrelevement::set_credite Erreur 1");
+                    dol_syslog("BonPrelevement::set_credite Erreur 1");
                     $error++;
                 }
             }
@@ -320,7 +320,7 @@ class BonPrelevement extends CommonObject
             {
 
                 $this->db->rollback();
-                dolibarr_syslog("BonPrelevement::set_credite ROLLBACK ");
+                dol_syslog("BonPrelevement::set_credite ROLLBACK ");
 
                 return -1;
             }
@@ -330,7 +330,7 @@ class BonPrelevement extends CommonObject
         else
         {
 
-            dolibarr_syslog("BonPrelevement::set_credite Ouverture transaction SQL impossible ");
+            dol_syslog("BonPrelevement::set_credite Ouverture transaction SQL impossible ");
             return -2;
         }
     }
@@ -361,13 +361,13 @@ class BonPrelevement extends CommonObject
                         $subject = "Cr�dit pr�l�vement ".$this->ref." � la banque";
                         $message = "Le bon de pr�l�vement ".$this->ref;
                         $message .= " a �t� cr�dit� par la banque.\n";
-                        $message .= "Date cr�dit : ".dolibarr_print_date($date,'dayhour');
+                        $message .= "Date cr�dit : ".dol_print_date($date,'dayhour');
 
                         $this->Notify($user, "cr", $subject, $message);
                     }
                     else
                     {
-                        dolibarr_syslog("BonPrelevement::set_infocredit Erreur 1");
+                        dol_syslog("BonPrelevement::set_infocredit Erreur 1");
                         $error++;
                     }
 
@@ -383,19 +383,19 @@ class BonPrelevement extends CommonObject
                     else
                     {
                         $this->db->rollback();
-                        dolibarr_syslog("bon-prelevment::set_infocredit ROLLBACK ");
+                        dol_syslog("bon-prelevment::set_infocredit ROLLBACK ");
                         return -1;
                     }
                 }
                 else
                 {
-                    dolibarr_syslog("bon-prelevement::set_infocredit Ouverture transaction SQL impossible ");
+                    dol_syslog("bon-prelevement::set_infocredit Ouverture transaction SQL impossible ");
                     return -1025;
                 }
             }
             else
             {
-                dolibarr_syslog("bon-prelevment::set_infocredit 1027 Date de credit < Date de trans ");
+                dol_syslog("bon-prelevment::set_infocredit 1027 Date de credit < Date de trans ");
                 return -1027;
             }
         }
@@ -412,7 +412,7 @@ class BonPrelevement extends CommonObject
     function set_infotrans($user, $date, $method)
     {
         $error == 0;
-        dolibarr_syslog("bon-prelevement::set_infotrans Start",LOG_INFO);
+        dol_syslog("bon-prelevement::set_infotrans Start",LOG_INFO);
         if ($this->db->begin())
         {
             $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons ";
@@ -433,14 +433,14 @@ class BonPrelevement extends CommonObject
                 $message .= "\n\n";
                 $message .= "\nMontant : ".price($this->amount);
                 $message .= "\nM�thode : ".$this->methodes_trans[$this->method_trans];
-                $message .= "\nDate  : ".dolibarr_print_date($date,'day');
+                $message .= "\nDate  : ".dol_print_date($date,'day');
 
                 $this->Notify($user,"tr", $subject, $message, 1);
             }
             else
             {
-                dolibarr_syslog("bon-prelevement::set_infotrans Erreur 1", LOG_ERR);
-                dolibarr_syslog($this->db->error());
+                dol_syslog("bon-prelevement::set_infotrans Erreur 1", LOG_ERR);
+                dol_syslog($this->db->error());
                 $error++;
             }
 
@@ -456,7 +456,7 @@ class BonPrelevement extends CommonObject
             else
             {
                 $this->db->rollback();
-                dolibarr_syslog("BonPrelevement::set_infotrans ROLLBACK", LOG_ERR);
+                dol_syslog("BonPrelevement::set_infotrans ROLLBACK", LOG_ERR);
 
                 return -1;
             }
@@ -464,7 +464,7 @@ class BonPrelevement extends CommonObject
         else
         {
 
-            dolibarr_syslog("BonPrelevement::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT);
+            dol_syslog("BonPrelevement::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT);
             return -2;
         }
     }
@@ -559,7 +559,7 @@ class BonPrelevement extends CommonObject
         }
         else
         {
-            dolibarr_syslog("Bon-Prelevement::_get_list_factures Erreur");
+            dol_syslog("Bon-Prelevement::_get_list_factures Erreur");
         }
 
         return $arr;
@@ -595,8 +595,8 @@ class BonPrelevement extends CommonObject
         else
         {
             $error = 1;
-            dolibarr_syslog("BonPrelevement::SommeAPrelever Erreur -1");
-            dolibarr_syslog($this->db->error());
+            dol_syslog("BonPrelevement::SommeAPrelever Erreur -1");
+            dol_syslog($this->db->error());
         }
     }
 
@@ -641,7 +641,7 @@ class BonPrelevement extends CommonObject
         else
         {
             $this->error="BonPrelevement::SommeAPrelever Erreur -1 sql=".$this->db->error();
-            dolibarr_syslog($this->error);
+            dol_syslog($this->error);
             return -1;
         }
     }
@@ -655,7 +655,7 @@ class BonPrelevement extends CommonObject
     {
         global $conf;
         
-        dolibarr_syslog("BonPrelevement::Create banque=$banque guichet=$guichet");
+        dol_syslog("BonPrelevement::Create banque=$banque guichet=$guichet");
 
         require_once (DOL_DOCUMENT_ROOT."/compta/prelevement/bon-prelevement.class.php");
         require_once (DOL_DOCUMENT_ROOT."/facture.class.php");
@@ -704,7 +704,7 @@ class BonPrelevement extends CommonObject
                 $sql .= " AND sr.code_guichet = '".PRELEVEMENT_CODE_GUICHET."'";
             }
 
-            dolibarr_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
+            dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
             $resql = $this->db->query($sql);
             if ($resql)
             {
@@ -718,13 +718,13 @@ class BonPrelevement extends CommonObject
                     $i++;
                 }
                 $this->db->free($resql);
-                dolibarr_syslog($i." invoices to withdraw");
+                dol_syslog($i." invoices to withdraw");
             }
             else
             {
                 $error = 1;
-                dolibarr_syslog("Erreur -1");
-                dolibarr_syslog($this->db->error());
+                dol_syslog("Erreur -1");
+                dol_syslog($this->db->error());
             }
         }
 
@@ -732,7 +732,7 @@ class BonPrelevement extends CommonObject
         {
             // Check RIB
         	$i = 0;
-            dolibarr_syslog("Start RIB check");
+            dol_syslog("Start RIB check");
 
             if (sizeof($factures) > 0)
             {
@@ -754,30 +754,30 @@ class BonPrelevement extends CommonObject
                             }
                             else
                             {
-                                dolibarr_syslog("Erreur de RIB societe $fact->socid $soc->nom", LOG_ERR);
+                                dol_syslog("Erreur de RIB societe $fact->socid $soc->nom", LOG_ERR);
                                 $facture_errors[$fac[0]]="Erreur de RIB societe $fact->socid $soc->nom";
                             }
                         }
                         else
                         {
-                            dolibarr_syslog("Failed to read company", LOG_ERR);
+                            dol_syslog("Failed to read company", LOG_ERR);
                         }
                     }
                     else
                     {
-                        dolibarr_syslog("Impossible de lire la facture", LOG_ERR);
+                        dol_syslog("Impossible de lire la facture", LOG_ERR);
                     }
                 }
             }
             else
             {
-                dolibarr_syslog("Aucune factures a traiter");
+                dol_syslog("Aucune factures a traiter");
             }
         }
 
 
         // Withdraw invoices in factures_prev array
-        dolibarr_syslog(sizeof($factures_prev)." invoices will be withdrawed");
+        dol_syslog(sizeof($factures_prev)." invoices will be withdrawed");
 
         if (sizeof($factures_prev) > 0)
         {
@@ -802,7 +802,7 @@ class BonPrelevement extends CommonObject
                 $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."prelevement_bons";
                 $sql .= " WHERE ref LIKE '$ref%'";
 
-            	dolibarr_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
+            	dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
                 $resql = $this->db->query($sql);
 
                 if ($resql)
@@ -812,7 +812,7 @@ class BonPrelevement extends CommonObject
                 else
                 {
                     $error++;
-                    dolibarr_syslog("Erreur recherche reference");
+                    dol_syslog("Erreur recherche reference");
                 }
 
                 $ref = $ref . substr("00".($row[0]+1), -2);
@@ -823,7 +823,7 @@ class BonPrelevement extends CommonObject
                 $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (ref,datec)";
                 $sql .= " VALUES ('".$ref."',".$this->db->idate(mktime()).")";
 
-            	dolibarr_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
+            	dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
                 $resql = $this->db->query($sql);
 
                 if ($resql)
@@ -840,7 +840,7 @@ class BonPrelevement extends CommonObject
                 else
                 {
                     $error++;
-                    dolibarr_syslog("Erreur creation du bon de prelevement");
+                    dol_syslog("Erreur creation du bon de prelevement");
                 }
             }
 
@@ -850,7 +850,7 @@ class BonPrelevement extends CommonObject
              */
             if (!$error)
             {
-                dolibarr_syslog("Start generation payments for the ".sizeof($factures_prev)." invoices");
+                dol_syslog("Start generation payments for the ".sizeof($factures_prev)." invoices");
 
                 if (sizeof($factures_prev) > 0)
                 {
@@ -872,7 +872,7 @@ class BonPrelevement extends CommonObject
                         if ($pai->create($user, 1) < 0)  // on appelle en no_commit
                         {
                             $error++;
-                            dolibarr_syslog("Erreur creation paiement facture ".$fac[0]);
+                            dol_syslog("Erreur creation paiement facture ".$fac[0]);
                         }
                         else
                         {
@@ -911,7 +911,7 @@ class BonPrelevement extends CommonObject
                             $sql .= ", fk_prelevement_bons = ".$prev_id;
                             $sql .= " WHERE rowid=".$fac[1];
 
-            				dolibarr_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
+            				dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
                             if ($this->db->query($sql))
                             {
 
@@ -919,15 +919,15 @@ class BonPrelevement extends CommonObject
                             else
                             {
                                 $error++;
-                                dolibarr_syslog("Erreur mise a jour des demandes");
-                                dolibarr_syslog($this->db->error());
+                                dol_syslog("Erreur mise a jour des demandes");
+                                dol_syslog($this->db->error());
                             }
 
                         }
                     }
                 }
 
-                dolibarr_syslog("Fin des paiements");
+                dol_syslog("Fin des paiements");
             }
 
             if (!$error)
@@ -938,8 +938,8 @@ class BonPrelevement extends CommonObject
                  *
                  */
 
-                dolibarr_syslog("Debut prelevement");
-                dolibarr_syslog("Nombre de factures ".sizeof($factures_prev));
+                dol_syslog("Debut prelevement");
+                dol_syslog("Nombre de factures ".sizeof($factures_prev));
 
                 if (sizeof($factures_prev) > 0)
                 {
@@ -958,8 +958,8 @@ class BonPrelevement extends CommonObject
 
                     $bonprev->generate();
                 }
-                dolibarr_syslog( $filebonprev ) ;
-                dolibarr_syslog("Fin prelevement");
+                dol_syslog( $filebonprev ) ;
+                dol_syslog("Fin prelevement");
             }
 
             /*
@@ -971,12 +971,12 @@ class BonPrelevement extends CommonObject
             $sql .= " SET amount = ".price2num($bonprev->total);
             $sql .= " WHERE rowid = ".$prev_id;
 
-            dolibarr_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
+            dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
             $resql=$this->db->query($sql);
             if (! $resql)
             {
                 $error++;
-                dolibarr_syslog("Erreur mise a jour du total - $sql");
+                dol_syslog("Erreur mise a jour du total - $sql");
             }
 
             /*
@@ -1092,7 +1092,7 @@ class BonPrelevement extends CommonObject
             else
             {
                 $result = -1;
-                dolibarr_syslog("BonPrelevement::AddNotification Erreur $result");
+                dol_syslog("BonPrelevement::AddNotification Erreur $result");
             }
         }
 
diff --git a/htdocs/compta/prelevement/bon.php b/htdocs/compta/prelevement/bon.php
index 116eb352a2e..f824d64edcd 100644
--- a/htdocs/compta/prelevement/bon.php
+++ b/htdocs/compta/prelevement/bon.php
@@ -75,7 +75,7 @@ if ($_GET["id"])
 
   if ($bon->fetch($_GET["id"]) == 0)
     {
-      dolibarr_fiche_head($head, $hselected, 'Pr�l�vement : '. $bon->ref);
+      dol_fiche_head($head, $hselected, 'Pr�l�vement : '. $bon->ref);
 
       print '<table class="border" width="100%">';
 
@@ -136,7 +136,7 @@ if ($_GET["id"])
     }
   else
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
     }
 }
 
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php
index ccbb017af17..13d2adaaed8 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/bons.php
@@ -103,7 +103,7 @@ if ($result)
 
       print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
 
-      print '<td align="center">'.dolibarr_print_date($obj->datec,'day')."</td>\n";
+      print '<td align="center">'.dol_print_date($obj->datec,'day')."</td>\n";
 
       print '<td align="right">'.price($obj->amount)."</td>\n";
 
@@ -115,7 +115,7 @@ if ($result)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php
index 78ad053da0e..db9a15dec0d 100644
--- a/htdocs/compta/prelevement/create.php
+++ b/htdocs/compta/prelevement/create.php
@@ -71,7 +71,7 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/create.php';
 $head[$h][1] = $langs->trans("NewStandingOrder");
 $h++;
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("StandingOrders"));
+dol_fiche_head($head, $hselected, $langs->trans("StandingOrders"));
 
 
 $nb=$bprev->NbFactureAPrelever();
@@ -79,7 +79,7 @@ $nb1=$bprev->NbFactureAPrelever(1);
 $nb11=$bprev->NbFactureAPrelever(1,1);
 if ($nb < 0 || $nb1 < 0 || $nb11 < 0)
 {
-	dolibarr_print_error($bprev->error);
+	dol_print_error($bprev->error);
 }
 print '<table class="border" width="100%">';
 
@@ -159,7 +159,7 @@ if ($result)
 		$bprev->ref=$obj->ref;
 		print $bprev->getNomUrl(1);
 		print "</td>\n";
-		print '<td align="center">'.dolibarr_print_date($obj->datec,'day')."</td>\n";
+		print '<td align="center">'.dol_print_date($obj->datec,'day')."</td>\n";
 
 		print '<td align="right">'.price($obj->amount).' '.$langs->trans("Currency".$conf->monnaie)."</td>\n";
 
@@ -171,7 +171,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
@@ -226,7 +226,7 @@ if ( $db->query($sql) )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php
index 8c367ae7a5a..f6b24c5903b 100644
--- a/htdocs/compta/prelevement/demandes.php
+++ b/htdocs/compta/prelevement/demandes.php
@@ -137,7 +137,7 @@ if ( $db->query($sql) )
 		print $thirdpartystatic->getNomUrl(1,'customer');
 		print '</td>';
 
-		print '<td align="center">'.dolibarr_print_date($obj->date_demande,'day').'</td>';
+		print '<td align="center">'.dol_print_date($obj->date_demande,'day').'</td>';
 
 		if (!array_key_exists($obj->fk_user_demande,$users))
 		{
@@ -159,7 +159,7 @@ if ( $db->query($sql) )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php
index eb2eee31ddf..51e6ffde117 100644
--- a/htdocs/compta/prelevement/factures.php
+++ b/htdocs/compta/prelevement/factures.php
@@ -73,7 +73,7 @@ if ($_GET["id"])
 
   if ($bon->fetch($_GET["id"]) == 0)
     {
-      dolibarr_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
+      dol_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
 
       print '<table class="border" width="100%">';
       print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
@@ -200,7 +200,7 @@ if ($result)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/facturesrejets.php b/htdocs/compta/prelevement/facturesrejets.php
index bed1df54fd9..681d651fac0 100644
--- a/htdocs/compta/prelevement/facturesrejets.php
+++ b/htdocs/compta/prelevement/facturesrejets.php
@@ -151,7 +151,7 @@ if ($result)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php
index 4b05e8c28c4..db5839c65e4 100644
--- a/htdocs/compta/prelevement/fiche-rejet.php
+++ b/htdocs/compta/prelevement/fiche-rejet.php
@@ -67,7 +67,7 @@ if ($_GET["id"])
 
   if ($bon->fetch($_GET["id"]) == 0)
     {
-      dolibarr_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
+      dol_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
 
       print '<table class="border" width="100%">';
       print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
@@ -156,7 +156,7 @@ if ($resql)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php
index df2eee839cd..1d15ba1fc22 100644
--- a/htdocs/compta/prelevement/fiche-stat.php
+++ b/htdocs/compta/prelevement/fiche-stat.php
@@ -70,7 +70,7 @@ if ($prev_id)
 
   if ($bon->fetch($_GET["id"]) == 0)
     {
-      dolibarr_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
+      dol_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
 
       print '<table class="border" width="100%">';
 
diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php
index 2b71a1c865a..169b05cd8a0 100644
--- a/htdocs/compta/prelevement/fiche.php
+++ b/htdocs/compta/prelevement/fiche.php
@@ -63,14 +63,14 @@ if ($_POST["action"] == 'infotrans')
 
       if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . $_FILES['userfile']['name'],1) > 0)
 	{
-	  $dt = dolibarr_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+	  $dt = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 	  
 	  $bon->set_infotrans($user, $dt, $_POST["methode"]);
 	}
     }
   else
     {
-      dolibarr_syslog("Fichier invalide",LOG_WARNING);
+      dol_syslog("Fichier invalide",LOG_WARNING);
     }
 
   Header("Location: fiche.php?id=".$_GET["id"]);
@@ -136,7 +136,7 @@ if ($_GET["id"])
 
   if ($bon->fetch($_GET["id"]) == 0)
     {
-      dolibarr_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
+      dol_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
 
       if (isset($_GET["error"]))
 	{
@@ -154,7 +154,7 @@ if ($_GET["id"])
       print '<table class="border" width="100%">';
 
       print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
-      print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dolibarr_print_date($bon->datec,'dayhour').'</td></tr>';
+      print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'dayhour').'</td></tr>';
       print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
       print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
 
@@ -174,7 +174,7 @@ if ($_GET["id"])
 	  $muser->fetch();
 
 	  print '<tr><td width="20%">Date Transmission / Par</td><td>';
-	  print dolibarr_print_date($bon->date_trans,'dayhour');
+	  print dol_print_date($bon->date_trans,'dayhour');
 	  print ' par '.$muser->fullname.'</td></tr>';
 	  print '<tr><td width="20%">Methode Transmission</td><td>';
 	  print $bon->methodes_trans[$bon->method_trans];
@@ -183,7 +183,7 @@ if ($_GET["id"])
       if($bon->date_credit <> 0)
 	{
 	  print '<tr><td width="20%">Credit on</td><td>';
-	  print dolibarr_print_date($bon->date_credit,'dayhour');
+	  print dol_print_date($bon->date_credit,'dayhour');
 	  print '</td></tr>';
 	}
 
@@ -227,7 +227,7 @@ if ($_GET["id"])
     }
   else
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
     }
 }
 
diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php
index c93d9367538..5374f7e0d4d 100644
--- a/htdocs/compta/prelevement/index.php
+++ b/htdocs/compta/prelevement/index.php
@@ -122,7 +122,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
@@ -162,7 +162,7 @@ if ($result)
 
 		print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
 
-		print '<td>'.dolibarr_print_date($obj->datec,"dayhour")."</td>\n";
+		print '<td>'.dol_print_date($obj->datec,"dayhour")."</td>\n";
 
 		print '<td align="right">'.price($obj->amount)."</td>\n";
 
@@ -174,7 +174,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '</td></tr></table>';
diff --git a/htdocs/compta/prelevement/ligne-prelevement.class.php b/htdocs/compta/prelevement/ligne-prelevement.class.php
index 01799a7a9e5..83f22e06718 100644
--- a/htdocs/compta/prelevement/ligne-prelevement.class.php
+++ b/htdocs/compta/prelevement/ligne-prelevement.class.php
@@ -86,7 +86,7 @@ class LignePrelevement
 	else
 	  {
 	    $result++;
-	    dolibarr_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0");
+	    dol_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0");
 	  }
 
 	$this->db->free();
@@ -94,8 +94,8 @@ class LignePrelevement
     else
       {
 	$result++;
-	dolibarr_syslog("LignePrelevement::Fetch rowid=$rowid");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("LignePrelevement::Fetch rowid=$rowid");
+	dol_syslog($this->db->error());
       }
 
     return $result;
diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php
index 81825580de9..874014b5de9 100644
--- a/htdocs/compta/prelevement/ligne.php
+++ b/htdocs/compta/prelevement/ligne.php
@@ -50,8 +50,8 @@ if ($_POST["action"] == 'confirm_rejet')
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Motif : ".$_POST["motif"]);
-	      dolibarr_syslog("$daterej $time ");
+	      dol_syslog("Motif : ".$_POST["motif"]);
+	      dol_syslog("$daterej $time ");
 	      Header("Location: ligne.php?id=".$_GET["id"]."&action=rejet");
 	    }
 	}
@@ -80,7 +80,7 @@ if ($_GET["id"])
       $bon = new BonPrelevement($db);
       $bon->fetch($lipre->bon_rowid);
 
-      dolibarr_fiche_head($head, $hselected, 'Pr�l�vement : '. $lipre->bon_ref);
+      dol_fiche_head($head, $hselected, 'Pr�l�vement : '. $lipre->bon_ref);
       
       print '<table class="border" width="100%">';
       
@@ -106,7 +106,7 @@ if ($_GET["id"])
 		}
 	      else
 		{
-		  print dolibarr_print_date($rej->date_rejet,'day');
+		  print dol_print_date($rej->date_rejet,'day');
 		}
 	      print '</td></tr>';
 	    }
@@ -263,7 +263,7 @@ if ($_GET["id"])
     }
   else 
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
     }
 
   $db->close();
diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php
index 090f8668a50..6831b83b6b2 100644
--- a/htdocs/compta/prelevement/lignes.php
+++ b/htdocs/compta/prelevement/lignes.php
@@ -72,7 +72,7 @@ if ($_GET["id"])
 	if ($bon->fetch($_GET["id"]) == 0)
 	{
 
-		dolibarr_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
+		dol_fiche_head($head, $hselected, $langs->trans("WithdrawalReceipt"));
 
 
 		print '<table class="border" width="100%">';
@@ -198,7 +198,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/liste.php b/htdocs/compta/prelevement/liste.php
index ddc4c17980e..d76db5b050f 100644
--- a/htdocs/compta/prelevement/liste.php
+++ b/htdocs/compta/prelevement/liste.php
@@ -141,7 +141,7 @@ if ($result)
 
       print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
       print '<td><a href="fiche.php?id='.$obj->rowid.'">'.$obj->nom."</a></td>\n";
-      print '<td align="center">'.dolibarr_print_date($obj->datec,'day')."</td>\n";
+      print '<td align="center">'.dol_print_date($obj->datec,'day')."</td>\n";
       print '<td align="right">'.price($obj->amount)."</td>\n";
       print '<td align="center"><a href="fiche.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
       print '<td>&nbsp;</td>';
@@ -154,7 +154,7 @@ if ($result)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/liste_factures.php b/htdocs/compta/prelevement/liste_factures.php
index 4fe5e3f0256..291032f20c7 100644
--- a/htdocs/compta/prelevement/liste_factures.php
+++ b/htdocs/compta/prelevement/liste_factures.php
@@ -156,7 +156,7 @@ if ($result)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/rejet-prelevement.class.php b/htdocs/compta/prelevement/rejet-prelevement.class.php
index b6f727c6caa..6e8c1dc8ce2 100644
--- a/htdocs/compta/prelevement/rejet-prelevement.class.php
+++ b/htdocs/compta/prelevement/rejet-prelevement.class.php
@@ -66,7 +66,7 @@ class RejetPrelevement
     $this->id = $id;
     $this->bon_id = $bonid;
     
-    dolibarr_syslog("RejetPrelevement::Create id $id");
+    dol_syslog("RejetPrelevement::Create id $id");
     
     $facs = $this->_get_list_factures();
     
@@ -86,8 +86,8 @@ class RejetPrelevement
     
     if (!$result)
       {
-	dolibarr_syslog("RejetPrelevement::create Erreur 4");
-	dolibarr_syslog("RejetPrelevement::create Erreur 4 $sql");
+	dol_syslog("RejetPrelevement::create Erreur 4");
+	dol_syslog("RejetPrelevement::create Erreur 4 $sql");
 	$error++;
       }
     
@@ -99,7 +99,7 @@ class RejetPrelevement
     
     if (! $this->db->query($sql))
       {
-	dolibarr_syslog("RejetPrelevement::create Erreur 5");
+	dol_syslog("RejetPrelevement::create Erreur 5");
 	$error++;
       }
     
@@ -126,7 +126,7 @@ class RejetPrelevement
 	if ($pai->create($this->user, 1) == -1)  // on appelle en no_commit
 	  {
 	    $error++;
-	    dolibarr_syslog("RejetPrelevement::Create Erreur creation paiement facture ".$facs[$i]);
+	    dol_syslog("RejetPrelevement::Create Erreur creation paiement facture ".$facs[$i]);
 	  }       
   
 	/* Valide le paiement */
@@ -134,11 +134,11 @@ class RejetPrelevement
 	if ($pai->valide() < 0)
 	  {
 	    $error++;
-	    dolibarr_syslog("RejetPrelevement::Create Erreur validation du paiement");
+	    dol_syslog("RejetPrelevement::Create Erreur validation du paiement");
 	  }
 
 	/* Tag la facture comme impay�e */
-	dolibarr_syslog("RejetPrelevement::Create set_unpayed fac ".$fac->ref);
+	dol_syslog("RejetPrelevement::Create set_unpayed fac ".$fac->ref);
 	$fac->set_unpayed($fac->id, $user);
 
 	/* Envoi un email � l'emetteur de la demande de prev */
@@ -147,12 +147,12 @@ class RejetPrelevement
 
     if ($error == 0)
       {
-	dolibarr_syslog("RejetPrelevement::Create Commit");
+	dol_syslog("RejetPrelevement::Create Commit");
 	$this->db->commit();
       }
     else
       {
-	dolibarr_syslog("RejetPrelevement::Create Rollback");
+	dol_syslog("RejetPrelevement::Create Rollback");
 	$this->db->rollback();
       }
 
@@ -183,7 +183,7 @@ class RejetPrelevement
         }
         else
         {
-            dolibarr_syslog("RejetPrelevement::_send_email Erreur lecture user");
+            dol_syslog("RejetPrelevement::_send_email Erreur lecture user");
         }
     
         if ($userid > 0)
@@ -216,16 +216,16 @@ class RejetPrelevement
             $result=$mailfile->sendfile();
             if ($result)
             {
-                dolibarr_syslog("RejetPrelevement::_send_email email envoy�");
+                dol_syslog("RejetPrelevement::_send_email email envoy�");
             }
             else
             {
-                dolibarr_syslog("RejetPrelevement::_send_email Erreur envoi email");
+                dol_syslog("RejetPrelevement::_send_email Erreur envoi email");
             }
         }
         else
         {
-            dolibarr_syslog("RejetPrelevement::_send_email Userid invalide");
+            dol_syslog("RejetPrelevement::_send_email Userid invalide");
         }
     }
 
@@ -269,7 +269,7 @@ class RejetPrelevement
       }
     else
       {
-	dolibarr_syslog("RejetPrelevement Erreur");
+	dol_syslog("RejetPrelevement Erreur");
       }
 
     return $arr;
@@ -307,13 +307,13 @@ class RejetPrelevement
 	  }
 	else
 	  {
-	    dolibarr_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid numrows=0");
+	    dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid numrows=0");
 	    return -1;
 	  }
       }
     else
       {
-	dolibarr_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid");
+	dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid");
 	return -2;
       }
   }
diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php
index ef08f971dcd..0194313ed6a 100644
--- a/htdocs/compta/prelevement/rejets.php
+++ b/htdocs/compta/prelevement/rejets.php
@@ -135,7 +135,7 @@ if ($result)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php
index 4e41ff42644..83ded0a16ec 100644
--- a/htdocs/compta/prelevement/stats.php
+++ b/htdocs/compta/prelevement/stats.php
@@ -119,7 +119,7 @@ if ($db->query($sql))
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 } 
 
 
@@ -210,7 +210,7 @@ if ($db->query($sql))
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }  
 
 
diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php
index c1559f80118..d0021d9c326 100644
--- a/htdocs/compta/propal.php
+++ b/htdocs/compta/propal.php
@@ -96,12 +96,12 @@ if ( $action == 'delete' )
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	$propalid = 0;
 	$brouillon = 1;
@@ -146,7 +146,7 @@ if ($_GET["propalid"] > 0)
 	$societe->fetch($propal->socid);
 
 	$head = propal_prepare_head($propal);
-	dolibarr_fiche_head($head, 'compta', $langs->trans('Proposal'));
+	dol_fiche_head($head, 'compta', $langs->trans('Proposal'));
 
 
 	/*
@@ -192,7 +192,7 @@ if ($_GET["propalid"] > 0)
 
 	// Dates
 	print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
-	print dolibarr_print_date($propal->date,'daytext');
+	print dol_print_date($propal->date,'daytext');
 	print '</td>';
 
 	if ($conf->projet->enabled) $rowspan++;
@@ -206,7 +206,7 @@ if ($_GET["propalid"] > 0)
 	print '<td>'.$langs->trans('DateEndPropal').'</td><td colspan="3">';
 	if ($propal->fin_validite)
 	{
-		print dolibarr_print_date($propal->fin_validite,'daytext');
+		print dol_print_date($propal->fin_validite,'daytext');
 		if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
 	}
 	else
@@ -364,15 +364,15 @@ if ($_GET["propalid"] > 0)
 					print ' '.$objp->ref.'</a> - '.stripslashes(nl2br($objp->product));
 					if ($objp->date_start && $objp->date_end)
 					{
-						print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')';
+						print ' (Du '.dol_print_date($objp->date_start).' au '.dol_print_date($objp->date_end).')';
 					}
 					if ($objp->date_start && ! $objp->date_end)
 					{
-						print ' (A partir du '.dolibarr_print_date($objp->date_start).')';
+						print ' (A partir du '.dol_print_date($objp->date_start).')';
 					}
 					if (! $objp->date_start && $objp->date_end)
 					{
-						print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')';
+						print " (Jusqu'au ".dol_print_date($objp->date_end).')';
 					}
 					print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
 					print '</td>';
@@ -405,15 +405,15 @@ if ($_GET["propalid"] > 0)
 						print nl2br($objp->description);
 						if ($objp->date_start && $objp->date_end)
 						{
-							print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')';
+							print ' (Du '.dol_print_date($objp->date_start).' au '.dol_print_date($objp->date_end).')';
 						}
 						if ($objp->date_start && ! $objp->date_end)
 						{
-							print ' (A partir du '.dolibarr_print_date($objp->date_start).')';
+							print ' (A partir du '.dol_print_date($objp->date_start).')';
 						}
 						if (! $objp->date_start && $objp->date_end)
 						{
-							print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')';
+							print " (Jusqu'au ".dol_print_date($objp->date_end).')';
 						}
 					}
 					print "</td>\n";
@@ -451,7 +451,7 @@ if ($_GET["propalid"] > 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	print '</table>';
@@ -524,7 +524,7 @@ if ($_GET["propalid"] > 0)
 				$var=!$var;
 				print '<tr '.$bc[$var].'><td>';
 				print '<a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$coms[$i]->id.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$coms[$i]->ref."</a></td>\n";
-				print '<td align="center">'.dolibarr_print_date($coms[$i]->date,'day').'</td>';
+				print '<td align="center">'.dol_print_date($coms[$i]->date,'day').'</td>';
 				print '<td align="right">'.price($coms[$i]->total_ttc).'</td>';
 				print '<td align="right">'.$coms[$i]->getLibStatut(3).'</td>';
 				print "</tr>\n";
@@ -550,12 +550,12 @@ if ($_GET["propalid"] > 0)
 	$sql2.= ", ".MAIN_DB_PREFIX."co_pr as cp, ".MAIN_DB_PREFIX."co_fa as cf";
 	$sql2.= " WHERE cp.fk_propale = ".$propal->id." AND cf.fk_commande = cp.fk_commande AND cf.fk_facture = f.rowid";
 
-	dolibarr_syslog("propal.php::liste factures sql=".$sql);
+	dol_syslog("propal.php::liste factures sql=".$sql);
 	$resql=$db->query($sql);
 	$resql2=null;
 	if ($resql)
 	{
-		dolibarr_syslog("propal.php::liste factures sql2=".$sql2);
+		dol_syslog("propal.php::liste factures sql2=".$sql2);
 		$resql2=$db->query($sql2);
 	}
 	if ($resql2)
@@ -607,7 +607,7 @@ if ($_GET["propalid"] > 0)
 			$var=!$var;
 			print "<tr $bc[$var]>";
 			print '<td><a href="../compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->facnumber.'</a></td>';
-			print '<td align="center">'.dolibarr_print_date($objp->df,'day').'</td>';
+			print '<td align="center">'.dol_print_date($objp->df,'day').'</td>';
 			print '<td align="right">'.price($objp->total).'</td>';
 			print '<td align="right">'.$staticfacture->LibStatut($objp->paye,$objp->fk_statut,3).'</td>';
 			print "</tr>";
@@ -778,10 +778,10 @@ else
 
 			// Date
 			print "<td align=\"right\">";
-			$y = dolibarr_print_date($objp->dp,"%Y");
-			$m = dolibarr_print_date($objp->dp,"%m");
-			$mt = dolibarr_print_date($objp->dp,"%b");
-			$d = dolibarr_print_date($objp->dp,"%d");
+			$y = dol_print_date($objp->dp,"%Y");
+			$m = dol_print_date($objp->dp,"%m");
+			$mt = dol_print_date($objp->dp,"%b");
+			$d = dol_print_date($objp->dp,"%d");
 			print $d."\n";
 			print " <a href=\"propal.php?year=$y&month=$m\">";
 			print $b."</a>\n";
@@ -802,7 +802,7 @@ else
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 $db->close();
diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php
index 37b9714a56c..165fb25056b 100644
--- a/htdocs/compta/recap-compta.php
+++ b/htdocs/compta/recap-compta.php
@@ -57,7 +57,7 @@ if ($socid > 0)
      */
 	$head = societe_prepare_head($societe);
 
-    dolibarr_fiche_head($head, 'compta', $langs->trans("ThirdParty"));
+    dol_fiche_head($head, 'compta', $langs->trans("ThirdParty"));
 
     print "<table width=\"100%\">\n";
     print '<tr><td valign="top" width="50%">';
@@ -134,7 +134,7 @@ if ($socid > 0)
                 $var=!$var;
                 print "<tr $bc[$var]>";
 
-                print "<td align=\"center\">".dolibarr_print_date($fac->date)."</td>\n";
+                print "<td align=\"center\">".dol_print_date($fac->date)."</td>\n";
                 print "<td><a href=\"../compta/facture.php?facid=$fac->id\">".img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."</a></td>\n";
 
     			print '<td aling="left">'.$fac->getLibStatut(2,$totalpaye).'</td>';
@@ -169,7 +169,7 @@ if ($socid > 0)
                         $objp = $db->fetch_object($resqlp);
                         //$var=!$var;
                         print "<tr $bc[$var]>";
-                        print '<td align="center">'.dolibarr_print_date($objp->dp)."</td>\n";
+                        print '<td align="center">'.dol_print_date($objp->dp)."</td>\n";
                         print '<td>';
                         print '&nbsp; &nbsp; &nbsp; '; // D�calage
                         print '<a href="paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.'</td>';
@@ -191,13 +191,13 @@ if ($socid > 0)
                 }
                 else
                 {
-                	dolibarr_print_error($db);
+                	dol_print_error($db);
                 }
             }
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
         print "<br>";
@@ -205,7 +205,7 @@ if ($socid > 0)
 }
 else
 {
-  	dolibarr_print_error($db);
+  	dol_print_error($db);
 }
 
 
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 15947c88d87..c37784597a1 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -124,7 +124,7 @@ if ($result) {
     }
     $db->free($result);
 } else {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 // On ajoute les paiements clients anciennes version, non lie par paiement_facture
@@ -162,7 +162,7 @@ if ($modecompta != 'CREANCES-DETTES')
         }
         $db->free($result);
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -246,7 +246,7 @@ if ($result) {
 
   $db->free($result);
 } else {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 print '<tr class="liste_total">';
 if ($modecompta == 'CREANCES-DETTES') print '<td colspan="3" align="right">'.price(-$subtotal_ht).'</td>';
@@ -311,7 +311,7 @@ if ($result) {
         print '</tr>';
     }
 } else {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 print '<tr class="liste_total">';
 if ($modecompta == 'CREANCES-DETTES') print '<td colspan="3" align="right">'.price(-$subtotal_ht).'</td>';
@@ -375,7 +375,7 @@ if ($result) {
         print '</tr>';
     }
 } else {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 print '<tr class="liste_total">';
 if ($modecompta == 'CREANCES-DETTES') print '<td colspan="3" align="right">'.price(-$subtotal_ht).'</td>';
@@ -437,7 +437,7 @@ if ($modecompta == 'CREANCES-DETTES')
           }
         }
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     print "<tr $bc[$var]><td>&nbsp;</td>";
     print "<td>".$langs->trans("VATToPay")."</td>\n";
@@ -475,7 +475,7 @@ if ($modecompta == 'CREANCES-DETTES')
           }
         }
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     print "<tr $bc[$var]><td>&nbsp;</td>";
     print "<td>".$langs->trans("VATToCollect")."</td>\n";
@@ -515,7 +515,7 @@ else
         }
         $db->free($result);
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     print "<tr $bc[$var]><td>&nbsp;</td>";
     print "<td>".$langs->trans("VATPayed")."</td>\n";
@@ -553,7 +553,7 @@ else
         }
         $db->free($result);
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     print "<tr $bc[$var]><td>&nbsp;</td>";
     print "<td>".$langs->trans("VATCollected")."</td>\n";
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index b2bca3bc756..363e497a72f 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -115,7 +115,7 @@ if ($result)
     $db->free($result);
 }
 else {
-	dolibarr_print_error($db);	
+	dol_print_error($db);	
 }
 
 // On ajoute les paiements clients anciennes version, non li�s par paiement_facture
@@ -149,7 +149,7 @@ if ($modecompta != 'CREANCES-DETTES') {
         }
     }
     else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 /*
@@ -157,7 +157,7 @@ print "<br>Facture clients: subtotal_ht=".$subtotal_ht.' - subtotal_ttc='.$subto
 for ($mois = 1 ; $mois <= 12 ; $mois++)
 {
 	$annee = 2007;
-	$case = strftime("%Y-%m",dolibarr_mktime(12,0,0,$mois,1,$annee));
+	$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois,1,$annee));
 	print 'Mois '.$mois.': '.$decaiss_ttc[$case].' ';
 	print 'Mois '.$mois.': '.$encaiss_ttc[$case].' ';
 }
@@ -209,14 +209,14 @@ if ($result)
     $db->free($result);
 }
 else {
-	dolibarr_print_error($db);	
+	dol_print_error($db);	
 }
 /*
 print "<br>Facture fournisseurs: subtotal_ht=".$subtotal_ht.' - subtotal_ttc='.$subtotal_ttc."<br>\n";
 for ($mois = 1 ; $mois <= 12 ; $mois++)
 {
 	$annee = 2007;
-	$case = strftime("%Y-%m",dolibarr_mktime(12,0,0,$mois,1,$annee));
+	$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois,1,$annee));
 	print 'Mois '.$mois.': '.$decaiss_ttc[$case].' ';
 	print 'Mois '.$mois.': '.$encaiss_ttc[$case].' ';
 }
@@ -249,7 +249,7 @@ if ($modecompta == 'CREANCES-DETTES') {
           }
         }
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     // TVA � r�cup�rer
     $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; 
@@ -272,7 +272,7 @@ if ($modecompta == 'CREANCES-DETTES') {
           }
         }
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 else {
@@ -303,7 +303,7 @@ else {
           }
         }
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     // TVA r�cup�r�e
     $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; 
@@ -332,7 +332,7 @@ else {
           }
         }
     } else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 /*
@@ -340,7 +340,7 @@ print "<br>TVA: subtotal_ht=".$subtotal_ht.' - subtotal_ttc='.$subtotal_ttc."<br
 for ($mois = 1 ; $mois <= 12 ; $mois++)
 {
 	$annee = 2007;
-	$case = strftime("%Y-%m",dolibarr_mktime(12,0,0,$mois,1,$annee));
+	$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois,1,$annee));
 	print 'Mois '.$mois.': '.$decaiss_ttc[$case].' ';
 	print 'Mois '.$mois.': '.$encaiss_ttc[$case].' ';
 }
@@ -393,14 +393,14 @@ if ($result) {
       }
     }
 } else {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 /*
 print "<br>Charges sociales non deduc: subtotal_ht=".$subtotal_ht.' - subtotal_ttc='.$subtotal_ttc."<br>\n";
 for ($mois = 1 ; $mois <= 12 ; $mois++)
 {
 	$annee = 2007;
-	$case = strftime("%Y-%m",dolibarr_mktime(12,0,0,$mois,1,$annee));
+	$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois,1,$annee));
 	print 'Mois '.$mois.': '.$decaiss_ttc[$case].' ';
 	print 'Mois '.$mois.': '.$encaiss_ttc[$case].' ';
 }
@@ -454,14 +454,14 @@ if ($result) {
         }
     }
 } else {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 /*
 print "<br>Charges sociales deduc: subtotal_ht=".$subtotal_ht.' - subtotal_ttc='.$subtotal_ttc."<br>\n";
 for ($mois = 1 ; $mois <= 12 ; $mois++)
 {
 	$annee = 2007;
-	$case = strftime("%Y-%m",dolibarr_mktime(12,0,0,$mois,1,$annee));
+	$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois,1,$annee));
 	print 'Mois '.$mois.': '.$decaiss_ttc[$case].' ';
 	print 'Mois '.$mois.': '.$encaiss_ttc[$case].' ';
 }
@@ -495,10 +495,10 @@ for ($mois = 1 ; $mois <= 12 ; $mois++)
 {
 	$var=!$var;
 	print '<tr '.$bc[$var].'>';
-	print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$mois,1,$annee),"%b")."</td>";
+	print "<td>".dol_print_date(dol_mktime(12,0,0,$mois,1,$annee),"%b")."</td>";
 	for ($annee = $year_start ; $annee <= $year_end ; $annee++)
 	{
-		$case = strftime("%Y-%m",dolibarr_mktime(12,0,0,$mois,1,$annee));
+		$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois,1,$annee));
 
 		print '<td align="right">&nbsp;';
 		if ($decaiss_ttc[$case] != 0)
diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php
index 8e19643ab0b..1d8a0ce1590 100644
--- a/htdocs/compta/sociales/charges.php
+++ b/htdocs/compta/sociales/charges.php
@@ -95,7 +95,7 @@ if ($_POST["action"] == 'confirm_delete')
 
 if ($_POST["action"] == 'add' && $user->rights->tax->charges->creer)
 {
-	$dateech=@dolibarr_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]);
+	$dateech=@dol_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]);
 	if (! $dateech)
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
@@ -136,7 +136,7 @@ if ($_POST["action"] == 'add' && $user->rights->tax->charges->creer)
 
 if ($_GET["action"] == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->creer)
 {
-	$dateech=@dolibarr_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]);
+	$dateech=@dol_mktime($_POST["echhour"],$_POST["echmin"],$_POST["echsec"],$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]);
 	if (! $dateech)
 	{
 		$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")).'</div>';
@@ -252,7 +252,7 @@ if ($chid > 0)
 		$head[$h][2] = 'card';
 		$h++;
 
-		dolibarr_fiche_head($head, 'card', $langs->trans("SocialContribution"));
+		dol_fiche_head($head, 'card', $langs->trans("SocialContribution"));
 
 		/*
 		* Confirmation de la suppression de la charge
@@ -284,11 +284,11 @@ if ($chid > 0)
 		print "<td>";
 		if ($cha->paye==0 && $_GET['action'] == 'edit')
 		{
-			print "<input type=\"text\" name=\"period\" value=\"".dolibarr_print_date($cha->periode,"%Y%m%d")."\"> (YYYYMMDD)";
+			print "<input type=\"text\" name=\"period\" value=\"".dol_print_date($cha->periode,"%Y%m%d")."\"> (YYYYMMDD)";
 		}
 		else
 		{
-			print dolibarr_print_date($cha->periode,"%Y");
+			print dol_print_date($cha->periode,"%Y");
 		}
 		print "</td>";
 		
@@ -320,7 +320,7 @@ if ($chid > 0)
 				$var=!$var;
 				print "<tr $bc[$var]><td>";
 				print img_object($langs->trans("Payment"),"payment").' ';
-				print dolibarr_print_date($objp->dp)."</td>\n";
+				print dol_print_date($objp->dp)."</td>\n";
 				print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
 				print '<td align="right">'.price($objp->amount)."</td><td>".$langs->trans("Currency".$conf->monnaie)."</td>\n";
 				print "</tr>";
@@ -343,7 +343,7 @@ if ($chid > 0)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 		print "</td>";
 
@@ -360,7 +360,7 @@ if ($chid > 0)
 		}
 		else {
 			print '<tr><td>'.$langs->trans("Label").'</td><td>'.$cha->lib.'</td></tr>';
-			print "<tr><td>".$langs->trans("DateDue")."</td><td>".dolibarr_print_date($cha->date_ech,'day')."</td></tr>";
+			print "<tr><td>".$langs->trans("DateDue")."</td><td>".dol_print_date($cha->date_ech,'day')."</td></tr>";
 		}
 		print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($cha->amount).'</td></tr>';
 	
@@ -419,7 +419,7 @@ if ($chid > 0)
 	else
 	{
 		/* Charge non trouv� */
-		dolibarr_print_error('',$cha->error);
+		dol_print_error('',$cha->error);
 	}
 }
 
diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php
index 9470489c9d5..af074c5ebed 100644
--- a/htdocs/compta/sociales/index.php
+++ b/htdocs/compta/sociales/index.php
@@ -144,7 +144,7 @@ if ($resql)
 		print '<a href="charges.php?id='.$obj->id.'">'.img_file().' '.$obj->id.'</a>';
 		print '</td>';
 
-		print '<td width="110">'.dolibarr_print_date($obj->de, 'day').'</td>';
+		print '<td width="110">'.dol_print_date($obj->de, 'day').'</td>';
 		
 		print '<td align="center">';
 		if ($obj->periode) 
@@ -157,9 +157,9 @@ if ($resql)
 		}
 		print '</td>';
 
-		print '<td>'.dolibarr_trunc($obj->type_lib,16).'</td>';
+		print '<td>'.dol_trunc($obj->type_lib,16).'</td>';
 		
-		print '<td>'.dolibarr_trunc($obj->libelle,42).'</td>';
+		print '<td>'.dol_trunc($obj->libelle,42).'</td>';
 		
 		print '<td align="right" width="100">'.price($obj->amount).'</td>';
 
@@ -171,7 +171,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '</table>';
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index f95d7f6b9b7..e7f3a83dc08 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -118,7 +118,7 @@ if ($result)
     }
 }
 else {
-    dolibarr_print_error($db);   
+    dol_print_error($db);   
 }
 
 // On ajoute les paiements anciennes version, non lies par paiement_facture
@@ -147,7 +147,7 @@ if ($modecompta != 'CREANCES-DETTES')
         }
     }
     else {
-        dolibarr_print_error($db);   
+        dol_print_error($db);   
     }
 }
 
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index fa61b4360b9..38081354c8a 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -110,7 +110,7 @@ if ($result)
     }
 }
 else {
-    dolibarr_print_error($db);   
+    dol_print_error($db);   
 }
 
 // On ajoute les paiements anciennes version, non li�s par paiement_facture
@@ -139,7 +139,7 @@ if ($modecompta != 'CREANCES-DETTES')
         }
     }
     else {
-        dolibarr_print_error($db);   
+        dol_print_error($db);   
     }
 }
 
diff --git a/htdocs/compta/stats/comm.php b/htdocs/compta/stats/comm.php
index a8cc611c005..f37dfd342e8 100644
--- a/htdocs/compta/stats/comm.php
+++ b/htdocs/compta/stats/comm.php
@@ -59,14 +59,14 @@ if($_GET['id']!="")
 	// Date de d�but du graphe
 	$date_debut = time() ;
 	$annees = "" ;
-	if ($conf->global->SOCIETE_FISCAL_MONTH_START < dolibarr_date("m",time()) ){
+	if ($conf->global->SOCIETE_FISCAL_MONTH_START < dol_date("m",time()) ){
 		// Si le mois actuel est plus grand, l'ann�e de d�part est l� m�me que l'ann�e actuelle
-		$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dolibarr_date("Y",time())) ;
-		$annees = dolibarr_date("Y",time()) ;
+		$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dol_date("Y",time())) ;
+		$annees = dol_date("Y",time()) ;
 	} else {
 		// Sinon le d�but de l'ann�e comptable �tait l'ann�e d'avant
-		$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dolibarr_date("Y",time())-1) ;
-		$annees = (dolibarr_date("Y",time())-1).' - '.(dolibarr_date("Y",time())) ;
+		$date_debut = mktime(0,0,0,$conf->global->SOCIETE_FISCAL_MONTH_START,1,dol_date("Y",time())-1) ;
+		$annees = (dol_date("Y",time())-1).' - '.(dol_date("Y",time())) ;
 	}
 	
 	/**********************************************
@@ -89,7 +89,7 @@ if($_GET['id']!="")
 	if($result){
 		if($db->num_rows($result)>0){
 			while($obj = $db->fetch_object($result)){
-				if($obj->date != dolibarr_date("Ym",time())){
+				if($obj->date != dol_date("Ym",time())){
 					$recapAnneeCA[] = array( $obj->month, $obj->CAMois ) ;
 					$recapAnneeMR[] = array( $obj->month, $obj->MRMois ) ;
 				}else{
@@ -117,12 +117,12 @@ if($_GET['id']!="")
 			),
 			'recapMoisCA'         =>array(
 				'file' => 'recapMoisCA.png', 
-				'label' => $langs->trans('CAOrder').' '.$langs->trans('FromTo',dolibarr_date("01/m/Y",time()),dolibarr_date("d/m/Y",time())),
+				'label' => $langs->trans('CAOrder').' '.$langs->trans('FromTo',dol_date("01/m/Y",time()),dol_date("d/m/Y",time())),
 				'data' => $recapMoisCA
 			),
 			'recapMoisMR'=>array(
 				'file' => 'recapMoisMR.png', 
-				'label' => $langs->trans('MargeOrder').' '.$langs->trans('FromTo',dolibarr_date("01/m/Y",time()),dolibarr_date("d/m/Y",time())),
+				'label' => $langs->trans('MargeOrder').' '.$langs->trans('FromTo',dol_date("01/m/Y",time()),dol_date("d/m/Y",time())),
 				'data' => $recapMoisMR
 			)
 	) ;
@@ -155,7 +155,7 @@ if($_GET['id']!="")
 				}
 				else
 				{
-					dolibarr_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
+					dol_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
 				}
 		}
 		
@@ -168,7 +168,7 @@ if($_GET['id']!="")
 	 ************/
 	// en-t�te
 	if($mesg) print '<div class="error">'.$mesg.'</div>' ;
-	dolibarr_fiche_head(array(array('stats.php',$langs->trans("Commercial"))), 0, $langs->trans("Stats"));
+	dol_fiche_head(array(array('stats.php',$langs->trans("Commercial"))), 0, $langs->trans("Stats"));
 	/*****************************
 	 * Rappel Infos du Commercial
 	 *****************************/
@@ -184,7 +184,7 @@ if($_GET['id']!="")
 		</tr>
 	</table>' ;
 	
-	print "</div>" ; // Fin de dolibarr_fiche_head
+	print "</div>" ; // Fin de dol_fiche_head
 	
 	/***************************
 	 * Affichage des Graphiques
@@ -193,7 +193,7 @@ if($_GET['id']!="")
 	foreach($graphfiles as $graph){
 		// donn�es
 		$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_comm&file='.urlencode($userstats->id .'/'.$graph['file']);
-		$generateOn = (file_exists($dir."/".$graph['file']))? $langs->trans("GeneratedOn",dolibarr_print_date(filemtime($dir."/".$graph['file']),"dayhour")) : "" ;
+		$generateOn = (file_exists($dir."/".$graph['file']))? $langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graph['file']),"dayhour")) : "" ;
 		
 		// html
 		print '<table class="border" style="float:left;margin:5px;width:48%;min-width:470px;">
diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php
index 3a95688c510..ca1f16364a9 100644
--- a/htdocs/compta/stats/comp.php
+++ b/htdocs/compta/stats/comp.php
@@ -83,7 +83,7 @@ function propals ($db, $year, $month)
 
 		print "<td><a href=\"".DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->propalid."\">".$objp->ref."</a></td>\n";
 
-		print "<td align=\"right\">".dolibarr_print_date($objp->dp)."</td>\n";
+		print "<td align=\"right\">".dol_print_date($objp->dp)."</td>\n";
 
 		print "<td align=\"right\">".price($objp->price)."</td>\n";
 		print "<td align=\"center\">".$objp->statut."</td>\n";
@@ -145,7 +145,7 @@ function factures ($db, $year, $month, $paye) {
 	  	print "<td><a href=\"../facture.php?facid=".$objp->facid."\">".$objp->facnumber."</a></td>\n";
 	  	if ($objp->df > 0 )
 	  	{
-	  		print "<td align=\"right\">".dolibarr_print_date($objp->df)."</td>\n";
+	  		print "<td align=\"right\">".dol_print_date($objp->df)."</td>\n";
 	  	}
 	  	else
 	  	{
@@ -199,7 +199,7 @@ function pt ($db, $sql, $year)
 			if ($obj->dm > $month ) {
 				for ($b = $month ; $b < $obj->dm ; $b++) {
 					print "<tr $bc[$var]>";
-					print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
+					print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
 					print "<td align=\"right\">0</td>\n";
 					print "</tr>\n";
 					$var=!$var;
@@ -210,7 +210,7 @@ function pt ($db, $sql, $year)
 			if ($obj->sum > 0) {
 				print "<tr $bc[$var]>";
 				print "<td><a href=\"comp.php?details=1&year=$year&month=$obj->dm\">";
-				print dolibarr_print_date(dolibarr_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n";
+				print dol_print_date(dol_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n";
 				print "<td align=\"right\">".price($obj->sum)."</td>\n";
 
 				print "</TR>\n";
@@ -231,7 +231,7 @@ function pt ($db, $sql, $year)
 			for ($b = $beg + 1 ; $b < 13 ; $b++) {
 				$var=!$var;
 				print "<tr $bc[$var]>";
-				print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
+				print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
 				print "<td align=\"right\">0</td>\n";
 				print "</tr>\n";
 				$ca[$b] = 0;
@@ -306,7 +306,7 @@ function ppt ($db, $year, $socid)
 		$delta = $ca[$b] - $prev[$b];
 		$deltat = $deltat + $delta ;
 		print "<tr $bc[$var]>";
-		print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
+		print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
 		print "<td align=\"right\">".price($delta)."</td>\n";
 		print "</tr>\n";
 	}
diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php
index fb8ff3d1cc8..e10bcf08dea 100644
--- a/htdocs/compta/stats/exercices.php
+++ b/htdocs/compta/stats/exercices.php
@@ -76,7 +76,7 @@ function factures ($db, $year, $month, $paye)
 	print "<TD><a href=\"comp.php?socid=".$objp->socid."\">".$objp->nom."</a></TD>\n";
 	print "<TD><a href=\"facture.php?facid=".$objp->facid."\">".$objp->facnumber."</a></TD>\n";
 	if ($objp->df > 0 ) {
-	  print "<TD align=\"right\">".dolibarr_print_date($objp->df)."</TD>\n";
+	  print "<TD align=\"right\">".dol_print_date($objp->df)."</TD>\n";
 	} else {
 	  print "<TD align=\"right\"><b>!!!</b></TD>\n";
 	}
@@ -123,7 +123,7 @@ function pt ($db, $sql, $year) {
       if ($obj->dm > $month ) {
         	for ($b = $month ; $b < $obj->dm ; $b++) {
         	  print "<tr $bc[$var]>";
-        	  print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
+        	  print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
         	  print "<td align=\"right\">0</td>\n";	  
         	  print "</tr>\n";
         	  $var=!$var;
@@ -134,7 +134,7 @@ function pt ($db, $sql, $year) {
       if ($obj->sum > 0) {
 	print "<tr $bc[$var]>";
 	print "<td>";
-	print dolibarr_print_date(dolibarr_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n";
+	print dol_print_date(dol_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n";
 	print "<td align=\"right\">".price($obj->sum)."</td>\n";
 	
 	print "</tr>\n";
@@ -155,7 +155,7 @@ function pt ($db, $sql, $year) {
       for ($b = $beg + 1 ; $b < 13 ; $b++) {
 	$var=!$var;
 	print "<tr $bc[$var]>";
-	print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
+	print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
 	print "<td align=\"right\">0</td>\n";	  
 	print "</tr>\n";
 	$ca[$b] = 0;
@@ -234,7 +234,7 @@ function ppt ($db, $year, $socid)
       $delta = $ca[$b] - $prev[$b];
       $deltat = $deltat + $delta ;
       print "<TR $bc[$var]>";
-      print "<TD>".dolibarr_print_date(dolibarr_mktime(12,0,0,$b, 1, $year),"%b")."</TD>\n";
+      print "<TD>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</TD>\n";
       print "<TD align=\"right\">".price($delta)."</TD>\n";
       print "<TD align=\"right\">".price($deltat)."</TD>\n";
       print "</TR>\n";
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index bfe2292caf5..4e014752119 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -111,7 +111,7 @@ if ($result)
     $db->free($result);
 }
 else {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 // On ajoute les paiements anciennes version, non li�s par paiement_facture
@@ -140,7 +140,7 @@ if ($modecompta != 'CREANCES-DETTES') {
         }
     }
     else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -177,12 +177,12 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
     $var=!$var;
     print "<tr $bc[$var]>";
 
-    print "<td>".dolibarr_print_date(dolibarr_mktime(12,0,0,$mois,1,2000),"%b")."</td>";
+    print "<td>".dol_print_date(dol_mktime(12,0,0,$mois,1,2000),"%b")."</td>";
     for ($annee = $year_start ; $annee <= $year_end ; $annee++)
     {
-        $casenow = dolibarr_print_date(mktime(),"%Y-%m");
-        $case = dolibarr_print_date(dolibarr_mktime(1,1,1,$mois,1,$annee),"%Y-%m");
-        $caseprev = dolibarr_print_date(dolibarr_mktime(1,1,1,$mois,1,$annee-1),"%Y-%m");
+        $casenow = dol_print_date(mktime(),"%Y-%m");
+        $case = dol_print_date(dol_mktime(1,1,1,$mois,1,$annee),"%Y-%m");
+        $caseprev = dol_print_date(dol_mktime(1,1,1,$mois,1,$annee-1),"%Y-%m");
 
         if ($annee == $year_current) {
             $total_CA += $cum[$case];
@@ -338,7 +338,7 @@ if ($modecompta != 'CREANCES-DETTES')
     }
   else
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
     }  
 */
 
@@ -388,7 +388,7 @@ En attendant correction.
     }
   else
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
     }  
   print "<tr $bc[$var]><td align=\"right\" colspan=\"5\"><i>Total CA pr�visionnel : </i></td><td align=\"right\"><i>".price($total_CA)."</i></td><td colspan=\"3\"><-- bug ici car bug sur les 2 pr�c�dents</td></tr>";
 }
diff --git a/htdocs/compta/stats/prev.php b/htdocs/compta/stats/prev.php
index 03b26d83f2c..c257b76eece 100644
--- a/htdocs/compta/stats/prev.php
+++ b/htdocs/compta/stats/prev.php
@@ -66,7 +66,7 @@ function pt ($db, $sql, $title) {
     } 
   else 
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
 
     }
   print "</table>";
diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php
index e60c8859d2a..4e9c245d2f2 100644
--- a/htdocs/compta/tva/fiche.php
+++ b/htdocs/compta/tva/fiche.php
@@ -50,8 +50,8 @@ if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
     
     $db->begin();
     
-    $datev=dolibarr_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
-    $datep=dolibarr_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
+    $datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
+    $datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
     
     $tva->accountid=$_POST["accountid"];
     $tva->paymenttype=$_POST["paiementtype"];
@@ -134,7 +134,7 @@ if ($id)
 	$result = $vatpayment->fetch($id);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		exit;
 	}
 }
@@ -200,7 +200,7 @@ if ($id)
 	$head[$h][2] = 'card';
 	$h++;
 
-	dolibarr_fiche_head($head, 'card', $langs->trans("VATPayment"));
+	dol_fiche_head($head, 'card', $langs->trans("VATPayment"));
 
 
 	print '<table class="border" width="100%">';
@@ -212,11 +212,11 @@ if ($id)
 
 	print "<tr>";
 	print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
-	print dolibarr_print_date($vatpayment->datep,'day');
+	print dol_print_date($vatpayment->datep,'day');
 	print '</td></tr>';
 
 	print '<tr><td>'.$langs->trans("DateValue").'</td><td colspan="3">';
-	print dolibarr_print_date($vatpayment->datev,'day');
+	print dol_print_date($vatpayment->datev,'day');
 	print '</td></tr>';
 
 	print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>';
diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php
index 8dd6f2a7416..402e1b988de 100644
--- a/htdocs/compta/tva/index.php
+++ b/htdocs/compta/tva/index.php
@@ -96,7 +96,7 @@ function tva_coll($db,$y,$m)
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -158,7 +158,7 @@ function tva_paye($db, $y,$m)
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -249,7 +249,7 @@ if ($conf->compta->mode == "CREANCES-DETTES")
 	{
 		$var=!$var;
 		print "<tr $bc[$var]>";
-		print '<td nowrap>'.dolibarr_print_date(dolibarr_mktime(0,0,0,$m,1,$y),"%b %Y").'</td>';
+		print '<td nowrap>'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'</td>';
 
 		$x_coll = tva_coll($db, $y, $m);
 		print "<td nowrap align=\"right\">".price($x_coll)."</td>";
diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php
index 81404305ad0..44ad296875b 100644
--- a/htdocs/compta/tva/quadri.php
+++ b/htdocs/compta/tva/quadri.php
@@ -105,7 +105,7 @@ function tva_coll($db,$y,$q)
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -168,7 +168,7 @@ function tva_paye($db, $y,$q)
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -217,7 +217,7 @@ if ($conf->compta->mode == "CREANCES-DETTES")
 	$subtot_paye_vat = 0;
 	for ($q = 1 ; $q <= 4 ; $q++ )
 	{
-		print "<tr class=\"liste_titre\"><td colspan=\"8\">".$langs->trans("Quadri")." $q (".dolibarr_print_date(dolibarr_mktime(0,0,0,(($q-1)*3)+1,1,$y),"%b %Y").' - '.dolibarr_print_date(dolibarr_mktime(0,0,0,($q*3),1,$y),"%b %Y").")</td></tr>";
+		print "<tr class=\"liste_titre\"><td colspan=\"8\">".$langs->trans("Quadri")." $q (".dol_print_date(dol_mktime(0,0,0,(($q-1)*3)+1,1,$y),"%b %Y").' - '.dol_print_date(dol_mktime(0,0,0,($q*3),1,$y),"%b %Y").")</td></tr>";
 		$var=true;
 	
 		$x_coll = tva_coll($db, $y, $q);
diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php
index 8df1928c2a4..dc6c12e29dc 100644
--- a/htdocs/compta/tva/quadri_detail.php
+++ b/htdocs/compta/tva/quadri_detail.php
@@ -85,7 +85,7 @@ if ($modetax==1)	// Caluclate on invoice for goods and services
 {
     $nom=$langs->trans("VATReportByQuartersInDueDebtMode");
     $nom.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&q='.$q.'&modetax=0">','</a>').')';
-    $period=$year_start.' - '.$langs->trans("Quadri")." $q (".dolibarr_print_date(dolibarr_mktime(12,0,0,(($q-1)*3)+1,1,$year_start),"%b %Y").' - '.dolibarr_print_date(dolibarr_mktime(12,0,0,($q*3),1,$year_start),"%b %Y").")";
+    $period=$year_start.' - '.$langs->trans("Quadri")." $q (".dol_print_date(dol_mktime(12,0,0,(($q-1)*3)+1,1,$year_start),"%b %Y").' - '.dol_print_date(dol_mktime(12,0,0,($q*3),1,$year_start),"%b %Y").")";
 	$prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) $prevquarter--;
 	else { $prevquarter=4; $prevyear--; }
@@ -114,7 +114,7 @@ if ($modetax==0) 	// Invoice for goods, payment for services
 {
     $nom=$langs->trans("VATReportByQuartersInInputOutputMode");
     $nom.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&q='.$q.'&modetax=1">','</a>').')';
-    $period=$year_start.' - '.$langs->trans("Quadri")." $q (".dolibarr_print_date(dolibarr_mktime(12,0,0,(($q-1)*3)+1,1,$year_start),"%b %Y").' - '.dolibarr_print_date(dolibarr_mktime(12,0,0,($q*3),1,$year_start),"%b %Y").")";
+    $period=$year_start.' - '.$langs->trans("Quadri")." $q (".dol_print_date(dol_mktime(12,0,0,(($q-1)*3)+1,1,$year_start),"%b %Y").' - '.dol_print_date(dol_mktime(12,0,0,($q*3),1,$year_start),"%b %Y").")";
 	$prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) $prevquarter--;
 	else { $prevquarter=4; $prevyear--; }
@@ -289,7 +289,7 @@ else
 					else $text = img_object($langs->trans('Product'),'product');
 					print $text.' ';
 				}
-				print dolibarr_trunc($fields['descr'],16).'</td>';
+				print dol_trunc($fields['descr'],16).'</td>';
 				// Amount line
 				if ($modetax == 0)
 				{
@@ -396,7 +396,7 @@ else
 					else $text = img_object($langs->trans('Product'),'product');
 					print $text.' ';
 				}
-				print dolibarr_trunc($fields['descr'],24).'</td>';
+				print dol_trunc($fields['descr'],24).'</td>';
 				// Amount line
 				if ($modetax == 0)
 				{
diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php
index bc3e55d9c68..108e8833438 100644
--- a/htdocs/compta/tva/reglement.php
+++ b/htdocs/compta/tva/reglement.php
@@ -75,7 +75,7 @@ if ($result)
 		$tva_static->id=$obj->rowid;
 		$tva_static->ref=$obj->rowid;
 		print "<td>".$tva_static->getNomUrl(1)."</td>\n";
-        print '<td align="left">'.dolibarr_print_date($obj->dm,'day')."</td>\n";
+        print '<td align="left">'.dol_print_date($obj->dm,'day')."</td>\n";
         print "<td>".$obj->label."</td>\n";
         $total = $total + $obj->amount;
 
@@ -92,7 +92,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/compta/tva/tva.class.php b/htdocs/compta/tva/tva.class.php
index f491de56efd..2189fca1a36 100644
--- a/htdocs/compta/tva/tva.class.php
+++ b/htdocs/compta/tva/tva.class.php
@@ -118,7 +118,7 @@ class Tva extends CommonObject
         
 		$sql.= ")";
 
-	   	dolibarr_syslog("Tva::create sql=".$sql, LOG_DEBUG);
+	   	dol_syslog("Tva::create sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -136,7 +136,7 @@ class Tva extends CommonObject
         else
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Tva::create ".$this->error, LOG_ERR);
+            dol_syslog("Tva::create ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -181,12 +181,12 @@ class Tva extends CommonObject
         
         $sql.= " WHERE rowid=".$this->id;
 
-        dolibarr_syslog("Tva::update sql=".$sql, LOG_DEBUG);
+        dol_syslog("Tva::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
         if (! $resql)
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Tva::update ".$this->error, LOG_ERR);
+            dol_syslog("Tva::update ".$this->error, LOG_ERR);
             return -1;
         }
 
@@ -233,7 +233,7 @@ class Tva extends CommonObject
 		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
         $sql.= " WHERE t.rowid = ".$id;
     
-    	dolibarr_syslog("Tva::fetch sql=".$sql, LOG_DEBUG);
+    	dol_syslog("Tva::fetch sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -263,7 +263,7 @@ class Tva extends CommonObject
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Tva::fetch ".$this->error, LOG_ERR);
+            dol_syslog("Tva::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -281,12 +281,12 @@ class Tva extends CommonObject
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
 		$sql.= " WHERE rowid=".$this->id;
 	
-	   	dolibarr_syslog("Tva::delete sql=".$sql);
+	   	dol_syslog("Tva::delete sql=".$sql);
 		$resql = $this->db->query($sql);
 		if (! $resql)
 		{
 			$this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Tva::delete ".$this->error, LOG_ERR);
+            dol_syslog("Tva::delete ".$this->error, LOG_ERR);
 			return -1;
 		}
 	
@@ -509,7 +509,7 @@ class Tva extends CommonObject
         $sql.=", '".$user->id."', NULL";
         $sql.= ")";
 
-		dolibarr_syslog("Tva::addPayment sql=".$sql);
+		dol_syslog("Tva::addPayment sql=".$sql);
         $result = $this->db->query($sql);
         if ($result)
         {
@@ -524,7 +524,7 @@ class Tva extends CommonObject
 
                     $acc = new Account($this->db);
 					$result=$acc->fetch($this->accountid);
-					if ($result <= 0) dolibarr_print_error($db);
+					if ($result <= 0) dol_print_error($db);
 									
                     $bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user);
             	  
@@ -590,7 +590,7 @@ class Tva extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php
index 13228950b3c..756756e36b3 100644
--- a/htdocs/compta/ventilation/lignes.php
+++ b/htdocs/compta/ventilation/lignes.php
@@ -123,8 +123,8 @@ if ($result)
 		else print '&nbsp;';
 		print '</td>';
 
-		print '<td>'.dolibarr_trunc($objp->product_label,24).'</td>';
-		print '<td>'.nl2br(dolibarr_trunc($objp->description,32)).'</td>';
+		print '<td>'.dol_trunc($objp->product_label,24).'</td>';
+		print '<td>'.nl2br(dol_trunc($objp->description,32)).'</td>';
 		print '<td align="left">'.price($objp->price).'</td>';
 		print '<td align="left">'.$codeCompta.'</td>';
 
diff --git a/htdocs/compta/ventilation/liste.php b/htdocs/compta/ventilation/liste.php
index 53b4c418929..71367081282 100644
--- a/htdocs/compta/ventilation/liste.php
+++ b/htdocs/compta/ventilation/liste.php
@@ -103,8 +103,8 @@ if ($result)
 		else print '&nbsp;';
 		print '</td>';
 
-		print '<td>'.dolibarr_trunc($objp->product_label,24).'</td>';
-		print '<td>'.nl2br(dolibarr_trunc($objp->description,32)).'</td>';
+		print '<td>'.dol_trunc($objp->product_label,24).'</td>';
+		print '<td>'.nl2br(dol_trunc($objp->description,32)).'</td>';
 
 		print '<td align="right">';
 		print price($objp->price);
diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php
index 05ee475dd5c..2c9770ea745 100644
--- a/htdocs/contact.class.php
+++ b/htdocs/contact.class.php
@@ -102,7 +102,7 @@ class Contact extends CommonObject
         $sql.= $this->priv;
         $sql.= ")";
 
-        dolibarr_syslog("Contact::create sql=".$sql);
+        dol_syslog("Contact::create sql=".$sql);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -127,7 +127,7 @@ class Contact extends CommonObject
         else
         {
             $this->error=$this->db->error();
-            dolibarr_syslog("Contact::create ".$this->error);
+            dol_syslog("Contact::create ".$this->error);
             return -1;
         }
     }
@@ -177,12 +177,12 @@ class Contact extends CommonObject
         $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null");
         $sql .= " WHERE rowid=".$id;
 
-        dolibarr_syslog("Contact::update sql=".$sql,LOG_DEBUG);
+        dol_syslog("Contact::update sql=".$sql,LOG_DEBUG);
         $result = $this->db->query($sql);
         if (! $result)
         {
             $this->error=$this->db->lasterror().' sql='.$sql;
-			dolibarr_syslog("Contact::update Error ".$this->error,LOG_ERR);
+			dol_syslog("Contact::update Error ".$this->error,LOG_ERR);
             return -1;
         }
 
@@ -312,7 +312,7 @@ class Contact extends CommonObject
         if ($user) $sql .= ", fk_user_modif=".$user->id;
 		$sql .= " WHERE rowid=".$id;
 		//print "update_perso: ".$this->birthday.'-'.$this->db->idate($this->birthday);
-		dolibarr_syslog("Contact::update_perso this->birthday=".$this->birthday." - sql=".$sql);
+		dol_syslog("Contact::update_perso this->birthday=".$this->birthday." - sql=".$sql);
 		$resql = $this->db->query($sql);
 		if (! $resql)
 		{
@@ -379,7 +379,7 @@ class Contact extends CommonObject
         $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
         $sql.= " WHERE c.rowid = ". $id;
 
-    	dolibarr_syslog("Contact::fetch sql=".$sql);
+    	dol_syslog("Contact::fetch sql=".$sql);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -444,7 +444,7 @@ class Contact extends CommonObject
 	            else
 	            {
 	           	    $this->error=$this->db->error();
-	                dolibarr_syslog("Contact::fetch ".$this->error, LOG_ERR);
+	                dol_syslog("Contact::fetch ".$this->error, LOG_ERR);
 	                return -1;
 	            }
 
@@ -469,7 +469,7 @@ class Contact extends CommonObject
 	                else
 	                {
 		           	    $this->error=$this->db->error();
-		                dolibarr_syslog("Contact::fetch ".$this->error, LOG_ERR);
+		                dol_syslog("Contact::fetch ".$this->error, LOG_ERR);
 	                    return -1;
 	                }
 	            }
@@ -485,7 +485,7 @@ class Contact extends CommonObject
         else
         {
 			$this->error=$this->db->error();
-			dolibarr_syslog("Contact::fetch ".$this->error, LOG_ERR);
+			dol_syslog("Contact::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -508,7 +508,7 @@ class Contact extends CommonObject
         $sql.=" AND fk_socpeople = ". $this->id;
         $sql.=" GROUP BY tc.element";
 
-        dolibarr_syslog("Contact::load_ref_elements sql=".$sql);
+        dol_syslog("Contact::load_ref_elements sql=".$sql);
 
         $resql=$this->db->query($sql);
         if ($resql)
@@ -529,7 +529,7 @@ class Contact extends CommonObject
         else
         {
 	        $this->error=$this->db->error()." - ".$sql;
-	        dolibarr_syslog("Contact::load_ref_elements Error ".$this->error);
+	        dol_syslog("Contact::load_ref_elements Error ".$this->error);
 	        return -1;
         }
     }
@@ -558,7 +558,7 @@ class Contact extends CommonObject
 			$sql.= " WHERE ec.fk_socpeople=".$this->id;
 			$sql.= " AND ec.fk_c_type_contact=tc.rowid";
 			$sql.= " AND tc.source='external'";
-			dolibarr_syslog("Contact::delete sql=".$sql);
+			dol_syslog("Contact::delete sql=".$sql);
 			$resql = $this->db->query($sql);
 			if ($resql)
 			{
@@ -571,7 +571,7 @@ class Contact extends CommonObject
 
 					$sqldel = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
 					$sqldel.=" WHERE rowid = ".$obj->rowid;
-					dolibarr_syslog("Contact::delete sql=".$sqldel);
+					dol_syslog("Contact::delete sql=".$sqldel);
 					$result = $this->db->query($sqldel);
 					if (! $result)
 					{
@@ -593,7 +593,7 @@ class Contact extends CommonObject
 		{
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople";
 			$sql .= " WHERE rowid=".$this->id;
-			dolibarr_syslog("Contact::delete sql=".$sql);
+			dol_syslog("Contact::delete sql=".$sql);
 			$result = $this->db->query($sql);
 			if (! $result)
 			{
@@ -721,7 +721,7 @@ class Contact extends CommonObject
 		}
 
 		if ($withpicto) $result.=($lien.img_object($langs->trans("ShowContact").': '.$this->getFullName($langs),'contact').$lienfin.' ');
-		$result.=$lien.($maxlen?dolibarr_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$lienfin;
+		$result.=$lien.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$lienfin;
 		return $result;
 	}
 
diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php
index 38f5a5cba0a..9277434a9f3 100644
--- a/htdocs/contact/exportimport.php
+++ b/htdocs/contact/exportimport.php
@@ -53,7 +53,7 @@ $contact->fetch($_GET["id"], $user);
  */
 $head = contact_prepare_head($contact);
 
-dolibarr_fiche_head($head, 'exportimport', $langs->trans("Contact"));
+dol_fiche_head($head, 'exportimport', $langs->trans("Contact"));
 
 
 /*
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index 7ca12a447df..ed969396ef2 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -203,7 +203,7 @@ if ($_GET["id"] > 0)
 	$return=$contact->fetch($_GET["id"], $user);
 	if ($return <= 0)
 	{
-		dolibarr_print_error('',$contact->error);
+		dol_print_error('',$contact->error);
 		$_GET["id"]=0;
 	}
 
@@ -212,7 +212,7 @@ if ($_GET["id"] > 0)
 	 */
 	$head = contact_prepare_head($contact);
 
-	dolibarr_fiche_head($head, 'general', $langs->trans("Contact"));
+	dol_fiche_head($head, 'general', $langs->trans("Contact"));
 }
 
 
diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php
index 0148e91feeb..48beb2623e7 100644
--- a/htdocs/contact/index.php
+++ b/htdocs/contact/index.php
@@ -192,7 +192,7 @@ else
 	$sql.= " ".$db->plimit($conf->liste_limit+1, $offset);
 }
 
-dolibarr_syslog("contact/index.php sql=".$sql);
+dol_syslog("contact/index.php sql=".$sql);
 $result = $db->query($sql);
 if ($result)
 {
@@ -296,14 +296,14 @@ if ($result)
         print '</td>';
 
 		// Firstname
-        print '<td>'.dolibarr_trunc($obj->firstname,20).'</td>';
+        print '<td>'.dol_trunc($obj->firstname,20).'</td>';
 
 		// Company
 		print '<td>';
         if ($obj->socid)
         {
             print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">';
-            print img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,20).'</a>';
+            print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,20).'</a>';
         }
         else
         {
@@ -328,7 +328,7 @@ if ($result)
         }
 
 		// Date
-		print '<td align="center">'.dolibarr_print_date($obj->tms,"day").'</td>';
+		print '<td align="center">'.dol_print_date($obj->tms,"day").'</td>';
 
 		// Private/Public
 		print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
@@ -353,7 +353,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 print '<br>';
diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php
index b6c22c5109b..458beaa487d 100644
--- a/htdocs/contact/info.php
+++ b/htdocs/contact/info.php
@@ -54,7 +54,7 @@ $contact->fetch($_GET["id"], $user);
  */
 $head = contact_prepare_head($contact);
 
-dolibarr_fiche_head($head, 'info', $langs->trans("Contact"));
+dol_fiche_head($head, 'info', $langs->trans("Contact"));
 
 
 /*
diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php
index f17452b28cb..74cd0cf5adf 100644
--- a/htdocs/contact/ldap.php
+++ b/htdocs/contact/ldap.php
@@ -57,7 +57,7 @@ $contact->fetch($_GET["id"], $user);
  */
 $head = contact_prepare_head($contact);
 
-dolibarr_fiche_head($head, 'ldap', $langs->trans("Contact"));
+dol_fiche_head($head, 'ldap', $langs->trans("Contact"));
 
 
 /*
@@ -156,7 +156,7 @@ if ($result > 0)
 }
 else
 {
-	dolibarr_print_error('',$ldap->error);
+	dol_print_error('',$ldap->error);
 }
 
 
diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php
index 4df9e55ef54..c63b26604eb 100644
--- a/htdocs/contact/perso.php
+++ b/htdocs/contact/perso.php
@@ -48,7 +48,7 @@ if ($user->rights->societe->contact->creer)
 		$contact->fetch($_POST["contactid"]);
 		
 		// Note: Correct date should be completed with location to have exact GM time of birth.
-		$contact->birthday = dolibarr_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
+		$contact->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
 		$contact->birthday_alert = $_POST["birthday_alert"];
 		 
 		$result = $contact->update_perso($_POST["contactid"], $user);
@@ -82,7 +82,7 @@ $contact->fetch($_GET["id"], $user);
  */
 $head = contact_prepare_head($contact);
 
-dolibarr_fiche_head($head, 'perso', $langs->trans("Contact"));
+dol_fiche_head($head, 'perso', $langs->trans("Contact"));
 
 
 
@@ -196,7 +196,7 @@ else
 	// Date To Birth
     if ($contact->birthday != '')
     {
-        print '<tr><td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dolibarr_print_date($contact->birthday,"day");
+        print '<tr><td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($contact->birthday,"day");
 		print ' (';
         if ($contact->birthday_alert) print 'alerte anniversaire active';
         else print 'alerte anniversaire inactive';
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index 32bf04c32b8..0ba546d22f8 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -90,12 +90,12 @@ if ($_POST["action"] == 'updateligne' && $user->rights->contrat->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -119,13 +119,13 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->contrat->creer)
 		}
 		else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	}
 	else
 	{
-		dolibarr_print_error($db,$contrat->error);
+		dol_print_error($db,$contrat->error);
 	}
 }
 
@@ -175,7 +175,7 @@ if ($id > 0)
 
 		$hselected=1;
 
-		dolibarr_fiche_head($head, $hselected, $langs->trans("Contract"));
+		dol_fiche_head($head, $hselected, $langs->trans("Contract"));
 
 		/*
 		 *   Contrat
diff --git a/htdocs/contrat/contrat.class.php b/htdocs/contrat/contrat.class.php
index 3dd021117e6..18903747abc 100644
--- a/htdocs/contrat/contrat.class.php
+++ b/htdocs/contrat/contrat.class.php
@@ -106,7 +106,7 @@ class Contrat extends CommonObject
 		$sql.= " date_cloture = null";
 		$sql.= " WHERE rowid = ".$line_id . " AND (statut = 0 OR statut = 3 OR statut = 5)";
 
-		dolibarr_syslog("Contrat::active_line sql=".$sql);
+		dol_syslog("Contrat::active_line sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -123,7 +123,7 @@ class Contrat extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Contrat::active_line error ".$this->error);
+			dol_syslog("Contrat::active_line error ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
@@ -206,7 +206,7 @@ class Contrat extends CommonObject
         }
         else
         {
-            dolibarr_print_error($db,'Failed to update contrat_det');
+            dol_print_error($db,'Failed to update contrat_det');
             $this->db->rollback();
         }
 	}
@@ -1098,7 +1098,7 @@ class Contrat extends CommonObject
 
 		if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
 		if ($withpicto && $withpicto != 2) $result.=' ';
-		if ($withpicto != 2) $result.=$lien.($maxlength?dolibarr_trunc($this->ref,$maxlength):$this->ref).$lienfin;
+		if ($withpicto != 2) $result.=$lien.($maxlength?dol_trunc($this->ref,$maxlength):$this->ref).$lienfin;
 		return $result;
 	}
 
@@ -1145,7 +1145,7 @@ class Contrat extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1271,7 +1271,7 @@ class Contrat extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -1306,7 +1306,7 @@ class Contrat extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index fc9613c7377..3a05d0913ef 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -122,7 +122,7 @@ if ($contrat->id)
 
 	$head=contract_prepare_head($contrat, $user);
 
-	dolibarr_fiche_head($head, 'documents',  $langs->trans("Contract"));
+	dol_fiche_head($head, 'documents',  $langs->trans("Contract"));
 
 
 	// Construit liste des fichiers
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index 775f83b9cd8..871c4beb9a8 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -89,11 +89,11 @@ if ($_POST["mode"]=='predefined')
 	$date_end='';
 	if ($_POST["date_startmonth"] && $_POST["date_startday"] && $_POST["date_startyear"])
 	{
-		$date_start=dolibarr_mktime($_POST["date_starthour"], $_POST["date_startmin"], 0, $_POST["date_startmonth"], $_POST["date_startday"], $_POST["date_startyear"]);
+		$date_start=dol_mktime($_POST["date_starthour"], $_POST["date_startmin"], 0, $_POST["date_startmonth"], $_POST["date_startday"], $_POST["date_startyear"]);
 	}
 	if ($_POST["date_endmonth"] && $_POST["date_endday"] && $_POST["date_endyear"])
 	{
-		$date_end=dolibarr_mktime($_POST["date_endhour"], $_POST["date_endmin"], 0, $_POST["date_endmonth"], $_POST["date_endday"], $_POST["date_endyear"]);
+		$date_end=dol_mktime($_POST["date_endhour"], $_POST["date_endmin"], 0, $_POST["date_endmonth"], $_POST["date_endday"], $_POST["date_endyear"]);
 	}
 }
 
@@ -104,11 +104,11 @@ if ($_POST["mode"]=='libre')
 	$date_end_sl='';
 	if ($_POST["date_start_slmonth"] && $_POST["date_start_slday"] && $_POST["date_start_slyear"])
 	{
-		$date_start_sl=dolibarr_mktime($_POST["date_start_slhour"], $_POST["date_start_slmin"], 0, $_POST["date_start_slmonth"], $_POST["date_start_slday"], $_POST["date_start_slyear"]);
+		$date_start_sl=dol_mktime($_POST["date_start_slhour"], $_POST["date_start_slmin"], 0, $_POST["date_start_slmonth"], $_POST["date_start_slday"], $_POST["date_start_slyear"]);
 	}
 	if ($_POST["date_end_slmonth"] && $_POST["date_end_slday"] && $_POST["date_end_slyear"])
 	{
-		$date_end_sl=dolibarr_mktime($_POST["date_end_slhour"], $_POST["date_end_slmin"], 0, $_POST["date_end_slmonth"], $_POST["date_end_slday"], $_POST["date_end_slyear"]);
+		$date_end_sl=dol_mktime($_POST["date_end_slhour"], $_POST["date_end_slmin"], 0, $_POST["date_end_slmonth"], $_POST["date_end_slday"], $_POST["date_end_slyear"]);
 	}
 }
 
@@ -119,24 +119,24 @@ $date_start_real_update='';
 $date_end_real_update='';
 if ($_POST["date_start_updatemonth"] && $_POST["date_start_updateday"] && $_POST["date_start_updateyear"])
 {
-    $date_start_update=dolibarr_mktime($_POST["date_start_updatehour"], $_POST["date_start_updatemin"], 0, $_POST["date_start_updatemonth"], $_POST["date_start_updateday"], $_POST["date_start_updateyear"]);
+    $date_start_update=dol_mktime($_POST["date_start_updatehour"], $_POST["date_start_updatemin"], 0, $_POST["date_start_updatemonth"], $_POST["date_start_updateday"], $_POST["date_start_updateyear"]);
 }
 if ($_POST["date_end_updatemonth"] && $_POST["date_end_updateday"] && $_POST["date_end_updateyear"])
 {
-    $date_end_update=dolibarr_mktime($_POST["date_end_updatehour"], $_POST["date_end_updatemin"], 0, $_POST["date_end_updatemonth"], $_POST["date_end_updateday"], $_POST["date_end_updateyear"]);
+    $date_end_update=dol_mktime($_POST["date_end_updatehour"], $_POST["date_end_updatemin"], 0, $_POST["date_end_updatemonth"], $_POST["date_end_updateday"], $_POST["date_end_updateyear"]);
 }
 if ($_POST["date_start_real_updatemonth"] && $_POST["date_start_real_updateday"] && $_POST["date_start_real_updateyear"])
 {
-    $date_start_real_update=dolibarr_mktime($_POST["date_start_real_updatehour"], $_POST["date_start_real_updatemin"], 0, $_POST["date_start_real_updatemonth"], $_POST["date_start_real_updateday"], $_POST["date_start_real_updateyear"]);
+    $date_start_real_update=dol_mktime($_POST["date_start_real_updatehour"], $_POST["date_start_real_updatemin"], 0, $_POST["date_start_real_updatemonth"], $_POST["date_start_real_updateday"], $_POST["date_start_real_updateyear"]);
 }
 if ($_POST["date_end_real_updatemonth"] && $_POST["date_end_real_updateday"] && $_POST["date_end_real_updateyear"])
 {
-    $date_end_real_update=dolibarr_mktime($_POST["date_end_real_updatehour"], $_POST["date_end_real_updatemin"], 0, $_POST["date_end_real_updatemonth"], $_POST["date_end_real_updateday"], $_POST["date_end_real_updateyear"]);
+    $date_end_real_update=dol_mktime($_POST["date_end_real_updatehour"], $_POST["date_end_real_updatemin"], 0, $_POST["date_end_real_updatemonth"], $_POST["date_end_real_updateday"], $_POST["date_end_real_updateyear"]);
 }
 
 if ($_POST["action"] == 'add')
 {
-    $datecontrat = dolibarr_mktime($_POST["rehour"], $_POST["remin"], 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+    $datecontrat = dol_mktime($_POST["rehour"], $_POST["remin"], 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 
     $contrat = new Contrat($db);
 
@@ -180,7 +180,7 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer)
         $ret=$contrat->fetch($_GET["id"]);
         if ($ret < 0)
 		{
-			dolibarr_print_error($db,$commande->error);
+			dol_print_error($db,$commande->error);
 			exit;
 		}
 		$ret=$contrat->fetch_client();
@@ -192,11 +192,11 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer)
 		{
 			if ($_POST["date_start_slmonth"] && $_POST["date_start_slday"] && $_POST["date_start_slyear"])
 			{
-				$date_start=dolibarr_mktime($_POST["date_start_slhour"], $_POST["date_start_slmin"], 0, $_POST["date_start_slmonth"], $_POST["date_start_slday"], $_POST["date_start_slyear"]);
+				$date_start=dol_mktime($_POST["date_start_slhour"], $_POST["date_start_slmin"], 0, $_POST["date_start_slmonth"], $_POST["date_start_slday"], $_POST["date_start_slyear"]);
 			}
 			if ($_POST["date_end_slmonth"] && $_POST["date_end_slday"] && $_POST["date_end_slyear"])
 			{
-				$date_end=dolibarr_mktime($_POST["date_end_slhour"], $_POST["date_end_slmin"], 0, $_POST["date_end_slmonth"], $_POST["date_end_slday"], $_POST["date_end_slyear"]);
+				$date_end=dol_mktime($_POST["date_end_slhour"], $_POST["date_end_slmin"], 0, $_POST["date_end_slmonth"], $_POST["date_end_slday"], $_POST["date_end_slyear"]);
 			}
 		}
 		// Si ajout champ produit predefini
@@ -204,11 +204,11 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer)
 		{
 			if ($_POST["date_startmonth"] && $_POST["date_startday"] && $_POST["date_startyear"])
 			{
-				$date_start=dolibarr_mktime($_POST["date_starthour"], $_POST["date_startmin"], 0, $_POST["date_startmonth"], $_POST["date_startday"], $_POST["date_startyear"]);
+				$date_start=dol_mktime($_POST["date_starthour"], $_POST["date_startmin"], 0, $_POST["date_startmonth"], $_POST["date_startday"], $_POST["date_startyear"]);
 			}
 			if ($_POST["date_endmonth"] && $_POST["date_endday"] && $_POST["date_endyear"])
 			{
-				$date_end=dolibarr_mktime($_POST["date_endhour"], $_POST["date_endmin"], 0, $_POST["date_endmonth"], $_POST["date_endday"], $_POST["date_endyear"]);
+				$date_end=dol_mktime($_POST["date_endhour"], $_POST["date_endmin"], 0, $_POST["date_endmonth"], $_POST["date_endday"], $_POST["date_endyear"]);
 			}
 		}
 
@@ -332,13 +332,13 @@ if ($_POST["action"] == 'updateligne' && $user->rights->contrat->creer && ! $_PO
         }
         else
         {
-            dolibarr_print_error($db,'Failed to update contrat_det');
+            dol_print_error($db,'Failed to update contrat_det');
             $db->rollback();
         }
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 
@@ -439,7 +439,7 @@ $contratlignestatic=new ContratLigne($db);
  *********************************************************************/
 if ($_GET["action"] == 'create')
 {
-    dolibarr_fiche_head($head, $a, $langs->trans("AddContract"));
+    dol_fiche_head($head, $a, $langs->trans("AddContract"));
 
     if ($mesg) print $mesg;
 
@@ -584,7 +584,7 @@ if ($_GET["action"] == 'create')
                 }
                 else
                 {
-                    dolibarr_print_error($db);
+                    dol_print_error($db);
                 }
 
                 print '</table>';
@@ -593,7 +593,7 @@ if ($_GET["action"] == 'create')
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 
     print '</div>';
@@ -616,7 +616,7 @@ else
         if ($result > 0) $result=$contrat->fetch_lignes();
         if ($result < 0)
         {
-            dolibarr_print_error($db,$contrat->error);
+            dol_print_error($db,$contrat->error);
             exit;
         }
 
@@ -640,7 +640,7 @@ else
 
         $hselected = 0;
 
-        dolibarr_fiche_head($head, $hselected, $langs->trans("Contract"));
+        dol_fiche_head($head, $hselected, $langs->trans("Contract"));
 
 
         /*
@@ -710,7 +710,7 @@ else
 
         // Date
         print '<tr><td>'.$langs->trans("Date").'</td>';
-        print '<td colspan="3">'.dolibarr_print_date($contrat->date_contrat,"dayhour")."</td></tr>\n";
+        print '<td colspan="3">'.dol_print_date($contrat->date_contrat,"dayhour")."</td></tr>\n";
 
         // Projet
         if ($conf->projet->enabled)
@@ -868,7 +868,7 @@ else
 						// Date planned
 						print $langs->trans("DateStartPlanned").': ';
 						if ($objp->date_debut) {
-							print dolibarr_print_date($objp->date_debut);
+							print dol_print_date($objp->date_debut);
 							// Warning si date prevu passee et pas en service
 							if ($objp->statut == 0 && $objp->date_debut < ($now - $conf->contrat->services->inactifs->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
 						}
@@ -876,7 +876,7 @@ else
 						print ' &nbsp;-&nbsp; ';
 						print $langs->trans("DateEndPlanned").': ';
 						if ($objp->date_fin) {
-							print dolibarr_print_date($objp->date_fin);
+							print dol_print_date($objp->date_fin);
 							if ($objp->statut == 4 && $objp->date_fin < ($now - $conf->contrat->services->expires->warning_delay)) { print " ".img_warning($langs->trans("Late")); }
 						}
 						else print $langs->trans("Unknown");
@@ -932,7 +932,7 @@ else
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 
 			if ($contrat->statut > 0)
@@ -972,9 +972,9 @@ else
 			if ($_REQUEST["action"] == 'active' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $contrat->lignes[$cursorline-1]->id == $_GET["ligne"])
 			{
 				//print '<br />';
-				$dateactstart = dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
-				$dateactend   = dolibarr_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
-				$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&amp;ligne=".$_GET["ligne"]."&amp;date=".$dateactstart."&amp;dateend=".$dateactend,$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dolibarr_print_date($dateactstart,"%A %d %B %Y")),"confirm_active");
+				$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+				$dateactend   = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
+				$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&amp;ligne=".$_GET["ligne"]."&amp;date=".$dateactstart."&amp;dateend=".$dateactend,$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active");
 				print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
 			}
 
@@ -984,9 +984,9 @@ else
 			if ($_REQUEST["action"] == 'closeline' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $contrat->lignes[$cursorline-1]->id == $_GET["ligne"])
 			{
 				//print '<br />';
-				$dateactstart = dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
-				$dateactend   = dolibarr_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
-				$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&amp;ligne=".$_GET["ligne"]."&amp;date=".$dateactstart."&amp;dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",dolibarr_print_date($dateactend,"%A %d %B %Y")),"confirm_closeline");
+				$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+				$dateactend   = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
+				$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&amp;ligne=".$_GET["ligne"]."&amp;date=".$dateactstart."&amp;dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")),"confirm_closeline");
 				print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
 			}
 
@@ -1018,21 +1018,21 @@ else
 				// Si pas encore active
 				if (! $objp->date_debut_reelle) {
 					print $langs->trans("DateStartReal").': ';
-					if ($objp->date_debut_reelle) print dolibarr_print_date($objp->date_debut_reelle);
+					if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle);
 					else print $langs->trans("ContractStatusNotRunning");
 				}
 				// Si active et en cours
 				if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) {
 					print $langs->trans("DateStartReal").': ';
-					print dolibarr_print_date($objp->date_debut_reelle);
+					print dol_print_date($objp->date_debut_reelle);
 				}
 				// Si desactive
 				if ($objp->date_debut_reelle && $objp->date_fin_reelle) {
 					print $langs->trans("DateStartReal").': ';
-					print dolibarr_print_date($objp->date_debut_reelle);
+					print dol_print_date($objp->date_debut_reelle);
 					print ' &nbsp;-&nbsp; ';
 					print $langs->trans("DateEndReal").': ';
-					print dolibarr_print_date($objp->date_fin_reelle);
+					print dol_print_date($objp->date_fin_reelle);
 				}
 				print '</td>';
 
@@ -1056,11 +1056,11 @@ else
 
 				// Definie date debut et fin par defaut
 				$dateactstart = $objp->date_debut;
-				if ($_POST["remonth"]) $dateactstart = dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+				if ($_POST["remonth"]) $dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 				elseif (! $dateactstart) $dateactstart = time();
 
 				$dateactend = $objp->date_fin;
-				if ($_POST["endmonth"]) $dateactend = dolibarr_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
+				if ($_POST["endmonth"]) $dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
 				elseif (! $dateactend)
 				{
 					if ($objp->fk_product > 0)
@@ -1104,11 +1104,11 @@ else
 
 				// Definie date debut et fin par defaut
 				$dateactstart = $objp->date_debut_reelle;
-				if ($_POST["remonth"]) $dateactstart = dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
+				if ($_POST["remonth"]) $dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 				elseif (! $dateactstart) $dateactstart = time();
 
 				$dateactend = $objp->date_fin_reelle;
-				if ($_POST["endmonth"]) $dateactend = dolibarr_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
+				if ($_POST["endmonth"]) $dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
 				elseif (! $dateactend)
 				{
 					if ($objp->fk_product > 0)
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index 0b72330c678..32acbad1341 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -156,7 +156,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -184,7 +184,7 @@ $sql.= " GROUP BY c.rowid, c.datec, c.statut, s.nom, s.rowid";
 $sql.= " ORDER BY c.tms DESC";
 $sql.= " LIMIT ".$max;
 
-dolibarr_syslog("contrat/index.php sql=".$sql, LOG_DEBUG);
+dol_syslog("contrat/index.php sql=".$sql, LOG_DEBUG);
 $result=$db->query($sql);
 if ($result)
 {
@@ -217,7 +217,7 @@ if ($result)
 		$staticcompany->nom=$obj->nom;
 		print $staticcompany->getNomUrl(1,'',20);
 		print '</td>';
-        print '<td align="center">'.dolibarr_print_date($obj->tms,'dayhour').'</td>';
+        print '<td align="center">'.dol_print_date($obj->tms,'dayhour').'</td>';
         //print '<td align="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>';
         print '<td align="right" width="32">'.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0,3):'').'</td>';
         print '<td align="right" width="32">'.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4,3,false):'').'</td>';
@@ -233,7 +233,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 print '<br>';
@@ -274,8 +274,8 @@ if ( $db->query($sql) )
 		print '</td>';
         print '<td nowrap="1">';
 		print '<a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->fk_contrat.'">'.img_object($langs->trans("ShowService"),"service");
-        if ($obj->label) print ' '.dolibarr_trunc($obj->label,20).'</a></td>';
-        else print '</a> '.dolibarr_trunc($obj->note,20).'</td>';
+        if ($obj->label) print ' '.dol_trunc($obj->label,20).'</a></td>';
+        else print '</a> '.dol_trunc($obj->note,20).'</td>';
         print '<td>';
 		$staticcompany->id=$obj->fk_soc;
 		$staticcompany->nom=$obj->nom;
@@ -294,7 +294,7 @@ if ( $db->query($sql) )
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 print '<br>';
@@ -337,8 +337,8 @@ if ($resql)
         //if (1 == 1) print img_warning($langs->trans("Late"));
         print '</td>';
         print '<td><a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->fk_contrat.'">'.img_object($langs->trans("ShowService"),"service");
-        if ($obj->label) print ' '.dolibarr_trunc($obj->label,20).'</a></td>';
-        else print '</a> '.dolibarr_trunc($obj->note,20).'</td>';
+        if ($obj->label) print ' '.dol_trunc($obj->label,20).'</a></td>';
+        else print '</a> '.dol_trunc($obj->note,20).'</td>';
         print '<td>';
 		$staticcompany->id=$obj->fk_soc;
 		$staticcompany->nom=$obj->nom;
@@ -358,7 +358,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 print '</td></tr></table>';
diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php
index 9930c4d72de..aed0afba7b9 100644
--- a/htdocs/contrat/info.php
+++ b/htdocs/contrat/info.php
@@ -48,7 +48,7 @@ $contrat->info($_GET["id"]);
 
 $head = contract_prepare_head($contrat);
 
-dolibarr_fiche_head($head, 'info', $langs->trans("Contract"));
+dol_fiche_head($head, 'info', $langs->trans("Contract"));
 
 
 print '<table width="100%"><tr><td>';
diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php
index ea7882bd283..6878bd6a686 100644
--- a/htdocs/contrat/liste.php
+++ b/htdocs/contrat/liste.php
@@ -137,8 +137,8 @@ if ($resql)
         if ($obj->nb_late) print img_warning($langs->trans("Late"));
         print '</td>';
         print '<td><a href="../comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
-        //print '<td align="center">'.dolibarr_print_date($obj->datec).'</td>';
-        print '<td align="center">'.dolibarr_print_date($obj->date_contrat).'</td>';
+        //print '<td align="center">'.dol_print_date($obj->datec).'</td>';
+        print '<td align="center">'.dol_print_date($obj->date_contrat).'</td>';
         //print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>';
         print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
         print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
@@ -154,7 +154,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php
index f95acf7a6ea..6284f00b992 100644
--- a/htdocs/contrat/note.php
+++ b/htdocs/contrat/note.php
@@ -103,7 +103,7 @@ if ($_GET["id"])
 
     $hselected = 2;
 
-    dolibarr_fiche_head($head, 'note', $langs->trans("Contract"));
+    dol_fiche_head($head, 'note', $langs->trans("Contract"));
 
 
     print '<table class="border" width="100%">';
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index 7a04ca66f9f..d1443c6526b 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -94,15 +94,15 @@ if ($search_nom)      $sql.= " AND s.nom like '%".addslashes($search_nom)."%'";
 if ($search_contract) $sql.= " AND c.rowid = '".addslashes($search_contract)."'";
 if ($search_service)  $sql.= " AND (p.ref like '%".addslashes($search_service)."%' OR p.description like '%".addslashes($search_service)."%')";
 if ($socid > 0)       $sql.= " AND s.rowid = ".$socid;
-$filter_date1=dolibarr_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['op1year']);
-$filter_date2=dolibarr_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUEST['op2year']);
+$filter_date1=dol_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['op1year']);
+$filter_date2=dol_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUEST['op2year']);
 if (! empty($_REQUEST['filter_op1']) && $_REQUEST['filter_op1'] != -1 && $filter_date1 != '') $sql.= " AND date_ouverture_prevue ".$_REQUEST['filter_op1']." ".$db->idate($filter_date1);
 if (! empty($_REQUEST['filter_op2']) && $_REQUEST['filter_op2'] != -1 && $filter_date2 != '') $sql.= " AND date_fin_validite ".$_REQUEST['filter_op2']." ".$db->idate($filter_date2);
 $sql .= $db->order($sortfield,$sortorder);
 $sql .= $db->plimit($limit + 1 ,$offset);
 
 //print $sql;
-dolibarr_syslog("contrat/services.php sql=".$sql);
+dol_syslog("contrat/services.php sql=".$sql);
 $resql=$db->query($sql);
 if ($resql)
 {
@@ -154,14 +154,14 @@ if ($resql)
     $arrayofoperators=array('<'=>'<','>'=>'>');
 	print $form->select_array('filter_op1',$arrayofoperators,$_REQUEST['filter_op1'],1);
     print ' ';
-    $filter_date1=dolibarr_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['"op1year']);
+    $filter_date1=dol_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['"op1year']);
     print $form->select_date($filter_date1,'op1',0,0,1);
     print '</td>';
     print '<td class="liste_titre" align="center">';
     $arrayofoperators=array('<'=>'<','>'=>'>');
     print $form->select_array('filter_op2',$arrayofoperators,$_REQUEST['filter_op2'],1);
     print ' ';
-    $filter_date2=dolibarr_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUEST['op2year']);
+    $filter_date2=dol_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUEST['op2year']);
     print $form->select_date($filter_date2,'op2',0,0,1);
     print '</td>';
     print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
@@ -186,11 +186,11 @@ if ($resql)
         print '<td>';
         if ($obj->pid)
         {
-        	print '<a href="../product/fiche.php?id='.$obj->pid.'">'.img_object($langs->trans("ShowService"),"service").' '.dolibarr_trunc($obj->label,20).'</a>';
+        	print '<a href="../product/fiche.php?id='.$obj->pid.'">'.img_object($langs->trans("ShowService"),"service").' '.dol_trunc($obj->label,20).'</a>';
         }
         else
         {
-        	print dolibarr_trunc($obj->description,20);
+        	print dol_trunc($obj->description,20);
     	}
         print '</td>';
 
@@ -205,16 +205,16 @@ if ($resql)
         // Start date
         if ($mode == "0") {
             print '<td align="center">';
-            print ($obj->date_ouverture_prevue?dolibarr_print_date($obj->date_ouverture_prevue):'&nbsp;');
+            print ($obj->date_ouverture_prevue?dol_print_date($obj->date_ouverture_prevue):'&nbsp;');
             if ($obj->date_ouverture_prevue && ($obj->date_ouverture_prevue < ($now - $conf->contrat->services->inactifs->warning_delay)))
             print img_picto($langs->trans("Late"),"warning");
             else print '&nbsp;&nbsp;&nbsp;&nbsp;';
             print '</td>';
         }
-        if ($mode == "" || $mode > 0) print '<td align="center">'.($obj->date_ouverture?dolibarr_print_date($obj->date_ouverture):'&nbsp;').'</td>';
+        if ($mode == "" || $mode > 0) print '<td align="center">'.($obj->date_ouverture?dol_print_date($obj->date_ouverture):'&nbsp;').'</td>';
         // Date fin
-        if ($mode == "" || $mode < 5) print '<td align="center">'.($obj->date_fin_validite?dolibarr_print_date($obj->date_fin_validite):'&nbsp;');
-        else print '<td align="center">'.dolibarr_print_date($obj->date_cloture);
+        if ($mode == "" || $mode < 5) print '<td align="center">'.($obj->date_fin_validite?dol_print_date($obj->date_fin_validite):'&nbsp;');
+        else print '<td align="center">'.dol_print_date($obj->date_cloture);
         // Icone warning
         if ($obj->date_fin_validite && $obj->date_fin_validite < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late"));
         else print '&nbsp;&nbsp;&nbsp;&nbsp;';
@@ -241,7 +241,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/core/dolgraph.class.php b/htdocs/core/dolgraph.class.php
index e2af253fdb8..d16c8def323 100644
--- a/htdocs/core/dolgraph.class.php
+++ b/htdocs/core/dolgraph.class.php
@@ -400,7 +400,7 @@ class DolGraph
 		if (! is_array($this->data) || sizeof($this->data) < 1)
 		{
 			$this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
-			dolibarr_syslog("DolGraph::draw ".$this->error, LOG_ERR);
+			dol_syslog("DolGraph::draw ".$this->error, LOG_ERR);
 			return -1;
 		}
 		$call = "draw_".$this->library;
@@ -414,7 +414,7 @@ class DolGraph
 	 */
 	function draw_artichow($file)
 	{
-		dolibarr_syslog("DolGraph.class::draw_artichow this->type=".$this->type);
+		dol_syslog("DolGraph.class::draw_artichow this->type=".$this->type);
 
 		if (! defined('SHADOW_RIGHT_TOP'))  define('SHADOW_RIGHT_TOP',3);
 		if (! defined('LEGEND_BACKGROUND')) define('LEGEND_BACKGROUND',2);
diff --git a/htdocs/core/events.class.php b/htdocs/core/events.class.php
index 34524e30877..ebd1e8123ef 100644
--- a/htdocs/core/events.class.php
+++ b/htdocs/core/events.class.php
@@ -99,7 +99,7 @@ class Events // extends CommonObject
 
 		$sql.= ")";
 
-	   	dolibarr_syslog("Events::create sql=".$sql, LOG_DEBUG);
+	   	dol_syslog("Events::create sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -110,7 +110,7 @@ class Events // extends CommonObject
         else
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Events::create ".$this->error, LOG_ERR);
+            dol_syslog("Events::create ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -145,12 +145,12 @@ class Events // extends CommonObject
 
         $sql.= " WHERE rowid=".$this->id;
 
-        dolibarr_syslog("Events::update sql=".$sql, LOG_DEBUG);
+        dol_syslog("Events::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
         if (! $resql)
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Events::update ".$this->error, LOG_ERR);
+            dol_syslog("Events::update ".$this->error, LOG_ERR);
             return -1;
         }
 
@@ -179,7 +179,7 @@ class Events // extends CommonObject
         $sql.= " FROM ".MAIN_DB_PREFIX."events as t";
         $sql.= " WHERE t.rowid = ".$id;
 
-    	dolibarr_syslog("Events::fetch sql=".$sql, LOG_DEBUG);
+    	dol_syslog("Events::fetch sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -203,7 +203,7 @@ class Events // extends CommonObject
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Events::fetch ".$this->error, LOG_ERR);
+            dol_syslog("Events::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -221,12 +221,12 @@ class Events // extends CommonObject
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."events";
 		$sql.= " WHERE rowid=".$this->id;
 
-	   	dolibarr_syslog("Events::delete sql=".$sql);
+	   	dol_syslog("Events::delete sql=".$sql);
 		$resql = $this->db->query($sql);
 		if (! $resql)
 		{
 			$this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Events::delete ".$this->error, LOG_ERR);
+            dol_syslog("Events::delete ".$this->error, LOG_ERR);
 			return -1;
 		}
 
diff --git a/htdocs/core/menubase.class.php b/htdocs/core/menubase.class.php
index 5c3dccd17b2..e0aa5e9541f 100644
--- a/htdocs/core/menubase.class.php
+++ b/htdocs/core/menubase.class.php
@@ -129,7 +129,7 @@ class Menubase
 		$sql.= " '".$this->user."'";
 		$sql.= ")";
 
-	   	dolibarr_syslog("Menubase::create sql=".$sql, LOG_DEBUG);
+	   	dol_syslog("Menubase::create sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -140,7 +140,7 @@ class Menubase
         else
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Menubase::create ".$this->error, LOG_ERR);
+            dol_syslog("Menubase::create ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -193,12 +193,12 @@ class Menubase
 		$sql.= " user='".$this->user."'";
         $sql.= " WHERE rowid=".$this->id;
 
-        dolibarr_syslog("Menubase::update sql=".$sql, LOG_DEBUG);
+        dol_syslog("Menubase::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
         if (! $resql)
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Menubase::update ".$this->error, LOG_ERR);
+            dol_syslog("Menubase::update ".$this->error, LOG_ERR);
             return -1;
         }
 
@@ -236,7 +236,7 @@ class Menubase
         $sql.= " FROM ".MAIN_DB_PREFIX."menu as t";
         $sql.= " WHERE t.rowid = ".$id;
 
-    	dolibarr_syslog("Menubase::fetch sql=".$sql, LOG_DEBUG);
+    	dol_syslog("Menubase::fetch sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -269,7 +269,7 @@ class Menubase
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Menubase::fetch ".$this->error, LOG_ERR);
+            dol_syslog("Menubase::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -287,12 +287,12 @@ class Menubase
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu";
 		$sql.= " WHERE rowid=".$this->id;
 
-	   	dolibarr_syslog("Menubase::delete sql=".$sql);
+	   	dol_syslog("Menubase::delete sql=".$sql);
 		$resql = $this->db->query($sql);
 		if (! $resql)
 		{
 			$this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Menubase::delete ".$this->error, LOG_ERR);
+            dol_syslog("Menubase::delete ".$this->error, LOG_ERR);
 			return -1;
 		}
 
@@ -358,7 +358,7 @@ class Menubase
 		// If type_user == 2, no test requires
 		$sql.= " ORDER BY m.position, m.rowid";
 
-		dolibarr_syslog("Menubase::menuLeftCharger sql=".$sql);
+		dol_syslog("Menubase::menuLeftCharger sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -428,7 +428,7 @@ class Menubase
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 		// Get menutopid
@@ -547,7 +547,7 @@ class Menubase
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 		return $overwritemenufor;
@@ -579,7 +579,7 @@ class Menubase
 		// If type_user == 2, no test requires
 		$sql.= " ORDER BY m.position";
 
-		dolibarr_syslog("Menubase::menuTopCharger sql=".$sql);
+		dol_syslog("Menubase::menuTopCharger sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -652,7 +652,7 @@ class Menubase
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 		return $tabMenu;
diff --git a/htdocs/discount.class.php b/htdocs/discount.class.php
index a1dc978bc86..16f0fba6ad2 100644
--- a/htdocs/discount.class.php
+++ b/htdocs/discount.class.php
@@ -84,7 +84,7 @@ class DiscountAbsolute
 		if ($rowid) $sql.= " sr.rowid=".$rowid;
 		if ($fk_facture_source) $sql.= " sr.fk_facture_source=".$fk_facture_source;
 
-		dolibarr_syslog("DiscountAbsolute::fetch sql=".$sql);
+		dol_syslog("DiscountAbsolute::fetch sql=".$sql);
  		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -149,7 +149,7 @@ class DiscountAbsolute
 		$sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null");
 		$sql.= ")";
 
-	   	dolibarr_syslog("DiscountAbsolute::create sql=".$sql);
+	   	dol_syslog("DiscountAbsolute::create sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -159,7 +159,7 @@ class DiscountAbsolute
 		else
 		{
             $this->error=$this->db->lasterror().' - sql='.$sql;
-            dolibarr_syslog("DiscountAbsolute::create ".$this->error);
+            dol_syslog("DiscountAbsolute::create ".$this->error);
             return -1;
 		}
     }
@@ -178,7 +178,7 @@ class DiscountAbsolute
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except ";
 		$sql.= " WHERE rowid = ".$this->id." AND (fk_facture_line IS NULL or fk_facture IS NULL)";
 
-	   	dolibarr_syslog("DiscountAbsolute::delete Delete discount sql=".$sql);
+	   	dol_syslog("DiscountAbsolute::delete Delete discount sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -189,7 +189,7 @@ class DiscountAbsolute
 				$sql.=" set paye=0, fk_statut=1";
 				$sql.=" WHERE type = 2 AND rowid=".$this->fk_facture_source;
 
-			   	dolibarr_syslog("DiscountAbsolute::delete Update credit note statut sql=".$sql);
+			   	dol_syslog("DiscountAbsolute::delete Update credit note statut sql=".$sql);
 				$result=$this->db->query($sql);
 				if ($result)
 				{
@@ -244,7 +244,7 @@ class DiscountAbsolute
 		if ($rowidinvoice) $sql.=" SET fk_facture = ".$rowidinvoice;
 		$sql.=" WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("DiscountAbsolute::link_to_invoice sql=".$sql,LOG_DEBUG);
+		dol_syslog("DiscountAbsolute::link_to_invoice sql=".$sql,LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -253,7 +253,7 @@ class DiscountAbsolute
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("DiscountAbsolute::link_to_invoice ".$this->error,LOG_ERR);
+			dol_syslog("DiscountAbsolute::link_to_invoice ".$this->error,LOG_ERR);
 			return -3;
 		}
 	}
@@ -272,7 +272,7 @@ class DiscountAbsolute
 		$sql.=" SET fk_facture_line = NULL, fk_facture = NULL";
 		$sql.=" WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("DiscountAbsolute::unlink_invoice sql=".$sql,LOG_DEBUG);
+		dol_syslog("DiscountAbsolute::unlink_invoice sql=".$sql,LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -281,7 +281,7 @@ class DiscountAbsolute
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("DiscountAbsolute::link_to_invoice ".$this->error,LOG_ERR);
+			dol_syslog("DiscountAbsolute::link_to_invoice ".$this->error,LOG_ERR);
 			return -3;
 		}
 	}
@@ -306,7 +306,7 @@ class DiscountAbsolute
         if ($filter)   $sql.=' AND '.$filter;
         if ($maxvalue) $sql.=' AND rc.amount_ttc <= '.price2num($maxvalue);
 
-        dolibarr_syslog("DiscountAbsolute::getAvailableDiscounts sql=".$sql,LOG_DEBUG);
+        dol_syslog("DiscountAbsolute::getAvailableDiscounts sql=".$sql,LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -332,7 +332,7 @@ class DiscountAbsolute
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc';
 		$sql.= ' WHERE rc.fk_facture = '.$invoice->id;
 
-        dolibarr_syslog("DiscountAbsolute::getSommeCreditNote sql=".$sql,LOG_DEBUG);
+        dol_syslog("DiscountAbsolute::getSommeCreditNote sql=".$sql,LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
diff --git a/htdocs/docs/class/pdf_courrier_droit_editeur.class.php b/htdocs/docs/class/pdf_courrier_droit_editeur.class.php
index 9971ce23415..6258ac4757a 100644
--- a/htdocs/docs/class/pdf_courrier_droit_editeur.class.php
+++ b/htdocs/docs/class/pdf_courrier_droit_editeur.class.php
@@ -48,7 +48,7 @@ class pdf_courrier_droit_editeur
 		$this->marge_haute=10;
 		$this->marge_basse=10;
 
-		$this->name = "Courrier des droits ".dolibarr_print_date(time(),"%Y");
+		$this->name = "Courrier des droits ".dol_print_date(time(),"%Y");
 		$this->file = '1'.strftime("%Y", time()).'.pdf';
 	}
 
@@ -63,7 +63,7 @@ class pdf_courrier_droit_editeur
 		$this->file = $numero.strftime("%Y", time());
 		$this->extension = "pdf";
 
-		dolibarr_syslog("pdf_courrier_droit_editeur::Generate ", LOG_DEBUG );
+		dol_syslog("pdf_courrier_droit_editeur::Generate ", LOG_DEBUG );
 
 		require_once(FPDF_PATH.'fpdf.php');
 		require_once(DOL_DOCUMENT_ROOT."/product.class.php");
@@ -106,7 +106,7 @@ class pdf_courrier_droit_editeur
 			{
 				$id = $obj->rowid;
 				 
-				dolibarr_syslog("droits-editeurs.php id:$id", LOG_DEBUG );
+				dol_syslog("droits-editeurs.php id:$id", LOG_DEBUG );
 				 
 				$coupdf = new pdf_courrier_droit_editeur($this->db, $langs);
 
@@ -136,17 +136,17 @@ class pdf_courrier_droit_editeur
 				if (! empty($conf->global->MAIN_UMASK))
 					@chmod($file, octdec($conf->global->MAIN_UMASK));
 				 
-				dolibarr_syslog("droits-editeurs.php write $file", LOG_DEBUG );
+				dol_syslog("droits-editeurs.php write $file", LOG_DEBUG );
 			}
 
 			$pdf_all->Close();
 			$pdf_all->Output($file_all);
-			dolibarr_syslog("droits-editeurs.php write $fileall", LOG_DEBUG );
+			dol_syslog("droits-editeurs.php write $fileall", LOG_DEBUG );
 
 		}
 		else
 		{
-			dolibarr_syslog("pdf_courrier_droit_editeur::Generate ".$db->error(), LOG_ERR );
+			dol_syslog("pdf_courrier_droit_editeur::Generate ".$db->error(), LOG_ERR );
 		}
 
 		return 0;
@@ -159,7 +159,7 @@ class pdf_courrier_droit_editeur
   */
 	function Write($id, $dir, $year, &$pdf)
 	{
-		dolibarr_syslog("pdf_courrier_droit_editeur::Write $id,$year ", LOG_DEBUG );
+		dol_syslog("pdf_courrier_droit_editeur::Write $id,$year ", LOG_DEBUG );
 		$soc = new Societe($this->db);
 		$soc->fetch($id);
    
diff --git a/htdocs/docs/document.class.php b/htdocs/docs/document.class.php
index 245eae29f85..e620495460b 100644
--- a/htdocs/docs/document.class.php
+++ b/htdocs/docs/document.class.php
@@ -48,7 +48,7 @@ class Document
   {
     $errno = 0;
 
-    dolibarr_syslog("Document::Generate id=$id", LOG_DEBUG );
+    dol_syslog("Document::Generate id=$id", LOG_DEBUG );
     $this->id = $id;
     $class = $id;
     $classfile = 'docs/class/'.$class.'.class.php';
@@ -76,12 +76,12 @@ class Document
     if ($err === 0)
       {
 	$this->db->commit();
-	dolibarr_syslog("Document::Generate COMMIT", LOG_DEBUG );
+	dol_syslog("Document::Generate COMMIT", LOG_DEBUG );
       }
     else
       {
 	$this->db->rollback();
-	dolibarr_syslog("Document::Generate ROLLBACK", LOG_ERR );
+	dol_syslog("Document::Generate ROLLBACK", LOG_ERR );
       }
 
     return $errno;
diff --git a/htdocs/docs/index.php b/htdocs/docs/index.php
index 9ef4fe14fc3..943ae36adc9 100644
--- a/htdocs/docs/index.php
+++ b/htdocs/docs/index.php
@@ -58,7 +58,7 @@ if ($resql)
       $loc = get_exdir($obj->rowid).$obj->rowid.".pdf";
       $file = stripslashes($obj->name);
       echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart=ged&type=application/binary&file='.urlencode($loc).'">'.$file.'</a></td>';
-      print '<td>'.dolibarr_print_date($obj->date_generation,'dayhour').'</td>';
+      print '<td>'.dol_print_date($obj->date_generation,'dayhour').'</td>';
 
       print "</tr>\n";
     }
@@ -67,7 +67,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/document.php b/htdocs/document.php
index ec2d8811ae0..5fc819902c7 100644
--- a/htdocs/document.php
+++ b/htdocs/document.php
@@ -421,9 +421,9 @@ if (! $accessallowed)
 // les noms de fichiers.
 if (eregi('\.\.',$original_file) || eregi('[<>|]',$original_file))
 {
-	dolibarr_syslog("Refused to deliver file ".$original_file);
+	dol_syslog("Refused to deliver file ".$original_file);
 	// Do no show plain path in shown error message
-	dolibarr_print_error(0,$langs->trans("ErrorFileNameInvalid",$_GET["file"]));
+	dol_print_error(0,$langs->trans("ErrorFileNameInvalid",$_GET["file"]));
 	exit;
 }
 
@@ -437,16 +437,16 @@ if ($action == 'remove_file')
 	clearstatcache();
 	$filename = basename($original_file);
 
-	dolibarr_syslog("document.php remove $original_file $filename $urlsource", LOG_DEBUG);
+	dol_syslog("document.php remove $original_file $filename $urlsource", LOG_DEBUG);
 
 	if (! file_exists($original_file))
 	{
-	    dolibarr_print_error(0,$langs->trans("ErrorFileDoesNotExists",$_GET["file"]));
+	    dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$_GET["file"]));
 	    exit;
 	}
 	unlink($original_file);
 
-	dolibarr_syslog("document.php back to ".urldecode($urlsource), LOG_DEBUG);
+	dol_syslog("document.php back to ".urldecode($urlsource), LOG_DEBUG);
 
 	header("Location: ".urldecode($urlsource));
 
@@ -460,11 +460,11 @@ else
 	clearstatcache();
 	$filename = basename($original_file);
 
-	dolibarr_syslog("document.php download $original_file $filename content-type=$type");
+	dol_syslog("document.php download $original_file $filename content-type=$type");
 
 	if (! file_exists($original_file))
 	{
-	    dolibarr_print_error(0,$langs->trans("ErrorFileDoesNotExists",$original_file));
+	    dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$original_file));
 	    exit;
 	}
 
diff --git a/htdocs/domain/index.php b/htdocs/domain/index.php
index 830e8638463..e1c5c97940b 100644
--- a/htdocs/domain/index.php
+++ b/htdocs/domain/index.php
@@ -79,7 +79,7 @@ if ($result)
   print "</table></form>";
 
 } else {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/don.class.php b/htdocs/don.class.php
index 5d17a237dbb..5a8bd4a76e5 100644
--- a/htdocs/don.class.php
+++ b/htdocs/don.class.php
@@ -294,7 +294,7 @@ class Don extends CommonObject
 		$sql .= " ".($this->projetid > 0?$this->projetid:"null").",";
 		$sql .= " '".addslashes($this->note)."', ".$user->id.", null, '$this->date','$this->email')";
 
-		dolibarr_syslog("Don::create sql=".$sql, LOG_DEBUG);
+		dol_syslog("Don::create sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -302,7 +302,7 @@ class Don extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -343,7 +343,7 @@ class Don extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -370,7 +370,7 @@ class Don extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 	 	 return -1;
 		}
 	}
@@ -422,7 +422,7 @@ class Don extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 
@@ -452,7 +452,7 @@ class Don extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 	  return 0;
 		}
 	}
@@ -485,7 +485,7 @@ class Don extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
@@ -514,7 +514,7 @@ class Don extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php
index e9206194cfe..3593d98f4f0 100644
--- a/htdocs/ecm/docdir.php
+++ b/htdocs/ecm/docdir.php
@@ -68,7 +68,7 @@ if (! empty($_GET["section"]))
 	$result=$ecmdir->fetch($_GET["section"]);
 	if (! $result > 0)
 	{
-		dolibarr_print_error($db,$ecmdir->error);
+		dol_print_error($db,$ecmdir->error);
 		exit;
 	}
 }
diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php
index f8a15008e01..3ee773750a1 100644
--- a/htdocs/ecm/docfile.php
+++ b/htdocs/ecm/docfile.php
@@ -64,13 +64,13 @@ if (! $sortfield) $sortfield="label";
 $fileid=$_REQUEST["fileid"];
 if (! $fileid)
 {
-	dolibarr_print_error('',"ErrorParamNotDefined");
+	dol_print_error('',"ErrorParamNotDefined");
 	exit;
 }
 $section=$_REQUEST["section"];
 if (! $section)
 {
-	dolibarr_print_error('',"ErrorSectionParamNotDefined");
+	dol_print_error('',"ErrorSectionParamNotDefined");
 	exit;
 }
 
@@ -83,7 +83,7 @@ if (! empty($_GET["fileid"]))
 	$result=$ecmfile->fetch($_GET["fileid"]);
 	if (! $result > 0)
 	{
-		dolibarr_print_error($db,$ecmfile->error);
+		dol_print_error($db,$ecmfile->error);
 		exit;
 	}
 }
@@ -114,7 +114,7 @@ $formecm=new FormEcm($db);
 
 
 $head = ecm_prepare_head($ecmdir);
-dolibarr_fiche_head($head, 'card', $langs->trans("ECMSectionManual"));
+dol_fiche_head($head, 'card', $langs->trans("ECMSectionManual"));
 
 if ($_GET["action"] == 'edit')
 {
@@ -168,7 +168,7 @@ $userecm->fetch();
 print $userecm->getNomUrl(1);
 print '</td></tr>';
 print '<tr><td>'.$langs->trans("ECMCreationDate").'</td><td>';
-print dolibarr_print_date($ecmdir->date_c,'dayhour');
+print dol_print_date($ecmdir->date_c,'dayhour');
 print '</td></tr>';
 print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
 //print $conf->ecm->dir_output;
diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php
index 72a9d0e0dab..c535904003a 100644
--- a/htdocs/ecm/docmine.php
+++ b/htdocs/ecm/docmine.php
@@ -59,7 +59,7 @@ $pagenext = $page + 1;
 $section=$_REQUEST["section"];
 if (! $section)
 {
-	dolibarr_print_error('',"ErrorSectionParamNotDefined");
+	dol_print_error('',"ErrorSectionParamNotDefined");
 	exit;
 }
 
@@ -68,13 +68,13 @@ if (! $section)
 $ecmdir = new ECMDirectory($db);
 if (empty($_REQUEST["section"])) 
 {
-	dolibarr_print_error('','Error, section parameter missing');
+	dol_print_error('','Error, section parameter missing');
 	exit;
 }
 $result=$ecmdir->fetch($_REQUEST["section"]);
 if (! $result > 0)
 {
-	dolibarr_print_error($db,$ecmdir->error);
+	dol_print_error($db,$ecmdir->error);
 	exit;
 }
 $relativepath=$ecmdir->getRelativePath();
@@ -223,7 +223,7 @@ foreach($filearray as $key => $file)
 
 
 $head = ecm_prepare_head($ecmdir);
-dolibarr_fiche_head($head, 'card', $langs->trans("ECMSectionManual"));
+dol_fiche_head($head, 'card', $langs->trans("ECMSectionManual"));
 
 if ($_GET["action"] == 'edit')
 {
@@ -277,7 +277,7 @@ $userecm->fetch();
 print $userecm->getNomUrl(1);
 print '</td></tr>';
 print '<tr><td>'.$langs->trans("ECMCreationDate").'</td><td>';
-print dolibarr_print_date($ecmdir->date_c,'dayhour');
+print dol_print_date($ecmdir->date_c,'dayhour');
 print '</td></tr>';
 print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
 //print $conf->ecm->dir_output;
diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php
index 83d8bb30e1e..37ca1ed953d 100644
--- a/htdocs/ecm/docother.php
+++ b/htdocs/ecm/docother.php
@@ -97,7 +97,7 @@ print_fiche_titre($langs->trans("ECMAutoOrg"));
 //$head = societe_prepare_head($societe);
 
 
-//dolibarr_fiche_head($head, 'document', $societe->nom);
+//dol_fiche_head($head, 'document', $societe->nom);
 
 
 /*
diff --git a/htdocs/ecm/ecmdirectory.class.php b/htdocs/ecm/ecmdirectory.class.php
index ffa249dc617..8199b898619 100644
--- a/htdocs/ecm/ecmdirectory.class.php
+++ b/htdocs/ecm/ecmdirectory.class.php
@@ -111,7 +111,7 @@ class EcmDirectory // extends CommonObject
 		if ($pathfound)
 		{
 	        $this->error="ErrorDirAlreadyExists";
-	        dolibarr_syslog("EcmDirectories::create ".$this->error, LOG_WARNING);
+	        dol_syslog("EcmDirectories::create ".$this->error, LOG_WARNING);
 			return -1;			
 		}
 		else
@@ -135,7 +135,7 @@ class EcmDirectory // extends CommonObject
 			$sql.= " '".$this->fk_user_c."'";
 			$sql.= ")";
 	
-		   	dolibarr_syslog("EcmDirectories::create sql=".$sql, LOG_DEBUG);
+		   	dol_syslog("EcmDirectories::create sql=".$sql, LOG_DEBUG);
 	        $resql=$this->db->query($sql);
 	        if ($resql)
 	        {
@@ -165,7 +165,7 @@ class EcmDirectory // extends CommonObject
 	        else
 	        {
 	            $this->error="Error ".$this->db->lasterror();
-	            dolibarr_syslog("EcmDirectories::create ".$this->error, LOG_ERR);
+	            dol_syslog("EcmDirectories::create ".$this->error, LOG_ERR);
 	        	$this->db->rollback();
 	            return -1;
 	        }
@@ -202,13 +202,13 @@ class EcmDirectory // extends CommonObject
 		$sql.= " description='".addslashes($this->description)."'";
         $sql.= " WHERE rowid=".$this->id;
 
-        dolibarr_syslog("EcmDirectories::update sql=".$sql, LOG_DEBUG);
+        dol_syslog("EcmDirectories::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
         if (! $resql)
         {
             $error++;
         	$this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("EcmDirectories::update ".$this->error, LOG_ERR);
+            dol_syslog("EcmDirectories::update ".$this->error, LOG_ERR);
         }
 
 		if (! $error && ! $notrigger)
@@ -249,12 +249,12 @@ class EcmDirectory // extends CommonObject
 		$sql.= " cachenbofdoc = cachenbofdoc ".$sign." 1";
         $sql.= " WHERE rowid = ".$this->id;
 
-        dolibarr_syslog("EcmDirectories::changeNbOfFiles sql=".$sql, LOG_DEBUG);
+        dol_syslog("EcmDirectories::changeNbOfFiles sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
         if (! $resql)
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("EcmDirectories::changeNbOfFiles ".$this->error, LOG_ERR);
+            dol_syslog("EcmDirectories::changeNbOfFiles ".$this->error, LOG_ERR);
             return -1;
         }
 
@@ -282,7 +282,7 @@ class EcmDirectory // extends CommonObject
         $sql.= " FROM ".MAIN_DB_PREFIX."ecm_directories as t";
         $sql.= " WHERE t.rowid = ".$id;
     
-    	dolibarr_syslog("EcmDirectories::fetch sql=".$sql, LOG_DEBUG);
+    	dol_syslog("EcmDirectories::fetch sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -309,7 +309,7 @@ class EcmDirectory // extends CommonObject
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("EcmDirectories::fetch ".$this->error, LOG_ERR);
+            dol_syslog("EcmDirectories::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -327,12 +327,12 @@ class EcmDirectory // extends CommonObject
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_directories";
 		$sql.= " WHERE rowid=".$this->id;
 	
-	   	dolibarr_syslog("EcmDirectories::delete sql=".$sql);
+	   	dol_syslog("EcmDirectories::delete sql=".$sql);
 		$resql = $this->db->query($sql);
 		if (! $resql)
 		{
 			$this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("EcmDirectories::delete ".$this->error, LOG_ERR);
+            dol_syslog("EcmDirectories::delete ".$this->error, LOG_ERR);
 			return -1;
 		}
 	
@@ -446,7 +446,7 @@ class EcmDirectory // extends CommonObject
 		$sql.= " FROM ".MAIN_DB_PREFIX."ecm_directories";
 		$sql.= " WHERE fk_parent != 0";
 		
-		dolibarr_syslog("EcmDirectory::get_full_arbo sql=".$sql);
+		dol_syslog("EcmDirectory::get_full_arbo sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -458,7 +458,7 @@ class EcmDirectory // extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -505,7 +505,7 @@ class EcmDirectory // extends CommonObject
 		$sql.= " WHERE c.fk_user_c = u.rowid";
 		$sql.= " ORDER BY c.label, c.rowid";
 
-		dolibarr_syslog("EcmDirectory::get_full_arbo sql=".$sql);
+		dol_syslog("EcmDirectory::get_full_arbo sql=".$sql);
 		$resql = $this->db->query ($sql);
 		if ($resql)
 		{
@@ -542,7 +542,7 @@ class EcmDirectory // extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 		
@@ -617,7 +617,7 @@ class EcmDirectory // extends CommonObject
         $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET";
 		$sql.= " cachenbofdoc='".sizeof($filelist)."'";
         $sql.= " WHERE rowid=".$this->id;
-        dolibarr_syslog("EcmDirectories::refreshcachenboffile sql=".$sql, LOG_DEBUG);
+        dol_syslog("EcmDirectories::refreshcachenboffile sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
         if ($resql)
         {
@@ -627,7 +627,7 @@ class EcmDirectory // extends CommonObject
         else
         {
             $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("EcmDirectories::refreshcachenboffile ".$this->error, LOG_ERR);
+            dol_syslog("EcmDirectories::refreshcachenboffile ".$this->error, LOG_ERR);
             return -1;
         }
 	}	
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 5ac8949346a..8d68630228c 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -67,7 +67,7 @@ if (! empty($_REQUEST["section"]))
 	$result=$ecmdir->fetch($_REQUEST["section"]);
 	if (! $result > 0)
 	{
-		dolibarr_print_error($db,$ecmdir->error);
+		dol_print_error($db,$ecmdir->error);
 		exit;
 	}
 }
@@ -85,7 +85,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
 	$result=$ecmdir->fetch($_REQUEST["section"]);
 	if (! $result > 0)
 	{
-		dolibarr_print_error($db,$ecmdir->error);
+		dol_print_error($db,$ecmdir->error);
 		exit;
 	}
 	$relativepath=$ecmdir->getRelativePath();
@@ -133,7 +133,7 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
 	$result=$ecmdir->fetch($_REQUEST["section"]);
 	if (! $result > 0)
 	{
-		dolibarr_print_error($db,$ecmdir->error);
+		dol_print_error($db,$ecmdir->error);
 		exit;
 	}
 	$relativepath=$ecmdir->getRelativePath();
@@ -226,7 +226,7 @@ if ($mesg) { print $mesg."<br>"; }
 $selected='file_manager';
 if (eregi('search',$action)) $selected='search_form';
 $head = ecm_prepare_head_fm($fac);
-dolibarr_fiche_head($head, $selected, '', 1);
+dol_fiche_head($head, $selected, '', 1);
 
 
 print '<table class="border" width="100%"><tr><td width="40%" valign="top">';
@@ -563,7 +563,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
 			$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
 			$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
 			$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1).'<br>';
-			$htmltooltip.='<b>'.$langs->trans("ECMCreationDate").'</b>: '.dolibarr_print_date($val['date_c'],"dayhour").'<br>';
+			$htmltooltip.='<b>'.$langs->trans("ECMCreationDate").'</b>: '.dol_print_date($val['date_c'],"dayhour").'<br>';
 			$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
 			$htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.$val['cachenbofdoc'].'<br>';
 			if ($nbofsubdir) $htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir;
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index c40d5370af7..536e8308e67 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -62,7 +62,7 @@ print_fiche_titre($langs->trans("Search"));
 //$head = societe_prepare_head($societe);
 
 
-//dolibarr_fiche_head($head, 'document', $societe->nom);
+//dol_fiche_head($head, 'document', $societe->nom);
 
 
 
diff --git a/htdocs/energie/EnergieCompteur.class.php b/htdocs/energie/EnergieCompteur.class.php
index c81523b69c3..bcb94c6d6c0 100644
--- a/htdocs/energie/EnergieCompteur.class.php
+++ b/htdocs/energie/EnergieCompteur.class.php
@@ -81,7 +81,7 @@ class EnergieCompteur
       }
     else
       {
-	dolibarr_syslog("");
+	dol_syslog("");
 	return -1;
       }
   }
@@ -111,8 +111,8 @@ class EnergieCompteur
       }
     else
       {
-	dolibarr_syslog("EnergieCompteur::Create Erreur 1");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("EnergieCompteur::Create Erreur 1");
+	dol_syslog($this->db->error());
 	return -1;
       }
   }
@@ -140,8 +140,8 @@ class EnergieCompteur
       }
     else
       {
-	dolibarr_syslog("EnergieCompteur::AjoutReleve Erreur 1");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("EnergieCompteur::AjoutReleve Erreur 1");
+	dol_syslog($this->db->error());
 	return -1;
       }
   }
@@ -162,8 +162,8 @@ class EnergieCompteur
       }
     else
       {
-	dolibarr_syslog("EnergieCompteur::AjoutReleve Erreur 1");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("EnergieCompteur::AjoutReleve Erreur 1");
+	dol_syslog($this->db->error());
 	return -1;
       }
   }
@@ -185,8 +185,8 @@ class EnergieCompteur
       }
     else
       {
-	dolibarr_syslog("EnergieCompteur::AddGroup Erreur 1");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("EnergieCompteur::AddGroup Erreur 1");
+	dol_syslog($this->db->error());
 	return -1;
       }
   }
@@ -221,7 +221,7 @@ class EnergieCompteur
       }
     else
       {
-	dolibarr_syslog("");
+	dol_syslog("");
 	return -1;
       }
   }
diff --git a/htdocs/energie/EnergieGroupe.class.php b/htdocs/energie/EnergieGroupe.class.php
index b90c038924d..777c793c448 100644
--- a/htdocs/energie/EnergieGroupe.class.php
+++ b/htdocs/energie/EnergieGroupe.class.php
@@ -57,7 +57,7 @@ class EnergieGroupe
       }
     else
       {
-	dolibarr_syslog("EnergieGroupe::fetch Erreur");
+	dol_syslog("EnergieGroupe::fetch Erreur");
 	return -1;
       }
   }
@@ -86,8 +86,8 @@ class EnergieGroupe
       }
     else
       {
-	dolibarr_syslog("EnergieGroupe::Create Erreur 1");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("EnergieGroupe::Create Erreur 1");
+	dol_syslog($this->db->error());
 	return -1;
       }
   }
diff --git a/htdocs/energie/compteur.php b/htdocs/energie/compteur.php
index c69d2d1b2e0..0b01764a922 100644
--- a/htdocs/energie/compteur.php
+++ b/htdocs/energie/compteur.php
@@ -86,7 +86,7 @@ if ($_GET["action"] == 'create')
   $h++;
   $a = 0;
 
-  dolibarr_fiche_head($head, $a, $soc->nom);
+  dol_fiche_head($head, $a, $soc->nom);
 
   $html = new Form($db);
   $compteur = new EnergieCompteur($db, $user);
@@ -143,7 +143,7 @@ else
 	  $head[$h][1] = "Groupe";
 	  $h++;
 
-	  dolibarr_fiche_head($head, $a, $soc->nom);
+	  dol_fiche_head($head, $a, $soc->nom);
 	  
 	  
 	  print '<table class="border" width="100%">';
@@ -197,7 +197,7 @@ else
 		  $obj = $db->fetch_object($resql);
 		  $var=!$var;
 		  print "<tr $bc[$var]><td>";
-		  print dolibarr_print_date($obj->date_releve,'%a %d %B %Y');
+		  print dol_print_date($obj->date_releve,'%a %d %B %Y');
 		  print '</td><td>'.$obj->valeur.'</td>';
 
 		  $i++;
diff --git a/htdocs/energie/compteur_graph.php b/htdocs/energie/compteur_graph.php
index a137c1f531f..46f6fabc15d 100644
--- a/htdocs/energie/compteur_graph.php
+++ b/htdocs/energie/compteur_graph.php
@@ -51,7 +51,7 @@ if ($_GET["id"] > 0)
       $head[$h][1] = "Groupe";
       $h++;
       
-      dolibarr_fiche_head($head, $a, $soc->nom);	  
+      dol_fiche_head($head, $a, $soc->nom);	  
       
       print '<table class="border" width="100%">';
       print "<tr><td>".$langs->trans("Compteur")."</td>";
diff --git a/htdocs/energie/compteur_groupe.php b/htdocs/energie/compteur_groupe.php
index 0ee20bd664b..78b708fdcbc 100644
--- a/htdocs/energie/compteur_groupe.php
+++ b/htdocs/energie/compteur_groupe.php
@@ -70,7 +70,7 @@ if ($_GET["id"] > 0)
       $a = $h;
       $h++;
       
-      dolibarr_fiche_head($head, $a, $soc->nom);
+      dol_fiche_head($head, $a, $soc->nom);
       
       
       print '<table class="border" width="100%">';
diff --git a/htdocs/energie/graph.php b/htdocs/energie/graph.php
index 36e4c805bc9..750d333a110 100644
--- a/htdocs/energie/graph.php
+++ b/htdocs/energie/graph.php
@@ -87,7 +87,7 @@ $as["week"] = 1;
 $as["month"] = 2;
 $as["year"] = 3;
 
-dolibarr_fiche_head($head, $as[$period], $soc->nom);	  
+dol_fiche_head($head, $as[$period], $soc->nom);	  
 
 print '<table class="noborder" width="100%">';
 
diff --git a/htdocs/energie/groupe.php b/htdocs/energie/groupe.php
index 3d1bf861baa..620f570332f 100644
--- a/htdocs/energie/groupe.php
+++ b/htdocs/energie/groupe.php
@@ -66,7 +66,7 @@ if ($_GET["action"] == 'create')
   $h++;
   $a = 0;
 
-  dolibarr_fiche_head($head, $a, $soc->nom);
+  dol_fiche_head($head, $a, $soc->nom);
 
   $html = new Form($db);
 
@@ -104,7 +104,7 @@ else
 	  $h++;
 	  $a = 0;
 
-	  dolibarr_fiche_head($head, $a, $soc->nom);
+	  dol_fiche_head($head, $a, $soc->nom);
 	  	  
 	  print '<table class="border" width="100%">';
 	  print "<tr><td>".$langs->trans("Groupe")."</td>";
diff --git a/htdocs/energie/releve.php b/htdocs/energie/releve.php
index 4e0b1404af4..c2f17fdc9e8 100644
--- a/htdocs/energie/releve.php
+++ b/htdocs/energie/releve.php
@@ -74,7 +74,7 @@ if ($_GET["id"] > 0)
       $head[$h][1] = "Groupe";
       $h++;
       
-      dolibarr_fiche_head($head, $a, $soc->nom);
+      dol_fiche_head($head, $a, $soc->nom);
       
       print '<table class="border" width="100%">';
       print "<tr><td>".$langs->trans("Compteur")."</td>";
@@ -113,7 +113,7 @@ if ($_GET["id"] > 0)
 	      $obj = $db->fetch_object($resql);
 	      $var=!$var;
 	      print "<tr $bc[$var]><td>";
-	      print dolibarr_print_date($obj->date_releve,'%a %d %B %Y');
+	      print dol_print_date($obj->date_releve,'%a %d %B %Y');
 	      print '</td><td>'.$obj->valeur.'</td>';
 	      print '<td><a href="releve.php?id='.$compteur->id.'&amp;action=delete&amp;rowid='.$obj->rowid.'&amp;page='.$page.'">';
 	      print img_delete().'</a></td></tr>';
diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php
index f9aa6871123..84bbfae8735 100644
--- a/htdocs/expedition/commande.php
+++ b/htdocs/expedition/commande.php
@@ -76,7 +76,7 @@ if ($_POST['action'] == 'set_ref_client' && $user->rights->commande->creer)
 if ($_POST['action'] == 'setdate_livraison' && $user->rights->commande->creer)
 {
 	//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
-	$datelivraison=dolibarr_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
+	$datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
 
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
@@ -99,7 +99,7 @@ if ($_POST['action'] == 'setmode' && $user->rights->commande->creer)
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
 	$result=$commande->mode_reglement($_POST['mode_reglement_id']);
-	if ($result < 0) dolibarr_print_error($db,$commande->error);
+	if ($result < 0) dol_print_error($db,$commande->error);
 }
 
 if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
@@ -107,7 +107,7 @@ if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
 	$commande = new Commande($db);
 	$commande->fetch($_GET['id']);
 	$result=$commande->cond_reglement($_POST['cond_reglement_id']);
-	if ($result < 0) dolibarr_print_error($db,$commande->error);
+	if ($result < 0) dol_print_error($db,$commande->error);
 }
 
 
@@ -140,7 +140,7 @@ if ($id > 0 || ! empty($ref))
 		$author->fetch();
 
 		$head = commande_prepare_head($commande);
-		dolibarr_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"));
+		dol_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"));
 
 		/*
 		 * Confirmation de la validation
@@ -223,7 +223,7 @@ if ($id > 0 || ! empty($ref))
 
 		// Date
 		print '<tr><td>'.$langs->trans('Date').'</td>';
-		print '<td colspan="2">'.dolibarr_print_date($commande->date,'daytext').'</td>';
+		print '<td colspan="2">'.dol_print_date($commande->date,'daytext').'</td>';
 		print '<td width="50%">'.$langs->trans('Source').' : '.$commande->getLabelSource();
 		if ($commande->source == 0)
 		{
@@ -254,7 +254,7 @@ if ($id > 0 || ! empty($ref))
 		}
 		else
 		{
-			print dolibarr_print_date($commande->date_livraison,'daytext');
+			print dol_print_date($commande->date_livraison,'daytext');
 		}
 		print '</td>';
 		print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('NotePublic').' :<br>';
@@ -381,7 +381,7 @@ if ($id > 0 || ! empty($ref))
 		$sql.= " ORDER BY cd.rowid";
 
 		//print $sql;
-		dolibarr_syslog("commande.php sql=".$sql, LOG_DEBUG);
+		dol_syslog("commande.php sql=".$sql, LOG_DEBUG);
 		$resql = $db->query($sql);
 		if ($resql)
 		{
@@ -499,7 +499,7 @@ if ($id > 0 || ! empty($ref))
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print '</div>';
diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php
index 48e19878fbe..64f47b4333c 100644
--- a/htdocs/expedition/expedition.class.php
+++ b/htdocs/expedition/expedition.class.php
@@ -234,7 +234,7 @@ class Expedition extends CommonObject
 		if ($conf->livraison_bon->enabled) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON e.rowid = l.fk_expedition";
 		$sql.= " WHERE e.rowid = ".$id;
 
-		dolibarr_syslog("Expedition::fetch sql=".$sql);
+		dol_syslog("Expedition::fetch sql=".$sql);
 		$result = $this->db->query($sql) ;
 		if ($result)
 		{
@@ -300,14 +300,14 @@ class Expedition extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog('Expedition::Fetch Error rowid='.$rowid.' numrows=0 sql='.$sql);
+				dol_syslog('Expedition::Fetch Error rowid='.$rowid.' numrows=0 sql='.$sql);
 				$this->error='Delivery with id '.$rowid.' not found sql='.$sql;
 				return -2;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('Expedition::Fetch Error rowid='.$rowid.' Erreur dans fetch de l\'expedition');
+			dol_syslog('Expedition::Fetch Error rowid='.$rowid.' Erreur dans fetch de l\'expedition');
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -324,7 +324,7 @@ class Expedition extends CommonObject
 
 		require_once DOL_DOCUMENT_ROOT ."/product/stock/mouvementstock.class.php";
 
-		dolibarr_syslog("Expedition::valid");
+		dol_syslog("Expedition::valid");
 
 		$this->db->begin();
 
@@ -344,7 +344,7 @@ class Expedition extends CommonObject
 	  	$num = $this->db->num_rows($resql);
 	  	if ($num > 0)
 	  	{
-	  		dolibarr_syslog("Expedition::valid already validated", LOG_WARNING);
+	  		dol_syslog("Expedition::valid already validated", LOG_WARNING);
 	  		$this->db->rollback();
 	  		return 0;
 	  	}
@@ -354,7 +354,7 @@ class Expedition extends CommonObject
 	  $sql.= " SET ref='".$this->ref."', fk_statut = 1, date_valid = ".$this->db->idate(mktime()).", fk_user_valid = ".$user->id;
 	  $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
 
-	  dolibarr_syslog("Expedition::valid update expedition sql=".$sql);
+	  dol_syslog("Expedition::valid update expedition sql=".$sql);
 	  $resql=$this->db->query($sql);
 	  if ($resql)
 	  {
@@ -368,7 +368,7 @@ class Expedition extends CommonObject
 	  		$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."expeditiondet as ed";
 	  		$sql.= " WHERE ed.fk_expedition = $this->id AND cd.rowid = ed.fk_origin_line";
 
-	  		dolibarr_syslog("Expedition::valid select details sql=".$sql);
+	  		dol_syslog("Expedition::valid select details sql=".$sql);
 	  		$resql=$this->db->query($sql);
 	  		if ($resql)
 	  		{
@@ -376,7 +376,7 @@ class Expedition extends CommonObject
 		    $i=0;
 		    while($i < $num)
 		    {
-		    	dolibarr_syslog("Expedition::valid movment nb ".$i);
+		    	dol_syslog("Expedition::valid movment nb ".$i);
 
 		    	$obj = $this->db->fetch_object($resql);
 
@@ -386,7 +386,7 @@ class Expedition extends CommonObject
 		    	{
 		    		$this->db->rollback();
 		    		$this->error=$this->db->error()." - sql=$sql";
-		    		dolibarr_syslog("Expedition::valid ".$this->error);
+		    		dol_syslog("Expedition::valid ".$this->error);
 		    		return -3;
 		    	}
 
@@ -398,7 +398,7 @@ class Expedition extends CommonObject
 	  		{
 		    $this->db->rollback();
 		    $this->error=$this->db->error()." - sql=$sql";
-		    dolibarr_syslog("Expedition::valid ".$this->error);
+		    dol_syslog("Expedition::valid ".$this->error);
 		    return -2;
 	  		}
 	  	}
@@ -430,7 +430,7 @@ class Expedition extends CommonObject
 	  {
 	  	$this->db->rollback();
 	  	$this->error=$this->db->error();
-	  	dolibarr_syslog("Expedition::valid ".$this->error);
+	  	dol_syslog("Expedition::valid ".$this->error);
 	  	return -1;
 	  }
 		}
@@ -438,12 +438,12 @@ class Expedition extends CommonObject
 		{
 			$this->db->rollback();
 			$this->error="Non autorise";
-			dolibarr_syslog("Expedition::valid ".$this->error);
+			dol_syslog("Expedition::valid ".$this->error);
 			return -1;
 		}
 
 		$this->db->commit();
-		//dolibarr_syslog("Expedition::valid commit");
+		//dol_syslog("Expedition::valid commit");
 		return 1;
 	}
 
@@ -633,7 +633,7 @@ class Expedition extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog('Expedition::fetch_lines: Error '.$this->error);
+			dol_syslog('Expedition::fetch_lines: Error '.$this->error);
 			return -3;
 		}
 	}
@@ -687,7 +687,7 @@ class Expedition extends CommonObject
 	{
 		global $user,$langs;
 
-		dolibarr_syslog("Expedition::initAsSpecimen");
+		dol_syslog("Expedition::initAsSpecimen");
 
 		// Charge tableau des id de soci�t� socids
 		$socids = array();
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index e4c4a3bfdb8..099b380ab99 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -184,7 +184,7 @@ if ($_REQUEST['action'] == 'builddoc')	// En get ou en post
 	$result=expedition_pdf_create($db,$expedition->id,$expedition->modelpdf,$outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 }
@@ -279,7 +279,7 @@ if ($_GET["action"] == 'create')
 
 			// Date
 			print "<tr><td>".$langs->trans("Date")."</td>";
-			print '<td colspan="3">'.dolibarr_print_date($object->date,"day")."</td></tr>\n";
+			print '<td colspan="3">'.dol_print_date($object->date,"day")."</td></tr>\n";
 
 			// Warehouse (id forced)
 			if ($conf->stock->enabled && $_GET["entrepot_id"])
@@ -495,7 +495,7 @@ if ($_GET["action"] == 'create')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 }
@@ -512,7 +512,7 @@ else
 		$result = $expedition->fetch($_GET["id"]);
 		if ($result < 0)
 		{
-			dolibarr_print_error($db,$expedition->error);
+			dol_print_error($db,$expedition->error);
 			exit -1;
 		}
 		$lignes = $expedition->lignes;
@@ -544,7 +544,7 @@ else
 				$h++;
 			}
 
-			dolibarr_fiche_head($head, $hselected, $langs->trans("Sending"));
+			dol_fiche_head($head, $hselected, $langs->trans("Sending"));
 
 			if ($mesg) print $mesg;
 
@@ -633,7 +633,7 @@ else
 
 			// Date
 			print '<tr><td>'.$langs->trans("Date").'</td>';
-			print '<td colspan="3">'.dolibarr_print_date($expedition->date,"daytext")."</td>\n";
+			print '<td colspan="3">'.dol_print_date($expedition->date,"daytext")."</td>\n";
 			print '</tr>';
 
 			// Weight
diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php
index 1e876b92a79..328ed3b1a71 100644
--- a/htdocs/expedition/index.php
+++ b/htdocs/expedition/index.php
@@ -128,7 +128,7 @@ if ( $db->query($sql) )
 	  print "<tr $bc[$var]>";
 	  print '<td nowrap="nowrap">';
 	  print "<a href=\"commande.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>';
-	  print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.dolibarr_trunc($obj->nom,20).'</a></td></tr>';
+	  print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.dol_trunc($obj->nom,20).'</a></td></tr>';
 	  $i++;
 	}
       print "</table><br>";
diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php
index 6ad91371779..ae151ae28f8 100644
--- a/htdocs/expedition/liste.php
+++ b/htdocs/expedition/liste.php
@@ -149,10 +149,10 @@ if ($resql)
     }
     
     print "<td align=\"right\">";
-    $y = dolibarr_print_date($objp->date_expedition,"%Y");
-    $m = dolibarr_print_date($objp->date_expedition,"%m");
-    $mt = dolibarr_print_date($objp->date_expedition,"%b");
-    $d = dolibarr_print_date($objp->date_expedition,"%d");
+    $y = dol_print_date($objp->date_expedition,"%Y");
+    $m = dol_print_date($objp->date_expedition,"%m");
+    $mt = dol_print_date($objp->date_expedition,"%b");
+    $d = dol_print_date($objp->date_expedition,"%d");
     print $d."\n";
     print " <a href=\"propal.php?year=$y&amp;month=$m\">";
     print $b."</a>\n";
@@ -170,7 +170,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/expedition/stats/expeditionstats.class.php b/htdocs/expedition/stats/expeditionstats.class.php
index 47a0fbbe138..d9f10a7b76a 100644
--- a/htdocs/expedition/stats/expeditionstats.class.php
+++ b/htdocs/expedition/stats/expeditionstats.class.php
@@ -85,7 +85,7 @@ class ExpeditionStats
     
     for ($i = 1 ; $i < 13 ; $i++)
       {
-	$data[$i-1] = array(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"), $res[$i]);
+	$data[$i-1] = array(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"), $res[$i]);
       }
 
     return $data;
@@ -101,7 +101,7 @@ class ExpeditionStats
 
     for ($i = 1 ; $i < 13 ; $i++)
       {
-	$data[$i-1] = array(dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b"), 
+	$data[$i-1] = array(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"), 
 			    $data1[$i][1],
 			    $data2[$i][1]);
       }
diff --git a/htdocs/exports/export.class.php b/htdocs/exports/export.class.php
index 3bd0d087680..ad8e98d40f0 100644
--- a/htdocs/exports/export.class.php
+++ b/htdocs/exports/export.class.php
@@ -67,7 +67,7 @@ class Export
     {
         global $langs,$conf;
         
-        dolibarr_syslog("Export::load_arrays user=".$user->id." filter=".$filter);
+        dol_syslog("Export::load_arrays user=".$user->id." filter=".$filter);
 
         $dir=DOL_DOCUMENT_ROOT."/includes/modules";
         $handle=opendir($dir);
@@ -151,7 +151,7 @@ class Export
 	                            $this->array_export_sql_end[$i]=$module->export_sql_end[$r];
 	                            //$this->array_export_sql[$i]=$module->export_sql[$r];
 	
-	                            dolibarr_syslog("Export loaded for module ".$modulename." with index ".$i.", dataset=".$module->export_code[$r].", nb of fields=".sizeof($module->export_fields_code[$r]));
+	                            dol_syslog("Export loaded for module ".$modulename." with index ".$i.", dataset=".$module->export_code[$r].", nb of fields=".sizeof($module->export_fields_code[$r]));
 	                            $i++;
 //	                        }
 	                    }            
@@ -178,7 +178,7 @@ class Export
         $indice=0;
         asort($array_selected);
         
-        dolibarr_syslog("Export::build_file $model, $datatoexport, $array_selected");
+        dol_syslog("Export::build_file $model, $datatoexport, $array_selected");
         
         // Creation de la classe d'export du model ExportXXX
         $dir = DOL_DOCUMENT_ROOT . "/includes/modules/export/";
@@ -204,7 +204,7 @@ class Export
         $sql.=$this->array_export_sql_end[$indice];
 	
 		// Run the sql
-		dolibarr_syslog("Export::build_file sql=".$sql);
+		dol_syslog("Export::build_file sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -265,14 +265,14 @@ class Export
 			else
 			{
 	            $this->error=$objmodel->error;
-	            dolibarr_syslog("Error: ".$this->error);
+	            dol_syslog("Error: ".$this->error);
 	            return -1;
 			}
         }
         else
         {
             $this->error=$this->db->error()." - sql=".$sql;
-            dolibarr_syslog("Error: ".$this->error);
+            dol_syslog("Error: ".$this->error);
             return -1;
         }
     }
@@ -285,7 +285,7 @@ class Export
 	{
 		global $conf;
 		
-		dolibarr_syslog("Export.class.php::create");
+		dol_syslog("Export.class.php::create");
 		
 		$this->db->begin();
 		
@@ -293,7 +293,7 @@ class Export
 		$sql.= 'label, type, field)';
 		$sql.= " VALUES ('".$this->model_name."', '".$this->datatoexport."', '".$this->hexa."')";
 		
-		dolibarr_syslog("Export::create sql=".$sql, LOG_DEBUG);
+		dol_syslog("Export::create sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -304,7 +304,7 @@ class Export
 		{
 			$this->error=$this->db->lasterror();
 			$this->errno=$this->db->lasterrno();
-			dolibarr_syslog("Export::create error ".$this->error, LOG_ERR);
+			dol_syslog("Export::create error ".$this->error, LOG_ERR);
 			$this->db->rollback();
 			return -1;
 		}
@@ -320,7 +320,7 @@ class Export
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em';
 		$sql.= ' WHERE em.rowid = '.$id;
 		
-		dolibarr_syslog("Export::fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("Export::fetch sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql) ;
 		if ($result)
 		{
@@ -342,7 +342,7 @@ class Export
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -3;
 		}
 	}
@@ -364,7 +364,7 @@ class Export
 	
 		$this->db->begin();
 		
-		dolibarr_syslog(get_class($this)."::delete sql=".$sql);
+		dol_syslog(get_class($this)."::delete sql=".$sql);
 		$resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
 		
@@ -389,7 +389,7 @@ class Export
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index cca355119a8..e01253312e6 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -264,7 +264,7 @@ if ($step == 1 || ! $datatoexport)
     $h++;
     */
     
-    dolibarr_fiche_head($head, $hselected, $langs->trans("NewExport"));
+    dol_fiche_head($head, $hselected, $langs->trans("NewExport"));
 
 
     print '<table class="notopnoleftnoright" width="100%">';
@@ -336,7 +336,7 @@ if ($step == 2 && $datatoexport)
     $hselected=$h;
     $h++;
     
-    dolibarr_fiche_head($head, $hselected, $langs->trans("NewExport"));
+    dol_fiche_head($head, $hselected, $langs->trans("NewExport"));
 
     print '<table width="100%" class="border">';
 
@@ -479,7 +479,7 @@ if ($step == 3 && $datatoexport)
     $hselected=$h;
     $h++;
     
-    dolibarr_fiche_head($head, $hselected, $langs->trans("NewExport"));
+    dol_fiche_head($head, $hselected, $langs->trans("NewExport"));
 
     print '<table width="100%" class="border">';
 
@@ -619,7 +619,7 @@ if ($step == 3 && $datatoexport)
 			}
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		        
         print '</table>';
@@ -656,7 +656,7 @@ if ($step == 4 && $datatoexport)
     $hselected=$h;
     $h++;
     
-    dolibarr_fiche_head($head, $hselected, $langs->trans("NewExport"));
+    dol_fiche_head($head, $hselected, $langs->trans("NewExport"));
 
     print '<table width="100%" class="border">';
 
diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php
index ce8871479d4..a1e8a913561 100644
--- a/htdocs/facture.class.php
+++ b/htdocs/facture.class.php
@@ -894,7 +894,7 @@ class Facture extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -1048,7 +1048,7 @@ class Facture extends CommonObject
 				$mois += 1;
 			}
 			// On se d�place au d�but du mois suivant, et on retire un jour
-			$datelim=dolibarr_mktime(12,0,0,$mois,1,$annee);
+			$datelim=dol_mktime(12,0,0,$mois,1,$annee);
 			$datelim -= (3600 * 24);
 		}
 
@@ -1294,7 +1294,7 @@ class Facture extends CommonObject
 			else
 			{
 				dol_syslog("Facture::set_valid() Echec update - 10 - sql=".$sql, LOG_DEBUG);
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				$error++;
 			}
 
@@ -1910,7 +1910,7 @@ class Facture extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $idarray;
 	}
@@ -2129,7 +2129,7 @@ class Facture extends CommonObject
 	  }
 	  else
 	  {
-	  	dolibarr_print_error($db,"Facture::getNextNumRef ".$obj->error);
+	  	dol_print_error($db,"Facture::getNextNumRef ".$obj->error);
 	  	return "";
 	  }
 		}
@@ -2178,7 +2178,7 @@ class Facture extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -2559,7 +2559,7 @@ class Facture extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -2694,7 +2694,7 @@ class Facture extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -2817,7 +2817,7 @@ class FactureLigne
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -2855,7 +2855,7 @@ class FactureLigne
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				$this->db->rollback();
 				return -1;
 			}
diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php
index a39e8daddfe..d6743452a29 100644
--- a/htdocs/fichinter/apercu.php
+++ b/htdocs/fichinter/apercu.php
@@ -73,7 +73,7 @@ if ($_GET["id"] > 0) {
 
 
 		$head = fichinter_prepare_head($fichinter);
-    dolibarr_fiche_head($head, 'preview', $langs->trans("InterventionCard"));
+    dol_fiche_head($head, 'preview', $langs->trans("InterventionCard"));
 
 
 		/*
@@ -135,7 +135,7 @@ if ($_GET["id"] > 0) {
 
 					print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepath).'">'.$fichinter->ref.'.pdf</a></td>';
 					print '<td align="right">'.filesize($file). ' bytes</td>';
-					print '<td align="right">'.dolibarr_print_date(filemtime($file),'dayhour').'</td>';
+					print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>';
 					print '</tr>';
 
 					// Si fichier detail PDF existe
@@ -144,7 +144,7 @@ if ($_GET["id"] > 0) {
 
 						print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepathdetail).'">'.$fichinter->ref.'-detail.pdf</a></td>';
 						print '<td align="right">'.filesize($filedetail). ' bytes</td>';
-						print '<td align="right">'.dolibarr_print_date(filemtime($filedetail),'dayhour').'</td>';
+						print '<td align="right">'.dol_print_date(filemtime($filedetail),'dayhour').'</td>';
 						print '</tr>';
 					}
 					print "</table>\n";
@@ -194,13 +194,13 @@ if ($_GET["id"] > 0) {
 
 		        // Date
 		        print '<tr><td>'.$langs->trans("Date").'</td>';
-		        print "<td colspan=\"2\">".dolibarr_print_date($fichinter->date,"daytext")."</td>\n";
+		        print "<td colspan=\"2\">".dol_print_date($fichinter->date,"daytext")."</td>\n";
 		        print '</tr>';
 
 				print '</table>';
 			}
 		} else {
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	} else {
 	// Intervention non trouv�e
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index 0974b118e40..f147a1fad11 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -91,12 +91,12 @@ if ($_POST["action"] == 'updateligne' && $user->rights->ficheinter->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -116,12 +116,12 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->ficheinter->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -138,7 +138,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->ficheinter->creer)
 		exit;
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -172,7 +172,7 @@ if ($id > 0)
 
 
 		$head = fichinter_prepare_head($fichinter);
-		dolibarr_fiche_head($head, 'contact', $langs->trans("InterventionCard"));
+		dol_fiche_head($head, 'contact', $langs->trans("InterventionCard"));
 
 
 		/*
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index abd8f44c6fb..61ddac78a59 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -125,7 +125,7 @@ if ($object->id)
 
 	$head=fichinter_prepare_head($object, $user);
 
-	dolibarr_fiche_head($head, 'documents',  $langs->trans("InterventionCard"));
+	dol_fiche_head($head, 'documents',  $langs->trans("InterventionCard"));
 
 
 	// Construit liste des fichiers
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index 07b0d72f72d..11ffc58d448 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -185,7 +185,7 @@ if ($_REQUEST['action'] == 'builddoc')	// En get ou en post
 	$result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 }
@@ -196,7 +196,7 @@ if ($_POST['action'] == 'classin')
 	$fichinter = new Fichinter($db);
 	$fichinter->fetch($_GET['id']);
 	$result=$fichinter->set_project($user, $_POST['projetidp']);
-	if ($result < 0) dolibarr_print_error($db,$fichinter->error);
+	if ($result < 0) dol_print_error($db,$fichinter->error);
 }
 
 if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes')
@@ -216,7 +216,7 @@ if ($_POST['action'] == 'setdescription')
 	$fichinter = new Fichinter($db);
 	$fichinter->fetch($_GET['id']);
 	$result=$fichinter->set_description($user,$_POST['description']);
-	if ($result < 0) dolibarr_print_error($db,$fichinter->error);
+	if ($result < 0) dol_print_error($db,$fichinter->error);
 }
 
 
@@ -232,7 +232,7 @@ if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer)
 		$ret=$fichinter->fetch($_POST['fichinterid']);
 
 		$desc=$_POST['np_desc'];
-		$date_intervention = dolibarr_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
+		$date_intervention = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
 		$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
 
 		$fichinter->addline(
@@ -260,17 +260,17 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P
 	$fichinterline = new FichinterLigne($db);
 	if ($fichinterline->fetch($_POST['ligne']) <= 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		exit;
 	}
 	$fichinter = new Fichinter($db);
 	if ($fichinter->fetch($fichinterline->fk_fichinter) <= 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		exit;
 	}
 	$desc=$_POST['desc'];
-	$date_intervention = dolibarr_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
+	$date_intervention = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
 	$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
 
 	$fichinterline->datei=$date_intervention;
@@ -296,14 +296,14 @@ if ($_GET['action'] == 'deleteline' && $user->rights->ficheinter->creer && !$con
 	$fichinterline = new FichinterLigne($db);
 	if ($fichinterline->fetch($_GET['ligne']) <= 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		exit;
 	}
 	$result=$fichinterline->delete_line();
 	$fichinter = new Fichinter($db);
 	if ($fichinter->fetch($fichinterline->fk_fichinter) <= 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		exit;
 	}
 
@@ -326,14 +326,14 @@ if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes'
 		$fichinterline = new FichinterLigne($db);
 		if ($fichinterline->fetch($_GET['ligne']) <= 0)
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			exit;
 		}
 		$result=$fichinterline->delete_line();
 		$fichinter = new Fichinter($db);
 		if ($fichinter->fetch($fichinterline->fk_fichinter) <= 0)
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			exit;
 		}
 
@@ -416,7 +416,7 @@ if ($_GET["action"] == 'create')
 
 	if (! $conf->global->FICHEINTER_ADDON)
 	{
-		dolibarr_print_error($db,$langs->trans("Error")." ".$langs->trans("Error_FICHEINTER_ADDON_NotDefined"));
+		dol_print_error($db,$langs->trans("Error")." ".$langs->trans("Error_FICHEINTER_ADDON_NotDefined"));
 		exit;
 	}
 
@@ -518,7 +518,7 @@ elseif ($_GET["id"] > 0)
 	$result=$fichinter->fetch($_GET["id"]);
 	if (! $result > 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		exit;
 	}
 	$fichinter->fetch_client();
@@ -527,7 +527,7 @@ elseif ($_GET["id"] > 0)
 
 	$head = fichinter_prepare_head($fichinter);
 
-	dolibarr_fiche_head($head, 'card', $langs->trans("InterventionCard"));
+	dol_fiche_head($head, 'card', $langs->trans("InterventionCard"));
 
 	// Confirmation de la suppression de la fiche d'intervention
 	if ($_GET['action'] == 'delete')
@@ -694,7 +694,7 @@ elseif ($_GET["id"] > 0)
 				print nl2br($objp->description);
 
 				// Date
-				print '<td align="center" width="150">'.dolibarr_print_date($objp->date_intervention,'dayhour').'</td>';
+				print '<td align="center" width="150">'.dol_print_date($objp->date_intervention,'dayhour').'</td>';
 
 				// Duration
 				print '<td align="right" width="150">'.ConvertSecondToTime($objp->duree).'</td>';
@@ -845,7 +845,7 @@ elseif ($_GET["id"] > 0)
 			// Date intervention
 			print '<td align="center" nowrap="nowrap">';
 			$timearray=dol_getdate(mktime());
-			$timewithnohour=dolibarr_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
+			$timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
 			$html->select_date($timewithnohour,'di',1,1,0,"addinter");
 			print '</td>';
 
@@ -866,7 +866,7 @@ elseif ($_GET["id"] > 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	print '</div>';
diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php
index 3e0c53460e2..5822aaa8f7c 100644
--- a/htdocs/fichinter/fichinter.class.php
+++ b/htdocs/fichinter/fichinter.class.php
@@ -87,13 +87,13 @@ class Fichinter extends CommonObject
 	 */
 	function create()
 	{
-		dolibarr_syslog("Fichinter.class::create ref=".$this->ref);
+		dol_syslog("Fichinter.class::create ref=".$this->ref);
 
 		if (! is_numeric($this->duree)) { $this->duree = 0; }
 		if ($this->socid <= 0)
 		{
 			$this->error='ErrorBadParameterForFunc';
-			dolibarr_syslog("Fichinter::create ".$this->error,LOG_ERR);
+			dol_syslog("Fichinter::create ".$this->error,LOG_ERR);
 			return -1;
 		}
 
@@ -114,7 +114,7 @@ class Fichinter extends CommonObject
 		$sql.= ")";
 		$sqlok = 0;
 
-		dolibarr_syslog("Fichinter::create sql=".$sql);
+		dol_syslog("Fichinter::create sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -125,7 +125,7 @@ class Fichinter extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Fichinter::create ".$this->error,LOG_ERR);
+			dol_syslog("Fichinter::create ".$this->error,LOG_ERR);
 			$this->db->rollback();
 			return -1;
 		}
@@ -153,11 +153,11 @@ class Fichinter extends CommonObject
 		$sql .= ", fk_projet = ".$this->projet_id;
 		$sql .= " WHERE rowid = ".$id;
 
-		dolibarr_syslog("Fichinter::update sql=".$sql);
+		dol_syslog("Fichinter::update sql=".$sql);
 		if (! $this->db->query($sql))
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Fichinter::update error ".$this->error,LOG_ERR);
+			dol_syslog("Fichinter::update error ".$this->error,LOG_ERR);
 			return -1;
 		}
 
@@ -179,7 +179,7 @@ class Fichinter extends CommonObject
 		$sql.= " FROM ".MAIN_DB_PREFIX."fichinter";
 		$sql.= " WHERE rowid=".$rowid;
 
-		dolibarr_syslog("Fichinter::fetch sql=".$sql);
+		dol_syslog("Fichinter::fetch sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -210,7 +210,7 @@ class Fichinter extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Fichinter::update error ".$this->error,LOG_ERR);
+			dol_syslog("Fichinter::update error ".$this->error,LOG_ERR);
 			return -1;
 		}
 	}
@@ -231,7 +231,7 @@ class Fichinter extends CommonObject
 			$sql.= " SET fk_statut = 0";
 			$sql.= " WHERE rowid = ".$this->id;
 	
-			dolibarr_syslog("Fichinter::setDraft sql=".$sql);
+			dol_syslog("Fichinter::setDraft sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -242,7 +242,7 @@ class Fichinter extends CommonObject
 			{
 				$this->db->rollback();
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("Fichinter::setDraft ".$this->error,LOG_ERR);
+				dol_syslog("Fichinter::setDraft ".$this->error,LOG_ERR);
 				return -1;
 			}
 		}		
@@ -265,7 +265,7 @@ class Fichinter extends CommonObject
 			$sql.= " SET fk_statut = 1, date_valid=".$this->db->idate(mktime()).", fk_user_valid=".$user->id;
 			$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
 	
-			dolibarr_syslog("Fichinter::setValid sql=".$sql);
+			dol_syslog("Fichinter::setValid sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -285,7 +285,7 @@ class Fichinter extends CommonObject
 				{
 					$this->db->rollback();
 					$this->error=join(',',$this->errors);
-					dolibarr_syslog("Fichinter::setValid ".$this->error,LOG_ERR);
+					dol_syslog("Fichinter::setValid ".$this->error,LOG_ERR);
 					return -1;
 				}
 			}
@@ -293,7 +293,7 @@ class Fichinter extends CommonObject
 			{
 				$this->db->rollback();
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("Fichinter::setValid ".$this->error,LOG_ERR);
+				dol_syslog("Fichinter::setValid ".$this->error,LOG_ERR);
 				return -1;
 			}
 		}
@@ -398,7 +398,7 @@ class Fichinter extends CommonObject
 			}
 			else
 			{
-				dolibarr_print_error($db,"Fichinter::getNextNumRef ".$obj->error);
+				dol_print_error($db,"Fichinter::getNextNumRef ".$obj->error);
 				return "";
 			}
 		}
@@ -449,7 +449,7 @@ class Fichinter extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -465,7 +465,7 @@ class Fichinter extends CommonObject
 			$sql.= ' SET fk_projet = '.($project_id <= 0?'NULL':$project_id);
 			$sql.= ' WHERE rowid = '.$this->id;
 
-			dolibarr_syslog("Fichinter::set_project sql=".$sql);
+			dol_syslog("Fichinter::set_project sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -474,12 +474,12 @@ class Fichinter extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Fichinter::set_project Error ".$this->error);
+				dol_syslog("Fichinter::set_project Error ".$this->error);
 			}
 		}
 		else
 		{
-			dolibarr_syslog("Fichinter::set_project Error Permission refused");
+			dol_syslog("Fichinter::set_project Error Permission refused");
 		}
 	}
 
@@ -494,11 +494,11 @@ class Fichinter extends CommonObject
 		$this->db->begin();
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE fk_fichinter = ".$this->id;
-		dolibarr_syslog("Fichinter::delete sql=".$sql);
+		dol_syslog("Fichinter::delete sql=".$sql);
 		if ( $this->db->query($sql) )
 		{
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter WHERE rowid = ".$this->id;
-			dolibarr_syslog("Fichinter::delete sql=".$sql);
+			dol_syslog("Fichinter::delete sql=".$sql);
 			if ( $this->db->query($sql) )
 			{
 
@@ -568,7 +568,7 @@ class Fichinter extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Fichinter::set_date_delivery Erreur SQL");
+				dol_syslog("Fichinter::set_date_delivery Erreur SQL");
 				return -1;
 			}
 		}
@@ -596,7 +596,7 @@ class Fichinter extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Fichinter::set_description Erreur SQL");
+				dol_syslog("Fichinter::set_description Erreur SQL");
 				return -1;
 			}
 		}
@@ -612,7 +612,7 @@ class Fichinter extends CommonObject
 	 */
 	function addline($fichinterid, $desc, $date_intervention, $duration)
 	{
-		dolibarr_syslog("Fichinter::Addline $fichinterid, $desc, $date_intervention, $duration");
+		dol_syslog("Fichinter::Addline $fichinterid, $desc, $date_intervention, $duration");
 		 
 		if ($this->statut == 0)
 		{
@@ -635,7 +635,7 @@ class Fichinter extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Error sql=$sql, error=".$this->error);
+				dol_syslog("Error sql=$sql, error=".$this->error);
 				$this->db->rollback();
 				return -1;
 			}
@@ -728,7 +728,7 @@ class Fichinter extends CommonObject
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet';
 		$sql.= ' where fk_fichinter = '.$this->id;
 
-		dolibarr_syslog("Fichinter::fetch_lines sql=".$sql);
+		dol_syslog("Fichinter::fetch_lines sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -795,7 +795,7 @@ class FichinterLigne
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
 		$sql.= ' WHERE ft.rowid = '.$rowid;
 
-		dolibarr_syslog("FichinterLigne::fetch sql=".$sql);
+		dol_syslog("FichinterLigne::fetch sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -813,7 +813,7 @@ class FichinterLigne
 		else
 		{
 			$this->error=$this->db->error().' sql='.$sql;
-			dolibarr_print_error($this->db,$this->error);
+			dol_print_error($this->db,$this->error);
 			return -1;
 		}
 	}
@@ -824,7 +824,7 @@ class FichinterLigne
 	 */
 	function insert()
 	{
-		dolibarr_syslog("FichinterLigne::insert rang=".$this->rang);
+		dol_syslog("FichinterLigne::insert rang=".$this->rang);
 		$this->db->begin();
 
 		$rangToUse=$this->rang;
@@ -841,7 +841,7 @@ class FichinterLigne
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				$this->db->rollback();
 				return -1;
 			}
@@ -857,7 +857,7 @@ class FichinterLigne
 		$sql.= ' '.$rangToUse;
 		$sql.= ')';
 
-		dolibarr_syslog("FichinterLigne::insert sql=".$sql);
+		dol_syslog("FichinterLigne::insert sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -877,7 +877,7 @@ class FichinterLigne
 		else
 		{
 			$this->error=$this->db->error()." sql=".$sql;
-			dolibarr_syslog("FichinterLigne::insert Error ".$this->error);
+			dol_syslog("FichinterLigne::insert Error ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
@@ -900,7 +900,7 @@ class FichinterLigne
 		$sql.= ",rang='".$this->rang."'";
 		$sql.= " WHERE rowid = ".$this->rowid;
 
-		dolibarr_syslog("FichinterLigne::update sql=".$sql);
+		dol_syslog("FichinterLigne::update sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -913,7 +913,7 @@ class FichinterLigne
 			else
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("FichinterLigne::update Error ".$this->error);
+				dol_syslog("FichinterLigne::update Error ".$this->error);
 				$this->db->rollback();
 				return -1;
 			}
@@ -921,7 +921,7 @@ class FichinterLigne
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("FichinterLigne::update Error ".$this->error);
+			dol_syslog("FichinterLigne::update Error ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
@@ -937,7 +937,7 @@ class FichinterLigne
 		$sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet";
 		$sql.= " WHERE fk_fichinter=".$this->fk_fichinter;
 
-		dolibarr_syslog("FichinterLigne::update_total sql=".$sql);
+		dol_syslog("FichinterLigne::update_total sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -949,7 +949,7 @@ class FichinterLigne
 			$sql.= " SET duree = ".$total_duration;
 			$sql.= " WHERE rowid = ".$this->fk_fichinter;
 
-			dolibarr_syslog("FichinterLigne::update_total sql=".$sql);
+			dol_syslog("FichinterLigne::update_total sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -959,7 +959,7 @@ class FichinterLigne
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("FichinterLigne::update_total Error ".$this->error);
+				dol_syslog("FichinterLigne::update_total Error ".$this->error);
 				$this->db->rollback();
 				return -2;
 			}
@@ -967,7 +967,7 @@ class FichinterLigne
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("FichinterLigne::update Error ".$this->error);
+			dol_syslog("FichinterLigne::update Error ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
@@ -981,12 +981,12 @@ class FichinterLigne
 	{
 		if ($this->statut == 0)
 		{
-			dolibarr_syslog("FichinterLigne::delete_line lineid=".$this->rowid);
+			dol_syslog("FichinterLigne::delete_line lineid=".$this->rowid);
 			$this->db->begin();
 			 
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid;
 			$resql = $this->db->query($sql);
-			dolibarr_syslog("FichinterLigne::delete_line sql=".$sql);
+			dol_syslog("FichinterLigne::delete_line sql=".$sql);
 
 			if ($resql)
 			{
@@ -1005,7 +1005,7 @@ class FichinterLigne
 			else
 			{
 				$this->error=$this->db->error()." sql=".$sql;
-				dolibarr_syslog("FichinterLigne::delete_line Error ".$this->error);
+				dol_syslog("FichinterLigne::delete_line Error ".$this->error);
 				$this->db->rollback();
 				return -1;
 			}
diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php
index 6ea1b7fd6b6..5c6254ec1c9 100644
--- a/htdocs/fichinter/index.php
+++ b/htdocs/fichinter/index.php
@@ -131,10 +131,10 @@ if ($result)
 		$var=!$var;
 		print "<tr $bc[$var]>";
 		print "<td><a href=\"fiche.php?id=".$objp->fichid."\">".img_object($langs->trans("Show"),"task").' '.$objp->ref."</a></td>\n";
-		print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44)."</a></td>\n";
-		print '<td>'.dol_htmlentitiesbr(dolibarr_trunc($objp->description,20)).'</td>';
-		print '<td>'.dol_htmlentitiesbr(dolibarr_trunc($objp->descriptiondetail,20)).'</td>';
-		print '<td align="center">'.dolibarr_print_date($objp->dp,'dayhour')."</td>\n";
+		print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44)."</a></td>\n";
+		print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->description,20)).'</td>';
+		print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).'</td>';
+		print '<td align="center">'.dol_print_date($objp->dp,'dayhour')."</td>\n";
 		print '<td align="right">'.ConvertSecondToTime($objp->duree).'</td>';
 		print '<td align="right">'.$fichinter_static->LibStatut($objp->fk_statut,5).'</td>';
 
@@ -153,7 +153,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php
index b454dfab7af..4cf3c6d214e 100644
--- a/htdocs/fichinter/info.php
+++ b/htdocs/fichinter/info.php
@@ -51,7 +51,7 @@ $societe = new Societe($db);
 $societe->fetch($fichinter->socid);
 
 $head = fichinter_prepare_head($fichinter);
-dolibarr_fiche_head($head, 'info', $langs->trans('InterventionCard'));
+dol_fiche_head($head, 'info', $langs->trans('InterventionCard'));
 
 $fichinter->info($fichinter->id);
 
diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php
index 2e4299a206f..4b43e1a14c8 100644
--- a/htdocs/fichinter/note.php
+++ b/htdocs/fichinter/note.php
@@ -99,7 +99,7 @@ if ($_GET['id'])
 		if ( $societe->fetch($fichinter->socid) )
 		{
 			$head = fichinter_prepare_head($fichinter);
-			dolibarr_fiche_head($head, 'note', $langs->trans('InterventionCard'));
+			dol_fiche_head($head, 'note', $langs->trans('InterventionCard'));
 
 			print '<table class="border" width="100%">';
 
diff --git a/htdocs/fichinter/rapport.php b/htdocs/fichinter/rapport.php
index 8fde011fb7c..a72c9c187b0 100644
--- a/htdocs/fichinter/rapport.php
+++ b/htdocs/fichinter/rapport.php
@@ -93,7 +93,7 @@ $sql .= " ORDER BY $sortfield $sortorder ";
 if ( $db->query($sql) )
 {
   $num = $db->num_rows();
-  $title = $langs->trans("Report")." ".dolibarr_print_date(strtotime($start),"%B %Y");
+  $title = $langs->trans("Report")." ".dol_print_date(strtotime($start),"%B %Y");
   print_barre_liste($title, $page, "rapport.php","&socid=$socid",$sortfield,$sortorder,'',$num);
 
   $i = 0;
@@ -124,7 +124,7 @@ if ( $db->query($sql) )
         print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->rowid.$filter."\">".$objp->nom."</a></TD>\n";
       }
       print '<td>'.nl2br($objp->description).'</td>';
-      print "<td>".dolibarr_print_date($objp->dp,"%d %B %Y")."</td>\n";
+      print "<td>".dol_print_date($objp->dp,"%d %B %Y")."</td>\n";
       print '<td align="center">'.sprintf("%.1f",$objp->duree).'</td>';
       $DureeTotal += $objp->duree;
       print "</tr>\n";
@@ -137,7 +137,7 @@ if ( $db->query($sql) )
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 $db->close();
 
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index 9c815a96b89..e67768acad7 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -92,12 +92,12 @@ if ($_POST["action"] == 'updateligne' && $user->rights->commande->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -117,12 +117,12 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->commande->creer)
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -139,7 +139,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->commande->creer)
 		exit;
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -176,7 +176,7 @@ if ($id > 0 || ! empty($ref))
 
 
 		$head = ordersupplier_prepare_head($commande);
-		dolibarr_fiche_head($head, 'contact', $langs->trans("SupplierOrder"));
+		dol_fiche_head($head, 'contact', $langs->trans("SupplierOrder"));
 
 
 		/*
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index b7f4a49599c..495676a8d4d 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -116,7 +116,7 @@ if ($id > 0 || ! empty($ref))
 		$head = ordersupplier_prepare_head($commande);
 
 		$title=$langs->trans("SupplierOrder");
-		dolibarr_fiche_head($head, 'dispatch', $title);
+		dol_fiche_head($head, 'dispatch', $title);
 
 		/*
 		 *	Commande
@@ -148,7 +148,7 @@ if ($id > 0 || ! empty($ref))
 			print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
 			if ($commande->date_commande)
 			{
-				print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n";
+				print dol_print_date($commande->date_commande,"dayhourtext")."\n";
 			}
 			print "</td></tr>";
 
@@ -263,7 +263,7 @@ if ($id > 0 || ! empty($ref))
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 
 			print "</table>\n";
@@ -322,7 +322,7 @@ if ($id > 0 || ! empty($ref))
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print "</table>\n";
@@ -384,7 +384,7 @@ if ($id > 0 || ! empty($ref))
 	else
 	{
 		// Commande	non	trouv�e
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 2ac31a4a1e4..01a846959a7 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -73,7 +73,7 @@ $pagenext = $page + 1;
 $commande = new CommandeFournisseur($db);
 if ($commande->fetch($_GET['id'],$_GET['ref']) < 0)
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 	exit;
 }
 
@@ -138,7 +138,7 @@ if ($id > 0 || ! empty($ref))
 
 	$head = ordersupplier_prepare_head($commande);
 
-	dolibarr_fiche_head($head, 'documents', $langs->trans('SupplierOrder'));
+	dol_fiche_head($head, 'documents', $langs->trans('SupplierOrder'));
 
 
 	// Construit liste des fichiers
@@ -177,7 +177,7 @@ if ($id > 0 || ! empty($ref))
 		print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
 		if ($commande->date_commande)
 		{
-			print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n";
+			print dol_print_date($commande->date_commande,"dayhourtext")."\n";
 		}
 		print "</td></tr>";
 
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 9c510564598..07599c9919c 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -99,7 +99,7 @@ if ($_POST['action'] ==	'addligne' && $user->rights->fournisseur->commande->cree
 		$ret=$commande->fetch($id);
 		if ($ret < 0)
 		{
-			dolibarr_print_error($db,$commande->error);
+			dol_print_error($db,$commande->error);
 			exit;
 		}
 
@@ -197,7 +197,7 @@ if ($_POST['action'] ==	'addligne' && $user->rights->fournisseur->commande->cree
 if ($_POST['action'] ==	'updateligne' && $user->rights->fournisseur->commande->creer &&	$_POST['save'] == $langs->trans('Save'))
 {
 	$commande =	new	CommandeFournisseur($db,"",$id);
-	if ($commande->fetch($id) < 0) dolibarr_print_error($db);
+	if ($commande->fetch($id) < 0) dol_print_error($db);
 
 	$result	= $commande->updateline($_POST['elrowid'],
 	$_POST['eldesc'],
@@ -219,7 +219,7 @@ if ($_POST['action'] ==	'updateligne' && $user->rights->fournisseur->commande->c
 	}
 	else
 	{
-		dolibarr_print_error($db,$commande->error);
+		dol_print_error($db,$commande->error);
 		exit;
 	}
 }
@@ -308,7 +308,7 @@ if ($_POST["action"] ==	'livraison'	&& $user->rights->fournisseur->commande->rec
 
 	if ($_POST["type"])
 	{
-		$date_liv = dolibarr_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+		$date_liv = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 
 		$result	= $commande->Livraison($user, $date_liv, $_POST["type"], $_POST["comment"]);
 		if ($result > 0)
@@ -318,7 +318,7 @@ if ($_POST["action"] ==	'livraison'	&& $user->rights->fournisseur->commande->rec
 		}
 		else
 		{
-			dolibarr_print_error($db,$commande->error);
+			dol_print_error($db,$commande->error);
 			exit;
 		}
 	}
@@ -400,7 +400,7 @@ if ($_REQUEST['action']	== 'builddoc')	// En get ou en	post
 	$result=supplier_order_pdf_create($db, $commande->id,$commande->modelpdf,$outputlangs);
 	if ($result	<= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 	else
@@ -500,7 +500,7 @@ if ($id > 0 || ! empty($ref))
 		$head = ordersupplier_prepare_head($commande);
 
 		$title=$langs->trans("SupplierOrder");
-		dolibarr_fiche_head($head, 'card', $title);
+		dol_fiche_head($head, 'card', $title);
 
 		/*
 		 * Confirmation de la suppression de	la commande
@@ -566,9 +566,9 @@ if ($id > 0 || ! empty($ref))
 		 */
 		if ($_GET["action"]	== 'commande')
 		{
-			$date_com = dolibarr_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+			$date_com = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 			$html->form_confirm("fiche.php?id=".$commande->id."&amp;datecommande=".$date_com."&amp;methode=".$_POST["methodecommande"]."&amp;comment=".urlencode($_POST["comment"]),
-			$langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dolibarr_print_date($date_com,'day')),"confirm_commande");
+			$langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande");
 			print '<br />';
 		}
 
@@ -613,7 +613,7 @@ if ($id > 0 || ! empty($ref))
 			print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
 			if ($commande->date_commande)
 			{
-				print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n";
+				print dol_print_date($commande->date_commande,"dayhourtext")."\n";
 			}
 			print "</td></tr>";
 
@@ -998,7 +998,7 @@ if ($id > 0 || ! empty($ref))
 			print '<table class="border" width="100%">';
 			print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
 			print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
-			$date_com = dolibarr_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
+			$date_com = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 			print $html->select_date($date_com,'','','','',"commande");
 			print '</td></tr>';
 
@@ -1047,7 +1047,7 @@ if ($id > 0 || ! empty($ref))
 	else
 	{
 		// Commande	non	trouvee
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/fourn/commande/history.php b/htdocs/fourn/commande/history.php
index ef5a2ec5290..50ee9c442a6 100644
--- a/htdocs/fourn/commande/history.php
+++ b/htdocs/fourn/commande/history.php
@@ -65,7 +65,7 @@ if ($id > 0 || ! empty($ref))
 		$head = ordersupplier_prepare_head($commande);
 
 		$title=$langs->trans("SupplierOrder");
-		dolibarr_fiche_head($head, 'info', $title);
+		dol_fiche_head($head, 'info', $title);
 
 
 		/*
@@ -99,7 +99,7 @@ if ($id > 0 || ! empty($ref))
 			print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
 			if ($commande->date_commande)
 			{
-				print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n";
+				print dol_print_date($commande->date_commande,"dayhourtext")."\n";
 			}
 			print "</td></tr>";
 
@@ -149,7 +149,7 @@ if ($id > 0 || ! empty($ref))
 				$obj = $db->fetch_object($resql);
 				print "<tr $bc[$var]>";
 
-				print '<td width="20%">'.dolibarr_print_date($db->jdate($obj->dl),"dayhour")."</td>\n";
+				print '<td width="20%">'.dol_print_date($db->jdate($obj->dl),"dayhour")."</td>\n";
 
 				// Statut
 				print '<td width="100px" nowrap="1">'.$commande->LibStatut($obj->fk_statut,4)."</td>\n";
@@ -159,7 +159,7 @@ if ($id > 0 || ! empty($ref))
 				print img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
 
 				// Comment
-				print '<td width="100px" nowrap="1" title="'.dol_escape_htmltag($obj->comment).'">'.dolibarr_trunc($obj->comment,48)."</td>\n";
+				print '<td width="100px" nowrap="1" title="'.dol_escape_htmltag($obj->comment).'">'.dol_trunc($obj->comment,48)."</td>\n";
 
 				print '</tr>';
 
@@ -169,7 +169,7 @@ if ($id > 0 || ! empty($ref))
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 		print "</table>";
 
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index 7512f100550..1fbd934d8b3 100644
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -88,7 +88,7 @@ if ($resql)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
@@ -132,7 +132,7 @@ if ($resql)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 print '</td></tr></table>';
diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php
index 5a8069f07fd..dc5e0739fd5 100644
--- a/htdocs/fourn/commande/liste.php
+++ b/htdocs/fourn/commande/liste.php
@@ -144,7 +144,7 @@ if ($resql)
         print "<td align=\"center\" width=\"100\">";
         if ($obj->dc)
         {
-            print dolibarr_print_date($obj->dc,"day");
+            print dol_print_date($obj->dc,"day");
         }
         else
         {
@@ -165,7 +165,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php
index 809e5e23030..ef1aceca63b 100644
--- a/htdocs/fourn/commande/note.php
+++ b/htdocs/fourn/commande/note.php
@@ -87,7 +87,7 @@ if ($id > 0 || ! empty($ref))
 		$head = ordersupplier_prepare_head($commande);
 
 		$title=$langs->trans("SupplierOrder");
-		dolibarr_fiche_head($head, 'note', $title);
+		dol_fiche_head($head, 'note', $title);
 
 
 		/*
@@ -123,7 +123,7 @@ if ($id > 0 || ! empty($ref))
 			print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
 			if ($commande->date_commande)
 			{
-				print dolibarr_print_date($commande->date_commande,"dayhourtext")."\n";
+				print dol_print_date($commande->date_commande,"dayhourtext")."\n";
 			}
 			print "</td></tr>";
 
diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php
index 91ffa252143..7a592d8661d 100644
--- a/htdocs/fourn/contact.php
+++ b/htdocs/fourn/contact.php
@@ -122,7 +122,7 @@ if ($result) {
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index 8defab0ad4d..9ca5d05c2f4 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -90,12 +90,12 @@ if ($_POST["action"] == 'updateligne' && $user->rights->fournisseur->facture->cr
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -115,12 +115,12 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->fournisseur->facture->cree
 			$db->commit();
 		} else
 		{
-			dolibarr_print_error($db, "result=$result");
+			dol_print_error($db, "result=$result");
 			$db->rollback();
 		}
 	} else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -137,7 +137,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->fournisseur->facture->cree
 		exit;
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -169,7 +169,7 @@ if ($id > 0)
 
 		$head = facturefourn_prepare_head($facture);
 
-		dolibarr_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'));
+		dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'));
 
 		/*
 		 *   Facture synthese pour rappel
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 1cbae9a3277..ed73039d757 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -129,7 +129,7 @@ if ($facid > 0)
 		$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$facture->id;
 
 		$head = facturefourn_prepare_head($facture);
-		dolibarr_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'));
+		dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'));
 
 
 		// Construit liste des fichiers
@@ -177,7 +177,7 @@ if ($facid > 0)
 	else
 	{
 		print 'facid='.$facid.'<br>';
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 else
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index 86f9cfb8820..245f4b373f5 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -158,8 +158,8 @@ if ($_POST['action'] == 'update' && ! $_POST['cancel'])
  */
 if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer)
 {
-	$datefacture=dolibarr_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
-	$datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
+	$datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
+	$datedue=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
 
 	if ($datefacture == '')
 	{
@@ -289,7 +289,7 @@ if ($_GET['action'] == 'add_ligne')
 	$ret=$facfou->fetch($_GET['facid']);
 	if ($ret < 0)
 	{
-		dolibarr_print_error($db,$facfou->error);
+		dol_print_error($db,$facfou->error);
 		exit;
 	}
 
@@ -376,8 +376,8 @@ if ($_GET['action'] == 'create')
 		$societe->fetch($_GET['socid']);
 	}
 
-	$datefacture=dolibarr_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
-	$datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
+	$datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
+	$datedue=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
 
 	$dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture);
 
@@ -566,7 +566,7 @@ else
 			 */
 			$head = facturefourn_prepare_head($fac);
 			$titre=$langs->trans('SupplierInvoice');
-			dolibarr_fiche_head($head, 'card', $titre);
+			dol_fiche_head($head, 'card', $titre);
 
 			if ($mesg) { print $mesg.'<br>'; }
 
@@ -642,11 +642,11 @@ else
 			print '</tr>';
 
 			print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3" nowrap="nowrap">';
-			print dolibarr_print_date($fac->datep,'daytext').'</td></tr>';
+			print dol_print_date($fac->datep,'daytext').'</td></tr>';
 
 			print '<tr>';
 			print '<td>'.$langs->trans('DateEcheance').'</td><td colspan="3">';
-			print dolibarr_print_date($fac->date_echeance,'daytext');
+			print dol_print_date($fac->date_echeance,'daytext');
 	        if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
 			print '</td></tr>';
 
@@ -730,7 +730,7 @@ else
 					$objp = $db->fetch_object($result);
 					$var=!$var;
 					print '<tr '.$bc[$var].'>';
-					print '<td nowrap><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('Payment'),'payment').'</a> '.dolibarr_print_date($objp->dp,'day')."</td>\n";
+					print '<td nowrap><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('Payment'),'payment').'</a> '.dol_print_date($objp->dp,'day')."</td>\n";
 					print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
 					print '<td align="right">'.price($objp->amount).'</td><td>'.$langs->trans('Currency'.$conf->monnaie).'</td>';
 
@@ -762,7 +762,7 @@ else
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 			print '</td></tr>';
 			print '</table>';
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index 346124791bd..3cfa2b8c380 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -209,12 +209,12 @@ if ($user->rights->fournisseur->facture->lire)
 				if ($objp->datelimite < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
 				print "</td>\n";
 
-				print "<td nowrap>".dolibarr_trunc($objp->facnumber,12)."</td>\n";
+				print "<td nowrap>".dol_trunc($objp->facnumber,12)."</td>\n";
 
-				print "<td nowrap align=\"center\">".dolibarr_print_date($objp->df)."</td>\n";
-				print "<td nowrap align=\"center\">".dolibarr_print_date($objp->datelimite)."</td>\n";
+				print "<td nowrap align=\"center\">".dol_print_date($objp->df)."</td>\n";
+				print "<td nowrap align=\"center\">".dol_print_date($objp->datelimite)."</td>\n";
 
-				print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).'</a></td>';
+				print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,32).'</a></td>';
 
 				print "<td align=\"right\">".price($objp->total_ht)."</td>";
 				print "<td align=\"right\">".price($objp->total_ttc)."</td>";
@@ -247,7 +247,7 @@ if ($user->rights->fournisseur->facture->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 }
diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php
index 86bbfceb386..af950ae2f5a 100644
--- a/htdocs/fourn/facture/index.php
+++ b/htdocs/fourn/facture/index.php
@@ -210,10 +210,10 @@ if ($resql)
 		print $facturestatic->getNomUrl(1);
         if (($obj->paye == 0) && ($obj->fk_statut > 0) && $obj->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
         print "</td>\n";
-        print '<td nowrap>'.dolibarr_trunc($obj->facnumber,10)."</td>";
-        print '<td align="center" nowrap="1">'.dolibarr_print_date($obj->datef,'day').'</td>';
-        print '<td align="center" nowrap="1">'.dolibarr_print_date($obj->date_echeance,'day').'</td>';
-        print '<td>'.dolibarr_trunc($obj->libelle,36).'</td>';
+        print '<td nowrap>'.dol_trunc($obj->facnumber,10)."</td>";
+        print '<td align="center" nowrap="1">'.dol_print_date($obj->datef,'day').'</td>';
+        print '<td align="center" nowrap="1">'.dol_print_date($obj->date_echeance,'day').'</td>';
+        print '<td>'.dol_trunc($obj->libelle,36).'</td>';
         print '<td>';
         $supplierstatic->id=$obj->socid;
 		$supplierstatic->nom=$obj->nom;
@@ -251,7 +251,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index 56e6da4bfd0..1c696e80c37 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -46,7 +46,7 @@ $soc->fetch($fac->socid);
 
 $head = facturefourn_prepare_head($fac);
 $titre=$langs->trans('SupplierInvoice');
-dolibarr_fiche_head($head, 'info', $langs->trans('SupplierInvoice'));
+dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'));
 
 print '<table width="100%"><tr><td>';
 dol_print_object_info($fac);
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index fc1e19bf7f4..fe968d1e22e 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -99,7 +99,7 @@ if ($_GET["facid"])
 
 	$head = facturefourn_prepare_head($fac);
 	$titre=$langs->trans('SupplierInvoice');
-	dolibarr_fiche_head($head, 'note', $titre);
+	dol_fiche_head($head, 'note', $titre);
 
 
     print '<table class="border" width="100%">';
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 7afb3f9c3d7..0d9759ad7e3 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -57,7 +57,7 @@ if ($action == 'add_paiement')
 {
 	$error = 0;
 
-	$datepaye = dolibarr_mktime(12, 0 , 0,
+	$datepaye = dol_mktime(12, 0 , 0,
 	$_POST['remonth'],
 	$_POST['reday'],
 	$_POST['reyear']);
@@ -199,7 +199,7 @@ if ($action == 'create' || $action == 'add_paiement')
 	$facture = new FactureFournisseur($db);
 	$facture->fetch($facid);
 
-	$datefacture=dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+	$datefacture=dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 	$dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture);
 
 	$sql = 'SELECT s.nom, s.rowid as socid,';
@@ -296,7 +296,7 @@ if ($action == 'create' || $action == 'add_paiement')
 						if ($objp->df > 0 )
 						{
 							print '<td align="center">';
-							print dolibarr_print_date($objp->df).'</td>';
+							print dol_print_date($objp->df).'</td>';
 						}
 						else
 						{
@@ -331,7 +331,7 @@ if ($action == 'create' || $action == 'add_paiement')
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 
 			/*
@@ -408,18 +408,18 @@ if (! $_GET['action'] && ! $_POST['action'])
 	  print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->pid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->pid.'</a></td>';
 
 	  // Ref invoice
-	  print '<td nowrap="nowrap">'.dolibarr_trunc($objp->facnumber,12).'</td>';
+	  print '<td nowrap="nowrap">'.dol_trunc($objp->facnumber,12).'</td>';
 
 	  // Date
-	  print '<td nowrap="nowrap" align="center">'.dolibarr_print_date($objp->dp,'day')."</td>\n";
+	  print '<td nowrap="nowrap" align="center">'.dol_print_date($objp->dp,'day')."</td>\n";
 
 	  print '<td>';
-	  if ($objp->socid) print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dolibarr_trunc($objp->nom,32).'</a>';
+	  if ($objp->socid) print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dol_trunc($objp->nom,32).'</a>';
 	  else print '&nbsp;';
 	  print '</td>';
-	  print '<td>'.dolibarr_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."</td>\n";
+	  print '<td>'.dol_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."</td>\n";
 	  print '<td>';
-	  if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.dolibarr_trunc($objp->label,24).'</a>';
+	  if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).'</a>';
 	  else print '&nbsp;';
 	  print '</td>';
 	  print '<td align="right">'.price($objp->pamount).'</td><td>&nbsp;</td>';
@@ -430,7 +430,7 @@ if (! $_GET['action'] && ! $_POST['action'])
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/fourn/facture/paiementfourn.class.php b/htdocs/fourn/facture/paiementfourn.class.php
index d88e87ca0f0..95b48d9bc1d 100644
--- a/htdocs/fourn/facture/paiementfourn.class.php
+++ b/htdocs/fourn/facture/paiementfourn.class.php
@@ -106,7 +106,7 @@ class PaiementFourn
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$error = -1;
 		}
 		return $error;
@@ -144,7 +144,7 @@ class PaiementFourn
 			$sql.= ' VALUES ('.$this->db->idate(mktime()).',';
 			$sql.= " ".$this->db->idate($this->datepaye).", '".$this->total."', ".$this->paiementid.", '".$this->num_paiement."', '".addslashes($this->note)."', ".$user->id.", 0)";
 			
-			dolibarr_syslog("PaiementFourn::create sql=".$sql);
+			dol_syslog("PaiementFourn::create sql=".$sql);
 			$resql = $this->db->query($sql);
 			if ($resql)
 			{
@@ -161,13 +161,13 @@ class PaiementFourn
 						$sql .= ' VALUES ('.$facid.','. $this->id.',\''.$amount.'\')';
 						if (! $this->db->query($sql) )
 						{
-							dolibarr_syslog('Paiement::Create Erreur INSERT dans paiement_facture '.$facid);
+							dol_syslog('Paiement::Create Erreur INSERT dans paiement_facture '.$facid);
 							$error++;
 						}
 					}
 					else
 					{
-						dolibarr_syslog('PaiementFourn::Create Montant non numerique',LOG_ERR);
+						dol_syslog('PaiementFourn::Create Montant non numerique',LOG_ERR);
 					}
 				}
 
@@ -184,21 +184,21 @@ class PaiementFourn
 			else
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog('PaiementFourn::Create Error '.$this->error, LOG_ERR);
+				dol_syslog('PaiementFourn::Create Error '.$this->error, LOG_ERR);
 				$error++;
 			}
 		}
 		else
 		{
 			$this->error="ErrorTotalIsNull";
-			dolibarr_syslog('PaiementFourn::Create Error '.$this->error, LOG_ERR);
+			dol_syslog('PaiementFourn::Create Error '.$this->error, LOG_ERR);
 			$error++;
 		}
 
 		if ($this->total <> 0 && $error == 0) // On accepte les montants negatifs
 		{
 			$this->db->commit();
-			dolibarr_syslog('PaiementFourn::Create Ok Total = '.$this->total);
+			dol_syslog('PaiementFourn::Create Ok Total = '.$this->total);
 			return $this->id;
 		}
 		else
@@ -308,7 +308,7 @@ class PaiementFourn
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
@@ -321,7 +321,7 @@ class PaiementFourn
 	{
 		$sql = 'UPDATE '.MAIN_DB_PREFIX.'paiementfourn SET statut = 1 WHERE rowid = '.$this->id;
 
-		dolibarr_syslog("PaiementFourn::valide sql=".$sql);
+		dol_syslog("PaiementFourn::valide sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -330,7 +330,7 @@ class PaiementFourn
 		else
 		{
 			$this->error='Paiement::Valide Error -1 '.$this->db->error();
-			dolibarr_syslog('PaiementFourn::valide error '.$this->error);
+			dol_syslog('PaiementFourn::valide error '.$this->error);
 			return -1;
 		}
 	}
@@ -373,7 +373,7 @@ class PaiementFourn
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -407,7 +407,7 @@ class PaiementFourn
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog('PaiementFourn::getBillsArray Error '.$this->error.' - sql='.$sql);
+			dol_syslog('PaiementFourn::getBillsArray Error '.$this->error.' - sql='.$sql);
 			return -1;
 		}
 	}
@@ -498,7 +498,7 @@ class PaiementFourn
         {
             $sql = 'UPDATE '.MAIN_DB_PREFIX.'paiementfourn SET num_paiement = \''.$this->db->escape($num).'\' WHERE rowid = '.$this->id;
     
-            dolibarr_syslog("PaiementFourn::update_num sql=".$sql);
+            dol_syslog("PaiementFourn::update_num sql=".$sql);
             $result = $this->db->query($sql);
             if ($result)
             {
@@ -508,7 +508,7 @@ class PaiementFourn
             else
             {
                 $this->error='PaiementFourn::update_num Error -1 '.$this->db->error();
-                dolibarr_syslog('PaiementFourn::update_num error '.$this->error);
+                dol_syslog('PaiementFourn::update_num error '.$this->error);
                 return -1;
             }
         }
@@ -524,7 +524,7 @@ class PaiementFourn
         if(!empty($date) && $this->statut!=1)
         {
             $sql = 'UPDATE '.MAIN_DB_PREFIX.'paiementfourn SET datep = '.$this->db->idate($date).' WHERE rowid = '.$this->id;
-            dolibarr_syslog("PaiementFourn::update_date sql=".$sql);
+            dol_syslog("PaiementFourn::update_date sql=".$sql);
             $result = $this->db->query($sql);
             if ($result)
             {
@@ -535,7 +535,7 @@ class PaiementFourn
             else
             {
                 $this->error='PaiementFourn::update_date Error -1 '.$this->db->error();
-                dolibarr_syslog('PaiementFourn::update_date error '.$this->error);
+                dol_syslog('PaiementFourn::update_date error '.$this->error);
                 return -1;
             }
         }
diff --git a/htdocs/fourn/fiche-stats.php b/htdocs/fourn/fiche-stats.php
index 13dc72b34e4..ed84b85a2da 100644
--- a/htdocs/fourn/fiche-stats.php
+++ b/htdocs/fourn/fiche-stats.php
@@ -65,7 +65,7 @@ if ( $societe->fetch($socid) )
    */
   $head = societe_prepare_head($societe);
 
-  dolibarr_fiche_head($head, 'supplierstat', $langs->trans("ThirdParty"));
+  dol_fiche_head($head, 'supplierstat', $langs->trans("ThirdParty"));
 
   
   print '<table class="border" width="100%">';
@@ -102,7 +102,7 @@ if ( $societe->fetch($socid) )
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 $db->close();
 
diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php
index 8986b8ce8b2..97710d79c5e 100644
--- a/htdocs/fourn/fiche.php
+++ b/htdocs/fourn/fiche.php
@@ -64,7 +64,7 @@ if ( $societe->fetch($socid) )
 	 */
 	$head = societe_prepare_head($societe);
 
-	dolibarr_fiche_head($head, 'supplier', $langs->trans("ThirdParty"));
+	dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"));
 
 
 	print '<table width="100%" class="notopnoleftnoright">';
@@ -165,7 +165,7 @@ if ( $societe->fetch($socid) )
 			print '<td align="center" width="80">';
 			if ($obj->dc)
 			{
-				print dolibarr_print_date($obj->dc,'day');
+				print dol_print_date($obj->dc,'day');
 			}
 			else
 			{
@@ -184,7 +184,7 @@ if ( $societe->fetch($socid) )
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 
@@ -220,8 +220,8 @@ if ( $societe->fetch($socid) )
 			print '<tr '.$bc[$var].'>';
 			print '<td>';
 			print '<a href="facture/fiche.php?facid='.$obj->rowid.'">';
-			print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.'</a> '.dolibarr_trunc($obj->libelle,14).'</td>';
-			print '<td align="center" nowrap="nowrap">'.dolibarr_print_date($obj->df,'day').'</td>';
+			print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.'</a> '.dol_trunc($obj->libelle,14).'</td>';
+			print '<td align="center" nowrap="nowrap">'.dol_print_date($obj->df,'day').'</td>';
 			print '<td align="right" nowrap="nowrap">'.price($obj->amount).'</td>';
 			print '<td align="right" nowrap="nowrap">'.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).'</td>';
 			print '</tr>';
@@ -235,7 +235,7 @@ if ( $societe->fetch($socid) )
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	/*
@@ -306,7 +306,7 @@ if ( $societe->fetch($socid) )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 $db->close();
 
diff --git a/htdocs/fourn/fournisseur.class.php b/htdocs/fourn/fournisseur.class.php
index ce3e30f63dc..06d541d335e 100644
--- a/htdocs/fourn/fournisseur.class.php
+++ b/htdocs/fourn/fournisseur.class.php
@@ -121,20 +121,20 @@ class Fournisseur extends Societe
 	 */
 	function create_commande($user)
 	{
-		dolibarr_syslog("Fournisseur::Create_Commande");
+		dol_syslog("Fournisseur::Create_Commande");
 		$comm = new CommandeFournisseur($this->db);
 		$comm->socid = $this->id;
 
 		if ($comm->create($user) > 0)
 		{
-			dolibarr_syslog("Fournisseur::Create_Commande : Success");
+			dol_syslog("Fournisseur::Create_Commande : Success");
 			$this->single_open_commande = $comm->id;
 
 			return $comm->id;
 		}
 		else
 		{
-			dolibarr_syslog("Fournisseur::Create_Commande : Failed");
+			dol_syslog("Fournisseur::Create_Commande : Failed");
 			return -1;
 		}
 	}
@@ -149,7 +149,7 @@ class Fournisseur extends Societe
 
 		$nbc = $this->nb_open_commande();
 
-		dolibarr_syslog("Fournisseur::ProductCommande : nbc = ".$nbc);
+		dol_syslog("Fournisseur::ProductCommande : nbc = ".$nbc);
 
 		if ($nbc == 0)
 		{
@@ -206,7 +206,7 @@ class Fournisseur extends Societe
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -221,7 +221,7 @@ class Fournisseur extends Societe
 	 */
 	function CreateCategory($user, $name)
 	{
-		dolibarr_syslog("Fournisseur::CreateCategory");
+		dol_syslog("Fournisseur::CreateCategory");
 
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label,visible,type)";
 		$sql.= " VALUES ";
@@ -231,12 +231,12 @@ class Fournisseur extends Societe
 
 		if ($result == 1)
 		{
-			dolibarr_syslog("Fournisseur::CreateCategory : Success");
+			dol_syslog("Fournisseur::CreateCategory : Success");
 			return 0;
 		}
 		else
 		{
-			dolibarr_syslog("Fournisseur::CreateCategory : Failed (".$this->db->error().")");
+			dol_syslog("Fournisseur::CreateCategory : Failed (".$this->db->error().")");
 			return -1;
 		}
 	}
@@ -269,7 +269,7 @@ class Fournisseur extends Societe
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 
 		}
diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php
index 6ffd04dbb99..c8114479b1f 100644
--- a/htdocs/fourn/fournisseur.commande.class.php
+++ b/htdocs/fourn/fournisseur.commande.class.php
@@ -87,7 +87,7 @@ class CommandeFournisseur extends Commande
 		if ($ref) $sql.= " WHERE c.ref='".$ref."'";
 		else $sql.= " WHERE c.rowid=".$id;
 
-		dolibarr_syslog("CommandeFournisseur::fetch sql=".$sql,LOG_DEBUG);
+		dol_syslog("CommandeFournisseur::fetch sql=".$sql,LOG_DEBUG);
 		$resql = $this->db->query($sql) ;
 		if ($resql)
 		{
@@ -133,7 +133,7 @@ class CommandeFournisseur extends Commande
 			$sql.= " ORDER BY l.rowid";
 			//print $sql;
 
-			dolibarr_syslog("CommandeFournisseur::fetch sql=".$sql,LOG_DEBUG);
+			dol_syslog("CommandeFournisseur::fetch sql=".$sql,LOG_DEBUG);
 			$result = $this->db->query($sql);
 			if ($result)
 			{
@@ -164,8 +164,8 @@ class CommandeFournisseur extends Commande
 					$ligne->ref_fourn           = $objp->ref_fourn;    // Reference supplier
 
 					$this->lignes[$i]      = $ligne;
-					//dolibarr_syslog("1 ".$ligne->desc);
-					//dolibarr_syslog("2 ".$ligne->product_desc);
+					//dol_syslog("1 ".$ligne->desc);
+					//dol_syslog("2 ".$ligne->product_desc);
 					$i++;
 				}
 				$this->db->free($result);
@@ -175,14 +175,14 @@ class CommandeFournisseur extends Commande
 			else
 			{
 				$this->error=$this->db->error()." sql=".$sql;
-				dolibarr_syslog("CommandeFournisseur::Fetch ".$this->error, LOG_ERR);
+				dol_syslog("CommandeFournisseur::Fetch ".$this->error, LOG_ERR);
 				return -1;
 			}
 		}
 		else
 		{
 			$this->error=$this->db->error()." sql=".$sql;
-			dolibarr_syslog("CommandeFournisseur::Fetch ".$this->error, LOG_ERR);
+			dol_syslog("CommandeFournisseur::Fetch ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -203,7 +203,7 @@ class CommandeFournisseur extends Commande
 		$sql.= ($comment?"'".addslashes($comment)."'":'null');
 		$sql.= ")";
 
-		dolibarr_syslog("FournisseurCommande::log sql=".$sql, LOG_DEBUG);
+		dol_syslog("FournisseurCommande::log sql=".$sql, LOG_DEBUG);
 		if ( $this->db->query($sql) )
 		{
 			return 1;
@@ -211,7 +211,7 @@ class CommandeFournisseur extends Commande
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("FournisseurCommande::log ".$this->error, LOG_ERR);
+			dol_syslog("FournisseurCommande::log ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -226,7 +226,7 @@ class CommandeFournisseur extends Commande
 
 		$error=0;
 
-		dolibarr_syslog("CommandeFournisseur::Valid");
+		dol_syslog("CommandeFournisseur::Valid");
 		$result = 0;
 		if ($user->rights->fournisseur->commande->valider)
 		{
@@ -282,7 +282,7 @@ class CommandeFournisseur extends Commande
 			else
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("CommandeFournisseur::valid ".$this->error);
+				dol_syslog("CommandeFournisseur::valid ".$this->error);
 				$this->db->rollback();
 				return -1;
 			}
@@ -290,7 +290,7 @@ class CommandeFournisseur extends Commande
 		else
 		{
 			$this->error='Not Authorized';
-			dolibarr_syslog("CommandeFournisseur::valid ".$this->error);
+			dol_syslog("CommandeFournisseur::valid ".$this->error);
 			return -1;
 		}
 	}
@@ -304,7 +304,7 @@ class CommandeFournisseur extends Commande
 	{
 		global $langs,$conf;
 
-		//dolibarr_syslog("CommandeFournisseur::Cancel");
+		//dol_syslog("CommandeFournisseur::Cancel");
 		$result = 0;
 		if ($user->rights->fournisseur->commande->annuler)
 		{
@@ -341,7 +341,7 @@ class CommandeFournisseur extends Commande
 			}
 			else
 			{
-				dolibarr_syslog("CommandeFournisseur::Cancel Error -1");
+				dol_syslog("CommandeFournisseur::Cancel Error -1");
 				$this->db->rollback();
 				$this->error=$this->db->lasterror();
 				return -1;
@@ -349,7 +349,7 @@ class CommandeFournisseur extends Commande
 		}
 		else
 		{
-			dolibarr_syslog("CommandeFournisseur::Cancel Not Authorized");
+			dol_syslog("CommandeFournisseur::Cancel Not Authorized");
 			return -1;
 		}
 	}
@@ -486,7 +486,7 @@ class CommandeFournisseur extends Commande
 				}
 				else
 				{
-					dolibarr_print_error($db,"CommandeFournisseur::getNextNumRef ".$obj->error);
+					dol_print_error($db,"CommandeFournisseur::getNextNumRef ".$obj->error);
 					return -1;
 				}
 			}
@@ -513,7 +513,7 @@ class CommandeFournisseur extends Commande
 
 		$error=0;
 
-		dolibarr_syslog("CommandeFournisseur::Approve");
+		dol_syslog("CommandeFournisseur::Approve");
 
 		if ($user->rights->fournisseur->commande->approuver)
 		{
@@ -580,13 +580,13 @@ class CommandeFournisseur extends Commande
 			{
 				$this->db->rollback();
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("CommandeFournisseur::Approve Error ",$this->error, LOG_ERR);
+				dol_syslog("CommandeFournisseur::Approve Error ",$this->error, LOG_ERR);
 				return -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog("CommandeFournisseur::Approve Not Authorized", LOG_ERR);
+			dol_syslog("CommandeFournisseur::Approve Not Authorized", LOG_ERR);
 		}
 		return -1;
 	}
@@ -598,7 +598,7 @@ class CommandeFournisseur extends Commande
 	 */
 	function refuse($user)
 	{
-		dolibarr_syslog("CommandeFournisseur::Refuse");
+		dol_syslog("CommandeFournisseur::Refuse");
 		$result = 0;
 		if ($user->rights->fournisseur->commande->approuver)
 		{
@@ -618,13 +618,13 @@ class CommandeFournisseur extends Commande
 	  }
 	  else
 	  {
-	  	dolibarr_syslog("CommandeFournisseur::Refuse Error -1");
+	  	dol_syslog("CommandeFournisseur::Refuse Error -1");
 	  	$result = -1;
 	  }
 		}
 		else
 		{
-			dolibarr_syslog("CommandeFournisseur::Refuse Not Authorized");
+			dol_syslog("CommandeFournisseur::Refuse Not Authorized");
 		}
 		return $result ;
 	}
@@ -657,7 +657,7 @@ class CommandeFournisseur extends Commande
 	 */
 	function commande($user, $date, $methode, $comment='')
 	{
-		dolibarr_syslog("CommandeFournisseur::Commande");
+		dol_syslog("CommandeFournisseur::Commande");
 		$result = 0;
 		if ($user->rights->fournisseur->commande->commander)
 		{
@@ -672,13 +672,13 @@ class CommandeFournisseur extends Commande
 			}
 			else
 			{
-				dolibarr_syslog("CommandeFournisseur::Commande Error -1", LOG_ERR);
+				dol_syslog("CommandeFournisseur::Commande Error -1", LOG_ERR);
 				$result = -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog("CommandeFournisseur::Commande User not Authorized", LOG_ERR);
+			dol_syslog("CommandeFournisseur::Commande User not Authorized", LOG_ERR);
 		}
 		return $result ;
 	}
@@ -692,7 +692,7 @@ class CommandeFournisseur extends Commande
 	{
 		global $langs,$conf;
 
-		dolibarr_syslog("CommandeFournisseur::Create soc id=".$this->socid);
+		dol_syslog("CommandeFournisseur::Create soc id=".$this->socid);
 
 		$this->db->begin();
 
@@ -721,14 +721,14 @@ class CommandeFournisseur extends Commande
 				if ($result < 0) { $error++; $this->errors=$interface->errors; }
 				// Fin appel triggers
 
-				dolibarr_syslog("CommandeFournisseur::Create : Success");
+				dol_syslog("CommandeFournisseur::Create : Success");
 				$this->db->commit();
 				return 1;
 			}
 			else
 			{
 				$this->error=$this->db->error()." - ".$sql;
-				dolibarr_syslog("CommandeFournisseur::Create: Failed -2 - ".$this->error);
+				dol_syslog("CommandeFournisseur::Create: Failed -2 - ".$this->error);
 				$this->db->rollback();
 				return -2;
 			}
@@ -736,7 +736,7 @@ class CommandeFournisseur extends Commande
 		else
 		{
 			$this->error=$this->db->error()." - ".$sql;
-			dolibarr_syslog("CommandeFournisseur::Create: Failed -1 - ".$this->error);
+			dol_syslog("CommandeFournisseur::Create: Failed -1 - ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
@@ -757,7 +757,7 @@ class CommandeFournisseur extends Commande
 	{
 		global $langs,$mysoc;
 
-		dolibarr_syslog("FournisseurCommande::addline $desc, $pu_ht, $qty, $txtva, $fk_product, $fk_prod_fourn_price, $fourn_ref, $remise_percent, $price_base_type, $pu_ttc");
+		dol_syslog("FournisseurCommande::addline $desc, $pu_ht, $qty, $txtva, $fk_product, $fk_prod_fourn_price, $fourn_ref, $remise_percent, $price_base_type, $pu_ttc");
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
 
 		// Clean parameters
@@ -804,14 +804,14 @@ class CommandeFournisseur extends Commande
 					{
 						$this->error="No price found for this quantity. Quantity may be too low ?";
 						$this->db->rollback();
-						dolibarr_syslog("FournisseurCommande::addline result=".$result." - ".$this->error, LOG_DEBUG);
+						dol_syslog("FournisseurCommande::addline result=".$result." - ".$this->error, LOG_DEBUG);
 						return -1;
 					}
 					if ($result < -1)
 					{
 						$this->error=$prod->error;
 						$this->db->rollback();
-						dolibarr_syslog("Fournisseur.commande::addline result=".$result." - ".$this->error, LOG_ERR);
+						dol_syslog("Fournisseur.commande::addline result=".$result." - ".$this->error, LOG_ERR);
 						return -1;
 					}
 				}
@@ -856,7 +856,7 @@ class CommandeFournisseur extends Commande
 			$sql.= "'".price2num($total_ttc)."'";
 			$sql.= ")";
 
-			dolibarr_syslog('FournisseurCommande::addline sql='.$sql);
+			dol_syslog('FournisseurCommande::addline sql='.$sql);
 			$resql=$this->db->query($sql);
 			//print $sql;
 			if ($resql)
@@ -870,7 +870,7 @@ class CommandeFournisseur extends Commande
 			{
 				$this->error=$this->db->error();
 				$this->db->rollback();
-				dolibarr_syslog('FournisseurCommande::addline '.$this->error, LOG_ERR);
+				dol_syslog('FournisseurCommande::addline '.$this->error, LOG_ERR);
 				return -1;
 			}
 		}
@@ -907,7 +907,7 @@ class CommandeFournisseur extends Commande
 		$error = 0;
 		require_once DOL_DOCUMENT_ROOT ."/product/stock/mouvementstock.class.php";
 
-		dolibarr_syslog("CommandeFournisseur::DispatchProduct");
+		dol_syslog("CommandeFournisseur::DispatchProduct");
 
 		if ( ($this->statut == 3 || $this->statut == 4 || $this->statut == 5) && $qty > 0)
 		{
@@ -931,7 +931,7 @@ class CommandeFournisseur extends Commande
 	  	if ($result < 0)
 	  	{
 	  		$this->error=$this->db->error()." - sql=$sql";
-	  		dolibarr_syslog("CommandeFournisseur::DispatchProduct".$this->error);
+	  		dol_syslog("CommandeFournisseur::DispatchProduct".$this->error);
 	  		$error = -2;
 	  	}
 	  	$i++;
@@ -964,7 +964,7 @@ class CommandeFournisseur extends Commande
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid = ".$idligne;
 			$resql=$this->db->query($sql);
 
-			dolibarr_syslog("Fournisseur.commande.class::delete_line sql=".$sql);
+			dol_syslog("Fournisseur.commande.class::delete_line sql=".$sql);
 			if ($resql)
 	  {
 	  	$result=$this->update_price();
@@ -1024,7 +1024,7 @@ class CommandeFournisseur extends Commande
 			if ($result < 0) { $error++; $this->errors=$interface->errors; }
 			// Fin appel triggers
 
-			dolibarr_syslog("CommandeFournisseur::delete : Success");
+			dol_syslog("CommandeFournisseur::delete : Success");
 			$this->db->commit();
 			return 1;
 		}
@@ -1075,7 +1075,7 @@ class CommandeFournisseur extends Commande
 	{
 		$result = 0;
 
-		dolibarr_syslog("CommandeFournisseur::Livraison");
+		dol_syslog("CommandeFournisseur::Livraison");
 
 		if ($user->rights->fournisseur->commande->receptionner && $date < gmmktime())
 		{
@@ -1093,7 +1093,7 @@ class CommandeFournisseur extends Commande
 				$sql.= " WHERE rowid = ".$this->id;
 				$sql.= " AND (fk_statut = 3 OR fk_statut = 4)";
 
-				dolibarr_syslog("CommandeFournisseur::Livraison sql=".$sql);
+				dol_syslog("CommandeFournisseur::Livraison sql=".$sql);
 				$resql=$this->db->query($sql);
 				if ($resql)
 				{
@@ -1106,19 +1106,19 @@ class CommandeFournisseur extends Commande
 				{
 					$this->db->rollback();
 					$this->error=$this->db->lasterror();
-					dolibarr_syslog("CommandeFournisseur::Livraison Error ".$this->error, LOG_ERR);
+					dol_syslog("CommandeFournisseur::Livraison Error ".$this->error, LOG_ERR);
 					$result = -1;
 				}
 			}
 			else
 			{
-				dolibarr_syslog("CommandeFournisseur::Livraison Error -2", LOG_ERR);
+				dol_syslog("CommandeFournisseur::Livraison Error -2", LOG_ERR);
 				$result = -2;
 			}
 		}
 		else
 		{
-			dolibarr_syslog("CommandeFournisseur::Livraison Not Authorized");
+			dol_syslog("CommandeFournisseur::Livraison Not Authorized");
 		}
 		return $result ;
 	}
@@ -1167,7 +1167,7 @@ class CommandeFournisseur extends Commande
 	 */
 	function UpdateNote($user, $note, $note_public)
 	{
-		dolibarr_syslog("CommandeFournisseur::UpdateNote");
+		dol_syslog("CommandeFournisseur::UpdateNote");
 
 		$result = 0;
 
@@ -1184,7 +1184,7 @@ class CommandeFournisseur extends Commande
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("CommandeFournisseur::UpdateNote "+$this->error);
+			dol_syslog("CommandeFournisseur::UpdateNote "+$this->error);
 			$result = -1;
 		}
 
@@ -1224,7 +1224,7 @@ class CommandeFournisseur extends Commande
 		}
 		else
 		{
-			dolibarr_syslog("ReadApprobators Erreur");
+			dol_syslog("ReadApprobators Erreur");
 		}
 	}
 
@@ -1242,7 +1242,7 @@ class CommandeFournisseur extends Commande
 	 */
 	function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $price_base_type='HT', $info_bits=0)
 	{
-		dolibarr_syslog("CommandeFournisseur::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva");
+		dol_syslog("CommandeFournisseur::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva");
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
 
 		if ($this->brouillon)
@@ -1292,7 +1292,7 @@ class CommandeFournisseur extends Commande
 			$sql.= ",total_ttc='".price2num($total_ttc)."'";
 			$sql.= " WHERE rowid = ".$rowid;
 
-			dolibarr_syslog("CommandeFournisseur::updateline sql=".$sql);
+			dol_syslog("CommandeFournisseur::updateline sql=".$sql);
 			$result = $this->db->query( $sql);
 			if ($result > 0)
 			{
@@ -1305,7 +1305,7 @@ class CommandeFournisseur extends Commande
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("CommandeFournisseur::updateline ".$this->error);
+				dol_syslog("CommandeFournisseur::updateline ".$this->error);
 				$this->db->rollback();
 				return -1;
 			}
@@ -1313,7 +1313,7 @@ class CommandeFournisseur extends Commande
 		else
 		{
 			$this->error="Order status makes operation forbidden";
-			dolibarr_syslog("CommandeFournisseur::updateline ".$this->error);
+			dol_syslog("CommandeFournisseur::updateline ".$this->error);
 			return -2;
 		}
 	}
@@ -1327,7 +1327,7 @@ class CommandeFournisseur extends Commande
 	{
 		global $user,$langs;
 
-		dolibarr_syslog("CommandeFournisseur::initAsSpecimen");
+		dol_syslog("CommandeFournisseur::initAsSpecimen");
 
 		// Charge tableau des id de soci�t� socids
 		$socids = array();
@@ -1464,7 +1464,7 @@ class CommandeFournisseurLigne extends CommandeLigne
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1483,7 +1483,7 @@ class CommandeFournisseurLigne extends CommandeLigne
 		$sql.= ",total_ttc='".price2num($this->total_ttc)."'";
 		$sql.= " WHERE rowid = ".$this->rowid;
 
-		dolibarr_syslog("CommandeFournisseurLigne.class.php::update_total sql=$sql");
+		dol_syslog("CommandeFournisseurLigne.class.php::update_total sql=$sql");
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -1494,7 +1494,7 @@ class CommandeFournisseurLigne extends CommandeLigne
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("CommandeFournisseurLigne.class.php::update_total Error ".$this->error);
+			dol_syslog("CommandeFournisseurLigne.class.php::update_total Error ".$this->error);
 			$this->db->rollback();
 			return -2;
 		}
diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php
index 636031ef816..d66361e682a 100644
--- a/htdocs/fourn/fournisseur.facture.class.php
+++ b/htdocs/fourn/fournisseur.facture.class.php
@@ -129,7 +129,7 @@ class FactureFournisseur extends Facture
 		$sql.= " '".addslashes($this->note_public)."',";
 		$sql.= " ".$user->id.",'".$this->db->idate($this->date_echeance)."');";
 
-		dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
+		dol_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -139,7 +139,7 @@ class FactureFournisseur extends Facture
 				$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
 				$sql .= ' VALUES ('.$this->id.');';
 
-				dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
+				dol_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
 				$resql_insert=$this->db->query($sql);
 				if ($resql_insert)
 				{
@@ -201,7 +201,7 @@ class FactureFournisseur extends Facture
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s';
 		$sql.= ' WHERE f.rowid='.$rowid.' AND f.fk_soc = s.rowid';
 
-		dolibarr_syslog("FactureFournisseur::Fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("FactureFournisseur::Fetch sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -246,24 +246,24 @@ class FactureFournisseur extends Facture
 				if ($result < 0)
 				{
 					$this->error=$this->db->error();
-					dolibarr_syslog('FactureFournisseur::Fetch Error '.$this->error, LOG_ERR);
+					dol_syslog('FactureFournisseur::Fetch Error '.$this->error, LOG_ERR);
 					return -3;
 				}
 				return 1;
 			}
 			else
 			{
-				dolibarr_syslog('FactureFournisseur::Fetch rowid='.$rowid.' numrows=0 sql='.$sql);
+				dol_syslog('FactureFournisseur::Fetch rowid='.$rowid.' numrows=0 sql='.$sql);
 				$this->error='Bill with id '.$rowid.' not found sql='.$sql;
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				return -2;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('FactureFournisseur::Fetch rowid='.$rowid.' Erreur dans fetch de la facture fournisseur');
+			dol_syslog('FactureFournisseur::Fetch rowid='.$rowid.' Erreur dans fetch de la facture fournisseur');
 			$this->error=$this->db->error();
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -284,7 +284,7 @@ class FactureFournisseur extends Facture
 		//$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur as pf ON f.fk_product = pf.fk_product';
 		$sql.= ' WHERE fk_facture_fourn='.$this->id;
 
-		dolibarr_syslog("FactureFournisseur::fetch_lines sql=".$sql, LOG_DEBUG);
+		dol_syslog("FactureFournisseur::fetch_lines sql=".$sql, LOG_DEBUG);
 		$resql_rows = $this->db->query($sql);
 		if ($resql_rows)
 		{
@@ -320,7 +320,7 @@ class FactureFournisseur extends Facture
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog('FactureFournisseur::fetch_lines: Error '.$this->error,LOG_ERR);
+			dol_syslog('FactureFournisseur::fetch_lines: Error '.$this->error,LOG_ERR);
 			return -3;
 		}
 	}
@@ -347,12 +347,12 @@ class FactureFournisseur extends Facture
 		$this->db->begin();
 
 		$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';';
-		dolibarr_syslog("FactureFournisseur sql=".$sql, LOG_DEBUG);
+		dol_syslog("FactureFournisseur sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
 				$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE rowid = '.$rowid;
-				dolibarr_syslog("FactureFournisseur sql=".$sql, LOG_DEBUG);
+				dol_syslog("FactureFournisseur sql=".$sql, LOG_DEBUG);
 				$resql2 = $this->db->query($sql);
 				if ($resql2)
 				{
@@ -363,7 +363,7 @@ class FactureFournisseur extends Facture
 				{
 					$this->db->rollback();
 					$this->error=$this->db->lasterror();
-					dolibarr_syslog("FactureFournisseur::delete ".$this->error, LOG_ERR);
+					dol_syslog("FactureFournisseur::delete ".$this->error, LOG_ERR);
 					return -1;
 				}
 		}
@@ -371,7 +371,7 @@ class FactureFournisseur extends Facture
 		{
 			$this->db->rollback();
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("FactureFournisseur::delete ".$this->error, LOG_ERR);
+			dol_syslog("FactureFournisseur::delete ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -391,7 +391,7 @@ class FactureFournisseur extends Facture
 		if (! $resql)
 		{
 			$this->error=$this->db->error();
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
             return -1;
 		}
         return 1;
@@ -413,7 +413,7 @@ class FactureFournisseur extends Facture
         $sql.= " SET fk_statut = 1, fk_user_valid = ".$user->id;
         $sql.= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("FactureFournisseur::set_valid sql=".$sql, LOG_DEBUG);
+		dol_syslog("FactureFournisseur::set_valid sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -488,7 +488,7 @@ class FactureFournisseur extends Facture
 	*/
 	function addline($desc, $pu, $txtva, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT')
 	{
-		dolibarr_syslog("FactureFourn::Addline $desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$date_start,$date_end,$ventil,$info_bits", LOG_DEBUG);
+		dol_syslog("FactureFourn::Addline $desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$date_start,$date_end,$ventil,$info_bits", LOG_DEBUG);
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
 
 		$this->db->begin();
@@ -500,7 +500,7 @@ class FactureFournisseur extends Facture
 
 		$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
 		$sql .= ' VALUES ('.$this->id.');';
-		dolibarr_syslog("Fournisseur.facture::addline sql=".$sql);
+		dol_syslog("Fournisseur.facture::addline sql=".$sql);
 
 		$resql = $this->db->query($sql);
 		if ($resql)
@@ -516,7 +516,7 @@ class FactureFournisseur extends Facture
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Error sql=$sql, error=".$this->error);
+				dol_syslog("Error sql=$sql, error=".$this->error);
 				$this->db->rollback();
 				return -1;
 			}
@@ -585,7 +585,7 @@ class FactureFournisseur extends Facture
 		$sql.= ', product_type='.$product_type;
 		$sql.= ' WHERE rowid = '.$id;
 
-		dolibarr_syslog("Fournisseur.facture::updateline sql=".$sql);
+		dol_syslog("Fournisseur.facture::updateline sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -595,7 +595,7 @@ class FactureFournisseur extends Facture
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Fournisseur.facture::updateline error=".$this->error);
+			dol_syslog("Fournisseur.facture::updateline error=".$this->error);
 			return -1;
 		}
 	}
@@ -612,7 +612,7 @@ class FactureFournisseur extends Facture
 		$resql = $this->db->query($sql);
 		if (! $resql)
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		// Mise a jour prix facture
 		$this->update_price();
@@ -657,7 +657,7 @@ class FactureFournisseur extends Facture
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -694,7 +694,7 @@ class FactureFournisseur extends Facture
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
diff --git a/htdocs/fourn/fournisseur.product.class.php b/htdocs/fourn/fournisseur.product.class.php
index ab6fc81673a..8c35ab41767 100644
--- a/htdocs/fourn/fournisseur.product.class.php
+++ b/htdocs/fourn/fournisseur.product.class.php
@@ -67,7 +67,7 @@ class ProductFournisseur extends Product
 		$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur";
 		$sql.= " WHERE fk_product = ".$this->id." AND fk_soc = ".$id_fourn;
 
-		dolibarr_syslog("ProductFournisseur::remove_fournisseur sql=".$sql);
+		dol_syslog("ProductFournisseur::remove_fournisseur sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -77,12 +77,12 @@ class ProductFournisseur extends Product
 				$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
 				$sql.= " WHERE fk_product_fournisseur = ".$obj->rowid;
 				
-				dolibarr_syslog("ProductFournisseur::remove_fournisseur sql=".$sql);
+				dol_syslog("ProductFournisseur::remove_fournisseur sql=".$sql);
 				$resql2=$this->db->query($sql);
 				if (! $resql2)
 				{
 					$this->error=$this->db->lasterror();
-					dolibarr_syslog("ProductFournisseur::remove_fournisseur ".$this->error, LOG_ERR);
+					dol_syslog("ProductFournisseur::remove_fournisseur ".$this->error, LOG_ERR);
 					$ok=0;
 				}
 			}
@@ -91,12 +91,12 @@ class ProductFournisseur extends Product
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur";
 			$sql.= " WHERE fk_product = ".$this->id." AND fk_soc = ".$id_fourn;
 			
-			dolibarr_syslog("ProductFournisseur::remove_fournisseur sql=".$sql);
+			dol_syslog("ProductFournisseur::remove_fournisseur sql=".$sql);
 			$resql=$this->db->query($sql);
 			if (! $resql)
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("ProductFournisseur::remove_fournisseur ".$this->error, LOG_ERR);
+				dol_syslog("ProductFournisseur::remove_fournisseur ".$this->error, LOG_ERR);
 				$ok=0;
 			}
 			
@@ -114,7 +114,7 @@ class ProductFournisseur extends Product
 		else
 		{
 			$this->db->rollback();
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -2;
 		}
 	}
@@ -125,7 +125,7 @@ class ProductFournisseur extends Product
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur";
 		$sql.= " WHERE rowid = ".$rowid;
 
-		dolibarr_syslog("ProductFournisseur::remove_product_fournisseur sql=".$sql);
+		dol_syslog("ProductFournisseur::remove_product_fournisseur sql=".$sql);
 		$resql = $this->db->query($sql);  
 		if ($resql)
 		{
@@ -148,7 +148,7 @@ class ProductFournisseur extends Product
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
 		$sql.= " WHERE rowid = ".$rowid;
-		dolibarr_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql);
+		dol_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql);
 		$resql = $this->db->query($sql);  
 		if ($resql) 
 		{
@@ -157,7 +157,7 @@ class ProductFournisseur extends Product
 			$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur as pf";
 			$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.fk_product_fournisseur = pf.rowid";
 			$sql.= " WHERE pfp.rowid IS NULL";
-			dolibarr_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql);
+			dol_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql);
 			$resql = $this->db->query($sql);  
 			if ($resql)
 			{
@@ -169,12 +169,12 @@ class ProductFournisseur extends Product
 	
 					$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur";
 					$sql.= " WHERE rowid = ".$rowidpf;
-					dolibarr_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql);
+					dol_syslog("ProductFournisseur::remove_product_fournisseur_price sql=".$sql);
 					$resql2 = $this->db->query($sql);  
 					if (! $resql2)
 					{
 						$this->error=$this->db->lasterror();
-						dolibarr_syslog("ProductFournisseur::remove_product_fournisseur_price ".$this->error,LOG_ERR);
+						dol_syslog("ProductFournisseur::remove_product_fournisseur_price ".$this->error,LOG_ERR);
 						$ok=0;
 					}
 				}
@@ -193,7 +193,7 @@ class ProductFournisseur extends Product
 			else
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("ProductFournisseur::remove_product_fournisseur_price ".$this->error,LOG_ERR);
+				dol_syslog("ProductFournisseur::remove_product_fournisseur_price ".$this->error,LOG_ERR);
 				$this->db->rollback();
 				return -2;
 			}
@@ -201,7 +201,7 @@ class ProductFournisseur extends Product
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("ProductFournisseur::remove_product_fournisseur_price ".$this->error,LOG_ERR);
+			dol_syslog("ProductFournisseur::remove_product_fournisseur_price ".$this->error,LOG_ERR);
 			$this->db->rollback();
 			return -1;
 		}
@@ -277,7 +277,7 @@ class ProductFournisseur extends Product
 			$sql.= " ,quantity = ".$qty;
 			$sql.= " ,unitprice = ".$unitBuyPrice;
 
-			dolibarr_syslog("ProductFournisseur::update_buyprice sql=".$sql);
+			dol_syslog("ProductFournisseur::update_buyprice sql=".$sql);
 			if (! $this->db->query($sql))
 			{
 				$error++;
@@ -365,7 +365,7 @@ class ProductFournisseur extends Product
 		$sql.= " WHERE fk_product = ".$this->id;
 		$sql.= " AND fk_soc = ".$fournid;
 
-		dolibarr_syslog("Product::fetch_fourn_data sql=".$sql);
+		dol_syslog("Product::fetch_fourn_data sql=".$sql);
 		$result = $this->db->query($sql) ;
 		if ($result)
 		{
@@ -377,7 +377,7 @@ class ProductFournisseur extends Product
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Product::fetch_fourn_data error=".$this->error);
+			dol_syslog("Product::fetch_fourn_data error=".$this->error);
 			return -1;
 		}
 	}
@@ -394,7 +394,7 @@ class ProductFournisseur extends Product
 		$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."product_fournisseur as pf";
 		$sql.= " WHERE pfp.rowid = ".$rowid." AND pf.rowid = pfp.fk_product_fournisseur";
 
-		dolibarr_syslog("Product::fetch_product_fournisseur_price sql=".$sql, LOG_DEBUG);
+		dol_syslog("Product::fetch_product_fournisseur_price sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql) ;
 		if ($resql)
 		{
@@ -419,7 +419,7 @@ class ProductFournisseur extends Product
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Product::fetch_product_fournisseur_price error=".$this->error, LOG_ERR);
+			dol_syslog("Product::fetch_product_fournisseur_price error=".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php
index 9fe58c6480a..c960bdb38d9 100644
--- a/htdocs/fourn/index.php
+++ b/htdocs/fourn/index.php
@@ -95,7 +95,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
@@ -216,7 +216,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
@@ -262,7 +262,7 @@ if ($resql)
 		print '<td><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"),"company").'</a>';
 		print "&nbsp;<a href=\"fiche.php?socid=".$obj->socid."\">".$obj->nom."</a></td>\n";
 		print '<td align="left">'.$obj->code_fournisseur.'&nbsp;</td>';
-		print '<td align="right">'.dolibarr_print_date($obj->tms,'day').'</td>';
+		print '<td align="right">'.dol_print_date($obj->tms,'day').'</td>';
 		print "</tr>\n";
 	}
 	print "</table>\n";
@@ -271,7 +271,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php
index 58eebf4ad01..bf2be885f83 100644
--- a/htdocs/fourn/liste.php
+++ b/htdocs/fourn/liste.php
@@ -152,7 +152,7 @@ if ($resql)
       print "<td>".$obj->ville."</td>\n";       
       print '<td align="left">'.$obj->code_fournisseur.'&nbsp;</td>';
       print '<td align="left">'.$obj->code_compta_fournisseur.'&nbsp;</td>';
-      print '<td align="center">'.dolibarr_print_date($obj->datec).'</td>';
+      print '<td align="center">'.dol_print_date($obj->datec).'</td>';
       print "<td>&nbsp;</td>\n";       
       print "</tr>\n";
       $i++;
@@ -163,7 +163,7 @@ if ($resql)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php
index 411633c74a9..eb9ab54315c 100644
--- a/htdocs/fourn/paiement/fiche.php
+++ b/htdocs/fourn/paiement/fiche.php
@@ -107,7 +107,7 @@ $head[$h][1] = $langs->trans('Info');
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, $langs->trans('SupplierPayment'));
+dol_fiche_head($head, $hselected, $langs->trans('SupplierPayment'));
 
 /*
  * Confirmation de la suppression du paiement
@@ -139,7 +139,7 @@ if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POS
 
 if (!empty($_POST['action']) && $_POST['action'] == 'update_date' && !empty($_POST['reday']))
 {
-	$datepaye = dolibarr_mktime(12, 0 , 0,
+	$datepaye = dol_mktime(12, 0 , 0,
 	$_POST['remonth'],
 	$_POST['reday'],
 	$_POST['reyear']);
@@ -185,7 +185,7 @@ if (empty($_GET['action']) || $_GET['action']!='edit_date')
 	if ($paiement->statut == 0 && $_GET['action'] != 'edit_date') print '<td align="right"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'&action=edit_date">'.img_edit($langs->trans('Modify')).'</a></td>';
 	print '</tr></table>';
 	print '</td>';
-	print '<td colspan="3">'.dolibarr_print_date($paiement->date,'day').'</td></tr>';
+	print '<td colspan="3">'.dol_print_date($paiement->date,'day').'</td></tr>';
 }
 else
 {
@@ -194,7 +194,7 @@ else
 	print '<td colspan="3">';
 	print '<form name="formsoc" method="post" action="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement->id.'"><input type="hidden" name="action" value="update_date" />';
 	if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear']))
-	$sel_date=dolibarr_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+	$sel_date=dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
 	else
 	$sel_date=$paiement->date;
 	$html->select_date($sel_date,'','','','',"addpaiement");
@@ -307,7 +307,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '</div>';
diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php
index c387a673df0..1bd2d98f2db 100644
--- a/htdocs/fourn/paiement/info.php
+++ b/htdocs/fourn/paiement/info.php
@@ -44,7 +44,7 @@ $head[$h][1] = $langs->trans("Info");
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("SupplierPayment"));
+dol_fiche_head($head, $hselected, $langs->trans("SupplierPayment"));
 
 
 /*
diff --git a/htdocs/fourn/product/categorie.php b/htdocs/fourn/product/categorie.php
index f337ac1e531..445737a1b80 100644
--- a/htdocs/fourn/product/categorie.php
+++ b/htdocs/fourn/product/categorie.php
@@ -103,7 +103,7 @@ if ($_GET["id"])
       }
 
 
-      dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
+      dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
 
       print($mesg);
       print '<table class="border" width="100%">';
diff --git a/htdocs/fourn/product/fourn.php b/htdocs/fourn/product/fourn.php
index b0c57327268..728bd5167c3 100644
--- a/htdocs/fourn/product/fourn.php
+++ b/htdocs/fourn/product/fourn.php
@@ -82,7 +82,7 @@ if ($_GET["id"])
       $hselected = $h;
       $h++;
 	  
-      dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
+      dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
       
       print '<table class="border" width="100%">';
       
@@ -152,7 +152,7 @@ if ($_GET["id"])
 	      $objp = $db->fetch_object($resql);
 	      $var=!$var;
 	      print "<tr $bc[$var]>";
-	      print '<td>'.dolibarr_print_date($objp->date_releve).'</td>';
+	      print '<td>'.dol_print_date($objp->date_releve).'</td>';
 	      print '<td align="right">'.price($objp->price).'</td>';
 	      print '<td align="center">'.$objp->quantity.'</td></tr>';
 	      
diff --git a/htdocs/fourn/product/index.php b/htdocs/fourn/product/index.php
index 397c042cf29..a69219e3843 100644
--- a/htdocs/fourn/product/index.php
+++ b/htdocs/fourn/product/index.php
@@ -142,7 +142,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error();
+  dol_print_error();
 }
 
 print '</td></tr></table>';
diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php
index 565ec787061..347aacb5523 100644
--- a/htdocs/fourn/product/liste.php
+++ b/htdocs/fourn/product/liste.php
@@ -138,7 +138,7 @@ $sql .= " ORDER BY ".$sortfield." ".$sortorder;
 $sql .= $db->plimit($limit + 1 ,$offset);
 
 
-dolibarr_syslog("fourn/product/liste: sql=".$sql);
+dol_syslog("fourn/product/liste: sql=".$sql);
 
 $resql = $db->query($sql) ;
 if ($resql)
@@ -250,7 +250,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/fourn/product/photos.php b/htdocs/fourn/product/photos.php
index 17dbe458988..408e45e7cbe 100644
--- a/htdocs/fourn/product/photos.php
+++ b/htdocs/fourn/product/photos.php
@@ -94,7 +94,7 @@ if ($_GET["id"])
       $head[$h][1] = $langs->trans("CommercialCard");
       $h++;
       	      
-      dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
+      dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
 
       print($mesg);
       print '<table class="border" width="100%">';
@@ -160,7 +160,7 @@ if ($_GET["id"])
                 print '<img border="0" height="120" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$filename).'">';
 
                 print '</a>';
-                print '<br>'.$langs->trans("File").': '.dolibarr_trunc($filename,16);
+                print '<br>'.$langs->trans("File").': '.dol_trunc($filename,16);
                 if ($user->rights->produit->creer)
                 {
                     print '<br>'.'<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=delete&amp;file='.urlencode($pdir.$filename).'">'.img_delete().'</a>';
diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php
index 4ee9981c5a0..7421bc91e4c 100644
--- a/htdocs/fourn/recap-fourn.php
+++ b/htdocs/fourn/recap-fourn.php
@@ -59,7 +59,7 @@ if ($socid > 0)
      */
 	$head = societe_prepare_head($societe);
 
-    dolibarr_fiche_head($head, 'supplier', $langs->trans("ThirdParty"));
+    dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"));
 
 
     print "<table width=\"100%\">\n";
@@ -86,7 +86,7 @@ if ($socid > 0)
 }
 else
 {
-  	dolibarr_print_error($db);
+  	dol_print_error($db);
 }
 
 
diff --git a/htdocs/fourn/stats.php b/htdocs/fourn/stats.php
index 616dd634d26..2d1a87673c7 100644
--- a/htdocs/fourn/stats.php
+++ b/htdocs/fourn/stats.php
@@ -89,7 +89,7 @@ $sql .= " AND ca.year > (date_format(".$db->idate(mktime()).",'%Y') - 5)";
 
 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
 
-dolibarr_syslog("fourn/stats.php sql=".$sql);
+dol_syslog("fourn/stats.php sql=".$sql);
 $resql = $db->query($sql);
 if ($resql)
 {
@@ -111,7 +111,7 @@ if ($resql)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 0ecf606ccb9..2ec5083b139 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -203,7 +203,7 @@ class Form
 		}
 		$sql.= " ORDER BY code ASC";
 
-		dolibarr_syslog("Form::select_pays sql=".$sql);
+		dol_syslog("Form::select_pays sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -277,7 +277,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 1;
 		}
 	}
@@ -331,7 +331,7 @@ class Form
 		$sql.= " WHERE active = 1";
 		$sql.= " ORDER BY c.libelle ASC";
 
-		dolibarr_syslog("Form::select_type_socialcontrib sql=".$sql, LOG_DEBUG);
+		dol_syslog("Form::select_type_socialcontrib sql=".$sql, LOG_DEBUG);
 		$resql=$db->query($sql);
 		if ($resql)
 		{
@@ -352,7 +352,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($db,$db->lasterror());
+			dol_print_error($db,$db->lasterror());
 		}
 	}
 
@@ -425,7 +425,7 @@ class Form
 		}
 		$sql.= " ORDER BY nom ASC";
 
-		dolibarr_syslog("Form::select_societes sql=".$sql);
+		dol_syslog("Form::select_societes sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -482,7 +482,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -507,7 +507,7 @@ class Form
 		if ($filter) $sql.= " AND ".$filter;
 		$sql.= " ORDER BY re.description ASC";
 
-		dolibarr_syslog("Form::select_remises sql=".$sql);
+		dol_syslog("Form::select_remises sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -523,7 +523,7 @@ class Form
 				while ($i < $num)
 				{
 					$obj = $this->db->fetch_object($resql);
-					$desc=dolibarr_trunc($obj->description,40);
+					$desc=dol_trunc($obj->description,40);
 					if ($desc=='(CREDIT_NOTE)')
 					{
 						$desc=$langs->trans("CreditNote");
@@ -549,7 +549,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -579,7 +579,7 @@ class Form
 		if (is_array($exclude) && $excludeContacts) $sql.= " AND s.rowid NOT IN ('".$excludeContacts."')";
 		$sql.= " ORDER BY s.name ASC";
 
-		dolibarr_syslog("Form::select_contacts sql=".$sql);
+		dol_syslog("Form::select_contacts sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -621,7 +621,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -649,7 +649,7 @@ class Form
 		if (is_array($exclude) && $excludeUsers) $sql.= " WHERE u.rowid NOT IN ('".$excludeUsers."')";
 		$sql.= " ORDER BY u.name ASC";
 
-		dolibarr_syslog("Form::select_users sql=".$sql);
+		dol_syslog("Form::select_users sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			print '<select class="flat" name="'.$htmlname.'"'.($disabled?' disabled="true"':'').'>';
@@ -677,7 +677,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -768,9 +768,9 @@ class Form
 		$sql.= " ORDER BY p.ref";
 		if ($limit) $sql.= " LIMIT $limit";
 
-		dolibarr_syslog("Form::select_produits_do sql=".$sql, LOG_DEBUG);
+		dol_syslog("Form::select_produits_do sql=".$sql, LOG_DEBUG);
 		$result=$this->db->query($sql);
-		if (! $result) dolibarr_print_error($this->db);
+		if (! $result) dol_print_error($this->db);
 
 		// Multilang : on construit une liste des traductions des produits list�s
 		if ($conf->global->MAIN_MULTILANGS)
@@ -780,7 +780,7 @@ class Form
 			$sqld.= " WHERE d.fk_product=p.rowid AND p.envente=1 AND d.lang='". $langs->getDefaultLang() ."'";
 			$sqld.= " ORDER BY p.ref";
 
-			dolibarr_syslog("Form::select_produits_do sql=".$sql, LOG_DEBUG);
+			dol_syslog("Form::select_produits_do sql=".$sql, LOG_DEBUG);
 			$resultd = $this->db->query($sqld);
 			if ( $resultd ) $objtp = $this->db->fetch_object($resultd);
 		}
@@ -825,7 +825,7 @@ class Form
 					}
 				}
 				$opt = '<option value="'.$objp->rowid.'">'.$objp->ref.' - ';
-				$opt.= dolibarr_trunc($objp->label,32).' - ';
+				$opt.= dol_trunc($objp->label,32).' - ';
 
 				// Multiprix
 				if ($price_level > 1)
@@ -835,7 +835,7 @@ class Form
 					$sql.= "where fk_product='".$objp->rowid."' and price_level=".$price_level;
 					$sql.= " order by date_price DESC limit 1";
 
-					dolibarr_syslog("Form::select_produits_do sql=".$sql);
+					dol_syslog("Form::select_produits_do sql=".$sql);
 					$result2 = $this->db->query($sql);
 					$objp2 = $this->db->fetch_object($result2);
 					if ($objp2)
@@ -888,7 +888,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
@@ -944,7 +944,7 @@ class Form
 		if ($ajaxkeysearch && $ajaxkeysearch != '') $sql.=" AND (pf.ref_fourn like '%".$ajaxkeysearch."%' OR p.ref like '%".$ajaxkeysearch."%' OR p.label like '%".$ajaxkeysearch."%')";
 		$sql.= " ORDER BY pf.ref_fourn DESC";
 
-		dolibarr_syslog("Form::select_produits_fournisseurs_do sql=".$sql,LOG_DEBUG);
+		dol_syslog("Form::select_produits_fournisseurs_do sql=".$sql,LOG_DEBUG);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -980,7 +980,7 @@ class Form
 				if ($selected == $objp->idprodfournprice) $opt.= ' selected="true"';
 				if ($objp->fprice == '') $opt.=' disabled="disabled"';
 				$opt.= '>'.$objp->ref.' ('.$objp->ref_fourn.') - ';
-				$opt.= dolibarr_trunc($objp->label,18).' - ';
+				$opt.= dol_trunc($objp->label,18).' - ';
 				if ($objp->fprice != '') 	// Keep != ''
 				{
 					$opt.= price($objp->fprice);
@@ -1000,7 +1000,7 @@ class Form
 						$opt.=")";
 					}
 					if ($objp->duration) $opt .= " - ".$objp->duration;
-					if (! $socid) $opt .= " - ".dolibarr_trunc($objp->nom,8);
+					if (! $socid) $opt .= " - ".dol_trunc($objp->nom,8);
 				}
 				else
 				{
@@ -1017,7 +1017,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
@@ -1044,7 +1044,7 @@ class Form
 		$sql.= " AND p.rowid = ".$productid;
 		$sql.= " ORDER BY s.nom, pf.ref_fourn DESC";
 
-		dolibarr_syslog("Form::select_product_fourn_price sql=".$sql,LOG_DEBUG);
+		dol_syslog("Form::select_product_fourn_price sql=".$sql,LOG_DEBUG);
 		$result=$this->db->query($sql);
 
 		if ($result)
@@ -1104,7 +1104,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
@@ -1121,7 +1121,7 @@ class Form
 		$sql .= " WHERE a.fk_societe = ".$socid;
 		$sql .= " ORDER BY a.label ASC";
 
-		dolibarr_syslog("Form::select_adresse_livraison sql=".$sql);
+		dol_syslog("Form::select_adresse_livraison sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			print '<select class="flat" name="'.$htmlname.'">';
@@ -1150,7 +1150,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1169,7 +1169,7 @@ class Form
 		$sql.= " FROM ".MAIN_DB_PREFIX."cond_reglement";
 		$sql.= " WHERE active=1";
 		$sql.= " ORDER BY sortorder";
-		dolibarr_syslog('Form::load_cache_conditions_paiements sql='.$sql,LOG_DEBUG);
+		dol_syslog('Form::load_cache_conditions_paiements sql='.$sql,LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -1188,7 +1188,7 @@ class Form
 			return 1;
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -1207,7 +1207,7 @@ class Form
 		$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement";
 		$sql.= " WHERE active > 0";
 		$sql.= " ORDER BY id";
-		dolibarr_syslog('Form::load_cache_types_paiements sql='.$sql,LOG_DEBUG);
+		dol_syslog('Form::load_cache_types_paiements sql='.$sql,LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -1227,7 +1227,7 @@ class Form
 			return $num;
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -1279,7 +1279,7 @@ class Form
 	{
 		global $langs,$user;
 
-		dolibarr_syslog("Form::select_type_paiements $selected, $htmlname, $filtertype, $format",LOG_DEBUG);
+		dol_syslog("Form::select_type_paiements $selected, $htmlname, $filtertype, $format",LOG_DEBUG);
 
 		$filterarray=array();
 		if ($filtertype == 'CRDT')  	$filterarray=array(0,2);
@@ -1350,7 +1350,7 @@ class Form
 		$sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst";
 		$sql .= " WHERE active = 1";
 
-		dolibarr_syslog("Form::select_propal_statut sql=".$sql);
+		dol_syslog("Form::select_propal_statut sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			print '<select class="flat" name="propal_statut">';
@@ -1381,7 +1381,7 @@ class Form
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1404,7 +1404,7 @@ class Form
 		if ($filtre) $sql.=" AND ".$filtre;
 		$sql.= " ORDER BY rowid";
 
-		dolibarr_syslog("Form::select_comptes sql=".$sql);
+		dol_syslog("Form::select_comptes sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -1434,7 +1434,7 @@ class Form
 			print "</select>";
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1471,7 +1471,7 @@ class Form
 					{
 						$add = '';
 					}
-					$output.= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'">'.dolibarr_trunc($cate_arbo[$key]['fulllabel'],80,'middle').'</option>';
+					$output.= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'">'.dol_trunc($cate_arbo[$key]['fulllabel'],80,'middle').'</option>';
 				}
 			}
 		}
@@ -1905,7 +1905,7 @@ class Form
 			return 0;
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 1;
 		}
 	}
@@ -2100,7 +2100,7 @@ class Form
 				//print "e".$set_time." t ".$conf->format_date_short;
 				if (strval($set_time) != '' && $set_time != -1)
 				{
-					$formated_date=dolibarr_print_date($set_time,$conf->format_date_short);
+					$formated_date=dol_print_date($set_time,$conf->format_date_short);
 				}
 
 				// Calendrier popup version eldy
@@ -2189,7 +2189,7 @@ class Form
 				for ($month = 1 ; $month <= 12 ; $month++)
 				{
 					print '<option value="'.$month.'"'.($month == $smonth?' selected="true"':'').'>';
-					print dolibarr_print_date(mktime(1,1,1,$month,1,2000),"%b");
+					print dol_print_date(mktime(1,1,1,$month,1,2000),"%b");
 					print "</option>";
 				}
 				print "</select>";
@@ -2401,13 +2401,13 @@ class Form
 				if ($key_in_label)
 				{
 					$newval=($translate?$langs->trans($value):$value);
-					$selectOptionValue = $key.' - '.($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
+					$selectOptionValue = $key.' - '.($maxlen?dol_trunc($newval,$maxlen):$newval);
 					print $selectOptionValue;
 				}
 				else
 				{
 					$newval=($translate?$langs->trans($value):$value);
-					$selectOptionValue = ($maxlen?dolibarr_trunc($newval,$maxlen):$newval);
+					$selectOptionValue = ($maxlen?dol_trunc($newval,$maxlen):$newval);
 					if ($value == '' || $value == '-') { $selectOptionValue='&nbsp;'; }
 					print $selectOptionValue;
 				}
@@ -2497,7 +2497,7 @@ class Form
 			print "</select>";
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
diff --git a/htdocs/html.formactions.class.php b/htdocs/html.formactions.class.php
index b62e4baf434..3547fa0314f 100644
--- a/htdocs/html.formactions.class.php
+++ b/htdocs/html.formactions.class.php
@@ -107,7 +107,7 @@ class FormActions
 		if ($typeelement == 'propal')  $sql.= ' AND a.propalrowid = '.$object->id;
 		if ($typeelement == 'order')   $sql.= ' AND a.fk_commande = '.$object->id;
 
-		dolibarr_syslog("FormActions::showactions sql=".$sql);
+		dol_syslog("FormActions::showactions sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -130,8 +130,8 @@ class FormActions
 					$var=!$var;
 					print '<tr '.$bc[$var].'>';
 					print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
-					print '<td>'.dolibarr_print_date($objp->da,'day').'</td>';
-					print '<td title="'.dol_escape_htmltag($objp->label).'">'.dolibarr_trunc($objp->label,32).'</td>';
+					print '<td>'.dol_print_date($objp->da,'day').'</td>';
+					print '<td title="'.dol_escape_htmltag($objp->label).'">'.dol_trunc($objp->label,32).'</td>';
 					print '<td>'.$objp->login.'</td>';
 					print '</tr>';
 					$i++;
@@ -143,7 +143,7 @@ class FormActions
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
diff --git a/htdocs/html.formcompany.class.php b/htdocs/html.formcompany.class.php
index 0762ba72148..4ccc8b6b6d1 100644
--- a/htdocs/html.formcompany.class.php
+++ b/htdocs/html.formcompany.class.php
@@ -62,7 +62,7 @@ class FormCompany
 		$sql.= " FROM ".MAIN_DB_PREFIX."c_typent";
 		$sql.= " WHERE active = 1";
 		$sql.= " ORDER by id";
-		dolibarr_syslog('Form::typent_array sql='.$sql,LOG_DEBUG);
+		dol_syslog('Form::typent_array sql='.$sql,LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -100,7 +100,7 @@ class FormCompany
 		$sql .= " FROM ".MAIN_DB_PREFIX."c_effectif";
 		$sql.= " WHERE active = 1";
 		$sql .= " ORDER BY id ASC";
-		dolibarr_syslog('Form::effectif_array sql='.$sql,LOG_DEBUG);
+		dol_syslog('Form::effectif_array sql='.$sql,LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -141,7 +141,7 @@ class FormCompany
 		print '<select class="flat" name="'.$htmlname.'">';
 		if ($empty) print '<option value="">&nbsp;</option>';
 
-		dolibarr_syslog('Form::form_prospect_level',LOG_DEBUG);
+		dol_syslog('Form::form_prospect_level',LOG_DEBUG);
 		$sql = "SELECT code, label";
 		$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
 		$sql.= " WHERE active > 0";
@@ -166,7 +166,7 @@ class FormCompany
 				$i++;
 			}
 		}
-		else dolibarr_print_error($this->db);
+		else dol_print_error($this->db);
 		print '</select>';
 
 		print '</td>';
@@ -188,7 +188,7 @@ class FormCompany
 	{
 		global $conf,$langs,$user;
 			
-		dolibarr_syslog("Form::select_departement selected=$selected, pays_code=$pays_code",LOG_DEBUG);
+		dol_syslog("Form::select_departement selected=$selected, pays_code=$pays_code",LOG_DEBUG);
 			
 		$langs->load("dict");
 
@@ -202,7 +202,7 @@ class FormCompany
 		if ($pays_code) $sql .= " AND p.code = '".$pays_code."'";
 		$sql .= " ORDER BY p.code, d.code_departement";
 
-		dolibarr_syslog("Form::select_departement sql=".$sql);
+		dol_syslog("Form::select_departement sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -210,7 +210,7 @@ class FormCompany
 			if ($pays_code) print '<option value="0">&nbsp;</option>';
 			$num = $this->db->num_rows($result);
 			$i = 0;
-			dolibarr_syslog("Form::select_departement num=$num",LOG_DEBUG);
+			dol_syslog("Form::select_departement num=$num",LOG_DEBUG);
 			if ($num)
 			{
 				$pays='';
@@ -252,7 +252,7 @@ class FormCompany
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -272,7 +272,7 @@ class FormCompany
 		$sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, p.libelle as libelle_pays FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p";
 		$sql .= " WHERE r.fk_pays=p.rowid AND r.active = 1 and p.active = 1 ORDER BY libelle_pays, libelle ASC";
 
-		dolibarr_syslog("Form::select_region sql=".$sql);
+		dol_syslog("Form::select_region sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			print '<select class="flat" name="'.$htmlname.'">';
@@ -311,7 +311,7 @@ class FormCompany
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -328,7 +328,7 @@ class FormCompany
 		$sql = "SELECT rowid, code, civilite, active FROM ".MAIN_DB_PREFIX."c_civilite";
 		$sql .= " WHERE active = 1";
 
-		dolibarr_syslog("Form::select_civilite sql=".$sql);
+		dol_syslog("Form::select_civilite sql=".$sql);
 		if ($this->db->query($sql))
 		{
 			print '<select class="flat" name="civilite_id">';
@@ -359,7 +359,7 @@ class FormCompany
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -383,7 +383,7 @@ class FormCompany
 		if ($pays_code) $sql .= " AND p.code = '".$pays_code."'";
 		$sql .= " ORDER BY p.code, f.code";
 
-		dolibarr_syslog("Form::select_forme_juridique sql=".$sql);
+		dol_syslog("Form::select_forme_juridique sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -432,7 +432,7 @@ class FormCompany
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -503,12 +503,12 @@ class FormCompany
 						if ($i == 0) $firstCompany = $obj->rowid;
 						if ($selected > 0 && $selected == $obj->rowid)
 						{
-							print '<option value="'.$obj->rowid.'" selected="true">'.dolibarr_trunc($obj->nom,24).'</option>';
+							print '<option value="'.$obj->rowid.'" selected="true">'.dol_trunc($obj->nom,24).'</option>';
 							$firstCompany = $obj->rowid;
 						}
 						else
 						{
-							print '<option value="'.$obj->rowid.'">'.dolibarr_trunc($obj->nom,24).'</option>';
+							print '<option value="'.$obj->rowid.'">'.dol_trunc($obj->nom,24).'</option>';
 						}
 						$i ++;
 					}
@@ -519,7 +519,7 @@ class FormCompany
 		}
 		else
 		{
-			dolibarr_print_error($object->db);
+			dol_print_error($object->db);
 		}
 	}
 
diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php
index 1d8946aaf14..c6ce404a6d3 100644
--- a/htdocs/html.formfile.class.php
+++ b/htdocs/html.formfile.class.php
@@ -276,7 +276,7 @@ class FormFile
 			}
 			else
 			{
-				dolibarr_print_error($this->db,'Bad value for modulepart');
+				dol_print_error($this->db,'Bad value for modulepart');
 				return -1;
 			}
 
@@ -358,7 +358,7 @@ class FormFile
 			print '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">';
 			if (!$iconPDF)
 			{
-				print img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dolibarr_trunc($file["name"],$maxfilenamelength);
+				print img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
 			}
 			else
 			{
@@ -369,7 +369,7 @@ class FormFile
 			// Affiche taille fichier
 			if (!$iconPDF) print '<td align="right">'.filesize($filedir."/".$file["name"]). ' bytes</td>';
 			// Affiche date fichier
-			if (!$iconPDF) print '<td align="right">'.dolibarr_print_date(filemtime($filedir."/".$file["name"]),'dayhour').'</td>';
+			if (!$iconPDF) print '<td align="right">'.dol_print_date(filemtime($filedir."/".$file["name"]),'dayhour').'</td>';
 
 			if ($delallowed)
 			{
@@ -456,7 +456,7 @@ class FormFile
 				print '</a>';
 				print "</td>\n";
 				print '<td align="right">'.dol_print_size($file['size']).'</td>';
-				print '<td align="center">'.dolibarr_print_date($file['date'],"dayhour").'</td>';
+				print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>';
 				print '<td align="right">';
 				//print '&nbsp;';
 				if ($permtodelete)
diff --git a/htdocs/html.formorder.class.php b/htdocs/html.formorder.class.php
index 47a494dec72..e3f4e22c770 100644
--- a/htdocs/html.formorder.class.php
+++ b/htdocs/html.formorder.class.php
@@ -89,7 +89,7 @@ class FormOrder
 		$sql.= " FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
 		$sql.= " WHERE active = 1";
 
-		dolibarr_syslog("Form::select_methodes_commande sql=".$sql);
+		dol_syslog("Form::select_methodes_commande sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -104,7 +104,7 @@ class FormOrder
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 
diff --git a/htdocs/html.formother.class.php b/htdocs/html.formother.class.php
index f78a7cc0298..9524ea08786 100644
--- a/htdocs/html.formother.class.php
+++ b/htdocs/html.formother.class.php
@@ -97,7 +97,7 @@ class FormOther
 			print "</select>";
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -148,7 +148,7 @@ class FormOther
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 1;
 		}
 	}
diff --git a/htdocs/html.formproduct.class.php b/htdocs/html.formproduct.class.php
index 4609421b90a..dd7d47f5108 100644
--- a/htdocs/html.formproduct.class.php
+++ b/htdocs/html.formproduct.class.php
@@ -66,7 +66,7 @@ class FormProduct
 		$sql .= " WHERE statut = 1";
 		$sql .= " ORDER BY e.label";
 
-		dolibarr_syslog('FormProduct::loadWarehouses sql='.$sql,LOG_DEBUG);
+		dol_syslog('FormProduct::loadWarehouses sql='.$sql,LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -84,7 +84,7 @@ class FormProduct
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -100,7 +100,7 @@ class FormProduct
 	{
 		global $langs,$user;
 
-		dolibarr_syslog("Form::selectWarehouses $selected, $htmlname, $filtertype, $format",LOG_DEBUG);
+		dol_syslog("Form::selectWarehouses $selected, $htmlname, $filtertype, $format",LOG_DEBUG);
 
 		$this->loadWarehouses();
 
diff --git a/htdocs/includes/barcode/html.formbarcode.class.php b/htdocs/includes/barcode/html.formbarcode.class.php
index dd39b3c7ba1..2ca3adbe4a7 100644
--- a/htdocs/includes/barcode/html.formbarcode.class.php
+++ b/htdocs/includes/barcode/html.formbarcode.class.php
@@ -131,7 +131,7 @@ class FormBarCode
             print "</select>";
         }
         else {
-            dolibarr_print_error($this->db);
+            dol_print_error($this->db);
         }
     }
     
diff --git a/htdocs/includes/barcode/php-barcode/php-barcode.php b/htdocs/includes/barcode/php-barcode/php-barcode.php
index dba19e1159b..dd57eff3ed1 100644
--- a/htdocs/includes/barcode/php-barcode/php-barcode.php
+++ b/htdocs/includes/barcode/php-barcode/php-barcode.php
@@ -85,7 +85,7 @@ else
 	//$genbarcode_loc = "/usr/local/bin/genbarcode";
 	$genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
 }
-//dolibarr_syslog("genbarcode_loc=".$genbarcode_loc);
+//dol_syslog("genbarcode_loc=".$genbarcode_loc);
 
 
 /* CONFIGURATION ENDS HERE */
@@ -438,7 +438,7 @@ function barcode_encode($code,$encoding){
  *    array[text]     : text-positioning info
  */
 function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png" ){
-	dolibarr_syslog("$code $encoding $scale $mode");
+	dol_syslog("$code $encoding $scale $mode");
 	$bars=barcode_encode($code,$encoding);
     if (!$bars) return;
     if (!$mode) $mode="png";
diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php
index d0ceda1b1ac..c05cbbcba93 100644
--- a/htdocs/includes/boxes/box_actions.php
+++ b/htdocs/includes/boxes/box_actions.php
@@ -89,7 +89,7 @@ class box_actions extends ModeleBoxes {
 			$sql.= " ORDER BY a.datec DESC";
 			$sql.= $db->plimit($max, 0);
 
-			dolibarr_syslog("Box_actions::loadBox sql=".$sql, LOG_DEBUG);
+			dol_syslog("Box_actions::loadBox sql=".$sql, LOG_DEBUG);
 			$result = $db->query($sql);
 			if ($result)
 			{
@@ -113,16 +113,16 @@ class box_actions extends ModeleBoxes {
 					'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id);
 
 					$this->info_box_contents[$i][1] = array('td' => 'align="left" nowrap="1"',
-					'text' => dolibarr_trunc($label,12),
+					'text' => dol_trunc($label,12),
 					'text2'=> $late,
 					'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id);
 
 					$this->info_box_contents[$i][2] = array('td' => 'align="left"',
-					'text' => dolibarr_trunc($objp->nom,20),
+					'text' => dol_trunc($objp->nom,20),
 					'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-					'text' => dolibarr_print_date($datelimite, "dayhour"));
+					'text' => dol_print_date($datelimite, "dayhour"));
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="right"',
 					'text' => $objp->percentage. "%");
@@ -136,7 +136,7 @@ class box_actions extends ModeleBoxes {
 				if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo"));
 			}
 			else {
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 		}
 		else {
diff --git a/htdocs/includes/boxes/box_bookmarks.php b/htdocs/includes/boxes/box_bookmarks.php
index 52093ba5a6c..dbcf883057a 100644
--- a/htdocs/includes/boxes/box_bookmarks.php
+++ b/htdocs/includes/boxes/box_bookmarks.php
@@ -111,7 +111,7 @@ class box_bookmarks extends ModeleBoxes {
             }
             else
             {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
         else {
diff --git a/htdocs/includes/boxes/box_clients.php b/htdocs/includes/boxes/box_clients.php
index 91a2582fb4f..cd467a0bc9d 100644
--- a/htdocs/includes/boxes/box_clients.php
+++ b/htdocs/includes/boxes/box_clients.php
@@ -102,7 +102,7 @@ class box_clients extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][2] = array('td' => 'align="right"',
-					'text' => dolibarr_print_date($datem, "day"));
+					'text' => dol_print_date($datem, "day"));
 
 					$i++;
 				}
@@ -110,7 +110,7 @@ class box_clients extends ModeleBoxes {
 				if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers"));
 			}
 			else {
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 		}
 		else {
diff --git a/htdocs/includes/boxes/box_commandes.php b/htdocs/includes/boxes/box_commandes.php
index 4a41e852626..7f80b89e479 100644
--- a/htdocs/includes/boxes/box_commandes.php
+++ b/htdocs/includes/boxes/box_commandes.php
@@ -111,7 +111,7 @@ class box_commandes extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
 
                     $this->info_box_contents[$i][3] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datem,'day'),
+                    'text' => dol_print_date($datem,'day'),
                     );
                     
                     $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
@@ -123,7 +123,7 @@ class box_commandes extends ModeleBoxes {
                 if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedOrders"));
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
         else {
diff --git a/htdocs/includes/boxes/box_comptes.php b/htdocs/includes/boxes/box_comptes.php
index 1e190d83101..f16bb8e3d8c 100644
--- a/htdocs/includes/boxes/box_comptes.php
+++ b/htdocs/includes/boxes/box_comptes.php
@@ -77,7 +77,7 @@ class box_comptes extends ModeleBoxes {
 			$sql.= " ORDER BY label";
 			$sql.= $db->plimit($max, 0);
 
-			dolibarr_syslog("Box_comptes::loadBox sql=".$sql);
+			dol_syslog("Box_comptes::loadBox sql=".$sql);
 			$result = $db->query($sql);
 			if ($result)
 			{
@@ -125,7 +125,7 @@ class box_comptes extends ModeleBoxes {
 
 			}
 			else {
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 		}
 		else {
diff --git a/htdocs/includes/boxes/box_external_rss.php b/htdocs/includes/boxes/box_external_rss.php
index daeac626045..78af3c636d6 100644
--- a/htdocs/includes/boxes/box_external_rss.php
+++ b/htdocs/includes/boxes/box_external_rss.php
@@ -83,8 +83,8 @@ class box_external_rss extends ModeleBoxes {
         $rss=fetch_rss($url);
         if (! is_object($rss))
         {
-        	dolibarr_syslog("FETCH_RSS site=".$site);
-        	dolibarr_syslog("FETCH_RSS url=".$url);
+        	dol_syslog("FETCH_RSS site=".$site);
+        	dol_syslog("FETCH_RSS url=".$url);
         	return -1;
         }
         
@@ -96,13 +96,13 @@ class box_external_rss extends ModeleBoxes {
         if ($rss->ERROR)
         {
             // Affiche warning car il y a eu une erreur
-            $title.=" ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate",(isset($rss->date)?dolibarr_print_date($rss->date,"dayhourtext"):$langs->trans("Unknown"))));
+            $title.=" ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate",(isset($rss->date)?dol_print_date($rss->date,"dayhourtext"):$langs->trans("Unknown"))));
             $this->info_box_head = array('text' => $title,'limit' => 0);
         }
         else
         {         
         	$this->info_box_head = array('text' => $title,
-        		'sublink' => $link, 'subtext'=>$langs->trans("LastRefreshDate").': '.(isset($rss->date)?dolibarr_print_date($rss->date,"dayhourtext"):$langs->trans("Unknown")), 'subpicto'=>'object_bookmark');
+        		'sublink' => $link, 'subtext'=>$langs->trans("LastRefreshDate").': '.(isset($rss->date)?dol_print_date($rss->date,"dayhourtext"):$langs->trans("Unknown")), 'subpicto'=>'object_bookmark');
 		}
 
 		// INFO sur le �lements
@@ -129,7 +129,7 @@ class box_external_rss extends ModeleBoxes {
 				//$item['modified']
 				//$item['atom_content']
 			}
-			if (is_numeric($date)) $date=dolibarr_print_date($date,"dayhour");
+			if (is_numeric($date)) $date=dol_print_date($date,"dayhour");
 			
 			$isutf8 = utf8_check($title);
 	        if (! $isutf8 && $conf->character_set_client == 'UTF-8') $title=utf8_encode($title); 
diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php
index f6d9a2706bd..eadc0304712 100644
--- a/htdocs/includes/boxes/box_factures.php
+++ b/htdocs/includes/boxes/box_factures.php
@@ -108,7 +108,7 @@ class box_factures extends ModeleBoxes {
 					if ($objp->type == 1) $picto.='r';
 					if ($objp->type == 2) $picto.='a';
 					$late = '';
-					if ($objp->paye == 0 && $objp->fk_statut != 3 && $datelimite < ($now - $conf->facture->warning_delay)) { $late = img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day')));}
+					if ($objp->paye == 0 && $objp->fk_statut != 3 && $datelimite < ($now - $conf->facture->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));}
 
 					$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
                     'logo' => $picto,
@@ -125,7 +125,7 @@ class box_factures extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datec,'day'),
+                    'text' => dol_print_date($datec,'day'),
 					);
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
diff --git a/htdocs/includes/boxes/box_factures_fourn.php b/htdocs/includes/boxes/box_factures_fourn.php
index 6eb06235adb..be4bf036c4c 100644
--- a/htdocs/includes/boxes/box_factures_fourn.php
+++ b/htdocs/includes/boxes/box_factures_fourn.php
@@ -104,7 +104,7 @@ class box_factures_fourn extends ModeleBoxes {
 					$datec=$db->jdate($objp->datec);
 
                     $late = '';
-                    if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dolibarr_print_date($datelimite,'day')));
+                    if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
 
                     $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
                     'logo' => $this->boximg,
@@ -120,7 +120,7 @@ class box_factures_fourn extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datec,'day'));
+                    'text' => dol_print_date($datec,'day'));
 
                     $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
                     'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
@@ -131,7 +131,7 @@ class box_factures_fourn extends ModeleBoxes {
                 if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedCustomerBills"));
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
         else {
diff --git a/htdocs/includes/boxes/box_factures_fourn_imp.php b/htdocs/includes/boxes/box_factures_fourn_imp.php
index 9e2661bf0e4..4305821b181 100644
--- a/htdocs/includes/boxes/box_factures_fourn_imp.php
+++ b/htdocs/includes/boxes/box_factures_fourn_imp.php
@@ -99,7 +99,7 @@ class box_factures_fourn_imp extends ModeleBoxes {
 					$datelimite=$db->jdate($objp->datelimite);
 					
                     $late='';
-                    if ($datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day')));
+                    if ($datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
                     
                     $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
                     'logo' => $this->boximg,
@@ -115,7 +115,7 @@ class box_factures_fourn_imp extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
                     
                     $this->info_box_contents[$i][3] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datelimite,'day'));
+                    'text' => dol_print_date($datelimite,'day'));
 
                     $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
                     'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
@@ -126,7 +126,7 @@ class box_factures_fourn_imp extends ModeleBoxes {
                 if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedSupplierBills"));
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
         else {
diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php
index ff4c81f753d..b3f3f607624 100644
--- a/htdocs/includes/boxes/box_factures_imp.php
+++ b/htdocs/includes/boxes/box_factures_imp.php
@@ -103,7 +103,7 @@ class box_factures_imp extends ModeleBoxes {
 					$datelimite=$db->jdate($objp->datelimite);
 					
                     $late='';
-                    if ($datelimite < ($now - $conf->facture->warning_delay)) $late = img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day')));
+                    if ($datelimite < ($now - $conf->facture->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
 
                     $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
                     'logo' => $this->boximg,
@@ -120,7 +120,7 @@ class box_factures_imp extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
 
                     $this->info_box_contents[$i][3] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datelimite,'day'),
+                    'text' => dol_print_date($datelimite,'day'),
                     );
 
                     $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
diff --git a/htdocs/includes/boxes/box_fournisseurs.php b/htdocs/includes/boxes/box_fournisseurs.php
index 8d89992efae..3e6769cde06 100644
--- a/htdocs/includes/boxes/box_fournisseurs.php
+++ b/htdocs/includes/boxes/box_fournisseurs.php
@@ -100,7 +100,7 @@ class box_fournisseurs extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
 
                     $this->info_box_contents[$i][2] = array('td' => 'align="right"',
-					'text' => dolibarr_print_date($datem, "day"));
+					'text' => dol_print_date($datem, "day"));
 
                     $i++;
                 }
@@ -108,7 +108,7 @@ class box_fournisseurs extends ModeleBoxes {
                 if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedSuppliers"));
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
         else {
diff --git a/htdocs/includes/boxes/box_osc_client.php b/htdocs/includes/boxes/box_osc_client.php
index 33b2693ca66..480a66a1a96 100644
--- a/htdocs/includes/boxes/box_osc_client.php
+++ b/htdocs/includes/boxes/box_osc_client.php
@@ -89,7 +89,7 @@ class box_osc_clients extends ModeleBoxes {
                 }
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
         else {
diff --git a/htdocs/includes/boxes/box_produits.php b/htdocs/includes/boxes/box_produits.php
index 5d1573e9c06..f354669d0de 100644
--- a/htdocs/includes/boxes/box_produits.php
+++ b/htdocs/includes/boxes/box_produits.php
@@ -131,7 +131,7 @@ class box_produits extends ModeleBoxes {
                     'text' => $price_base_type);
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datem,'day'));
+                    'text' => dol_print_date($datem,'day'));
 
 					$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
                     'text' => $productstatic->LibStatut($objp->envente,3));
@@ -140,7 +140,7 @@ class box_produits extends ModeleBoxes {
 				}
 			}
 			else {
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 		}
 		else {
diff --git a/htdocs/includes/boxes/box_propales.php b/htdocs/includes/boxes/box_propales.php
index 61d79d686db..bbb6c97a360 100644
--- a/htdocs/includes/boxes/box_propales.php
+++ b/htdocs/includes/boxes/box_propales.php
@@ -115,11 +115,11 @@ class box_propales extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->rowid);
                     
                     $this->info_box_contents[$i][2] = array('td' => 'align="left"',
-                    'text' => dolibarr_trunc($objp->nom,40),
+                    'text' => dol_trunc($objp->nom,40),
                     'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
                     
                     $this->info_box_contents[$i][3] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datec,'day'));
+                    'text' => dol_print_date($datec,'day'));
 
                     $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
                     'text' => $propalstatic->LibStatut($objp->fk_statut,3));
@@ -131,7 +131,7 @@ class box_propales extends ModeleBoxes {
             }
             else 
             {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
         else {
diff --git a/htdocs/includes/boxes/box_prospect.php b/htdocs/includes/boxes/box_prospect.php
index 484fed226dc..067514464d3 100644
--- a/htdocs/includes/boxes/box_prospect.php
+++ b/htdocs/includes/boxes/box_prospect.php
@@ -84,7 +84,7 @@ class box_prospect extends ModeleBoxes {
             $sql .= " ORDER BY s.tms DESC";
             $sql .= $db->plimit($max, 0);
 
-			dolibarr_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG);
+			dol_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG);
             $resql = $db->query($sql);
             if ($resql)
             {
@@ -106,7 +106,7 @@ class box_prospect extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid);
 
                     $this->info_box_contents[$i][2] = array('td' => 'align="right"',
-					'text' => dolibarr_print_date($datem, "day"));
+					'text' => dol_print_date($datem, "day"));
 
                     $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
                     'text' => eregi_replace('img ','img height="14px" ',$prospectstatic->LibStatut($objp->fk_stcomm,3)));
@@ -118,11 +118,11 @@ class box_prospect extends ModeleBoxes {
             }
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
         }
         else {
-			dolibarr_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR);
+			dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR);
             $this->info_box_contents[0][0] = array('td' => 'align="left"',
             'text' => $langs->trans("ReadPermissionNotAllowed"));
         }
diff --git a/htdocs/includes/boxes/box_services_vendus.php b/htdocs/includes/boxes/box_services_vendus.php
index 7cd1a99d8f5..561c0e8f49c 100644
--- a/htdocs/includes/boxes/box_services_vendus.php
+++ b/htdocs/includes/boxes/box_services_vendus.php
@@ -137,7 +137,7 @@ class box_services_vendus extends ModeleBoxes {
                     'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="right"',
-                    'text' => dolibarr_print_date($datem,'day'));
+                    'text' => dol_print_date($datem,'day'));
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
                     'text' => $contratlignestatic->LibStatut($objp->statut,3)
@@ -148,7 +148,7 @@ class box_services_vendus extends ModeleBoxes {
 			}
 			else 
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 		}
 		else {
diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php
index 5a3ebe2e99a..8d2d3df55b0 100644
--- a/htdocs/includes/boxes/modules_boxes.php
+++ b/htdocs/includes/boxes/modules_boxes.php
@@ -62,7 +62,7 @@ class ModeleBoxes
 		$sql = "SELECT b.rowid, b.box_id, b.position, b.box_order, b.fk_user";
 		$sql.= " FROM ".MAIN_DB_PREFIX."boxes as b";
 		$sql.= " WHERE b.rowid = ".$rowid;
-		dolibarr_syslog("ModeleBoxes::fetch rowid=".$rowid);
+		dol_syslog("ModeleBoxes::fetch rowid=".$rowid);
 
 		$resql = $this->db->query($sql);
 		if ($resql)
@@ -103,7 +103,7 @@ class ModeleBoxes
 		$bcx[1] = 'class="box_impair"';
 		$var = true;
 
-		dolibarr_syslog("modules_box::showBox ".get_Class($this));
+		dol_syslog("modules_box::showBox ".get_Class($this));
 
 		// Define nbcol and nblines of the box to show
 		$nbcol=0;
@@ -128,7 +128,7 @@ class ModeleBoxes
 			}
 			if (! empty($head['text']))
 			{
-				$s=dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
+				$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
 				print $s;
 			}
 			if (! empty($head['sublink']))
@@ -198,7 +198,7 @@ class ModeleBoxes
 						$maxlength=$MAXLENGTHBOX;
 						if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength'];
 
-						if ($maxlength) $textewithnotags=dolibarr_trunc($textewithnotags,$maxlength);
+						if ($maxlength) $textewithnotags=dol_trunc($textewithnotags,$maxlength);
 						if (eregi('^<img',$texte)) print $texte;	// show text with no html cleaning
 						else print $textewithnotags;				// show text with html cleaning
 
diff --git a/htdocs/includes/fckeditor/editor/filemanager/connectors/php/config.php b/htdocs/includes/fckeditor/editor/filemanager/connectors/php/config.php
index 952326af0d7..a33cd4ef2ff 100644
--- a/htdocs/includes/fckeditor/editor/filemanager/connectors/php/config.php
+++ b/htdocs/includes/fckeditor/editor/filemanager/connectors/php/config.php
@@ -38,7 +38,7 @@ define('DOL_URL_ROOT', $pos);
 $conf->syslog->enabled=1;
 define('SYSLOG_FILE','c:/log/dolibarr/dolibarr.log');
 require_once("../../../../../../lib/functions.lib.php");
-dolibarr_syslog("eee".$conf->fckeditor->dir_output);
+dol_syslog("eee".$conf->fckeditor->dir_output);
 */
 
 // SECURITY: You must explicitly enable this "connector". (Set it to "true").
diff --git a/htdocs/includes/login/functions_dolibarr.php b/htdocs/includes/login/functions_dolibarr.php
index daa32926823..e6848bf26d5 100644
--- a/htdocs/includes/login/functions_dolibarr.php
+++ b/htdocs/includes/login/functions_dolibarr.php
@@ -34,7 +34,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
 {
 	global $_POST,$db,$conf,$langs;
 	
-	dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest);
+	dol_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest);
 
 	$login='';
 	
@@ -48,7 +48,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
 		$sql.=' from '.$table;
 		$sql.=' where '.$usernamecol." = '".addslashes($_POST["username"])."'";
 
-		dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr sql=".$sql);
+		dol_syslog("functions_dolibarr::check_user_password_dolibarr sql=".$sql);
 		$resql=$db->query($sql);
 		if ($resql)
 		{
@@ -72,7 +72,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
 					if (md5($passtyped) == $passcrypted) 
 					{
 						$passok=true;
-						dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - ".$cryptType." of pass is ok");
+						dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - ".$cryptType." of pass is ok");
 					}
 				}
 
@@ -83,7 +83,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
 						&& ($passtyped == $passclear)) 
 					{
 						$passok=true;
-						dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database");
+						dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database");
 					}
 				}
 				
@@ -94,7 +94,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
 				}
 				else
 				{
-					dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko bad password pour '".$_POST["username"]."'");
+					dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko bad password pour '".$_POST["username"]."'");
 					sleep(1);
 					$langs->load('main');
 					$langs->load('other');
@@ -103,7 +103,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
 			}
 			else
 			{
-				dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko user not found pour '".$_POST["username"]."'");
+				dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko user not found pour '".$_POST["username"]."'");
 				sleep(1);
 				$langs->load('main');
 				$langs->load('other');
@@ -112,7 +112,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest)
 		}
 		else
 		{
-			dolibarr_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko db error pour '".$_POST["username"]."' error=".$db->lasterror());
+			dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ko db error pour '".$_POST["username"]."' error=".$db->lasterror());
 			sleep(1);
 			$_SESSION["dol_loginmesg"]=$db->lasterror();
 		}
diff --git a/htdocs/includes/login/functions_forceuser.php b/htdocs/includes/login/functions_forceuser.php
index 8dfa652f50e..de4d4fc1a7f 100644
--- a/htdocs/includes/login/functions_forceuser.php
+++ b/htdocs/includes/login/functions_forceuser.php
@@ -36,7 +36,7 @@ function check_user_password_forceuser($usertotest,$passwordtotest)
 	// Variable dolibarr_auto_user must be defined in conf.php file
 	global $dolibarr_auto_user;
 	
-	dolibarr_syslog("functions_forceuser::check_user_password_forceuser");
+	dol_syslog("functions_forceuser::check_user_password_forceuser");
 
 	$login=$dolibarr_auto_user;
 	if (empty($login)) $login='auto';
diff --git a/htdocs/includes/login/functions_http.php b/htdocs/includes/login/functions_http.php
index d6707f954dd..b6facb72289 100644
--- a/htdocs/includes/login/functions_http.php
+++ b/htdocs/includes/login/functions_http.php
@@ -32,7 +32,7 @@
 */
 function check_user_password_http($usertotest,$passwordtotest)
 {
-	dolibarr_syslog("functions_http::check_user_password_http _SERVER[REMOTE_USER]=".$_SERVER["REMOTE_USER"]);
+	dol_syslog("functions_http::check_user_password_http _SERVER[REMOTE_USER]=".$_SERVER["REMOTE_USER"]);
 
 	$login='';
 	if (! empty($_SERVER["REMOTE_USER"]))
diff --git a/htdocs/includes/login/functions_ldap.php b/htdocs/includes/login/functions_ldap.php
index ba54e697d78..7f78e5e8541 100644
--- a/htdocs/includes/login/functions_ldap.php
+++ b/htdocs/includes/login/functions_ldap.php
@@ -43,7 +43,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 	
 	if (! function_exists("ldap_connect"))
 	{
-		dolibarr_syslog("functions_ldap::check_user_password_ldap Authentification ko failed to connect to LDAP. LDAP functions are disabled on this PHP");
+		dol_syslog("functions_ldap::check_user_password_ldap Authentification ko failed to connect to LDAP. LDAP functions are disabled on this PHP");
 		sleep(1);
 		$langs->load('main');
 		$langs->load('other');
@@ -95,7 +95,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 		*/
 		// Fin code pour compatiblite
 
-		dolibarr_syslog("functions_ldap::check_user_password_ldap usertotest=".$usertotest." admin_login=".$ldapadminlogin);
+		dol_syslog("functions_ldap::check_user_password_ldap usertotest=".$usertotest." admin_login=".$ldapadminlogin);
 		
 		require_once(DOL_DOCUMENT_ROOT."/lib/ldap.class.php");
 		$ldap=new Ldap();
@@ -106,7 +106,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 		$ldap->searchUser=$ldapadminlogin;
 		$ldap->searchPassword=$ldapadminpass;
 		
-		if ($ldapdebug) dolibarr_syslog("functions_ldap::check_user_password_ldap Server:".join(',',$ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword);
+		if ($ldapdebug) dol_syslog("functions_ldap::check_user_password_ldap Server:".join(',',$ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword);
 		
 		$resultCheckUserDN=false;
 
@@ -121,7 +121,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 				// On stop si le mot de passe ldap doit etre modifie sur le domaine
 				if ($resultFetchLdapUser == 1 && $ldap->pwdlastset == 0)
 				{
-					dolibarr_syslog('functions_ldap::check_user_password_ldap '.$_POST["username"].' must change password next logon');
+					dol_syslog('functions_ldap::check_user_password_ldap '.$_POST["username"].' must change password next logon');
 					if ($ldapdebug) print "DEBUG: User ".$_POST["username"]." must change password<br>\n";
 					$ldap->close();
 					sleep(1);
@@ -149,7 +149,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 		{
 			if ($result == 2)
 			{
-				dolibarr_syslog("functions_ldap::check_user_password_ldap Authentification ok");
+				dol_syslog("functions_ldap::check_user_password_ldap Authentification ok");
 				$login=$_POST["username"];
 
 				// ldap2dolibarr synchronisation
@@ -160,8 +160,8 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 					$ldap->fetch($login);
 					
 					if ($ldapdebug) print "DEBUG: UACF = ".join(',',$ldap->uacf)."<br>\n";
-					if ($ldapdebug) print "DEBUG: pwdLastSet = ".dolibarr_print_date($ldap->pwdlastset,'day')."<br>\n";
-					if ($ldapdebug) print "DEBUG: badPasswordTime = ".dolibarr_print_date($ldap->badpwdtime,'day')."<br>\n";
+					if ($ldapdebug) print "DEBUG: pwdLastSet = ".dol_print_date($ldap->pwdlastset,'day')."<br>\n";
+					if ($ldapdebug) print "DEBUG: badPasswordTime = ".dol_print_date($ldap->badpwdtime,'day')."<br>\n";
 					
 					// On recherche le user dolibarr en fonction de son SID ldap
 					$sid = $ldap->getObjectSid($login);
@@ -184,7 +184,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 			}
 			if ($result == 1)
 			{
-				dolibarr_syslog("functions_ldap::check_user_password_ldap Authentification ko bad user/password for '".$_POST["username"]."'");
+				dol_syslog("functions_ldap::check_user_password_ldap Authentification ko bad user/password for '".$_POST["username"]."'");
 				sleep(1);
 				$langs->load('main');
 				$langs->load('other');
@@ -193,7 +193,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
 		}
 		else
 		{
-			dolibarr_syslog("functions_ldap::check_user_password_ldap Authentification ko failed to connect to LDAP for '".$_POST["username"]."'");
+			dol_syslog("functions_ldap::check_user_password_ldap Authentification ko failed to connect to LDAP for '".$_POST["username"]."'");
 			sleep(1);
 			$langs->load('main');
 			$langs->load('other');
diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php
index d9e4aa02189..2fb5c3bfb43 100644
--- a/htdocs/includes/modules/DolibarrModules.class.php
+++ b/htdocs/includes/modules/DolibarrModules.class.php
@@ -107,12 +107,12 @@ class DolibarrModules
 			{
 				$sql=$array_sql[$i];
 
-				dolibarr_syslog("DolibarrModules::_init sql=".$sql, LOG_DEBUG);
+				dol_syslog("DolibarrModules::_init sql=".$sql, LOG_DEBUG);
 				$result=$this->db->query($sql);
 				if (! $result)
 				{
 					$this->error=$this->db->error();
-					dolibarr_syslog("DolibarrModules::_init Error ".$this->error, LOG_ERR);
+					dol_syslog("DolibarrModules::_init Error ".$this->error, LOG_ERR);
 					$err++;
 				}
 			}
@@ -128,7 +128,7 @@ class DolibarrModules
 					if (create_exdir($dir) < 0)
 					{
 						$this->error = $langs->trans("ErrorCanNotCreateDir",$dir);
-						dolibarr_syslog("DolibarrModules::_init ".$this->error, LOG_ERR);
+						dol_syslog("DolibarrModules::_init ".$this->error, LOG_ERR);
 					}
 				}
 			}
@@ -334,13 +334,13 @@ class DolibarrModules
 		$err = 0;
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."dolibarr_modules WHERE numero=".$this->numero.";";
-		dolibarr_syslog("DolibarrModules::_dbactive sql=".$sql, LOG_DEBUG);
+		dol_syslog("DolibarrModules::_dbactive sql=".$sql, LOG_DEBUG);
 		$this->db->query($sql);
 
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."dolibarr_modules (numero,active,active_date,active_version)";
 		$sql.= " VALUES (";
 		$sql.= $this->numero.",1,".$this->db->idate(mktime()).",'".$this->version."')";
-		dolibarr_syslog("DolibarrModules::_dbactive sql=".$sql, LOG_DEBUG);
+		dol_syslog("DolibarrModules::_dbactive sql=".$sql, LOG_DEBUG);
 		$this->db->query($sql);
 
 		return $err;
@@ -356,7 +356,7 @@ class DolibarrModules
 		$err = 0;
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."dolibarr_modules WHERE numero=".$this->numero;
-		dolibarr_syslog("DolibarrModules::_dbactive sql=".$sql, LOG_DEBUG);
+		dol_syslog("DolibarrModules::_dbactive sql=".$sql, LOG_DEBUG);
 		$this->db->query($sql);
 
 		return $err;
@@ -372,12 +372,12 @@ class DolibarrModules
 		$err = 0;
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = '".$this->const_name."'";
-		dolibarr_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
+		dol_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
 		$this->db->query($sql);
 
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible) VALUES
         ('".$this->const_name."','1',0)";
-		dolibarr_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
+		dol_syslog("DolibarrModules::_active sql=".$sql, LOG_DEBUG);
 		if (!$this->db->query($sql))
 		{
 			$err++;
@@ -396,7 +396,7 @@ class DolibarrModules
 		$err = 0;
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = '".$this->const_name."'";
-		dolibarr_syslog("DolibarrModules::_unactive sql=".$sql);
+		dol_syslog("DolibarrModules::_unactive sql=".$sql);
 		$this->db->query($sql);
 
 		return $err;
@@ -531,12 +531,12 @@ class DolibarrModules
 				$sql.= " FROM ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def";
 				$sql.= " WHERE ".MAIN_DB_PREFIX."boxes.box_id = ".MAIN_DB_PREFIX."boxes_def.rowid";
 				$sql.= " AND ".MAIN_DB_PREFIX."boxes_def.file = '".addslashes($file)."'";
-				dolibarr_syslog("DolibarrModules::delete_boxes sql=".$sql);
+				dol_syslog("DolibarrModules::delete_boxes sql=".$sql);
 				$this->db->query($sql);
 
 				$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def";
 				$sql.= " WHERE file = '".addslashes($file)."'";
-				dolibarr_syslog("DolibarrModules::delete_boxes sql=".$sql);
+				dol_syslog("DolibarrModules::delete_boxes sql=".$sql);
 				if (! $this->db->query($sql))
 				{
 					$err++;
@@ -559,7 +559,7 @@ class DolibarrModules
 		{
 			$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
 			$sql.= " WHERE name = '".$this->const_name."_CSS'";
-			dolibarr_syslog("DolibarrModules::delete_style_sheet sql=".$sql);
+			dol_syslog("DolibarrModules::delete_style_sheet sql=".$sql);
 			if (! $this->db->query($sql))
 			{
 				$err++;
@@ -579,7 +579,7 @@ class DolibarrModules
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
 		$sql.= " WHERE name like '".$this->const_name."_TABS_%'";
-		dolibarr_syslog("DolibarrModules::delete_tabs sql=".$sql);
+		dol_syslog("DolibarrModules::delete_tabs sql=".$sql);
 		if (! $this->db->query($sql))
 		{
 			$err++;
@@ -600,7 +600,7 @@ class DolibarrModules
 		{
 			$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,note,visible)";
 			$sql.= " VALUES ('".$this->const_name."_CSS','chaine','".$this->style_sheet."','Style sheet for module ".$this->name."','0')";
-			dolibarr_syslog("DolibarrModules::insert_style_sheet sql=".$sql);
+			dol_syslog("DolibarrModules::insert_style_sheet sql=".$sql);
 			$resql=$this->db->query($sql);
 			/* Allow duplicate key
 			 if (! $resql)
@@ -630,7 +630,7 @@ class DolibarrModules
 				{
 					$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,note,visible)";
 					$sql.= " VALUES ('".$this->const_name."_TABS_".$i."','chaine','".$value."',null,'0')";
-					dolibarr_syslog("DolibarrModules::insert_tabs sql=".$sql);
+					dol_syslog("DolibarrModules::insert_tabs sql=".$sql);
 					$resql=$this->db->query($sql);
 					/* Allow duplicate key
 					 if (! $resql)
@@ -684,10 +684,10 @@ class DolibarrModules
 						$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,visible) VALUES ('$name','$type','$visible')";
 					}
 
-					dolibarr_syslog("DolibarrModules::insert_const sql=".$sql);
+					dol_syslog("DolibarrModules::insert_const sql=".$sql);
 					if (! $this->db->query($sql) )
 					{
-						dolibarr_syslog("DolibarrModules::insert_const ".$this->db->lasterror(), LOG_ERR);
+						dol_syslog("DolibarrModules::insert_const ".$this->db->lasterror(), LOG_ERR);
 						$err++;
 					}
 				}
@@ -757,12 +757,12 @@ class DolibarrModules
 						$sql .= "(".$r_id.",'".addslashes($r_desc)."','".$r_modul."','".$r_type."',".$r_def.")";
 					}
 
-					dolibarr_syslog("DolibarrModules::insert_permissions sql=".$sql, LOG_DEBUG);
+					dol_syslog("DolibarrModules::insert_permissions sql=".$sql, LOG_DEBUG);
 					$resql=$this->db->query($sql);
 					if (! $resql)
 					{
 						if ($this->db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS") {
-							dolibarr_syslog("DolibarrModules::insert_permissions error ".$this->db->lasterror(), LOG_ERR);
+							dol_syslog("DolibarrModules::insert_permissions error ".$this->db->lasterror(), LOG_ERR);
 							$err++;
 						}
 					}
@@ -783,7 +783,7 @@ class DolibarrModules
 		$err=0;
 
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = '".$this->rights_class."'";
-		dolibarr_syslog("DolibarrModules::delete_permissions sql=".$sql);
+		dol_syslog("DolibarrModules::delete_permissions sql=".$sql);
 		if (!$this->db->query($sql))
 		{
 			$err++;
@@ -830,7 +830,7 @@ class DolibarrModules
 				else
 				{
 					$this->error="BadDefinitionOfMenuArrayInModuleDescriptor";
-					dolibarr_syslog("DolibarrModules::insert_menus ".$this->error." ".$this->menu[$key]['fk_menu'], LOG_ERR);
+					dol_syslog("DolibarrModules::insert_menus ".$this->error." ".$this->menu[$key]['fk_menu'], LOG_ERR);
 					$err++;
 				}
 			}
@@ -854,7 +854,7 @@ class DolibarrModules
 				else
 				{
 					$this->error=$menu->error;
-					dolibarr_syslog('DolibarrModules::insert_menus result='.$result." ".$this->error, LOG_ERR);
+					dol_syslog('DolibarrModules::insert_menus result='.$result." ".$this->error, LOG_ERR);
 					$err++;
 					break;
 				}
@@ -867,7 +867,7 @@ class DolibarrModules
 		}
 		else
 		{
-			dolibarr_syslog("DolibarrModules::insert_menus ".$this->error, LOG_ERR);
+			dol_syslog("DolibarrModules::insert_menus ".$this->error, LOG_ERR);
 			$this->db->rollback();
 		}
 
@@ -886,7 +886,7 @@ class DolibarrModules
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu";
 		$sql.= " WHERE module = '".addslashes($this->rights_class)."'";
 
-		dolibarr_syslog("DolibarrModules::delete_menus sql=".$sql);
+		dol_syslog("DolibarrModules::delete_menus sql=".$sql);
 		$resql=$this->db->query($sql);
 		if (! $resql)
 		{
diff --git a/htdocs/includes/modules/action/rapport.pdf.php b/htdocs/includes/modules/action/rapport.pdf.php
index 7b7e89bca4e..b523f36726e 100644
--- a/htdocs/includes/modules/action/rapport.pdf.php
+++ b/htdocs/includes/modules/action/rapport.pdf.php
@@ -166,7 +166,7 @@ class CommActionRapport
         $sql.= " AND date_format(a.datep, '%Y') = ".$this->year;
         $sql.= " ORDER BY a.datep DESC";
 
-        dolibarr_syslog("Rapport.pdf::_page sql=".$sql);
+        dol_syslog("Rapport.pdf::_page sql=".$sql);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -181,7 +181,7 @@ class CommActionRapport
 		        $y = max($y, $pdf->GetY(), $y0, $y1, $y2, $y3);
 
 		        // Calculate height of text
-        		$text=dolibarr_trunc(dol_htmlentitiesbr_decode($obj->note),150);
+        		$text=dol_trunc(dol_htmlentitiesbr_decode($obj->note),150);
 		        //print 'd'.$text; exit;
         		$nboflines=dol_nboflines($text);
 		        $heightlinemax=max(2*$height,$nboflines*$height);
@@ -197,15 +197,15 @@ class CommActionRapport
 		        $y++;
 
                 $pdf->SetXY($this->marge_gauche, $y);
-                $pdf->MultiCell(22, $height, dol_print_date($obj->dp,"day")."\n".dolibarr_print_date($obj->dp,"hour"), 0, 'L', 0);
+                $pdf->MultiCell(22, $height, dol_print_date($obj->dp,"day")."\n".dol_print_date($obj->dp,"hour"), 0, 'L', 0);
                 $y0 = $pdf->GetY();
 
                 $pdf->SetXY(26, $y);
-                $pdf->MultiCell(32, $height, dolibarr_trunc($outputlangs->convToOutputCharset($obj->societe),32), 0, 'L', 0);
+                $pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($obj->societe),32), 0, 'L', 0);
                 $y1 = $pdf->GetY();
 
                 $pdf->SetXY(60,$y);
-                $pdf->MultiCell(32, $height, dolibarr_trunc($outputlangs->convToOutputCharset($obj->libelle),32), 0, 'L', 0);
+                $pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($obj->libelle),32), 0, 'L', 0);
                 $y2 = $pdf->GetY();
 
                 $pdf->SetXY(106,$y);
diff --git a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
index 3173b9c16f5..03a06c3dd3f 100644
--- a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
+++ b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
@@ -282,10 +282,10 @@ class BordereauChequeBlochet extends FPDF
 			$pdf->MultiCell(20, $this->line_height, $this->lines[$j]->num_chq?$this->lines[$j]->num_chq:'', 0, 'J', 0);
 
 			$pdf->SetXY (30, $this->tab_top + 10 + $yp);
-			$pdf->MultiCell(70, $this->line_height, dolibarr_trunc($outputlangs->convToOutputCharset($this->lines[$j]->bank_chq),44), 0, 'J', 0);
+			$pdf->MultiCell(70, $this->line_height, dol_trunc($outputlangs->convToOutputCharset($this->lines[$j]->bank_chq),44), 0, 'J', 0);
 
 			$pdf->SetXY (100, $this->tab_top + 10 + $yp);
-			$pdf->MultiCell(80, $this->line_height, dolibarr_trunc($outputlangs->convToOutputCharset($this->lines[$j]->emetteur_chq),50), 0, 'J', 0);
+			$pdf->MultiCell(80, $this->line_height, dol_trunc($outputlangs->convToOutputCharset($this->lines[$j]->emetteur_chq),50), 0, 'J', 0);
 
 			$pdf->SetXY (180, $this->tab_top + 10 + $yp);
 			$pdf->MultiCell(20, $this->line_height, price($this->lines[$j]->amount_chq), 0, 'R', 0);
diff --git a/htdocs/includes/modules/commande/mod_commande_marbre.php b/htdocs/includes/modules/commande/mod_commande_marbre.php
index f6ce656d217..a4db4818393 100644
--- a/htdocs/includes/modules/commande/mod_commande_marbre.php
+++ b/htdocs/includes/modules/commande/mod_commande_marbre.php
@@ -108,7 +108,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
         }
         else
         {
-        	dolibarr_syslog("mod_commande_marbre::getNextValue sql=".$sql);
+        	dol_syslog("mod_commande_marbre::getNextValue sql=".$sql);
         	return -1;
         }
     
@@ -117,7 +117,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
         $yymm = strftime("%y%m",$date);
         $num = sprintf("%04s",$max+1);
         
-        dolibarr_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
+        dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
         return $this->prefix.$yymm."-".$num;
     }
 
diff --git a/htdocs/includes/modules/commande/modules_commande.php b/htdocs/includes/modules/commande/modules_commande.php
index 33909442d7c..1d43f9ca24e 100644
--- a/htdocs/includes/modules/commande/modules_commande.php
+++ b/htdocs/includes/modules/commande/modules_commande.php
@@ -216,8 +216,8 @@ function commande_pdf_create($db, $id, $modele, $outputlangs)
 		else
 		{
 			$outputlangs->charset_output=$sav_charset_output;
-			dolibarr_syslog("Erreur dans commande_pdf_create");
-			dolibarr_print_error($db,$obj->pdferror());
+			dol_syslog("Erreur dans commande_pdf_create");
+			dol_print_error($db,$obj->pdferror());
 			return 0;
 		}
 	}
diff --git a/htdocs/includes/modules/dons/html_cerfafr.modules.php b/htdocs/includes/modules/dons/html_cerfafr.modules.php
index 768a8f52022..6ed5809e94a 100644
--- a/htdocs/includes/modules/dons/html_cerfafr.modules.php
+++ b/htdocs/includes/modules/dons/html_cerfafr.modules.php
@@ -144,7 +144,7 @@ class html_cerfafr extends ModeleDon
 		        $html = eregi_replace('__NOW__',dol_print_date($now,'',false,$outputlangs),$html);
 
 		        // Sauve fichier sur disque
-		        dolibarr_syslog("html_cerfafr::write_file $file");
+		        dol_syslog("html_cerfafr::write_file $file");
 		        $handle=fopen($file,"w");
 		        fwrite($handle,$html);
 		        fclose($handle);
diff --git a/htdocs/includes/modules/dons/modules_don.php b/htdocs/includes/modules/dons/modules_don.php
index 743f620338f..42b9c729106 100644
--- a/htdocs/includes/modules/dons/modules_don.php
+++ b/htdocs/includes/modules/dons/modules_don.php
@@ -208,8 +208,8 @@ function don_create($db, $id, $message, $modele, $outputlangs)
         else
         {
 			$outputlangs->charset_output=$sav_charset_output;
-        	dolibarr_syslog("Erreur dans don_create");
-            dolibarr_print_error($db,$obj->pdferror());
+        	dol_syslog("Erreur dans don_create");
+            dol_print_error($db,$obj->pdferror());
             return 0;
         }
     }
diff --git a/htdocs/includes/modules/expedition/methode_expedition.modules.php b/htdocs/includes/modules/expedition/methode_expedition.modules.php
index c88434e99ba..0e7243ee5bf 100644
--- a/htdocs/includes/modules/expedition/methode_expedition.modules.php
+++ b/htdocs/includes/modules/expedition/methode_expedition.modules.php
@@ -71,7 +71,7 @@ class methode_expedition
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			return -1;
 		}
 		return $liste;
diff --git a/htdocs/includes/modules/expedition/pdf/ModelePdfExpedition.class.php b/htdocs/includes/modules/expedition/pdf/ModelePdfExpedition.class.php
index ef1709a4071..8958fcb5109 100644
--- a/htdocs/includes/modules/expedition/pdf/ModelePdfExpedition.class.php
+++ b/htdocs/includes/modules/expedition/pdf/ModelePdfExpedition.class.php
@@ -147,8 +147,8 @@ function expedition_pdf_create($db, $id, $modele, $outputlangs)
 		else
 		{
 			$outputlangs->charset_output=$sav_charset_output;
-			dolibarr_syslog("Erreur dans expedition_pdf_create");
-			dolibarr_print_error($db,$obj->pdferror());
+			dol_syslog("Erreur dans expedition_pdf_create");
+			dol_print_error($db,$obj->pdferror());
 			return 0;
 		}
 	}
diff --git a/htdocs/includes/modules/export/export_csv.modules.php b/htdocs/includes/modules/export/export_csv.modules.php
index 0c241c065ee..d829c624334 100644
--- a/htdocs/includes/modules/export/export_csv.modules.php
+++ b/htdocs/includes/modules/export/export_csv.modules.php
@@ -110,7 +110,7 @@ class ExportCsv extends ModeleExports
     {
     	global $langs;
     	
-        dolibarr_syslog("ExportCsv::open_file file=".$file);
+        dol_syslog("ExportCsv::open_file file=".$file);
 
 		$ret=1;
 		
@@ -169,7 +169,7 @@ class ExportCsv extends ModeleExports
  		foreach($array_selected_sorted as $code => $value)
         {
             $alias=$array_alias[$code];
-            if (empty($alias)) dolibarr_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
+            if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
 			$newvalue=$outputlangs->convToOutputCharset($objp->$alias);
 
             // Translation newvalue
diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php
index 61de5deb959..0b4f5c0abe9 100644
--- a/htdocs/includes/modules/export/export_excel.modules.php
+++ b/htdocs/includes/modules/export/export_excel.modules.php
@@ -116,7 +116,7 @@ class ExportExcel extends ModeleExports
 
 		$outputlangs->charset_output='ISO-8859-1';	// Because Excel 5 format is ISO
 
-		dolibarr_syslog("ExportExcel::open_file file=".$file);
+		dol_syslog("ExportExcel::open_file file=".$file);
 
 		$ret=1;
 
@@ -164,7 +164,7 @@ class ExportExcel extends ModeleExports
 		{
 			$alias=$array_export_fields_label[$code];
 			//print "dd".$alias;
-			if (empty($alias)) dolibarr_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
+			if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
 			$this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($alias), $formatheader);
 			$this->col++;
 		}
diff --git a/htdocs/includes/modules/export/export_tsv.modules.php b/htdocs/includes/modules/export/export_tsv.modules.php
index 5c4ebcc72cf..325f7b416ca 100644
--- a/htdocs/includes/modules/export/export_tsv.modules.php
+++ b/htdocs/includes/modules/export/export_tsv.modules.php
@@ -107,7 +107,7 @@ class ExportTsv extends ModeleExports
     {
         global $langs;
         
-        dolibarr_syslog("ExportTsv::open_file file=".$file);
+        dol_syslog("ExportTsv::open_file file=".$file);
 
 		$ret=1;
 		
@@ -160,7 +160,7 @@ class ExportTsv extends ModeleExports
  		foreach($array_selected_sorted as $code => $value)
         {
             $alias=$array_alias[$code];
-            if (empty($alias)) dolibarr_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
+            if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
             $newvalue=$objp->$alias;
 
             // Translation newvalue
diff --git a/htdocs/includes/modules/export/modules_export.php b/htdocs/includes/modules/export/modules_export.php
index 5ae3ce2dada..01103914f8e 100644
--- a/htdocs/includes/modules/export/modules_export.php
+++ b/htdocs/includes/modules/export/modules_export.php
@@ -57,7 +57,7 @@ class ModeleExports
 	 */
 	function liste_modeles($db)
 	{
-		dolibarr_syslog("ModeleExport::loadFormat");
+		dol_syslog("ModeleExport::loadFormat");
 
 		$dir=DOL_DOCUMENT_ROOT."/includes/modules/export/";
 		$handle=opendir($dir);
@@ -136,7 +136,7 @@ class ModeleExports
 	{
 		global $langs;
 
-		dolibarr_syslog("Export::build_file $model, $datatoexport, $array_selected");
+		dol_syslog("Export::build_file $model, $datatoexport, $array_selected");
 
 		// Creation de la classe d'export du model ExportXXX
 		$dir = DOL_DOCUMENT_ROOT . "/includes/modules/export/";
@@ -168,7 +168,7 @@ class ModeleExports
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Error: sql=$sql ".$this->error);
+			dol_syslog("Error: sql=$sql ".$this->error);
 			return -1;
 		}
 	}
diff --git a/htdocs/includes/modules/facture/modules_facture.php b/htdocs/includes/modules/facture/modules_facture.php
index d172cfeeca5..2b54a72d207 100644
--- a/htdocs/includes/modules/facture/modules_facture.php
+++ b/htdocs/includes/modules/facture/modules_facture.php
@@ -77,7 +77,7 @@ class ModelePDFFactures extends FPDF
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			return -1;
 		}
 		return $liste;
@@ -213,14 +213,14 @@ function facture_pdf_create($db, $id, $message, $modele, $outputlangs)
 		else
 		{
 			$outputlangs->charset_output=$sav_charset_output;
-			dolibarr_print_error($db,"facture_pdf_create Error: ".$obj->error);
+			dol_print_error($db,"facture_pdf_create Error: ".$obj->error);
 			return -1;
 		}
 
 	}
 	else
 	{
-		dolibarr_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$dir.$file));
+		dol_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$dir.$file));
 		return -1;
 	}
 }
diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php
index e204e235e60..ab843fbd01b 100644
--- a/htdocs/includes/modules/facture/pdf_crabe.modules.php
+++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php
@@ -470,7 +470,7 @@ class pdf_crabe extends ModelePDFFactures
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog($this->db,$this->error);
+			dol_syslog($this->db,$this->error);
 			return -1;
 		}
 
@@ -529,7 +529,7 @@ class pdf_crabe extends ModelePDFFactures
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog($this->db,$this->error);
+			dol_syslog($this->db,$this->error);
 			return -1;
 		}
 
@@ -984,7 +984,7 @@ class pdf_crabe extends ModelePDFFactures
 		$posy+=5;
 		$pdf->SetXY(100,$posy);
 		$pdf->SetTextColor(0,0,60);
-		$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dolibarr_print_date($object->date,"day",false,$outpulangs), '', 'R');
+		$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dol_print_date($object->date,"day",false,$outpulangs), '', 'R');
 
 		if ($object->type != 2)
 		{
diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php
index 1d8e3725de1..273d263978d 100644
--- a/htdocs/includes/modules/facture/pdf_oursin.modules.php
+++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php
@@ -382,7 +382,7 @@ class pdf_oursin extends ModelePDFFactures
 		else
 		{
 			$this->error=$outputlangs->trans("ErrorSQL")." sql=".$sql;
-			dolibarr_syslog($this->db,$this->error, LOG_ERR);
+			dol_syslog($this->db,$this->error, LOG_ERR);
 			return -1;
 		}
 
@@ -442,7 +442,7 @@ class pdf_oursin extends ModelePDFFactures
 		else
 		{
 			$this->error=$outputlangs->trans("ErrorSQL")." sql=".$sql;
-			dolibarr_syslog($this->db,$this->error, LOG_ERR);
+			dol_syslog($this->db,$this->error, LOG_ERR);
 			return -1;
 		}
 
diff --git a/htdocs/includes/modules/facture/terre/terre.modules.php b/htdocs/includes/modules/facture/terre/terre.modules.php
index 0ac07f84742..4ae6811df4f 100644
--- a/htdocs/includes/modules/facture/terre/terre.modules.php
+++ b/htdocs/includes/modules/facture/terre/terre.modules.php
@@ -134,7 +134,7 @@ class mod_facture_terre extends ModeleNumRefFactures
         }
         else
         {
-        	dolibarr_syslog("mod_facture_terre::getNextValue sql=".$sql);
+        	dol_syslog("mod_facture_terre::getNextValue sql=".$sql);
         	return -1;
         }
 
@@ -143,7 +143,7 @@ class mod_facture_terre extends ModeleNumRefFactures
         $yymm = strftime("%y%m",$date);
         $num = sprintf("%04s",$max+1);
         
-        dolibarr_syslog("mod_facture_terre::getNextValue return ".$prefix.$yymm."-".$num);
+        dol_syslog("mod_facture_terre::getNextValue return ".$prefix.$yymm."-".$num);
         return $prefix.$yymm."-".$num;
     }
     
diff --git a/htdocs/includes/modules/fichinter/modules_fichinter.php b/htdocs/includes/modules/fichinter/modules_fichinter.php
index 1fa8b6cf7d8..882832b9b24 100644
--- a/htdocs/includes/modules/fichinter/modules_fichinter.php
+++ b/htdocs/includes/modules/fichinter/modules_fichinter.php
@@ -182,7 +182,7 @@ function fichinter_create($db, $object, $modele='', $outputlangs='')
 		}
 		else
 		{
-			dolibarr_syslog("Error ".$langs->trans("Error_FICHEINTER_ADDON_PDF_NotDefined"), LOG_ERR);
+			dol_syslog("Error ".$langs->trans("Error_FICHEINTER_ADDON_PDF_NotDefined"), LOG_ERR);
 			print "Error ".$langs->trans("Error_FICHEINTER_ADDON_PDF_NotDefined");
 			return 0;
 		}
@@ -197,7 +197,7 @@ function fichinter_create($db, $object, $modele='', $outputlangs='')
 
 		$obj = new $classname($db);
 
-		dolibarr_syslog("fichinter_create build PDF", LOG_DEBUG);
+		dol_syslog("fichinter_create build PDF", LOG_DEBUG);
 
 		// We save charset_output to restore it because write_file can change it if needed for
 		// output format that does not support UTF8.
@@ -210,7 +210,7 @@ function fichinter_create($db, $object, $modele='', $outputlangs='')
 		else
 		{
 			$outputlangs->charset_output=$sav_charset_output;
-			dolibarr_print_error($db,$obj->pdferror());
+			dol_print_error($db,$obj->pdferror());
 			return 0;
 		}
 	}
diff --git a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php
index 6cbcf6af647..fbd0a35c15f 100644
--- a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php
+++ b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php
@@ -104,7 +104,7 @@ class pdf_soleil extends ModelePDFFicheinter
 				$result=$fichinter->fetch($id);
 				if ($result < 0)
 				{
-					dolibarr_print_error($db,$fichinter->error);
+					dol_print_error($db,$fichinter->error);
 				}
 			}
 
@@ -271,7 +271,7 @@ class pdf_soleil extends ModelePDFFicheinter
 
 				$pdf->MultiCell(0, 4, '', 0, 'J');		// Set interline to 4
 
-				//dolibarr_syslog("desc=".dol_htmlentitiesbr($fichinter->description));
+				//dol_syslog("desc=".dol_htmlentitiesbr($fichinter->description));
 				$num = sizeof($fichinter->lignes);
 				$i=0;$j=0;
 				$height=9;
diff --git a/htdocs/includes/modules/livraison/modules_livraison.php b/htdocs/includes/modules/livraison/modules_livraison.php
index cf877d6dc74..a1475acae12 100644
--- a/htdocs/includes/modules/livraison/modules_livraison.php
+++ b/htdocs/includes/modules/livraison/modules_livraison.php
@@ -206,8 +206,8 @@ function delivery_order_pdf_create($db, $deliveryid, $modele='', $outputlangs=''
 		else
 		{
 			$outputlangs->charset_output=$sav_charset_output;
-			dolibarr_syslog("Erreur dans delivery_order_pdf_create");
-			dolibarr_print_error($db,$obj->pdferror());
+			dol_syslog("Erreur dans delivery_order_pdf_create");
+			dol_print_error($db,$obj->pdferror());
 			return 0;
 		}
 	}
diff --git a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
index f5aad96e6ca..ab5d99e25b7 100644
--- a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
+++ b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
@@ -117,7 +117,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
 				$delivery->id = $id;
 				if ($result < 0)
 				{
-					dolibarr_print_error($db,$delivery->error);
+					dol_print_error($db,$delivery->error);
 				}
 			}
 
diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
index d9017e10ee6..d5e1294739b 100644
--- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
+++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
@@ -138,7 +138,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
 
 				if ($result < 0)
 				{
-					dolibarr_print_error($db,$delivery->error);
+					dol_print_error($db,$delivery->error);
 				}
 			}
 
diff --git a/htdocs/includes/modules/mailings/fraise.modules.php b/htdocs/includes/modules/mailings/fraise.modules.php
index 8c93a001224..d146b1d067b 100644
--- a/htdocs/includes/modules/mailings/fraise.modules.php
+++ b/htdocs/includes/modules/mailings/fraise.modules.php
@@ -149,7 +149,7 @@ class mailing_fraise extends MailingTargets
             $i = 0;
             $j = 0;
 
-            dolibarr_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
+            dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
 
             $old = '';
             while ($i < $num)
@@ -174,7 +174,7 @@ class mailing_fraise extends MailingTargets
         }
         else
         {
-            dolibarr_syslog($this->db->error());
+            dol_syslog($this->db->error());
             $this->error=$this->db->error();
             return -1;
         }
diff --git a/htdocs/includes/modules/mailings/kiwi.modules.php b/htdocs/includes/modules/mailings/kiwi.modules.php
index 73b80f40d53..786cd9e71fd 100644
--- a/htdocs/includes/modules/mailings/kiwi.modules.php
+++ b/htdocs/includes/modules/mailings/kiwi.modules.php
@@ -76,7 +76,7 @@ class mailing_kiwi extends MailingTargets
             $i = 0;
             $j = 0;
 
-            dolibarr_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
+            dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
 
             $old = '';
             while ($i < $num)
@@ -101,7 +101,7 @@ class mailing_kiwi extends MailingTargets
         }
         else
         {
-            dolibarr_syslog($this->db->error());
+            dol_syslog($this->db->error());
             $this->error=$this->db->error();
             return -1;
         }
diff --git a/htdocs/includes/modules/mailings/modules_mailings.php b/htdocs/includes/modules/mailings/modules_mailings.php
index b003cbab3bb..5776ec8f0ab 100644
--- a/htdocs/includes/modules/mailings/modules_mailings.php
+++ b/htdocs/includes/modules/mailings/modules_mailings.php
@@ -114,7 +114,7 @@ class MailingTargets
             $sql .= " SET nbemail = ".$nb." WHERE rowid = ".$mailing_id;
             if (!$this->db->query($sql))
             {
-                dolibarr_syslog($this->db->error());
+                dol_syslog($this->db->error());
                 $this->error=$this->db->error();
                 return -1;
             }
@@ -162,7 +162,7 @@ class MailingTargets
                 if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS')
                 {
                     // Si erreur autre que doublon
-                    dolibarr_syslog($this->db->error());
+                    dol_syslog($this->db->error());
                     $this->error=$this->db->error();
                     $this->db->rollback();
                     return -1;
@@ -170,7 +170,7 @@ class MailingTargets
             }
         }
 
-        dolibarr_syslog("MailingTargets::add_to_target: mailing ".$j." targets added");
+        dol_syslog("MailingTargets::add_to_target: mailing ".$j." targets added");
 
         $this->update_nb($mailing_id);
 
@@ -189,7 +189,7 @@ class MailingTargets
 
         if (! $this->db->query($sql))
         {
-            dolibarr_syslog($this->db->error());
+            dol_syslog($this->db->error());
         }
 
         $this->update_nb($mailing_id);
diff --git a/htdocs/includes/modules/mailings/peche.modules.php b/htdocs/includes/modules/mailings/peche.modules.php
index 859b1e28faf..183303db12a 100644
--- a/htdocs/includes/modules/mailings/peche.modules.php
+++ b/htdocs/includes/modules/mailings/peche.modules.php
@@ -80,7 +80,7 @@ class mailing_peche extends MailingTargets
 	{
 		global $langs;
 		return $langs->trans('LineInFile',$id);
-		//' - '.$langs->trans("File").' '.dolibarr_trunc( ,12);
+		//' - '.$langs->trans("File").' '.dol_trunc( ,12);
 	}
 
 
@@ -181,7 +181,7 @@ class mailing_peche extends MailingTargets
 					return -1;
 				}
 
-				dolibarr_syslog(get_class($this)."::add_to_target mailing ".$cpt." targets found");
+				dol_syslog(get_class($this)."::add_to_target mailing ".$cpt." targets found");
 			}
 			else if ($result < 0)
 			{
diff --git a/htdocs/includes/modules/mailings/poire.modules.php b/htdocs/includes/modules/mailings/poire.modules.php
index dc043ba6acb..947185109a5 100644
--- a/htdocs/includes/modules/mailings/poire.modules.php
+++ b/htdocs/includes/modules/mailings/poire.modules.php
@@ -165,7 +165,7 @@ class mailing_poire extends MailingTargets
 				$i++;
 			}
 		}
-		else dolibarr_print_error($this->db);
+		else dol_print_error($this->db);
 
 		// La requete doit retourner: id, email, fk_contact, name, firstname, other
         $sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,";
@@ -194,7 +194,7 @@ class mailing_poire extends MailingTargets
             $i = 0;
             $j = 0;
 
-            dolibarr_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
+            dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
 
             $old = '';
             while ($i < $num)
@@ -222,7 +222,7 @@ class mailing_poire extends MailingTargets
         }
         else
         {
-            dolibarr_syslog($this->db->error());
+            dol_syslog($this->db->error());
             $this->error=$this->db->error();
             return -1;
         }
diff --git a/htdocs/includes/modules/mailings/pomme.modules.php b/htdocs/includes/modules/mailings/pomme.modules.php
index aa2464d0231..972bf110d29 100644
--- a/htdocs/includes/modules/mailings/pomme.modules.php
+++ b/htdocs/includes/modules/mailings/pomme.modules.php
@@ -142,7 +142,7 @@ class mailing_pomme extends MailingTargets
             $i = 0;
             $j = 0;
 
-            dolibarr_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
+            dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
 
             $old = '';
             while ($i < $num)
@@ -167,7 +167,7 @@ class mailing_pomme extends MailingTargets
         }
         else
         {
-            dolibarr_syslog($this->db->error());
+            dol_syslog($this->db->error());
             $this->error=$this->db->error();
             return -1;
         }
diff --git a/htdocs/includes/modules/propale/mod_propale_marbre.php b/htdocs/includes/modules/propale/mod_propale_marbre.php
index f25fe96b907..243e392f4f3 100644
--- a/htdocs/includes/modules/propale/mod_propale_marbre.php
+++ b/htdocs/includes/modules/propale/mod_propale_marbre.php
@@ -110,7 +110,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
         }
         else
         {
-        	dolibarr_syslog("mod_propale_marbre::getNextValue sql=".$sql);
+        	dol_syslog("mod_propale_marbre::getNextValue sql=".$sql);
         	return -1;
         }
 
@@ -119,7 +119,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
         $yymm = strftime("%y%m",$date);
         $num = sprintf("%04s",$max+1);
         
-        dolibarr_syslog("mod_propale_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
+        dol_syslog("mod_propale_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
         return $this->prefix.$yymm."-".$num;
     }
 
diff --git a/htdocs/includes/modules/propale/modules_propale.php b/htdocs/includes/modules/propale/modules_propale.php
index 7176311a057..f85a517bf97 100644
--- a/htdocs/includes/modules/propale/modules_propale.php
+++ b/htdocs/includes/modules/propale/modules_propale.php
@@ -59,7 +59,7 @@ class ModelePDFPropales extends FPDF
         $sql.=" FROM ".MAIN_DB_PREFIX."document_model";
         $sql.=" WHERE type = '".$type."'";
 
-        dolibarr_syslog("modules_propale::liste_modeles sql=".$sql, LOG_DEBUG);
+        dol_syslog("modules_propale::liste_modeles sql=".$sql, LOG_DEBUG);
         $resql = $db->query($sql);
         if ($resql)
         {
@@ -214,8 +214,8 @@ function propale_pdf_create($db, $id, $modele, $outputlangs)
 		else
 		{
 			$outputlangs->charset_output=$sav_charset_output;
-			dolibarr_syslog("modules_propale::propale_pdf_create error");
-			dolibarr_print_error($db,$obj->pdferror());
+			dol_syslog("modules_propale::propale_pdf_create error");
+			dol_print_error($db,$obj->pdferror());
 			return 0;
 		}
 	}
diff --git a/htdocs/includes/modules/rapport/pdf_paiement.class.php b/htdocs/includes/modules/rapport/pdf_paiement.class.php
index ba108a51851..bd0735e2b84 100644
--- a/htdocs/includes/modules/rapport/pdf_paiement.class.php
+++ b/htdocs/includes/modules/rapport/pdf_paiement.class.php
@@ -130,7 +130,7 @@ class pdf_paiement extends FPDF
 		$sql .= " AND date_format(p.datep, '%Y%m') = " . sprintf("%04d%02d",$year,$month);
 		$sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
 
-		dolibarr_syslog("pdf_paiement::write_file sql=".$sql);
+		dol_syslog("pdf_paiement::write_file sql=".$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -157,7 +157,7 @@ class pdf_paiement extends FPDF
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 		$pages = intval($lignes / $this->line_per_page);
@@ -221,7 +221,7 @@ class pdf_paiement extends FPDF
 		global $langs;
 
 		$title=$outputlangs->transnoentities("ListOfCustomerPayments");
-		$title.=' - '.dol_print_date(dolibarr_mktime(0,0,0,$this->month,1,$this->year),"%B %Y",false,$outputlangs,true);
+		$title.=' - '.dol_print_date(dol_mktime(0,0,0,$this->month,1,$this->year),"%B %Y",false,$outputlangs,true);
 		$pdf->SetFont('Arial','B',12);
 		$pdf->Text(70, 10, $title);
 
diff --git a/htdocs/includes/modules/societe/mod_codeclient_elephant.php b/htdocs/includes/modules/societe/mod_codeclient_elephant.php
index e08c5d05e37..19e2615a392 100644
--- a/htdocs/includes/modules/societe/mod_codeclient_elephant.php
+++ b/htdocs/includes/modules/societe/mod_codeclient_elephant.php
@@ -231,7 +231,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
 			$result=check_value($mask,$code);
 		}
 
-		dolibarr_syslog("mod_codeclient_elephant::verif type=".$type." result=".$result);
+		dol_syslog("mod_codeclient_elephant::verif type=".$type." result=".$result);
 		return $result;
 	}
 
diff --git a/htdocs/includes/modules/societe/mod_codeclient_monkey.php b/htdocs/includes/modules/societe/mod_codeclient_monkey.php
index 68440aa5f72..7d8ce030aba 100644
--- a/htdocs/includes/modules/societe/mod_codeclient_monkey.php
+++ b/htdocs/includes/modules/societe/mod_codeclient_monkey.php
@@ -120,7 +120,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
         }
         else
         {
-        	dolibarr_syslog("mod_codeclient_monkey::getNextValue sql=".$sql);
+        	dol_syslog("mod_codeclient_monkey::getNextValue sql=".$sql);
         	return -1;
         }
 
@@ -129,7 +129,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
         $yymm = strftime("%y%m",$date);
         $num = sprintf("%04s",$max+1);
 
-        dolibarr_syslog("mod_codeclient_monkey::getNextValue return ".$prefix.$yymm."-".$num);
+        dol_syslog("mod_codeclient_monkey::getNextValue return ".$prefix.$yymm."-".$num);
         return $prefix.$yymm."-".$num;
 	}
 
@@ -176,7 +176,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
 				}
 			}
 		}
-		dolibarr_syslog("mod_codeclient_monkey::verif result=".$result);
+		dol_syslog("mod_codeclient_monkey::verif result=".$result);
 		return $result;
 	}
 
diff --git a/htdocs/includes/modules/societe/mod_codecompta_aquarium.php b/htdocs/includes/modules/societe/mod_codecompta_aquarium.php
index 16470d49156..2add754fa2c 100644
--- a/htdocs/includes/modules/societe/mod_codecompta_aquarium.php
+++ b/htdocs/includes/modules/societe/mod_codecompta_aquarium.php
@@ -72,7 +72,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
 		$i = 0;
 		$this->db = $DB;
 
-		dolibarr_syslog("mod_codecompta_aquarium::get_code search code for type=".$type." company=".$societe->nom);
+		dol_syslog("mod_codecompta_aquarium::get_code search code for type=".$type." company=".$societe->nom);
 
 		// Regle gestion compte compta
 		$codetouse='';
@@ -106,7 +106,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
 			// Pour retour
 			$this->code=$codetouse;
 		}
-		dolibarr_syslog("mod_codecompta_aquarium::get_code found code=".$this->code);
+		dol_syslog("mod_codecompta_aquarium::get_code found code=".$this->code);
 		return $is_dispo;
 	}
 
@@ -136,19 +136,19 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
 		{
 			if ($db->num_rows($resql) == 0)
 			{
-				dolibarr_syslog("mod_codecompta_aquarium::verif code '".$code."' available");
+				dol_syslog("mod_codecompta_aquarium::verif code '".$code."' available");
 				return 1;	// Dispo
 			}
 			else
 			{
-				dolibarr_syslog("mod_codecompta_aquarium::verif code '".$code."' not available");
+				dol_syslog("mod_codecompta_aquarium::verif code '".$code."' not available");
 				return 0;	// Non dispo
 			}
 		}
 		else
 		{
 			$this->error=$db->error()." sql=".$sql;
-			dolibarr_syslog("mod_codecompta_aquarium::verif error".$this->error);
+			dol_syslog("mod_codecompta_aquarium::verif error".$this->error);
 			return -1;		// Erreur
 		}
 	}
diff --git a/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php b/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
index 9630dfa0048..59b8c6e8d82 100644
--- a/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
+++ b/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
@@ -205,8 +205,8 @@ function supplier_order_pdf_create($db, $comid, $modele,$outputlangs)
 		else
 		{
 			$outputlangs->charset_output=$sav_charset_output;
-			dolibarr_syslog("Erreur dans supplier_order_pdf_create");
-			dolibarr_print_error($db,$obj->pdferror());
+			dol_syslog("Erreur dans supplier_order_pdf_create");
+			dol_print_error($db,$obj->pdferror());
 			return 0;
 		}
 	}
diff --git a/htdocs/includes/triggers/interface_all_Logevents.class.php b/htdocs/includes/triggers/interface_all_Logevents.class.php
index 62787065727..9f1da9bb8e4 100644
--- a/htdocs/includes/triggers/interface_all_Logevents.class.php
+++ b/htdocs/includes/triggers/interface_all_Logevents.class.php
@@ -100,13 +100,13 @@ class InterfaceLogevents
         if (! empty($conf->global->MAIN_LOGEVENTS_DISABLE_ALL)) return 0;	// Log events is disabled (hidden features)
 
 		$key='MAIN_LOGEVENTS_'.$action;
-		//dolibarr_syslog("xxxxxxxxxxx".$key);
+		//dol_syslog("xxxxxxxxxxx".$key);
 		if (empty($conf->global->$key)) return 0;				// Log events not enabled for this action
 
         // Actions
         if ($action == 'USER_LOGIN')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 
             // Initialisation donnees (date,duree,texte,desc)
             $this->date=time();
@@ -116,7 +116,7 @@ class InterfaceLogevents
         }
         if ($action == 'USER_LOGIN_FAILED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 
             // Initialisation donnees (date,duree,texte,desc)
             $this->date=time();
@@ -126,7 +126,7 @@ class InterfaceLogevents
         }
         if ($action == 'USER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -137,7 +137,7 @@ class InterfaceLogevents
 		}
         elseif ($action == 'USER_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -148,7 +148,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'USER_NEW_PASSWORD')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -159,7 +159,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'USER_ENABLEDISABLE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
             $this->date=time();
@@ -177,7 +177,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'USER_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
             $this->date=time();
@@ -189,7 +189,7 @@ class InterfaceLogevents
 		// Groupes
         elseif ($action == 'GROUP_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
             $this->date=time();
@@ -199,7 +199,7 @@ class InterfaceLogevents
 		}
         elseif ($action == 'GROUP_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
             $this->date=time();
@@ -209,7 +209,7 @@ class InterfaceLogevents
 		}
         elseif ($action == 'GROUP_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
             $this->date=time();
@@ -221,7 +221,7 @@ class InterfaceLogevents
 		// Actions
         if ($action == 'ACTION_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -250,7 +250,7 @@ class InterfaceLogevents
 		// Third parties
         elseif ($action == 'COMPANY_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -267,7 +267,7 @@ class InterfaceLogevents
 		// Contracts
         elseif ($action == 'CONTRACT_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -279,7 +279,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'CONTRACT_CANCEL')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -290,7 +290,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'CONTRACT_CLOSE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -303,7 +303,7 @@ class InterfaceLogevents
 		// Proposals
         elseif ($action == 'PROPAL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -314,7 +314,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'PROPAL_CLOSE_SIGNED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -325,7 +325,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'PROPAL_CLOSE_REFUSED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -338,7 +338,7 @@ class InterfaceLogevents
         // Invoices
 		elseif ($action == 'BILL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -349,7 +349,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'BILL_PAYED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -360,7 +360,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'BILL_CANCELED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -373,7 +373,7 @@ class InterfaceLogevents
         // Payments
         elseif ($action == 'PAYMENT_CUSTOMER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -385,7 +385,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'PAYMENT_SUPPLIER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -399,7 +399,7 @@ class InterfaceLogevents
         // Members
         elseif ($action == 'MEMBER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -413,7 +413,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'MEMBER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -427,7 +427,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'MEMBER_SUBSCRIPTION')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -438,12 +438,12 @@ class InterfaceLogevents
             $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
             $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
             $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
-            $this->desc.="\n".$langs->transnoentities("Period").': '.dolibarr_print_date($object->last_subscription_date_start,'day').' - '.dolibarr_print_date($object->last_subscription_date_end,'day');
+            $this->desc.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day');
             $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
         }
         elseif ($action == 'MEMBER_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -457,7 +457,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'MEMBER_RESILIATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -471,7 +471,7 @@ class InterfaceLogevents
         }
         elseif ($action == 'MEMBER_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -488,7 +488,7 @@ class InterfaceLogevents
 /*
         else
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
+            dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
 			return 0;
         }
 */
@@ -514,7 +514,7 @@ class InterfaceLogevents
                 $error ="Failed to insert security event: ".$event->error;
                 $this->error=$error;
 
-                dolibarr_syslog("interface_all_Logevents.class.php: ".$this->error);
+                dol_syslog("interface_all_Logevents.class.php: ".$this->error);
                 return -1;
             }
         }
diff --git a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php
index 06e82592435..e97d3c083c7 100644
--- a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php
+++ b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php
@@ -99,7 +99,7 @@ class InterfaceActionsAuto
     function run_trigger($action,$object,$user,$langs,$conf)
     {
 		$key='MAIN_AGENDA_ACTIONAUTO_'.$action;
-		//dolibarr_syslog("xxxxxxxxxxx".$key);
+		//dol_syslog("xxxxxxxxxxx".$key);
 		if (empty($conf->global->$key)) return 0;				// Log events not enabled for this action
 		
 		// Following properties must be filled:
@@ -118,7 +118,7 @@ class InterfaceActionsAuto
 		// Actions
 		if ($action == 'COMPANY_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("agenda");
 
@@ -137,7 +137,7 @@ class InterfaceActionsAuto
         }
         elseif ($action == 'CONTRACT_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("contracts");
             $langs->load("agenda");
@@ -153,7 +153,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'PROPAL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("propal");
             $langs->load("agenda");
 
@@ -169,7 +169,7 @@ class InterfaceActionsAuto
 		}
         elseif ($action == 'PROPAL_SENTBYMAIL')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("propal");
             $langs->load("agenda");
 			$ok=1;
@@ -178,7 +178,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'PROPAL_CLOSE_SIGNED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("propal");
             $langs->load("agenda");
 
@@ -194,7 +194,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'PROPAL_CLOSE_REFUSED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("propal");
             $langs->load("agenda");
 
@@ -210,7 +210,7 @@ class InterfaceActionsAuto
 		}		
 		elseif ($action == 'ORDER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("orders");
             $langs->load("agenda");
 			
@@ -226,7 +226,7 @@ class InterfaceActionsAuto
 		}
         elseif ($action == 'ORDER_SENTBYMAIL')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("orders");
             $langs->load("agenda");
 			$ok=1;
@@ -235,7 +235,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'BILL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("bills");
             $langs->load("agenda");
@@ -252,7 +252,7 @@ class InterfaceActionsAuto
 		}
         elseif ($action == 'BILL_SENTBYMAIL')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("bills");
             $langs->load("agenda");
@@ -262,7 +262,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'BILL_PAYED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("bills");
             $langs->load("agenda");
@@ -279,7 +279,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'BILL_CANCELED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("bills");
             $langs->load("agenda");
@@ -296,7 +296,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("orders");
             $langs->load("agenda");
 			
@@ -312,7 +312,7 @@ class InterfaceActionsAuto
 		}
 		elseif ($action == 'BILL_SUPPLIER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("bills");
             $langs->load("agenda");
@@ -331,7 +331,7 @@ class InterfaceActionsAuto
         // Members
         elseif ($action == 'MEMBER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
             $langs->load("agenda");
@@ -350,7 +350,7 @@ class InterfaceActionsAuto
         }
         elseif ($action == 'MEMBER_SUBSCRIPTION')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
             $langs->load("agenda");
@@ -361,7 +361,7 @@ class InterfaceActionsAuto
             $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname;
             $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
             $object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
-            $object->actionmsg.="\n".$langs->transnoentities("Period").': '.dolibarr_print_date($object->last_subscription_date_start,'day').' - '.dolibarr_print_date($object->last_subscription_date_end,'day');
+            $object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day');
             $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
             
 			$object->sendtoid=0;
@@ -370,11 +370,11 @@ class InterfaceActionsAuto
         }
         elseif ($action == 'MEMBER_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         }
         elseif ($action == 'MEMBER_RESILIATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
             $langs->load("agenda");
@@ -392,7 +392,7 @@ class InterfaceActionsAuto
         }
         elseif ($action == 'MEMBER_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
             $langs->load("agenda");
@@ -413,7 +413,7 @@ class InterfaceActionsAuto
 /*
         else
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
+            dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
 			return 0;
         }
 */
@@ -453,7 +453,7 @@ class InterfaceActionsAuto
                 $error ="Failed to insert : ".$actioncomm->error." ";
                 $this->error=$error;
 
-                dolibarr_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error);
+                dol_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error);
                 return -1;
 			}
 		}
diff --git a/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php b/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php
index 8dd70a540ff..c018f4df571 100644
--- a/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php
+++ b/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php
@@ -103,14 +103,14 @@ class InterfaceLdapsynchro
 
         if (! function_exists('ldap_connect'))
         {
-        	dolibarr_syslog("Warning, module LDAP is enabled but LDAP functions not available in this PHP", LOG_WARNING);
+        	dol_syslog("Warning, module LDAP is enabled but LDAP functions not available in this PHP", LOG_WARNING);
         	return 0;
         }
 
         // Users
         if ($action == 'USER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
         	{
         		$ldap=new Ldap();
@@ -129,7 +129,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'USER_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
         	{
         		$ldap=new Ldap();
@@ -148,15 +148,15 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'USER_NEW_PASSWORD')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         }
         elseif ($action == 'USER_ENABLEDISABLE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         }
         elseif ($action == 'USER_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
         	{
         		$ldap=new Ldap();
@@ -233,7 +233,7 @@ class InterfaceLdapsynchro
         // Contacts
         elseif ($action == 'CONTACT_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 	      	if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)
         	{
         		$ldap=new Ldap();
@@ -252,7 +252,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'CONTACT_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)
         	{
         		$ldap=new Ldap();
@@ -271,7 +271,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'CONTACT_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 	    	if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)
 	    	{
 	    		$ldap=new Ldap();
@@ -292,7 +292,7 @@ class InterfaceLdapsynchro
         // Members
         elseif ($action == 'MEMBER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
         	{
         		$ldap=new Ldap();
@@ -311,7 +311,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'MEMBER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
         	{
 				# If status field is setup to be synchronized
@@ -334,7 +334,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'MEMBER_SUBSCRIPTION')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
         	{
 				# If subscriptions fields are setup to be synchronized
@@ -361,7 +361,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'MEMBER_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
         	{
         		$ldap=new Ldap();
@@ -380,7 +380,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'MEMBER_NEW_PASSWORD')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
         	{
 				# If password field is setup to be synchronized
@@ -403,7 +403,7 @@ class InterfaceLdapsynchro
 		}
         elseif ($action == 'MEMBER_RESILIATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
         	if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
         	{
 				# If status field is setup to be synchronized
@@ -426,7 +426,7 @@ class InterfaceLdapsynchro
         }
         elseif ($action == 'MEMBER_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 			if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
 			{
 				$ldap=new Ldap();
@@ -448,7 +448,7 @@ class InterfaceLdapsynchro
 /*
         else
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
+            dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
 			return -1;
         }
 */
diff --git a/htdocs/includes/triggers/interface_modNotification_Notification.class.php b/htdocs/includes/triggers/interface_modNotification_Notification.class.php
index bd37e817336..5a21a52b9c4 100644
--- a/htdocs/includes/triggers/interface_modNotification_Notification.class.php
+++ b/htdocs/includes/triggers/interface_modNotification_Notification.class.php
@@ -102,7 +102,7 @@ class InterfaceNotification
 
 		if ($action == 'BILL_VALIDATE')
 		{
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 
 			$action_notify = 2;
             $ref = sanitizeFileName($object->ref);
@@ -115,7 +115,7 @@ class InterfaceNotification
 
 		elseif ($action == 'FICHEINTER_VALIDATE')
 		{
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 
 			$action_notify = 1;
             $ref = sanitizeFileName($object->ref);
@@ -128,7 +128,7 @@ class InterfaceNotification
 
 		elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
 		{
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
 
 			$action_notify = 3;
             $ref = sanitizeFileName($object->ref);
@@ -143,7 +143,7 @@ class InterfaceNotification
 /*
         else
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
+            dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
 			return -1;
         }
 */
diff --git a/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php b/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php
index 1e2037617e8..433600bdd73 100644
--- a/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php
+++ b/htdocs/includes/triggers/interface_modPhenix_Phenixsynchro.class.php
@@ -110,7 +110,7 @@ class InterfacePhenixsynchro
         // Actions
         if ($action == 'ACTION_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -139,7 +139,7 @@ class InterfacePhenixsynchro
 		// Third parties
         elseif ($action == 'COMPANY_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             
             // Initialisation donnees (date,duree,texte,desc)
@@ -156,7 +156,7 @@ class InterfacePhenixsynchro
 		// Contracts
         elseif ($action == 'CONTRACT_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -168,7 +168,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'CONTRACT_CANCEL')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -179,7 +179,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'CONTRACT_CLOSE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -192,7 +192,7 @@ class InterfacePhenixsynchro
 		// Proposals
         elseif ($action == 'PROPAL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -203,7 +203,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'PROPAL_CLOSE_SIGNED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -214,7 +214,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'PROPAL_CLOSE_REFUSED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -227,7 +227,7 @@ class InterfacePhenixsynchro
         // Invoices
 		elseif ($action == 'BILL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -238,7 +238,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'BILL_PAYED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -249,7 +249,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'BILL_CANCELED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -262,7 +262,7 @@ class InterfacePhenixsynchro
         // Payments
         elseif ($action == 'PAYMENT_CUSTOMER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -274,7 +274,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'PAYMENT_SUPPLIER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -288,7 +288,7 @@ class InterfacePhenixsynchro
         // Members
         elseif ($action == 'MEMBER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -302,7 +302,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'MEMBER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -316,7 +316,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'MEMBER_SUBSCRIPTION')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -327,12 +327,12 @@ class InterfacePhenixsynchro
             $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
             $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
             $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
-            $this->desc.="\n".$langs->transnoentities("Period").': '.dolibarr_print_date($object->last_subscription_date_start,'day').' - '.dolibarr_print_date($object->last_subscription_date_end,'day');
+            $this->desc.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day');
             $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
         }
         elseif ($action == 'MEMBER_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -346,7 +346,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'MEMBER_RESILIATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -360,7 +360,7 @@ class InterfacePhenixsynchro
         }
         elseif ($action == 'MEMBER_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -377,7 +377,7 @@ class InterfacePhenixsynchro
 /*
         else
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
+            dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
 			return 0;
         }
 */
@@ -395,7 +395,7 @@ class InterfacePhenixsynchro
                 $error.="La mise a jour Webcalendar a �t� ignor�e.";
                 $this->error=$error;
     
-                //dolibarr_syslog("interface_phenix.class.php: ".$this->error);
+                //dol_syslog("interface_phenix.class.php: ".$this->error);
                 return -1;
             }
 
@@ -415,7 +415,7 @@ class InterfacePhenixsynchro
                 $error.="La mise a jour Phenix a �t� ignor�e.";
                 $this->error=$error;
 
-                //dolibarr_syslog("interface_phenix.class.php: ".$this->error);
+                //dol_syslog("interface_phenix.class.php: ".$this->error);
                 return -2;
             }
         }
diff --git a/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php b/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php
index a49bcbba910..cee1deea4a4 100644
--- a/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php
+++ b/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php
@@ -109,7 +109,7 @@ class InterfaceWebcalsynchro
         // Actions
         if ($action == 'ACTION_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -138,7 +138,7 @@ class InterfaceWebcalsynchro
 		// Third parties
         elseif ($action == 'COMPANY_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             
             // Initialisation donnees (date,duree,texte,desc)
@@ -155,7 +155,7 @@ class InterfaceWebcalsynchro
 		// Contracts
         elseif ($action == 'CONTRACT_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             // Initialisation donnees (date,duree,texte,desc)
@@ -169,7 +169,7 @@ class InterfaceWebcalsynchro
 		// Proposals
         elseif ($action == 'PROPAL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -180,7 +180,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'PROPAL_CLOSE_SIGNED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -191,7 +191,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'PROPAL_CLOSE_REFUSED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -204,7 +204,7 @@ class InterfaceWebcalsynchro
         // Invoices
 		elseif ($action == 'BILL_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -215,7 +215,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'BILL_PAYED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -226,7 +226,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'BILL_CANCELED')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -239,7 +239,7 @@ class InterfaceWebcalsynchro
         // Payments
         elseif ($action == 'PAYMENT_CUSTOMER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -251,7 +251,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'PAYMENT_SUPPLIER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
 
             $this->date=time();
@@ -265,7 +265,7 @@ class InterfaceWebcalsynchro
         // Members
         elseif ($action == 'MEMBER_CREATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -279,7 +279,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'MEMBER_VALIDATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -293,7 +293,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'MEMBER_SUBSCRIPTION')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -304,12 +304,12 @@ class InterfaceWebcalsynchro
             $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
             $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
             $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
-            $this->desc.="\n".$langs->transnoentities("Period").': '.dolibarr_print_date($object->last_subscription_date_start,'day').' - '.dolibarr_print_date($object->last_subscription_date_end,'day');
+            $this->desc.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day');
             $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
         }
         elseif ($action == 'MEMBER_MODIFY')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -323,7 +323,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'MEMBER_RESILIATE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -337,7 +337,7 @@ class InterfaceWebcalsynchro
         }
         elseif ($action == 'MEMBER_DELETE')
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
+            dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("other");
             $langs->load("members");
 
@@ -354,7 +354,7 @@ class InterfaceWebcalsynchro
 /*
         else
         {
-            dolibarr_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
+            dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
 			return 0;
         }
 */
@@ -372,7 +372,7 @@ class InterfaceWebcalsynchro
                 $error.="La mise a jour Webcalendar a �t� ignor�e.";
                 $this->error=$error;
     
-                //dolibarr_syslog("interface_webcal.class.php: ".$this->error);
+                //dol_syslog("interface_webcal.class.php: ".$this->error);
                 return -1;
             }
 
@@ -392,7 +392,7 @@ class InterfaceWebcalsynchro
                 $error.="La mise a jour Webcalendar a �t� ignor�e.";
                 $this->error=$error;
 
-                //dolibarr_syslog("interface_webcal.class.php: ".$this->error);
+                //dol_syslog("interface_webcal.class.php: ".$this->error);
                 return -2;
             }
         }
diff --git a/htdocs/index.php b/htdocs/index.php
index da2a18dfea0..adc07878910 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -99,7 +99,7 @@ $userstring=$user->fullname;
 print '<td nowrap>'.$langs->trans("User").'</td><td>'.$userstring.'</td></tr>';
 print '<tr '.$bc[true].'>';
 print '<td nowrap>'.$langs->trans("PreviousConnexion").'</td><td>';
-if ($user->datepreviouslogin) print dolibarr_print_date($user->datepreviouslogin,"dayhour");
+if ($user->datepreviouslogin) print dol_print_date($user->datepreviouslogin,"dayhour");
 else print $langs->trans("Unknown");
 print '</td>';
 print "</tr>\n";
diff --git a/htdocs/install/etape0.php b/htdocs/install/etape0.php
index 22ecfc580fe..1cc31844d6d 100644
--- a/htdocs/install/etape0.php
+++ b/htdocs/install/etape0.php
@@ -137,7 +137,7 @@ if (! $error)
 			//print $_POST["db_type"].",".$_POST["db_host"].",$userroot,$passroot,$databasefortest,".$_POST["db_port"];
 			$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest,$_POST["db_port"]);
 
-			dolibarr_syslog("databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected, LOG_DEBUG);
+			dol_syslog("databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected, LOG_DEBUG);
 			//print "databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected;
 
 			if (empty($_POST["db_create_database"]) && $db->connected && ! $db->database_selected)
diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php
index f76702fcbba..87db4fde57b 100644
--- a/htdocs/install/etape1.php
+++ b/htdocs/install/etape1.php
@@ -473,7 +473,7 @@ function write_conf_file($conffile)
 		fputs($fp, '<?php');
 		fputs($fp,"\n");
 		fputs($fp,"#\n");
-		fputs($fp,"# File generated by Dolibarr installer on ".dolibarr_print_date(gmmktime(),''));
+		fputs($fp,"# File generated by Dolibarr installer on ".dol_print_date(gmmktime(),''));
 		fputs($fp,"\n");
 		fputs($fp,"#\n");
 		fputs($fp,"# Take a look at conf.php.example file for an example of conf.php file\n");
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index ef471bab680..8455890ef34 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -317,7 +317,7 @@ function pFooter($nonext=0,$setuplang='')
 function dolibarr_install_syslog($message, $level=LOG_DEBUG)
 {
 	if (! defined('LOG_DEBUG')) define('LOG_DEBUG',6);
-	dolibarr_syslog($message,$level);
+	dol_syslog($message,$level);
 }
 
 ?>
\ No newline at end of file
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index c6014b5d2cd..ed3e8d4c5c8 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -251,7 +251,7 @@ function migrate_paiements($db,$langs,$conf)
 		}
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	if ($num)
@@ -341,7 +341,7 @@ function migrate_paiements_orphelins_1($db,$langs,$conf)
 		}
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	if (sizeof($row))
@@ -449,7 +449,7 @@ function migrate_paiements_orphelins_2($db,$langs,$conf)
 		}
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	if (sizeof($row))
@@ -585,7 +585,7 @@ function migrate_contracts_det($db,$langs,$conf)
 				}
 				else
 				{
-					dolibarr_print_error($db);
+					dol_print_error($db);
 					$nberr++;
 				}
 
@@ -611,7 +611,7 @@ function migrate_contracts_det($db,$langs,$conf)
 	else
 	{
 		print $langs->trans('MigrationContractsFieldDontExist')."<br>\n";
-		//    dolibarr_print_error($db);
+		//    dol_print_error($db);
 	}
 
 	print '</td></tr>';
@@ -663,7 +663,7 @@ function migrate_links_transfert($db,$langs,$conf)
 
 				if (! $db->query($sql))
 				{
-					dolibarr_print_error($db);
+					dol_print_error($db);
 					$nberr++;
 				}
 
@@ -688,7 +688,7 @@ function migrate_links_transfert($db,$langs,$conf)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	print '</td></tr>';
@@ -707,7 +707,7 @@ function migrate_contracts_date1($db,$langs,$conf)
 
 	$sql="update llx_contrat set date_contrat=tms where date_contrat is null";
 	$resql = $db->query($sql);
-	if (! $resql) dolibarr_print_error($db);
+	if (! $resql) dol_print_error($db);
 	if ($db->affected_rows($resql) > 0)
 	print $langs->trans('MigrationContractsEmptyDatesUpdateSuccess')."<br>\n";
 	else
@@ -715,7 +715,7 @@ function migrate_contracts_date1($db,$langs,$conf)
 
 	$sql="update llx_contrat set datec=tms where datec is null";
 	$resql = $db->query($sql);
-	if (! $resql) dolibarr_print_error($db);
+	if (! $resql) dol_print_error($db);
 	if ($db->affected_rows($resql) > 0)
 	print $langs->trans('MigrationContractsEmptyCreationDatesUpdateSuccess')."<br>\n";
 	else
@@ -765,7 +765,7 @@ function migrate_contracts_date2($db,$langs,$conf)
 					$sql.=" SET date_contrat='".$obj->datemin."'";
 					$sql.=" WHERE rowid=".$obj->cref;
 					$resql2=$db->query($sql);
-					if (! $resql2) dolibarr_print_error($db);
+					if (! $resql2) dol_print_error($db);
 
 					$nbcontratsmodifie++;
 				}
@@ -782,7 +782,7 @@ function migrate_contracts_date2($db,$langs,$conf)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	print '</td></tr>';
@@ -801,7 +801,7 @@ function migrate_contracts_date3($db,$langs,$conf)
 
 	$sql="update llx_contrat set datec=date_contrat where datec is null or datec > date_contrat";
 	$resql = $db->query($sql);
-	if (! $resql) dolibarr_print_error($db);
+	if (! $resql) dol_print_error($db);
 	if ($db->affected_rows() > 0)
 	print $langs->trans('MigrationContractsIncoherentCreationDateUpdateSuccess')."<br>\n";
 	else
@@ -824,7 +824,7 @@ function migrate_contracts_open($db,$langs,$conf)
 	$sql = "SELECT c.rowid as cref FROM llx_contrat as c, llx_contratdet as cd";
 	$sql.= " WHERE cd.statut = 4 AND c.statut=2 AND c.rowid=cd.fk_contrat";
 	$resql = $db->query($sql);
-	if (! $resql) dolibarr_print_error($db);
+	if (! $resql) dol_print_error($db);
 	if ($db->affected_rows() > 0) {
 		$i = 0;
 		$row = array();
@@ -844,7 +844,7 @@ function migrate_contracts_open($db,$langs,$conf)
 				$sql.=" SET statut=1";
 				$sql.=" WHERE rowid=".$obj->cref;
 				$resql2=$db->query($sql);
-				if (! $resql2) dolibarr_print_error($db);
+				if (! $resql2) dol_print_error($db);
 
 				$nbcontratsmodifie++;
 
@@ -1367,7 +1367,7 @@ function migrate_price_commande($db,$langs,$conf)
 		$resql=$db->query($sql);
 		if (! $resql)
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		$db->commit();
@@ -1478,7 +1478,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
 		$resql=$db->query($sql);
 		if (! $resql)
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		$db->commit();
@@ -1515,7 +1515,7 @@ function migrate_modeles($db,$langs,$conf)
 			// Aucun model par defaut.
 			$sql=" insert into llx_document_model(nom,type) values('crabe','invoice')";
 			$resql = $db->query($sql);
-			if (! $resql) dolibarr_print_error($db);
+			if (! $resql) dol_print_error($db);
 		}
 	}
 
@@ -1529,7 +1529,7 @@ function migrate_modeles($db,$langs,$conf)
 			// Aucun model par defaut.
 			$sql=" insert into llx_document_model(nom,type) values('einstein','order')";
 			$resql = $db->query($sql);
-			if (! $resql) dolibarr_print_error($db);
+			if (! $resql) dol_print_error($db);
 		}
 	}
 
@@ -1543,7 +1543,7 @@ function migrate_modeles($db,$langs,$conf)
 			// Aucun model par defaut.
 			$sql=" insert into llx_document_model(nom,type) values('rouget','shipping')";
 			$resql = $db->query($sql);
-			if (! $resql) dolibarr_print_error($db);
+			if (! $resql) dol_print_error($db);
 		}
 	}
 
@@ -1658,7 +1658,7 @@ function migrate_commande_expedition($db,$langs,$conf)
 					if (!$resql2)
 					{
 						$error++;
-						dolibarr_print_error($db);
+						dol_print_error($db);
 					}
 					print ". ";
 					$i++;
@@ -1679,7 +1679,7 @@ function migrate_commande_expedition($db,$langs,$conf)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			$db->rollback();
 		}
 	}
@@ -1738,13 +1738,13 @@ function migrate_commande_livraison($db,$langs,$conf)
 						if (!$resql3)
 						{
 							$error++;
-							dolibarr_print_error($db);
+							dol_print_error($db);
 						}
 					}
 					else
 					{
 						$error++;
-						dolibarr_print_error($db);
+						dol_print_error($db);
 					}
 					print ". ";
 					$i++;
@@ -1765,7 +1765,7 @@ function migrate_commande_livraison($db,$langs,$conf)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			$db->rollback();
 		}
 	}
@@ -1839,19 +1839,19 @@ function migrate_detail_livraison($db,$langs,$conf)
 							if (!$resql4)
 							{
 								$error++;
-								dolibarr_print_error($db);
+								dol_print_error($db);
 							}
 						}
 						else
 						{
 							$error++;
-							dolibarr_print_error($db);
+							dol_print_error($db);
 						}
 					}
 					else
 					{
 						$error++;
-						dolibarr_print_error($db);
+						dol_print_error($db);
 					}
 					print ". ";
 					$i++;
@@ -1873,7 +1873,7 @@ function migrate_detail_livraison($db,$langs,$conf)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			$db->rollback();
 		}
 	}
@@ -1934,7 +1934,7 @@ function migrate_stocks($db,$langs,$conf)
 				else
 				{
 					$error++;
-					dolibarr_print_error($db);
+					dol_print_error($db);
 				}
 				print ". ";
 				$i++;
@@ -1953,7 +1953,7 @@ function migrate_stocks($db,$langs,$conf)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		$db->rollback();
 	}
 
diff --git a/htdocs/interfaces.class.php b/htdocs/interfaces.class.php
index cac5f7dc2d1..0b11041f663 100644
--- a/htdocs/interfaces.class.php
+++ b/htdocs/interfaces.class.php
@@ -72,7 +72,7 @@ class Interfaces
 				if (in_array($modName,$modules))
 				{
 					$langs->load("errors");
-					dolibarr_syslog("Interface::run_triggers ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/"),LOG_ERR);
+					dol_syslog("Interface::run_triggers ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/"),LOG_ERR);
 					continue;
 				}
 
@@ -92,18 +92,18 @@ class Interfaces
 
 				if (! $qualified)
 				{
-					dolibarr_syslog("Interfaces::run_triggers Triggers for file '".$file."' need module to be enabled",LOG_INFO);
+					dol_syslog("Interfaces::run_triggers Triggers for file '".$file."' need module to be enabled",LOG_INFO);
 					continue;
 				}
 
-				dolibarr_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
+				dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
 				include_once($this->dir."/".$file);
 				$objMod = new $modName($this->db);
 				$i=0;
 				if ($objMod)
 				{
 					$modules[$i] = $modName;
-					//dolibarr_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
+					//dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
 					$result=$objMod->run_trigger($action,$object,$user,$langs,$conf);
 					if ($result > 0)
 					{
@@ -129,12 +129,12 @@ class Interfaces
 		}
 		if ($nbko)
 		{
-			dolibarr_syslog("Interfaces::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_ERR);
+			dol_syslog("Interfaces::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_ERR);
 			return -$nbko;
 		}
 		else
 		{
-			//dolibarr_syslog("Interfaces::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_DEBUG);
+			//dol_syslog("Interfaces::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_DEBUG);
 			return $nbok;
 		}
 	}
diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php
index fb867c6e736..ed9d8b348da 100644
--- a/htdocs/lib/CMailFile.class.php
+++ b/htdocs/lib/CMailFile.class.php
@@ -78,8 +78,8 @@ class CMailFile
 		// If ending method not defined
 		if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail';
 
-		dolibarr_syslog("CMailFile::CMailfile: MAIN_MAIL_SENDMODE=".$conf->global->MAIN_MAIL_SENDMODE." charset=".$conf->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to", LOG_DEBUG);
-		dolibarr_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG);
+		dol_syslog("CMailFile::CMailfile: MAIN_MAIL_SENDMODE=".$conf->global->MAIN_MAIL_SENDMODE." charset=".$conf->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to", LOG_DEBUG);
+		dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG);
 
 		// Detect if message is HTML (use fast method)
 		if ($msgishtml == -1)
@@ -98,7 +98,7 @@ class CMailFile
 			if ($filename_list[$i])
 			{
 				$this->atleastonefile=1;
-				dolibarr_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i], LOG_DEBUG);
+				dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i], LOG_DEBUG);
 			}
 		}
 
@@ -217,9 +217,9 @@ class CMailFile
 
 				// Use mail php function (default PHP method)
 				// ------------------------------------------
-				dolibarr_syslog("CMailFile::sendfile addr_to=".$this->addr_to.", subject=".$this->subject, LOG_DEBUG);
-				dolibarr_syslog("CMailFile::sendfile header=\n".$this->headers, LOG_DEBUG);
-				//dolibarr_syslog("CMailFile::sendfile message=\n".$message);
+				dol_syslog("CMailFile::sendfile addr_to=".$this->addr_to.", subject=".$this->subject, LOG_DEBUG);
+				dol_syslog("CMailFile::sendfile header=\n".$this->headers, LOG_DEBUG);
+				//dol_syslog("CMailFile::sendfile message=\n".$message);
 
 
 				if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
@@ -240,12 +240,12 @@ class CMailFile
 				if (! $dest)
 				{
 					$this->error="Failed to send mail to SMTP=".ini_get('SMTP').", PORT=".ini_get('smtp_port')."<br>Recipient address '$dest' invalid";
-					dolibarr_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_DEBUG);
+					dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_DEBUG);
 				}
 				else
 				{
-					dolibarr_syslog("CMailFile::sendfile: mail start SMTP=".ini_get('SMTP').", PORT=".ini_get('smtp_port'), LOG_DEBUG);
-					//dolibarr_syslog("to=".getValidAddress($this->addr_to,2).", subject=".$this->subject.", message=".stripslashes($this->message).", header=".$this->headers);
+					dol_syslog("CMailFile::sendfile: mail start SMTP=".ini_get('SMTP').", PORT=".ini_get('smtp_port'), LOG_DEBUG);
+					//dol_syslog("to=".getValidAddress($this->addr_to,2).", subject=".$this->subject.", message=".stripslashes($this->message).", header=".$this->headers);
 
 					$bounce = '';
 					if ($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F)
@@ -261,11 +261,11 @@ class CMailFile
 					if (! $res)
 					{
 						$this->error="Failed to send mail to SMTP=".ini_get('SMTP').", PORT=".ini_get('smtp_port')."<br>Check your server logs and your firewalls setup";
-						dolibarr_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_DEBUG);
+						dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_DEBUG);
 					}
 					else
 					{
-						dolibarr_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG);
+						dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG);
 					}
 				}
 
@@ -300,7 +300,7 @@ class CMailFile
 				if (! $dest)
 				{
 					$this->error="Failed to send mail to SMTP=".$conf->global->MAIN_MAIL_SMTP_SERVER.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT."<br>Recipient address '$dest' invalid";
-					dolibarr_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_DEBUG);
+					dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_DEBUG);
 				}
 				else
 				{
@@ -329,7 +329,7 @@ class CMailFile
 		else
 		{
 			$this->error='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
-			dolibarr_syslog("CMailFile::sendfile: ".$this->error);
+			dol_syslog("CMailFile::sendfile: ".$this->error);
 		}
 
 		error_reporting($errorlevel);              // Reactive niveau erreur origine
@@ -357,7 +357,7 @@ class CMailFile
 		else
 		{
 			$this->error="Error: Can't read file '$sourcefile'";
-			dolibarr_syslog("CMailFile::encode_file: ".$this->error, LOG_ERR);
+			dol_syslog("CMailFile::encode_file: ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -428,7 +428,7 @@ class CMailFile
 			$out.= "Content-Transfer-Encoding: 8bit".$this->eol;
 		}
 
-		dolibarr_syslog("CMailFile::write_smtpheaders smtp_header=\n".$out, LOG_DEBUG);
+		dol_syslog("CMailFile::write_smtpheaders smtp_header=\n".$out, LOG_DEBUG);
 		return $out;
 	}
 
@@ -456,7 +456,7 @@ class CMailFile
 			}
 		}
 		//$out.= $this->eol;
-		dolibarr_syslog("CMailFile::write_mimeheaders mime_header=\n".$out, LOG_DEBUG);
+		dol_syslog("CMailFile::write_mimeheaders mime_header=\n".$out, LOG_DEBUG);
 		return $out;
 	}
 
@@ -517,7 +517,7 @@ class CMailFile
 		{
 			if ($filename_list[$i])
 			{
-				dolibarr_syslog("CMailFile::write_files: i=$i");
+				dol_syslog("CMailFile::write_files: i=$i");
 				$encoded = $this->_encode_file($filename_list[$i]);
 				if ($encoded >= 0)
 				{
diff --git a/htdocs/lib/admin.lib.php b/htdocs/lib/admin.lib.php
index cdf89069459..e95b722880f 100644
--- a/htdocs/lib/admin.lib.php
+++ b/htdocs/lib/admin.lib.php
@@ -89,7 +89,7 @@ function run_sql($sqlfile,$silent=1)
 {
 	global $db, $conf, $langs, $user;
 
-	dolibarr_syslog("Admin.lib::run_sql run sql file ".$sqlfile, LOG_DEBUG);
+	dol_syslog("Admin.lib::run_sql run sql file ".$sqlfile, LOG_DEBUG);
 
 	$ok=0;
 	$error=0;
@@ -174,7 +174,7 @@ function run_sql($sqlfile,$silent=1)
 				$from='__+MAX_'.$table.'__';
 				$to='+'.$listofmaxrowid[$table];
 				$newsql=str_replace($from,$to,$newsql);
-				dolibarr_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
+				dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
 
 				$arraysql[$i]=$newsql;
 			}
@@ -192,7 +192,7 @@ function run_sql($sqlfile,$silent=1)
 
 			// Ajout trace sur requete (eventuellement ? commenter si beaucoup de requetes)
 			if (! $silent) print '<tr><td valign="top">'.$langs->trans("Request").' '.($i+1)." sql='".$newsql."'</td></tr>\n";
-			dolibarr_syslog('Admin.lib::run_sql Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
+			dol_syslog('Admin.lib::run_sql Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
 
 			if (eregi('insert into ([^ ]+)',$newsql,$reg))
 			{
@@ -215,7 +215,7 @@ function run_sql($sqlfile,$silent=1)
 				$from='__'.$cursor.'__';
 				$to=$listofinsertedrowid[$cursor];
 				$newsql=str_replace($from,$to,$newsql);
-				dolibarr_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
+				dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
 			}
 
 			$result=$db->query($newsql);
@@ -227,7 +227,7 @@ function run_sql($sqlfile,$silent=1)
 					$table=eregi_replace('[^a-zA-Z_]+','',$reg[1]);
 					$insertedrowid=$db->last_insert_id($table);
 					$listofinsertedrowid[$cursorinsert]=$insertedrowid;
-					dolibarr_syslog('Admin.lib::run_sql Insert nb '.$cursorinsert.', done in table '.$table.', rowid is '.$listofinsertedrowid[$cursorinsert], LOG_DEBUG);
+					dol_syslog('Admin.lib::run_sql Insert nb '.$cursorinsert.', done in table '.$table.', rowid is '.$listofinsertedrowid[$cursorinsert], LOG_DEBUG);
 				}
 				// 	          print '<td align="right">OK</td>';
 			}
@@ -255,7 +255,7 @@ function run_sql($sqlfile,$silent=1)
 					if (! $silent) print '<tr><td valign="top" colspan="2">';
 					if (! $silent) print '<div class="error">'.$langs->trans("Error")." ".$db->errno().": ".$newsql."<br>".$db->error()."</div></td>";
 					if (! $silent) print '</tr>';
-					dolibarr_syslog('Admin.lib::run_sql Request '.($i+1)." Error ".$db->errno()." ".$newsql."<br>".$db->error(), LOG_ERR);
+					dol_syslog('Admin.lib::run_sql Request '.($i+1)." Error ".$db->errno()." ".$newsql."<br>".$db->error(), LOG_ERR);
 					$error++;
 				}
 			}
@@ -295,7 +295,7 @@ function dolibarr_del_const($db, $name)
 	$sql = "DELETE FROM llx_const";
 	$sql.=" WHERE name='".addslashes($name)."' or rowid='".addslashes($name)."'";
 
-    dolibarr_syslog("admin.lib::dolibarr_del_const sql=".$sql);
+    dol_syslog("admin.lib::dolibarr_del_const sql=".$sql);
 	$resql=$db->query($sql);
 	if ($resql)
 	{
@@ -323,7 +323,7 @@ function dolibarr_get_const($db, $name)
     $sql.=" FROM llx_const";
     $sql.=" WHERE name = '".addslashes($name)."'";
 
-    dolibarr_syslog("admin.lib::dolibarr_get_const sql=".$sql);
+    dol_syslog("admin.lib::dolibarr_get_const sql=".$sql);
     $resql=$db->query($sql);
     if ($resql)
     {
@@ -351,15 +351,15 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
 
     if (empty($name))
     {
-    	dolibarr_print_error("Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
+    	dol_print_error("Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
     	exit;
     }
 
     $db->begin();
 
-    //dolibarr_syslog("dolibarr_set_const name=$name, value=$value");
+    //dol_syslog("dolibarr_set_const name=$name, value=$value");
     $sql = "DELETE FROM llx_const WHERE name = '".addslashes($name)."';";
-    dolibarr_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
+    dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
 	$resql=$db->query($sql);
 
     if (strcmp($value,''))	// true if different. Must work for $value='0' or $value=0
@@ -367,7 +367,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
 	    $sql = "INSERT INTO llx_const(name,value,type,visible,note)";
 	    $sql.= " VALUES ('".$name."','".addslashes($value)."','".$type."',".$visible.",'".addslashes($note)."')";
 
-		dolibarr_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
+		dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG);
 	    $resql=$db->query($sql);
     }
 
@@ -380,7 +380,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
     else
     {
     	$this->error=$db->lasterror();
-    	dolibarr_syslog("admin.lib::dolibarr_set_const ".$this->error, LOG_ERR);
+    	dol_syslog("admin.lib::dolibarr_set_const ".$this->error, LOG_ERR);
     	$db->rollback();
         return -1;
     }
diff --git a/htdocs/lib/agenda.lib.php b/htdocs/lib/agenda.lib.php
index 1d0f3ce2fe8..169a8771d6c 100644
--- a/htdocs/lib/agenda.lib.php
+++ b/htdocs/lib/agenda.lib.php
@@ -78,7 +78,7 @@ function show_array_actions_to_do($max=5)
 	            $staticaction->id=$obj->id;
 	            print '<td>'.$staticaction->getNomUrl(1,12).'</td>';
 
-	            print '<td>'.dolibarr_trunc($obj->label,24).'</td>';
+	            print '<td>'.dol_trunc($obj->label,24).'</td>';
 
 	            $customerstatic->id=$obj->rowid;
 	            $customerstatic->nom=$obj->sname;
@@ -86,7 +86,7 @@ function show_array_actions_to_do($max=5)
 	            print '<td>'.$customerstatic->getNomUrl(1,'',16).'</td>';
 
 				// Date
-				print '<td width="100" alig="right">'.dolibarr_print_date($obj->dp,'day').'&nbsp;';
+				print '<td width="100" alig="right">'.dol_print_date($obj->dp,'day').'&nbsp;';
 				$late=0;
 				if ($obj->percent == 0 && $obj->dp && date("U",$obj->dp) < time()) $late=1;
 				if ($obj->percent == 0 && ! $obj->dp && $obj->dp2 && date("U",$obj->dp) < time()) $late=1;
@@ -108,7 +108,7 @@ function show_array_actions_to_do($max=5)
 	}
 	else
 	{
-	    dolibarr_print_error($db);
+	    dol_print_error($db);
 	}
 }
 
@@ -166,7 +166,7 @@ function show_array_last_actions_done($max=5)
 			$staticaction->id=$obj->id;
 			print '<td>'.$staticaction->getNomUrl(1,12).'</td>';
 
-            print '<td>'.dolibarr_trunc($obj->label,24).'</td>';
+            print '<td>'.dol_trunc($obj->label,24).'</td>';
 
 			$customerstatic->id=$obj->rowid;
 			$customerstatic->nom=$obj->sname;
@@ -174,7 +174,7 @@ function show_array_last_actions_done($max=5)
 			print '<td>'.$customerstatic->getNomUrl(1,'',24).'</td>';
 
 			// Date
-			print '<td width="100" align="right">'.dolibarr_print_date($obj->da2,'day');
+			print '<td width="100" align="right">'.dol_print_date($obj->da2,'day');
 			print "</td>";	
 
 			// Statut
@@ -191,7 +191,7 @@ function show_array_last_actions_done($max=5)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/lib/antispamimage.php b/htdocs/lib/antispamimage.php
index 6462026d5a0..e579ec70544 100644
--- a/htdocs/lib/antispamimage.php
+++ b/htdocs/lib/antispamimage.php
@@ -40,7 +40,7 @@ $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_start();
-dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
+dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
 
 
 // On cree l'objet anti-spam
diff --git a/htdocs/lib/bank.lib.php b/htdocs/lib/bank.lib.php
index 613f2106f16..5ea54a51d78 100644
--- a/htdocs/lib/bank.lib.php
+++ b/htdocs/lib/bank.lib.php
@@ -99,7 +99,7 @@ function checkBanForAccount($account)
 	if (empty($account->number)) $account->number=$account->num_compte;
 	if (empty($account->cle))    $account->cle=$account->cle_rib;
 	
-	dolibarr_syslog("Bank.lib::checkBanForAccount account->code_banque=".$account->code_banque." account->code_guichet=".$account->code_guichet." account->number=".$account->number." account->cle=".$account->cle." account->iban=".$account->iban." country_code=".$country_code, LOG_DEBUG);
+	dol_syslog("Bank.lib::checkBanForAccount account->code_banque=".$account->code_banque." account->code_guichet=".$account->code_guichet." account->number=".$account->number." account->cle=".$account->cle." account->iban=".$account->iban." country_code=".$country_code, LOG_DEBUG);
 	
 	if ($country_code == 'FR')	// France rules
 	{
diff --git a/htdocs/lib/bookmark.lib.php b/htdocs/lib/bookmark.lib.php
index 8e0c8b6331d..b363cd3e9d6 100644
--- a/htdocs/lib/bookmark.lib.php
+++ b/htdocs/lib/bookmark.lib.php
@@ -62,7 +62,7 @@ function showArrayOfBookmark($fac)
 	}
 	else
 	{
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 	}
 }
 
diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php
index 36c46302c4c..651124a3099 100644
--- a/htdocs/lib/company.lib.php
+++ b/htdocs/lib/company.lib.php
@@ -173,7 +173,7 @@ function getCountryLabel($id,$withcode=0)
 	$sql = "SELECT rowid, code, libelle FROM ".MAIN_DB_PREFIX."c_pays";
 	$sql.= " WHERE rowid=".$id;
 
-	dolibarr_syslog("Company.lib::getCountryLabel sql=".$sql);
+	dol_syslog("Company.lib::getCountryLabel sql=".$sql);
 	$resql=$db->query($sql);
 	if ($resql)
 	{
@@ -207,7 +207,7 @@ function getFormeJuridiqueLabel($code)
 	$sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_forme_juridique";
 	$sql.= " WHERE code='$code'";
 
-	dolibarr_syslog("Company.lib::getFormeJuridiqueLabel sql=".$sql);
+	dol_syslog("Company.lib::getFormeJuridiqueLabel sql=".$sql);
 	$resql=$db->query($sql);
 	if ($resql)
 	{
@@ -370,7 +370,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
 		$sql.= " AND c.id=a.fk_action AND a.percent < 100";
 		$sql.= " ORDER BY a.datep DESC, a.id DESC";
 
-		dolibarr_syslog("company.lib::show_actions_todo sql=".$sql);
+		dol_syslog("company.lib::show_actions_todo sql=".$sql);
 		$result=$db->query($sql);
 		if ($result)
 		{
@@ -387,7 +387,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
 					$obj = $db->fetch_object($result);
 					print "<tr ".$bc[$var].">";
 
-					print '<td width="100" align="left">'.dolibarr_print_date($obj->dp,'dayhour')."</td>\n";
+					print '<td width="100" align="left">'.dol_print_date($obj->dp,'dayhour')."</td>\n";
 
 					// Picto warning
 					print '<td width="16">';
@@ -448,7 +448,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 		print "</table>\n";
 
@@ -492,7 +492,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
 		$sql.= " AND a.percent = 100";
 		$sql.= " ORDER BY a.datea DESC, a.id DESC";
 
-		dolibarr_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG);
+		dol_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG);
 		$resql=$db->query($sql);
 		if ($resql)
 		{
@@ -513,7 +513,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
@@ -532,7 +532,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
 		$sql.= " AND mc.fk_mailing=m.rowid";
 		$sql.= " ORDER BY mc.date_envoi DESC, m.rowid DESC";
 
-		dolibarr_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG);
+		dol_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG);
 		$resql=$db->query($sql);
 		if ($resql)
 		{
@@ -552,7 +552,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 	}
 
@@ -581,7 +581,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
 			print "<tr ".$bc[$var].">";
 
 			// Champ date
-			print '<td width="100" align="left">'.dolibarr_print_date($histo[$key]['date'],'dayhour')."</td>\n";
+			print '<td width="100" align="left">'.dol_print_date($histo[$key]['date'],'dayhour')."</td>\n";
 
 			// Picto
 			print '<td width="16">&nbsp;</td>';
@@ -600,12 +600,12 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
 				print '<a href="'.DOL_URL_ROOT.'/comm/mailing/fiche.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"),"email").' ';
 				$transcode=$langs->trans("Action".$histo[$key]['acode']);
 				$libelle=($transcode!="Action".$histo[$key]['acode']?$transcode:'Send mass mailing');
-				print dolibarr_trunc($libelle,30);
+				print dol_trunc($libelle,30);
 			}
 			print '</td>';
 
 			// Note
-			print '<td>'.dolibarr_trunc($histo[$key]['note'], 30).'</td>';
+			print '<td>'.dol_trunc($histo[$key]['note'], 30).'</td>';
 
 			// Objet lie
 			print '<td>';
diff --git a/htdocs/lib/databases/mssql.lib.php b/htdocs/lib/databases/mssql.lib.php
index 9c5663c613c..669501df03b 100644
--- a/htdocs/lib/databases/mssql.lib.php
+++ b/htdocs/lib/databases/mssql.lib.php
@@ -93,7 +93,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error="Mssql PHP functions for using MSSql driver are not available in this version of PHP";
-			dolibarr_syslog("DoliDB::DoliDB : MSsql PHP functions for using MSsql driver are not available in this version of PHP",LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : MSsql PHP functions for using MSsql driver are not available in this version of PHP",LOG_ERR);
 			return $this->ok;
 		}
 
@@ -102,7 +102,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error=$langs->trans("ErrorWrongHostParameter");
-			dolibarr_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
 			return $this->ok;
 		}
 
@@ -121,7 +121,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error=mssql_get_last_message();
-			dolibarr_syslog("DoliDB::DoliDB : Erreur Connect mssql_get_last_message=".$this->error,LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Erreur Connect mssql_get_last_message=".$this->error,LOG_ERR);
 		}
 
 		// Si connexion serveur ok et si connexion base demand�e, on essaie connexion base
@@ -139,7 +139,7 @@ class DoliDb
 				$this->database_name = '';
 				$this->ok = 0;
 				$this->error=$this->error();
-				dolibarr_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
+				dol_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
 			}
 		}
 		else
@@ -183,7 +183,7 @@ class DoliDb
 	 */
 	function connect($host, $login, $passwd, $name, $port=0)
 	{
-		dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name");
+		dol_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name");
 		$newhost=$host;
 		if ($port) $newhost.=':'.$port;
 		$this->db  = @mssql_connect($newhost, $login, $passwd);
@@ -224,7 +224,7 @@ class DoliDb
 	 */
 	function close()
 	{
-		dolibarr_syslog("DoliDB::disconnect",LOG_DEBUG);
+		dol_syslog("DoliDB::disconnect",LOG_DEBUG);
 		return mssql_close($this->db);
 	}
 
@@ -241,7 +241,7 @@ class DoliDb
 			if ($ret)
 			{
 				$this->transaction_opened++;
-				dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
+				dol_syslog("BEGIN Transaction",LOG_DEBUG);
 			}
 			return $ret;
 		}
@@ -264,7 +264,7 @@ class DoliDb
 			if ($ret)
 			{
 				$this->transaction_opened=0;
-				dolibarr_syslog("COMMIT Transaction",LOG_DEBUG);
+				dol_syslog("COMMIT Transaction",LOG_DEBUG);
 			}
 			return $ret;
 		}
@@ -285,7 +285,7 @@ class DoliDb
 		{
 			$ret=$this->query("ROLLBACK TRANSACTION");
 			$this->transaction_opened=0;
-			dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
+			dol_syslog("ROLLBACK Transaction",LOG_DEBUG);
 			return $ret;
 		}
 		else
@@ -555,7 +555,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
 		return $date;
 	}
 
@@ -580,7 +580,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
 		return $date;
 	}*/
 
@@ -837,7 +837,7 @@ class DoliDb
 		$sql .= ",".implode(',',$sqlk);
 		$sql .=") type=".$type;
 
-		dolibarr_syslog($sql);
+		dol_syslog($sql);
 		if(! $this -> query($sql))
 		return -1;
 		else
@@ -854,7 +854,7 @@ class DoliDb
 	{
 		$sql="DESC ".$table." ".$field;
 
-		dolibarr_syslog($sql);
+		dol_syslog($sql);
 		$this->results = $this->query($sql);
 		return $this->results;
 	}
@@ -904,7 +904,7 @@ class DoliDb
 	function DDLDropField($table,$field_name)
 	{
 		$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if (! $this->query($sql))
 		{
 			$this->error=$this->lasterror();
diff --git a/htdocs/lib/databases/mysql.lib.php b/htdocs/lib/databases/mysql.lib.php
index cb899763342..0ccf4ad5270 100644
--- a/htdocs/lib/databases/mysql.lib.php
+++ b/htdocs/lib/databases/mysql.lib.php
@@ -99,7 +99,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error="Mysql PHP functions for using MySql driver are not available in this version of PHP. Try to use another driver.";
-			dolibarr_syslog("DoliDB::DoliDB : Mysql PHP functions for using Mysql driver are not available in this version of PHP. Try to use another driver.",LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Mysql PHP functions for using Mysql driver are not available in this version of PHP. Try to use another driver.",LOG_ERR);
 			return $this->ok;
 		}
 
@@ -108,7 +108,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error=$langs->trans("ErrorWrongHostParameter");
-			dolibarr_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
 			return $this->ok;
 		}
 
@@ -125,7 +125,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error=mysql_error();
-			dolibarr_syslog("DoliDB::DoliDB : Erreur Connect mysql_error=".$this->error,LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Erreur Connect mysql_error=".$this->error,LOG_ERR);
 		}
 
 		// Si connexion serveur ok et si connexion base demandee, on essaie connexion base
@@ -153,7 +153,7 @@ class DoliDb
 				$this->database_name = '';
 				$this->ok = 0;
 				$this->error=$this->error();
-				dolibarr_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
+				dol_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
 			}
 		}
 		else
@@ -196,7 +196,7 @@ class DoliDb
 	 */
 	function select_db($database)
 	{
-		dolibarr_syslog("DoliDB::select_db database=".$database, LOG_DEBUG);
+		dol_syslog("DoliDB::select_db database=".$database, LOG_DEBUG);
 		return mysql_select_db($database, $this->db);
 	}
 
@@ -212,7 +212,7 @@ class DoliDb
 	 */
 	function connect($host, $login, $passwd, $name, $port=0)
 	{
-		dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name",LOG_DEBUG);
+		dol_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name",LOG_DEBUG);
 
 		$newhost=$host;
 
@@ -269,7 +269,7 @@ class DoliDb
 	 */
 	function close()
 	{
-		dolibarr_syslog("DoliDB::disconnect",LOG_DEBUG);
+		dol_syslog("DoliDB::disconnect",LOG_DEBUG);
 		return mysql_close($this->db);
 	}
 
@@ -286,7 +286,7 @@ class DoliDb
 			if ($ret)
 			{
 				$this->transaction_opened++;
-				dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
+				dol_syslog("BEGIN Transaction",LOG_DEBUG);
 			}
 			return $ret;
 		}
@@ -310,7 +310,7 @@ class DoliDb
 			if ($ret)
 			{
 				$this->transaction_opened=0;
-				dolibarr_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
+				dol_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
 			}
 			return $ret;
 		}
@@ -332,7 +332,7 @@ class DoliDb
 		{
 			$ret=$this->query("ROLLBACK");
 			$this->transaction_opened=0;
-			dolibarr_syslog("ROLLBACK Transaction".($log?' '.$log:''),LOG_DEBUG);
+			dol_syslog("ROLLBACK Transaction".($log?' '.$log:''),LOG_DEBUG);
 			return $ret;
 		}
 		else
@@ -546,7 +546,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
 		return $date;
 	}
 
@@ -571,7 +571,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
 		return $date;
 	}*/
 
@@ -736,14 +736,14 @@ class DoliDb
 		$sql = 'CREATE DATABASE '.$database;
 		$sql.= ' DEFAULT CHARACTER SET '.$charset.' DEFAULT COLLATE '.$collation;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		$ret=$this->query($sql);
 		if (! $ret)
 		{
 			// We try again for compatibility with Mysql < 4.1.1
 			$sql = 'CREATE DATABASE '.$database;
 			$ret=$this->query($sql);
-			dolibarr_syslog($sql,LOG_DEBUG);
+			dol_syslog($sql,LOG_DEBUG);
 		}
 		return $ret;
 	}
@@ -839,7 +839,7 @@ class DoliDb
 		$sql .= ",".implode(',',$sqlk);
 		$sql .=") type=".$type;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if(! $this -> query($sql))
 		return -1;
 		else
@@ -856,7 +856,7 @@ class DoliDb
 	{
 		$sql="DESC ".$table." ".$field;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		$this->results = $this->query($sql);
 		return $this->results;
 	}
@@ -890,7 +890,7 @@ class DoliDb
 		$sql  .= " ".$field_desc['extra'];
 		$sql .= " ".$field_position;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if(! $this -> query($sql))
 		return -1;
 		else
@@ -906,7 +906,7 @@ class DoliDb
 	function DDLDropField($table,$field_name)
 	{
 		$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if (! $this->query($sql))
 		{
 			$this->error=$this->lasterror();
@@ -931,7 +931,7 @@ class DoliDb
 		$sql.= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_user',password('$dolibarr_main_db_pass')";
 		$sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y');";
 
-		dolibarr_syslog("mysql.lib::DDLCreateUser", LOG_DEBUG);	// No sql to avoid password in log
+		dol_syslog("mysql.lib::DDLCreateUser", LOG_DEBUG);	// No sql to avoid password in log
 		$resql=$this->query($sql);
 		if (! $resql)
 		{
@@ -943,7 +943,7 @@ class DoliDb
 		$sql.= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_name','$dolibarr_main_db_user'";
 		$sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y');";
 
-		dolibarr_syslog("mysql.lib::DDLCreateUser sql=".$sql,LOG_DEBUG);
+		dol_syslog("mysql.lib::DDLCreateUser sql=".$sql,LOG_DEBUG);
 		$resql=$this->query($sql);
 		if (! $resql)
 		{
@@ -952,7 +952,7 @@ class DoliDb
 
 		$sql="FLUSH Privileges";
 
-		dolibarr_syslog("mysql.lib::DDLCreateUser sql=".$sql,LOG_DEBUG);
+		dol_syslog("mysql.lib::DDLCreateUser sql=".$sql,LOG_DEBUG);
 		$resql=$this->query($sql);
 
 		return 1;
diff --git a/htdocs/lib/databases/mysqli.lib.php b/htdocs/lib/databases/mysqli.lib.php
index 4dc206263b1..331c8052937 100644
--- a/htdocs/lib/databases/mysqli.lib.php
+++ b/htdocs/lib/databases/mysqli.lib.php
@@ -99,7 +99,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error="Mysqli PHP functions for using Mysqli driver are not available in this version of PHP. Try to use another driver.";
-			dolibarr_syslog("DoliDB::DoliDB : Mysqli PHP functions for using Mysqli driver are not available in this version of PHP. Try to use another driver.",LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Mysqli PHP functions for using Mysqli driver are not available in this version of PHP. Try to use another driver.",LOG_ERR);
 			return $this->ok;
 		}
 
@@ -108,7 +108,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error=$langs->trans("ErrorWrongHostParameter");
-			dolibarr_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
 			return $this->ok;
 		}
 
@@ -127,7 +127,7 @@ class DoliDb
 			$this->connected = 0;
 			$this->ok = 0;
 			$this->error=mysqli_connect_error();
-			dolibarr_syslog("DoliDB::DoliDB : Erreur Connect mysqli_connect_error=".$this->error,LOG_ERR);
+			dol_syslog("DoliDB::DoliDB : Erreur Connect mysqli_connect_error=".$this->error,LOG_ERR);
 		}
 
 		// Si connexion serveur ok et si connexion base demandee, on essaie connexion base
@@ -155,7 +155,7 @@ class DoliDb
 				$this->database_name = '';
 				$this->ok = 0;
 				$this->error=$this->error();
-				dolibarr_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
+				dol_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
 			}
 		}
 		else
@@ -198,7 +198,7 @@ class DoliDb
 	 */
 	function select_db($database)
 	{
-		dolibarr_syslog("DoliDB::select_db database=".$database, LOG_DEBUG);
+		dol_syslog("DoliDB::select_db database=".$database, LOG_DEBUG);
 		return mysqli_select_db($this->db,$database);
 	}
 
@@ -215,7 +215,7 @@ class DoliDb
 	 */
 	function connect($host, $login, $passwd, $name, $port=0)
 	{
-		dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name",LOG_DEBUG);
+		dol_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name",LOG_DEBUG);
 
 		$newhost=$host;
 		$newport=$port;
@@ -275,7 +275,7 @@ class DoliDb
 	 */
 	function close()
 	{
-		dolibarr_syslog("DoliDB::disconnect",LOG_DEBUG);
+		dol_syslog("DoliDB::disconnect",LOG_DEBUG);
 		return mysqli_close($this->db);
 	}
 
@@ -292,7 +292,7 @@ class DoliDb
 			if ($ret)
 			{
 				$this->transaction_opened++;
-				dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
+				dol_syslog("BEGIN Transaction",LOG_DEBUG);
 			}
 			return $ret;
 		}
@@ -316,7 +316,7 @@ class DoliDb
 			if ($ret)
 			{
 				$this->transaction_opened=0;
-				dolibarr_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
+				dol_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
 			}
 			return $ret;
 		}
@@ -338,7 +338,7 @@ class DoliDb
 		{
 			$ret=$this->query("ROLLBACK");
 			$this->transaction_opened=0;
-			dolibarr_syslog("ROLLBACK Transaction".($log?' '.$log:''),LOG_DEBUG);
+			dol_syslog("ROLLBACK Transaction".($log?' '.$log:''),LOG_DEBUG);
 			return $ret;
 		}
 		else
@@ -560,7 +560,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
 		return $date;
 	}
 
@@ -585,7 +585,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
 		return $date;
 	}
 	*/
@@ -750,14 +750,14 @@ class DoliDb
 		$sql = 'CREATE DATABASE '.$database;
 		$sql.= ' DEFAULT CHARACTER SET '.$charset.' DEFAULT COLLATE '.$collation;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		$ret=$this->query($sql);
 		if (! $ret)
 		{
 			// We try again for compatibility with Mysql < 4.1.1
 			$sql = 'CREATE DATABASE '.$database;
 			$ret=$this->query($sql);
-			dolibarr_syslog($sql,LOG_DEBUG);
+			dol_syslog($sql,LOG_DEBUG);
 		}
 		return $ret;
 	}
@@ -853,7 +853,7 @@ class DoliDb
 		$sql .= ",".implode(',',$sqlk);
 		$sql .=") type=".$type;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if(! $this -> query($sql))
 		return -1;
 		else
@@ -870,7 +870,7 @@ class DoliDb
 	{
 		$sql="DESC ".$table." ".$field;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		$this->results = $this->query($sql);
 		return $this->results;
 	}
@@ -904,7 +904,7 @@ class DoliDb
 		$sql  .= " ".$field_desc['extra'];
 		$sql .= " ".$field_position;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if(! $this -> query($sql))
 		return -1;
 		else
@@ -921,7 +921,7 @@ class DoliDb
 	function DDLDropField($table,$field_name)
 	{
 		$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if (! $this->query($sql))
 		{
 			$this->error=$this->lasterror();
@@ -946,7 +946,7 @@ class DoliDb
 		$sql.= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_user',password('$dolibarr_main_db_pass')";
 		$sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y');";
 
-		dolibarr_syslog("mysqli.lib::DDLCreateUser", LOG_DEBUG);	// No sql to avoid password in log
+		dol_syslog("mysqli.lib::DDLCreateUser", LOG_DEBUG);	// No sql to avoid password in log
 		$resql=$this->query($sql);
 		if (! $resql)
 		{
@@ -958,7 +958,7 @@ class DoliDb
 		$sql.= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_name','$dolibarr_main_db_user'";
 		$sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y');";
 
-		dolibarr_syslog("mysqli.lib::DDLCreateUser sql=".$sql);
+		dol_syslog("mysqli.lib::DDLCreateUser sql=".$sql);
 		$resql=$this->query($sql);
 		if (! $resql)
 		{
@@ -967,7 +967,7 @@ class DoliDb
 
 		$sql="FLUSH Privileges";
 
-		dolibarr_syslog("mysqli.lib::DDLCreateUser sql=".$sql);
+		dol_syslog("mysqli.lib::DDLCreateUser sql=".$sql);
 		$resql=$this->query($sql);
 
 		return 1;
diff --git a/htdocs/lib/databases/pgsql.lib.php b/htdocs/lib/databases/pgsql.lib.php
index 21e6db757e8..924d88f76a2 100644
--- a/htdocs/lib/databases/pgsql.lib.php
+++ b/htdocs/lib/databases/pgsql.lib.php
@@ -85,7 +85,7 @@ class DoliDb
         	$this->connected = 0;
         	$this->ok = 0;
             $this->error="Pgsql PHP functions are not available in this version of PHP";
-        	dolibarr_syslog("DoliDB::DoliDB : Pgsql PHP functions are not available in this version of PHP",LOG_ERR);
+        	dol_syslog("DoliDB::DoliDB : Pgsql PHP functions are not available in this version of PHP",LOG_ERR);
             return $this->ok;
         }
 
@@ -94,7 +94,7 @@ class DoliDb
         	$this->connected = 0;
         	$this->ok = 0;
             $this->error=$langs->trans("ErrorWrongHostParameter");
-        	dolibarr_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
+        	dol_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters",LOG_ERR);
             return $this->ok;
         }
 
@@ -112,7 +112,7 @@ class DoliDb
             $this->connected = 0;
             $this->ok = 0;
 			$this->error='Host, login or password incorrect';
-            dolibarr_syslog("DoliDB::DoliDB : Erreur Connect ".$this->error,LOG_ERR);
+            dol_syslog("DoliDB::DoliDB : Erreur Connect ".$this->error,LOG_ERR);
         }
 
         // Si connexion serveur ok et si connexion base demand�e, on essaie connexion base
@@ -130,7 +130,7 @@ class DoliDb
                 $this->database_name = '';
                 $this->ok = 0;
                 $this->error=$this->error();
-                dolibarr_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
+                dol_syslog("DoliDB::DoliDB : Erreur Select_db ".$this->error,LOG_ERR);
             }
         }
         else
@@ -412,7 +412,7 @@ class DoliDb
     */
     function close()
     {
-		dolibarr_syslog("DoliDB::disconnect",LOG_DEBUG);
+		dol_syslog("DoliDB::disconnect",LOG_DEBUG);
     	return pg_close($this->db);
     }
 
@@ -429,7 +429,7 @@ class DoliDb
             if ($ret)
 			{
 				$this->transaction_opened++;
-				dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
+				dol_syslog("BEGIN Transaction",LOG_DEBUG);
 			}
             return $ret;
         }
@@ -452,7 +452,7 @@ class DoliDb
 			if ($ret)
 			{
 				$this->transaction_opened=0;
-				dolibarr_syslog("COMMIT Transaction",LOG_DEBUG);
+				dol_syslog("COMMIT Transaction",LOG_DEBUG);
 			}
             return $ret;
         }
@@ -473,7 +473,7 @@ class DoliDb
         {
             $ret=$this->query("ROLLBACK;");
 			$this->transaction_opened=0;
-			dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
+			dol_syslog("ROLLBACK Transaction",LOG_DEBUG);
             return $ret;
         }
         else
@@ -680,7 +680,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4));
 		return $date;
 	}
 
@@ -705,7 +705,7 @@ class DoliDb
 	{
 		$string=eregi_replace('[^0-9]','',$string);
 		$tmp=$string.'000000';
-		$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
+		$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
 		return $date;
 	}*/
 
@@ -865,7 +865,7 @@ class DoliDb
 	{
 		$sql = "create user \"".$dolibarr_main_db_user."\" with password '".$dolibarr_main_db_pass."'";
 
-		dolibarr_syslog("pgsql.lib::DDLCreateUser", LOG_DEBUG);	// No sql to avoid password in log
+		dol_syslog("pgsql.lib::DDLCreateUser", LOG_DEBUG);	// No sql to avoid password in log
 		$resql=$this->query($sql);
 		if (! $resql)
 		{
@@ -904,7 +904,7 @@ class DoliDb
 		$sql  .= " ".$field_desc['extra'];
 		$sql .= " ".$field_position;
 
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if(! $this -> query($sql))
 		return -1;
 		else
@@ -920,7 +920,7 @@ class DoliDb
 	function DDLDropField($table,$field_name)
 	{
 		$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
-		dolibarr_syslog($sql,LOG_DEBUG);
+		dol_syslog($sql,LOG_DEBUG);
 		if (! $this->query($sql))
 		{
 			$this->error=$this->lasterror();
diff --git a/htdocs/lib/datepicker.php b/htdocs/lib/datepicker.php
index b0c7141eb0d..4f7669d853a 100644
--- a/htdocs/lib/datepicker.php
+++ b/htdocs/lib/datepicker.php
@@ -93,7 +93,7 @@ if ($qualified)
 }
 else
 {
-	dolibarr_print_error('','ErrorBadParameters');
+	dol_print_error('','ErrorBadParameters');
 }
 
 
@@ -104,7 +104,7 @@ function xyzToUnixTimestamp($mysqldate){
 	$year=substr($mysqldate,0,4);
 	$month=substr($mysqldate,4,2);
 	$day=substr($mysqldate,6,2);
-	$unixtimestamp=dolibarr_mktime(12,0,0,$month,$day,$year);
+	$unixtimestamp=dol_mktime(12,0,0,$month,$day,$year);
 	return $unixtimestamp;
 }
 
@@ -112,14 +112,14 @@ function displayBox($selectedDate,$month,$year){
 	global $dolibarr_main_url_root,$langs,$conf;
 	
 	//print "$selectedDate,$month,$year";
-	$thedate=dolibarr_mktime(12,0,0,$month,1,$year);
+	$thedate=dol_mktime(12,0,0,$month,1,$year);
 	//print "thedate=$thedate";
 	$today=mktime();
 	$todayArray=dol_getdate($today);
 	if($selectedDate != "00000000")
 	{ 
 		$selDate=xyzToUnixTimestamp($selectedDate);
-		$xyz=dolibarr_date("Ymd",$selDate);
+		$xyz=dol_date("Ymd",$selDate);
 	}
 	else
 	{
@@ -131,8 +131,8 @@ function displayBox($selectedDate,$month,$year){
 	<tr>
 		<td colspan="6" class="dpHead">
 		<?php
-		$selectMonth = dolibarr_date("F", $thedate);
-		$selectYear = dolibarr_date("Y", $thedate);
+		$selectMonth = dol_date("F", $thedate);
+		$selectYear = dol_date("Y", $thedate);
 		echo $langs->trans($selectMonth).", ".$selectYear;
 		?>
 		</td>
@@ -141,7 +141,7 @@ function displayBox($selectedDate,$month,$year){
 	<tr>
 		<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo $month?>','<?php echo $year-1?>','<?php echo $xyz ?>')">&lt;&lt;</td>
 		<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php if($month==1) echo "12"; else echo $month-1?>','<?php if($month==1) echo $year-1; else echo $year?>','<?php echo $xyz ?>')">&lt;</td>
-		<td colspan="3" class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo dolibarr_date('m',$today)?>','<?php echo $todayArray["year"]?>','<?php echo $xyz ?>')"><?php echo $langs->trans("MonthOfDay") ?></td>
+		<td colspan="3" class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo dol_date('m',$today)?>','<?php echo $todayArray["year"]?>','<?php echo $xyz ?>')"><?php echo $langs->trans("MonthOfDay") ?></td>
 		<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php if($month==12) echo "1"; else echo $month+1?>','<?php if($month==12) echo $year+1; else echo $year;?>','<?php echo $xyz ?>')">&gt;</td>
 		<td class="dpButtons" onClick="loadMonth('<?php echo $dolibarr_main_url_root.'/lib/' ?>','<?php echo $month?>','<?php echo $year+1?>','<?php echo $xyz ?>')">&gt;&gt;</td>
 	</tr>
@@ -189,8 +189,8 @@ function displayBox($selectedDate,$month,$year){
 			
 			// Sur click dans calendrier, appelle fonction dpClickDay
 			echo "<TD class=\"".$dayclass."\"";
-			echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",".dolibarr_date("n",$thedate).",".$mydate["mday"].",tradMonths)\"";
-			echo " onClick=\"dpClickDay(".$mydate["year"].",".dolibarr_date("n",$thedate).",".$mydate["mday"].",'".$conf->format_date_short_java."')\"";
+			echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",".dol_date("n",$thedate).",".$mydate["mday"].",tradMonths)\"";
+			echo " onClick=\"dpClickDay(".$mydate["year"].",".dol_date("n",$thedate).",".$mydate["mday"].",'".$conf->format_date_short_java."')\"";
 			echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
 			$cols++;
 			
@@ -198,7 +198,7 @@ function displayBox($selectedDate,$month,$year){
 			
 			//$thedate=strtotime("tomorrow",$thedate);
 			$day++;
-			$thedate=dolibarr_mktime(12,0,0,$month,$day,$year);
+			$thedate=dol_mktime(12,0,0,$month,$day,$year);
 			if ($thedate == '')
 			{
 				$stoploop=1;
diff --git a/htdocs/lib/doleditor.class.php b/htdocs/lib/doleditor.class.php
index f91abb1f85c..7f6bca8dc8e 100644
--- a/htdocs/lib/doleditor.class.php
+++ b/htdocs/lib/doleditor.class.php
@@ -51,7 +51,7 @@ class DolEditor
     {
     	global $conf,$langs;
 
-    	dolibarr_syslog("DolEditor::DolEditor modulepart=".$modulepart);
+    	dol_syslog("DolEditor::DolEditor modulepart=".$modulepart);
 
     	require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php");
 
diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php
index 5e7bd2bfa77..6d8e7d0284e 100644
--- a/htdocs/lib/files.lib.php
+++ b/htdocs/lib/files.lib.php
@@ -37,7 +37,7 @@
  */
 function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0)
 {
-	dolibarr_syslog("files.lib.php::dol_dir_list $path");
+	dol_syslog("files.lib.php::dol_dir_list $path");
 
 	$loaddate=$mode?true:false;
 	$loadsize=$mode?true:false;
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index eebad430d8b..5258a8b4edb 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -273,7 +273,7 @@ function dol_fiche_head($links, $active='0', $title='', $notab=0)
 		print '<a class="tabTitle">';
 		print
 		((!defined('MAIN_USE_SHORT_TITLE')) || (defined('MAIN_USE_SHORT_TITLE') &&  MAIN_USE_SHORT_TITLE))
-		? dolibarr_trunc($title,$limittitle)
+		? dol_trunc($title,$limittitle)
 		: $title;
 		print '</a>';
 	}
@@ -380,7 +380,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='',$encodeto
 	 || eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$',$time,$reg))
 	{
 		// This part of code should not be used.
-		dol_syslog("Functions.lib::dolibarr_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_WARNING);
+		dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_WARNING);
 		// Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS'
 		$syear = $reg[1];
 		$smonth = $reg[2];
@@ -389,7 +389,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='',$encodeto
 		$smin = $reg[5];
 		$ssec = $reg[6];
 
-		$time=dolibarr_mktime($shour,$smin,$ssec,$smonth,$sday,$syear);
+		$time=dol_mktime($shour,$smin,$ssec,$smonth,$sday,$syear);
 		$ret=adodb_strftime($format,$time,$to_gmt);
 	}
 	else
@@ -460,7 +460,7 @@ function dol_stringtotime($string)
 
 	$string=eregi_replace('[^0-9]','',$string);
 	$tmp=$string.'000000';
-	$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
+	$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
 	return $date;
 }
 
@@ -637,7 +637,7 @@ function dol_print_url($url,$target='_blank',$max=32)
 	$link.=$url;
 	if ($target) $link.='" target="'.$target.'">';
 	if (! eregi('^http',$url)) $link.='http://';
-	$link.=dolibarr_trunc($url,$max);
+	$link.=dol_trunc($url,$max);
 	$link.='</a>';
 	return $link;
 }
@@ -1531,7 +1531,7 @@ function dol_print_error($db='',$error='')
 		print $langs->trans("InformationToHelpDiagnose").":<br>\n";
 
 		print "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";;
-		print "<b>".$langs->trans("Date").":</b> ".dolibarr_print_date(time(),'dayhourlog')."<br>\n";;
+		print "<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n";;
 		if (isset($conf->global->MAIN_FEATURES_LEVEL)) print "<b>".$langs->trans("LevelOfFeature").":</b> ".$conf->global->MAIN_FEATURES_LEVEL."<br>\n";;
 		print "<b>".$langs->trans("Server").":</b> ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";;
 		print "<b>".$langs->trans("RequestedUrl").":</b> ".$_SERVER["REQUEST_URI"]."<br>\n";;
@@ -2625,15 +2625,15 @@ function print_date_range($date_start,$date_end,$format = '',$outputlangs='')
 
 	if ($date_start && $date_end)
 	{
-		print ' ('.$outputlangs->trans('DateFromTo',dolibarr_print_date($date_start, $format, false, $outputlangs),dolibarr_print_date($date_end, $format, false, $outputlangs)).')';
+		print ' ('.$outputlangs->trans('DateFromTo',dol_print_date($date_start, $format, false, $outputlangs),dol_print_date($date_end, $format, false, $outputlangs)).')';
 	}
 	if ($date_start && ! $date_end)
 	{
-		print ' ('.$outputlangs->trans('DateFrom',dolibarr_print_date($date_start, $format, false, $outputlangs)).')';
+		print ' ('.$outputlangs->trans('DateFrom',dol_print_date($date_start, $format, false, $outputlangs)).')';
 	}
 	if (! $date_start && $date_end)
 	{
-		print ' ('.$outputlangs->trans('DateUntil',dolibarr_print_date($date_end, $format, false, $outputlangs)).')';
+		print ' ('.$outputlangs->trans('DateUntil',dol_print_date($date_end, $format, false, $outputlangs)).')';
 	}
 }
 
diff --git a/htdocs/lib/functions2.lib.php b/htdocs/lib/functions2.lib.php
index 93115725668..71ddda16f7c 100644
--- a/htdocs/lib/functions2.lib.php
+++ b/htdocs/lib/functions2.lib.php
@@ -87,31 +87,31 @@ function dol_print_object_info($object)
 	print $langs->trans("CreatedBy")." : " . $object->user_creation->fullname . '<br>';
 
 	if (isset($object->date_creation))
-	print $langs->trans("DateCreation")." : " . dolibarr_print_date($object->date_creation,"dayhourtext") . '<br>';
+	print $langs->trans("DateCreation")." : " . dol_print_date($object->date_creation,"dayhourtext") . '<br>';
 
 	if (isset($object->user_modification) && $object->user_modification->fullname)
 	print $langs->trans("ModifiedBy")." : " . $object->user_modification->fullname . '<br>';
 
 	if (isset($object->date_modification))
-	print $langs->trans("DateLastModification")." : " . dolibarr_print_date($object->date_modification,"dayhourtext") . '<br>';
+	print $langs->trans("DateLastModification")." : " . dol_print_date($object->date_modification,"dayhourtext") . '<br>';
 
 	if (isset($object->user_validation) && $object->user_validation->fullname)
 	print $langs->trans("ValidatedBy")." : " . $object->user_validation->fullname . '<br>';
 
 	if (isset($object->date_validation))
-	print $langs->trans("DateValidation")." : " . dolibarr_print_date($object->date_validation,"dayhourtext") . '<br>';
+	print $langs->trans("DateValidation")." : " . dol_print_date($object->date_validation,"dayhourtext") . '<br>';
 
 	if (isset($object->user_cloture) && $object->user_cloture->fullname )
 	print $langs->trans("ClosedBy")." : " . $object->user_cloture->fullname . '<br>';
 
 	if (isset($object->date_cloture))
-	print $langs->trans("DateClosing")." : " . dolibarr_print_date($object->date_cloture,"dayhourtext") . '<br>';
+	print $langs->trans("DateClosing")." : " . dol_print_date($object->date_cloture,"dayhourtext") . '<br>';
 
 	if (isset($object->user_rappro) && $object->user_rappro->fullname )
 	print $langs->trans("ConciliatedBy")." : " . $object->user_rappro->fullname . '<br>';
 
 	if (isset($object->date_rappro))
-	print $langs->trans("DateConciliating")." : " . dolibarr_print_date($object->date_rappro,"dayhourtext") . '<br>';
+	print $langs->trans("DateConciliating")." : " . dol_print_date($object->date_rappro,"dayhourtext") . '<br>';
 }
 
 
@@ -316,7 +316,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$valueforccc='',$date=
 		$obj = $db->fetch_object($resql);
 		$counter = $obj->val;
 	}
-	else dolibarr_print_error($db);
+	else dol_print_error($db);
 	if (empty($counter) || eregi('[^0-9]',$counter)) $counter=$maskoffset;
 	$counter++;
 
@@ -359,7 +359,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$valueforccc='',$date=
 			$maskrefclient_obj = $db->fetch_object($maskrefclient_resql);
 			$maskrefclient_counter = $maskrefclient_obj->val;
 		}
-		else dolibarr_print_error($db);
+		else dol_print_error($db);
 		if (empty($maskrefclient_counter) || eregi('[^0-9]',$maskrefclient_counter)) $maskrefclient_counter=$maskrefclient_maskoffset;
 		$maskrefclient_counter++;
 	}
@@ -702,7 +702,7 @@ function dol_set_user_param($db, &$user, $tab)
 	$resql=$db->query($sql);
 	if (! $resql)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 		$db->rollback();
 		return -1;
 	}
@@ -720,7 +720,7 @@ function dol_set_user_param($db, &$user, $tab)
 			$result=$db->query($sql);
 			if (! $result)
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 				$db->rollback();
 				return -1;
 			}
diff --git a/htdocs/lib/images.lib.php b/htdocs/lib/images.lib.php
index 2d388e941c4..83ec91fa998 100644
--- a/htdocs/lib/images.lib.php
+++ b/htdocs/lib/images.lib.php
@@ -43,7 +43,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
 
 	global $conf,$langs;
 
-	dolibarr_syslog("functions.inc::vignette file=".$file." extName=".$extName." maxWidth=".$maxWidth." maxHeight=".$maxHeight." quality=".$quality);
+	dol_syslog("functions.inc::vignette file=".$file." extName=".$extName." maxWidth=".$maxWidth." maxHeight=".$maxHeight." quality=".$quality);
 
 	// Clean parameters
 	$file=trim($file);
@@ -84,7 +84,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
 	if ($infoImg[0] < $maxWidth && $infoImg[1] < $maxHeight)
 	{
 		// On cree toujours les vignettes
-		dolibarr_syslog("File size is smaller than thumb size",LOG_DEBUG);
+		dol_syslog("File size is smaller than thumb size",LOG_DEBUG);
 		//return 'Le fichier '.$file.' ne necessite pas de creation de vignette';
 	}
 
@@ -208,7 +208,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
 	}
 	if (function_exists("imagefill")) imagefill($imgThumb, 0, 0, $trans_colour);
 
-	dolibarr_syslog("vignette: convert image from ($imgWidth x $imgHeight) to ($thumbWidth x $thumbHeight) as $extImg, newquality=$newquality");
+	dol_syslog("vignette: convert image from ($imgWidth x $imgHeight) to ($thumbWidth x $thumbHeight) as $extImg, newquality=$newquality");
 	//imagecopyresized($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee
 	imagecopyresampled($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee
 
diff --git a/htdocs/lib/ldap.class.php b/htdocs/lib/ldap.class.php
index 70d4b64c39d..860173f7be0 100644
--- a/htdocs/lib/ldap.class.php
+++ b/htdocs/lib/ldap.class.php
@@ -214,7 +214,7 @@ class Ldap
 				if ($this->serverType == "activedirectory")
 				{
 					$result=$this->setReferrals();
-					dolibarr_syslog("Ldap::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser,LOG_DEBUG);
+					dol_syslog("Ldap::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser,LOG_DEBUG);
 					$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
 					if ($this->result)
 					{
@@ -232,7 +232,7 @@ class Ldap
 					// Try in auth mode
 					if ($this->searchUser && $this->searchPassword)
 					{
-						dolibarr_syslog("Ldap::connect_bind try bindauth on ".$host." user=".$this->searchUser,LOG_DEBUG);
+						dol_syslog("Ldap::connect_bind try bindauth on ".$host." user=".$this->searchUser,LOG_DEBUG);
 						$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
 						if ($this->result)
 						{
@@ -248,7 +248,7 @@ class Ldap
 					// Try in anonymous
 					if (! $this->bind)
 					{
-						dolibarr_syslog("Ldap::connect_bind try bind on ".$host,LOG_DEBUG);
+						dol_syslog("Ldap::connect_bind try bind on ".$host,LOG_DEBUG);
 						$result=$this->bind();
 						if ($result)
 						{
@@ -270,13 +270,13 @@ class Ldap
 		if ($connected)
 		{
 			$return=$connected;
-			dolibarr_syslog("Ldap::connect_bind return=".$return, LOG_DEBUG);
+			dol_syslog("Ldap::connect_bind return=".$return, LOG_DEBUG);
 		}
 		else
 		{
 			$this->error='Failed to connect to LDAP';
 			$return=-1;
-			dolibarr_syslog("Ldap::connect_bind return=".$return, LOG_WARNING);
+			dol_syslog("Ldap::connect_bind return=".$return, LOG_WARNING);
 		}
 		return $return;
 	}
@@ -413,7 +413,7 @@ class Ldap
 
 		if (! $olddn) $olddn=$dn;
 
-		dolibarr_syslog("Ldap::update dn=".$dn." olddn=".$olddn);
+		dol_syslog("Ldap::update dn=".$dn." olddn=".$olddn);
 
 		// On supprime et on ins�re
 		$result = $this->delete($olddn);
@@ -421,13 +421,13 @@ class Ldap
 		if ($result <= 0)
 		{
 			$this->error = ldap_errno($this->connection)." ".ldap_error($this->connection)." ".$this->error;
-			dolibarr_syslog("Ldap::update ".$this->error,LOG_ERR);
+			dol_syslog("Ldap::update ".$this->error,LOG_ERR);
 			//print_r($info);
 			return -1;
 		}
 		else
 		{
-			dolibarr_syslog("Ldap::update done successfully");
+			dol_syslog("Ldap::update done successfully");
 			return 1;
 		}
 	}
@@ -489,7 +489,7 @@ class Ldap
 	{
 		global $conf;
 
-		dolibarr_syslog("Ldap::add dn=".$dn." info=".join(',',$info));
+		dol_syslog("Ldap::add dn=".$dn." info=".join(',',$info));
 
 		// Encode to LDAP page code
 		$dn=$this->convFromOutputCharset($dn,$this->ldapcharset);
@@ -505,13 +505,13 @@ class Ldap
 
 		if ($result)
 		{
-			dolibarr_syslog("Ldap::add successfull", LOG_DEBUG);
+			dol_syslog("Ldap::add successfull", LOG_DEBUG);
 			return 1;
 		}
 		else
 		{
 			$this->error=@ldap_error($this->connection);
-			dolibarr_syslog("Ldap::add failed: ".$this->error, LOG_ERR);
+			dol_syslog("Ldap::add failed: ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -525,7 +525,7 @@ class Ldap
 	{
 		global $conf;
 
-		dolibarr_syslog("Ldap::delete Delete LDAP entry dn=".$dn);
+		dol_syslog("Ldap::delete Delete LDAP entry dn=".$dn);
 
 		// Encode to LDAP page code
 		$dn=$this->convFromOutputCharset($dn,$this->ldapcharset);
@@ -661,13 +661,13 @@ class Ldap
 	{
 		$fulllist=array();
 
-		dolibarr_syslog("Ldap::getRecords search=".$search." userDn=".$userDn." useridentifier=".$useridentifier." attributeArray=array(".join(',',$attributeArray).")");
+		dol_syslog("Ldap::getRecords search=".$search." userDn=".$userDn." useridentifier=".$useridentifier." attributeArray=array(".join(',',$attributeArray).")");
 
 		// if the directory is AD, then bind first with the search user first
 		if ($this->serverType == "activedirectory")
 		{
 			$this->bindauth($this->searchUser, $this->searchPassword);
-			dolibarr_syslog("Ldap::bindauth serverType=activedirectory searchUser=".$this->searchUser);
+			dol_syslog("Ldap::bindauth serverType=activedirectory searchUser=".$this->searchUser);
 		}
 
 		// Define filter
@@ -690,13 +690,13 @@ class Ldap
 		if (is_array($attributeArray))
 		{
 			// Return list with required fields
-			dolibarr_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter. " attributeArray=(".join(',',$attributeArray).")");
+			dol_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter. " attributeArray=(".join(',',$attributeArray).")");
 			$this->result = @ldap_search($this->connection, $userDn, $filter, $attributeArray);
 		}
 		else
 		{
 			// Return list with fields selected by default
-			dolibarr_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter);
+			dol_syslog("Ldap::getRecords connection=".$this->connection." userDn=".$userDn." filter=".$filter);
 			$this->result = @ldap_search($this->connection, $userDn, $filter);
 		}
 		if (!$this->result)
@@ -842,7 +842,7 @@ class Ldap
 	 */
 	function search($checkDn, $filter)
 	{
-		dolibarr_syslog("Ldap::search checkDn=".$checkDn." filter=".$filter);
+		dol_syslog("Ldap::search checkDn=".$checkDn." filter=".$filter);
 
 		$checkDn=$this->convFromOutputCharset($checkDn,$this->ldapcharset);
 		$filter=$this->convFromOutputCharset($filter,$this->ldapcharset);
diff --git a/htdocs/lib/pdf.lib.php b/htdocs/lib/pdf.lib.php
index 7e467335e57..61d319e4f65 100644
--- a/htdocs/lib/pdf.lib.php
+++ b/htdocs/lib/pdf.lib.php
@@ -278,15 +278,15 @@ function pdf_getlinedesc($line,$outputlangs)
 		// Show duration if exists
 		if ($line->date_start && $line->date_end)
 		{
-			$period='('.$outputlangs->transnoentitiesnoconv('DateFromTo',dolibarr_print_date($line->date_start, $format, false, $outputlangs),dolibarr_print_date($line->date_end, $format, false, $outputlangs)).')';
+			$period='('.$outputlangs->transnoentitiesnoconv('DateFromTo',dol_print_date($line->date_start, $format, false, $outputlangs),dol_print_date($line->date_end, $format, false, $outputlangs)).')';
 		}
 		if ($line->date_start && ! $line->date_end)
 		{
-			$period='('.$outputlangs->transnoentitiesnoconv('DateFrom',dolibarr_print_date($line->date_start, $format, false, $outputlangs)).')';
+			$period='('.$outputlangs->transnoentitiesnoconv('DateFrom',dol_print_date($line->date_start, $format, false, $outputlangs)).')';
 		}
 		if (! $line->date_start && $line->date_end)
 		{
-			$period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dolibarr_print_date($line->date_end, $format, false, $outputlangs)).')';
+			$period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($line->date_end, $format, false, $outputlangs)).')';
 		}
 		//print '>'.$outputlangs->charset_output.','.$period;
 		$libelleproduitservice.="<br>".dol_htmlentitiesbr($period,1);
diff --git a/htdocs/lib/price.lib.php b/htdocs/lib/price.lib.php
index 2e7dca9deed..5e837d0c7cc 100644
--- a/htdocs/lib/price.lib.php
+++ b/htdocs/lib/price.lib.php
@@ -44,7 +44,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $remise_pe
 
 	$result=array();
 
-	//dolibarr_syslog("price.lib::calcul_price_total $qty, $pu, $remise_percent_ligne, $txtva, $price_base_type $info_bits");
+	//dol_syslog("price.lib::calcul_price_total $qty, $pu, $remise_percent_ligne, $txtva, $price_base_type $info_bits");
 	if ($price_base_type == 'HT')
 	{
 		// On travaille par defaut en partant du prix HT
diff --git a/htdocs/lib/product.lib.php b/htdocs/lib/product.lib.php
index 10659142e29..adba6e50ed6 100644
--- a/htdocs/lib/product.lib.php
+++ b/htdocs/lib/product.lib.php
@@ -162,7 +162,7 @@ function show_stats_for_company($product,$socid)
 	if ($conf->propal->enabled && $user->rights->propale->lire)
 	{
 		$ret=$product->load_stats_propale($socid);
-		if ($ret < 0) dolibarr_print_error($db);
+		if ($ret < 0) dol_print_error($db);
 		$langs->load("propal");
 		print '<tr><td>';
 		print '<a href="propal.php?id='.$product->id.'">'.img_object('','propal').' '.$langs->trans("Proposals").'</a>';
@@ -179,7 +179,7 @@ function show_stats_for_company($product,$socid)
 	if ($conf->commande->enabled && $user->rights->commande->lire)
 	{
 		$ret=$product->load_stats_commande($socid);
-		if ($ret < 0) dolibarr_print_error($db);
+		if ($ret < 0) dol_print_error($db);
 		$langs->load("orders");
 		print '<tr><td>';
 		print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
@@ -196,7 +196,7 @@ function show_stats_for_company($product,$socid)
 	if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
 	{
 		$ret=$product->load_stats_commande_fournisseur($socid);
-		if ($ret < 0) dolibarr_print_error($db);
+		if ($ret < 0) dol_print_error($db);
 		$langs->load("orders");
 		print '<tr><td>';
 		print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("SuppliersOrders").'</a>';
@@ -213,7 +213,7 @@ function show_stats_for_company($product,$socid)
 	if ($conf->contrat->enabled && $user->rights->contrat->lire)
 	{
 		$ret=$product->load_stats_contrat($socid);
-		if ($ret < 0) dolibarr_print_error($db);
+		if ($ret < 0) dol_print_error($db);
 		$langs->load("contracts");
 		print '<tr><td>';
 		print '<a href="contrat.php?id='.$product->id.'">'.img_object('','contract').' '.$langs->trans("Contracts").'</a>';
@@ -230,7 +230,7 @@ function show_stats_for_company($product,$socid)
 	if ($conf->facture->enabled && $user->rights->facture->lire)
 	{
 		$ret=$product->load_stats_facture($socid);
-		if ($ret < 0) dolibarr_print_error($db);
+		if ($ret < 0) dol_print_error($db);
 		$langs->load("bills");
 		print '<tr><td>';
 		print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
@@ -247,7 +247,7 @@ function show_stats_for_company($product,$socid)
 	if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
 	{
 		$ret=$product->load_stats_facture_fournisseur($socid);
-		if ($ret < 0) dolibarr_print_error($db);
+		if ($ret < 0) dol_print_error($db);
 		$langs->load("bills");
 		print '<tr><td>';
 		print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("SuppliersInvoices").'</a>';
diff --git a/htdocs/lib/project.lib.php b/htdocs/lib/project.lib.php
index 67d55dec480..20d4104abfc 100644
--- a/htdocs/lib/project.lib.php
+++ b/htdocs/lib/project.lib.php
@@ -100,7 +100,7 @@ function select_projects($socid, $selected='', $htmlname='projectid')
 	$sql.= " WHERE (fk_soc='".$socid."' or fk_soc IS NULL)";
 	$sql.= " ORDER BY p.title ASC";
 
-	dolibarr_syslog("project.lib::select_projects sql=".$sql);
+	dol_syslog("project.lib::select_projects sql=".$sql);
 	$resql=$db->query($sql);
 	if ($resql)
 	{
@@ -115,11 +115,11 @@ function select_projects($socid, $selected='', $htmlname='projectid')
 				$obj = $db->fetch_object($resql);
 				if (!empty($selected) && $selected == $obj->rowid)
 				{
-					print '<option value="'.$obj->rowid.'" selected="true">'.dolibarr_trunc($obj->ref,12).' - '.dolibarr_trunc($obj->title,12).'</option>';
+					print '<option value="'.$obj->rowid.'" selected="true">'.dol_trunc($obj->ref,12).' - '.dol_trunc($obj->title,12).'</option>';
 				}
 				else
 				{
-					print '<option value="'.$obj->rowid.'">'.dolibarr_trunc($obj->ref,12).' - '.dolibarr_trunc($obj->title,12).'</option>';
+					print '<option value="'.$obj->rowid.'">'.dol_trunc($obj->ref,12).' - '.dol_trunc($obj->title,12).'</option>';
 				}
 				$i++;
 			}
@@ -130,7 +130,7 @@ function select_projects($socid, $selected='', $htmlname='projectid')
 	}
 	else
 	{
-		dolibarr_print_error($this->db);
+		dol_print_error($this->db);
 		return -1;
 	}
 }
@@ -312,7 +312,7 @@ function clean_orphelins($db)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	if (sizeof($listofid))
diff --git a/htdocs/lib/report.lib.php b/htdocs/lib/report.lib.php
index 0f900300f3f..3cd6684eee0 100644
--- a/htdocs/lib/report.lib.php
+++ b/htdocs/lib/report.lib.php
@@ -43,7 +43,7 @@ function report_header($nom,$variante='',$period,$periodlink,$description,$build
 	$h=0;
 	$head[$h][0] = $_SERVER["PHP_SELF"];
 	$head[$h][1] = $langs->trans("Report");
-	dolibarr_fiche_head($head, $hselected, $societe->nom);
+	dol_fiche_head($head, $hselected, $societe->nom);
 	
 	print '<table width="100%" class="border">';
 
@@ -78,7 +78,7 @@ function report_header($nom,$variante='',$period,$periodlink,$description,$build
 	print '<td>'.$langs->trans("GeneratedOn").'</td>';
 	if (! $exportlink) print '<td colspan="3">';
 	else print '<td>';
-	print dolibarr_print_date($builddate);
+	print dol_print_date($builddate);
 	if ($exportlink) print '</td><td>'.$langs->trans("Export").'</td><td>'.$exportlink;
 	print '</td></tr>';
 	
diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php
index 7b08c71233c..1fbbd06bc73 100644
--- a/htdocs/lib/security.lib.php
+++ b/htdocs/lib/security.lib.php
@@ -219,7 +219,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
  */
 function makesalt($type=CRYPT_SALT_LENGTH)
 {
-	dolibarr_syslog("security.lib.php::makesalt type=".$type);
+	dol_syslog("security.lib.php::makesalt type=".$type);
 	switch($type)
 	{
 	case 12:	// 8 + 4
@@ -234,7 +234,7 @@ function makesalt($type=CRYPT_SALT_LENGTH)
 	while(strlen($salt) < $saltlen) $salt.=chr(rand(64,126));
 
 	$result=$saltprefix.$salt.$saltsuffix;
-	dolibarr_syslog("security.lib.php::makesalt return=".$result);
+	dol_syslog("security.lib.php::makesalt return=".$result);
 	return $result;
 }
 
@@ -245,7 +245,7 @@ function makesalt($type=CRYPT_SALT_LENGTH)
  */
 function encodedecode_dbpassconf($level=0)
 {
-	dolibarr_syslog("security.lib::encodedecode_dbpassconf level=".$level, LOG_DEBUG);
+	dol_syslog("security.lib::encodedecode_dbpassconf level=".$level, LOG_DEBUG);
 	$config = '';
 
 	if ($fp = fopen(DOL_DOCUMENT_ROOT.'/conf/conf.php','r'))
@@ -287,13 +287,13 @@ function encodedecode_dbpassconf($level=0)
 		}
 		else
 		{
-			dolibarr_syslog("security.lib::encodedecode_dbpassconf Failed to open conf.php file for writing", LOG_WARNING);
+			dol_syslog("security.lib::encodedecode_dbpassconf Failed to open conf.php file for writing", LOG_WARNING);
 			return -1;
 		}
 	}
 	else
 	{
-		dolibarr_syslog("security.lib::encodedecode_dbpassconf Failed to read conf.php", LOG_ERR);
+		dol_syslog("security.lib::encodedecode_dbpassconf Failed to read conf.php", LOG_ERR);
 		return -2;
 	}
 }
diff --git a/htdocs/lib/sendings.lib.php b/htdocs/lib/sendings.lib.php
index f8fe8ffee4f..8e1060fdd3e 100644
--- a/htdocs/lib/sendings.lib.php
+++ b/htdocs/lib/sendings.lib.php
@@ -48,7 +48,7 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
 	$sql.= " AND ed.fk_expedition = e.rowid";
 	$sql.= " ORDER BY obj.fk_product";
 
-	dolibarr_syslog("show_list_sending_receive sql=".$sql, LOG_DEBUG);
+	dol_syslog("show_list_sending_receive sql=".$sql, LOG_DEBUG);
 	$resql = $db->query($sql);
 	if ($resql)
 	{
@@ -91,13 +91,13 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
 					$product->fetch($objp->fk_product);
 
 					print '<td>';
-					print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.dolibarr_trunc($product->libelle,20);
-					if ($objp->description) print '<br>'.dol_htmlentitiesbr(dolibarr_trunc($objp->description,24));
+					print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.'</a> - '.dol_trunc($product->libelle,20);
+					if ($objp->description) print '<br>'.dol_htmlentitiesbr(dol_trunc($objp->description,24));
 					print '</td>';
 				}
 				else
 				{
-					print "<td>".dol_htmlentitiesbr(dolibarr_trunc($objp->description,24))."</td>\n";
+					print "<td>".dol_htmlentitiesbr(dol_trunc($objp->description,24))."</td>\n";
 				}
 
 				//print '<td align="center">'.$objp->qty_asked.'</td>';
@@ -107,14 +107,14 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
 
 				print '<td align="center">'.$objp->qty_shipped.'</td>';
 				
-				print '<td align="center" nowrap="nowrap">'.dolibarr_print_date($objp->date_expedition,'dayhour').'</td>';
+				print '<td align="center" nowrap="nowrap">'.dol_print_date($objp->date_expedition,'dayhour').'</td>';
 				if ($conf->livraison_bon->enabled)
 				{
 					if ($objp->livraison_id)
 					{
 						print '<td><a href="'.DOL_URL_ROOT.'/livraison/fiche.php?id='.$objp->livraison_id.'">'.img_object($langs->trans("ShowSending"),'sending').' '.$objp->livraison_ref.'<a></td>';
 						print '<td align="center">'.$objp->qty_received.'</td>';
-						print '<td>'.dolibarr_print_date($objp->date_delivery,'dayhour').'</td>';
+						print '<td>'.dol_print_date($objp->date_delivery,'dayhour').'</td>';
 					}
 					else
 					{
@@ -133,7 +133,7 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	return 1;
diff --git a/htdocs/lib/tax.lib.php b/htdocs/lib/tax.lib.php
index b2ec8c54040..a69e6d40df0 100644
--- a/htdocs/lib/tax.lib.php
+++ b/htdocs/lib/tax.lib.php
@@ -116,7 +116,7 @@ function vat_by_thirdparty($db, $y, $modetax, $direction)
 	if ($sql && $sql=='TODO') return -2;
 	if ($sql && $sql!='TODO')
 	{
-		dolibarr_syslog("Client::vat_by_customer sql=".$sql);
+		dol_syslog("Client::vat_by_customer sql=".$sql);
 	    $resql = $db->query($sql);
 	    if ($resql)
 	    {
@@ -129,7 +129,7 @@ function vat_by_thirdparty($db, $y, $modetax, $direction)
 	    }
 	    else
 	    {
-	        dolibarr_print_error($db);
+	        dol_print_error($db);
 			return -3;
 	    }
 	}
@@ -245,7 +245,7 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction)
 	if ($sql && $sql=='TODO') return -2;
 	if ($sql && $sql!='TODO')
 	{
-		dolibarr_syslog("Client::vat_by_quarter sql=".$sql);
+		dol_syslog("Client::vat_by_quarter sql=".$sql);
 	    $resql = $db->query($sql);
 	    if ($resql)
 	    {
@@ -285,7 +285,7 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction)
 	    }
 	    else
 	    {
-	        dolibarr_print_error($db);
+	        dol_print_error($db);
 			return -3;
 	    }
 	}
@@ -364,7 +364,7 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction)
 	if ($sql && $sql=='TODO') return -2;
 	if ($sql && $sql!='TODO')
 	{
-		dolibarr_syslog("Client::vat_by_quarter sql=".$sql);
+		dol_syslog("Client::vat_by_quarter sql=".$sql);
 	    $resql = $db->query($sql);
 	    if ($resql)
 	    {
@@ -404,7 +404,7 @@ function vat_by_quarter($db, $y, $q, $modetax, $direction)
 	    }
 	    else
 	    {
-	        dolibarr_print_error($db);
+	        dol_print_error($db);
 			return -3;
 	    }
 	}
diff --git a/htdocs/lib/xcal.lib.php b/htdocs/lib/xcal.lib.php
index 13ffdae40a8..91a1ec3ff71 100644
--- a/htdocs/lib/xcal.lib.php
+++ b/htdocs/lib/xcal.lib.php
@@ -38,7 +38,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
 {
 	global $langs;
 	
-	dolibarr_syslog("xcal.lib.php::build_calfile Build cal file ".$outputfile." to format ".$format);
+	dol_syslog("xcal.lib.php::build_calfile Build cal file ".$outputfile." to format ".$format);
 
 	if (empty($outputfile)) return -1;
 	
@@ -143,11 +143,11 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
 					//fwrite($calfileh,"CLASS:PUBLIC\n");				// PUBLIC, PRIVATE, CONFIDENTIAL
 
 					// Date must be GMT dates 
-					fwrite($calfileh,"DTSTAMP:".dolibarr_print_date($now,'dayhourxcard',true)."\n");
-					$startdatef = dolibarr_print_date($startdate,'dayhourxcard',true);
+					fwrite($calfileh,"DTSTAMP:".dol_print_date($now,'dayhourxcard',true)."\n");
+					$startdatef = dol_print_date($startdate,'dayhourxcard',true);
 					fwrite($calfileh,"DTSTART:".$startdatef."\n");
 					if (empty($enddate)) $enddate=$startdate+$duration;
-					$enddatef = dolibarr_print_date($enddate,'dayhourxcard',true);
+					$enddatef = dol_print_date($enddate,'dayhourxcard',true);
 					fwrite($calfileh,"DTEND:".$enddatef."\n");
 
 					if (! empty($transparency)) fwrite($calfileh,"TRANSP:".$transparency."\n");
@@ -181,7 +181,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
 					fwrite($calfileh,"LOCATION:".$location."\n");
 					fwrite($calfileh,"TRANSP:OPAQUE\n");
 					fwrite($calfileh,"CLASS:CONFIDENTIAL\n");
-					fwrite($calfileh,"DTSTAMP:".dolibarr_print_date($startdatef,'dayhourxcard',true)."\n");
+					fwrite($calfileh,"DTSTAMP:".dol_print_date($startdatef,'dayhourxcard',true)."\n");
 
 					fwrite($calfileh,"END:VJOURNAL\n");
 				}
@@ -192,7 +192,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
 				$comment=array();
 				$comment ['eid']			= $eid;
 				$comment ['url']			= $linktoevent;
-				$comment ['date']			= dolibarr_mktime($evttime,"Ymd");
+				$comment ['date']			= dol_mktime($evttime,"Ymd");
 				$comment ['duration']		= $duration;
 				$comment ['startdate']		= $startdate;
 				$comment ['enddate']		= $enddate;
@@ -211,7 +211,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
 	}
 	else
 	{
-		dolibarr_syslog("xcal.lib.php::build_cal_file Failed to open file ".$outputfile." for writing");
+		dol_syslog("xcal.lib.php::build_cal_file Failed to open file ".$outputfile." for writing");
 		return -2;
 	}
 }
@@ -232,7 +232,7 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
 	global $user,$conf,$langs;
 	global $dolibarr_main_url_root;
 	
-	dolibarr_syslog("xcal.lib.php::build_rssfile Build rss file ".$outputfile." to format ".$format);
+	dol_syslog("xcal.lib.php::build_rssfile Build rss file ".$outputfile." to format ".$format);
 
 	if (empty($outputfile)) return -1;
 	
diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php
index ecf3cb775b6..3fcf99ce8c6 100644
--- a/htdocs/livraison/fiche.php
+++ b/htdocs/livraison/fiche.php
@@ -152,7 +152,7 @@ if ($_REQUEST['action'] == 'builddoc')	// En get ou en post
 	$result=delivery_order_pdf_create($db, $_REQUEST['id'],$_REQUEST['model'],$outputlangs);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$result);
+		dol_print_error($db,$result);
 		exit;
 	}
 }
@@ -217,7 +217,7 @@ if ($_GET["action"] == 'create')
 		print "</td></tr>";
 
 		print "<tr><td>".$langs->trans("Date")."</td>";
-		print "<td>".dolibarr_print_date($commande->date,'dayhourtext')."</td>\n";
+		print "<td>".dol_print_date($commande->date,'dayhourtext')."</td>\n";
 
 		print '<td>'.$langs->trans("Order").'</td><td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id.'">'.img_object($langs->trans("ShowOrder"),'order').' '.$commande->ref.'</a>';
 		print "</td></tr>\n";
@@ -347,7 +347,7 @@ if ($_GET["action"] == 'create')
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 else
@@ -390,7 +390,7 @@ else
 			$hselected = $h;
 			$h++;
 
-			dolibarr_fiche_head($head, $hselected, $langs->trans("Sending"));
+			dol_fiche_head($head, $hselected, $langs->trans("Sending"));
 
 			/*
 			 * Confirmation de la suppression
@@ -457,7 +457,7 @@ else
 
 			// Date
 			print '<tr><td>'.$langs->trans("Date").'</td>';
-			print '<td colspan="3">'.dolibarr_print_date($livraison->date_creation,'dayhourtext')."</td>\n";
+			print '<td colspan="3">'.dol_print_date($livraison->date_creation,'dayhourtext')."</td>\n";
 			print '</tr>';
 
 			// Statut
diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php
index d14afe7a014..5c23e9c74cf 100644
--- a/htdocs/livraison/livraison.class.php
+++ b/htdocs/livraison/livraison.class.php
@@ -79,7 +79,7 @@ class Livraison extends CommonObject
 	{
 		global $conf;
 
-		dolibarr_syslog("Livraison::create");
+		dol_syslog("Livraison::create");
 
 		$error = 0;
 
@@ -99,7 +99,7 @@ class Livraison extends CommonObject
 		if ($this->expedition_id) $sql.= ", $this->expedition_id";
 		$sql.= ")";
 
-		dolibarr_syslog("Livraison::create sql=".$sql, LOG_DEBUG);
+		dol_syslog("Livraison::create sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -109,7 +109,7 @@ class Livraison extends CommonObject
 			$sql = "UPDATE ".MAIN_DB_PREFIX."livraison ";
 			$sql.= "SET ref='".addslashes($numref)."' WHERE rowid=".$this->id;
 
-			dolibarr_syslog("Livraison::create sql=".$sql, LOG_DEBUG);
+			dol_syslog("Livraison::create sql=".$sql, LOG_DEBUG);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -141,7 +141,7 @@ class Livraison extends CommonObject
 					$sql.= " SET fk_statut = 2";
 					$sql.= " WHERE rowid=".$this->commande_id;
 
-					dolibarr_syslog("Livraison::create sql=".$sql, LOG_DEBUG);
+					dol_syslog("Livraison::create sql=".$sql, LOG_DEBUG);
 					$resql=$this->db->query($sql);
 					if (! $resql)
 					{
@@ -158,7 +158,7 @@ class Livraison extends CommonObject
 				{
 					$error++;
 					$this->error=$this->db->lasterror()." - sql=".$this->db->lastqueryerror;
-					dolibarr_syslog("Livraison::create Error -3 ".$this->error);
+					dol_syslog("Livraison::create Error -3 ".$this->error);
 					$this->db->rollback();
 					return -3;
 				}
@@ -167,7 +167,7 @@ class Livraison extends CommonObject
 			{
 				$error++;
 				$this->error=$this->db->lasterror()." - sql=".$this->db->lastqueryerror;
-				dolibarr_syslog("Livraison::create Error -2 ".$this->error);
+				dol_syslog("Livraison::create Error -2 ".$this->error);
 				$this->db->rollback();
 				return -2;
 			}
@@ -176,7 +176,7 @@ class Livraison extends CommonObject
 		{
 			$error++;
 			$this->error=$this->db->lasterror()." - sql=".$this->db->lastqueryerror;
-			dolibarr_syslog("Livraison::create Error -1 ".$this->error);
+			dol_syslog("Livraison::create Error -1 ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
@@ -199,7 +199,7 @@ class Livraison extends CommonObject
 		$sql.= " ".($description?"'".addslashes($description)."'":"null").",";
 		$sql.= $qty.")";
 
-		dolibarr_syslog("Livraison::create_line sql=".$sql, LOG_DEBUG);
+		dol_syslog("Livraison::create_line sql=".$sql, LOG_DEBUG);
 		if (! $this->db->query($sql) )
 		{
 			$error++;
@@ -240,7 +240,7 @@ class Livraison extends CommonObject
 		}
 		$sql.= " WHERE l.rowid = ".$id;
 
-		dolibarr_syslog("Livraison::fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("Livraison::fetch sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql) ;
 		if ($result)
 		{
@@ -298,13 +298,13 @@ class Livraison extends CommonObject
 			else
 			{
 				$this->error='Delivery with id '.$rowid.' not found sql='.$sql;
-				dolibarr_syslog('Livraison::Fetch Error '.$this->error);
+				dol_syslog('Livraison::Fetch Error '.$this->error);
 				return -2;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('Livraison::Fetch Error '.$this->error);
+			dol_syslog('Livraison::Fetch Error '.$this->error);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -319,7 +319,7 @@ class Livraison extends CommonObject
 	{
 		global $conf;
 
-		dolibarr_syslog("livraison.class.php::valid begin");
+		dol_syslog("livraison.class.php::valid begin");
 
 		$this->db->begin();
 
@@ -374,7 +374,7 @@ class Livraison extends CommonObject
 							//Enregistrement d'un mouvement de stock pour chaque produit de l'expedition
 
 
-							dolibarr_syslog("livraison.class.php::valid enregistrement des mouvements");
+							dol_syslog("livraison.class.php::valid enregistrement des mouvements");
 
 							$sql = "SELECT cd.fk_product, ld.qty ";
 							$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld";
@@ -387,7 +387,7 @@ class Livraison extends CommonObject
 								$i=0;
 								while($i < $num)
 								{
-									dolibarr_syslog("livraison.class.php::valid movment $i");
+									dol_syslog("livraison.class.php::valid movment $i");
 
 									$obj = $this->db->fetch_object($resql);
 
@@ -398,7 +398,7 @@ class Livraison extends CommonObject
 									{
 										$this->db->rollback();
 										$this->error=$this->db->error()." - sql=$sql";
-										dolibarr_syslog("livraison.class.php::valid ".$this->error);
+										dol_syslog("livraison.class.php::valid ".$this->error);
 										return -3;
 									}
 									$i++;
@@ -409,7 +409,7 @@ class Livraison extends CommonObject
 							{
 								$this->db->rollback();
 								$this->error=$this->db->error()." - sql=$sql";
-								dolibarr_syslog("livraison.class.php::valid ".$this->error);
+								dol_syslog("livraison.class.php::valid ".$this->error);
 								return -2;
 
 							}
@@ -439,13 +439,13 @@ class Livraison extends CommonObject
 							}
 						}
 
-						dolibarr_syslog("livraison.class.php::valid ok");
+						dol_syslog("livraison.class.php::valid ok");
 					}
 					else
 					{
 						$this->db->rollback();
 						$this->error=$this->db->error()." - sql=$sql";
-						dolibarr_syslog("livraison.class.php::valid ".$this->error);
+						dol_syslog("livraison.class.php::valid ".$this->error);
 						return -1;
 					}
 				}
@@ -454,12 +454,12 @@ class Livraison extends CommonObject
 		else
 		{
 			$this->error="Non autorise";
-			dolibarr_syslog("livraison.class.php::valid ".$this->error);
+			dol_syslog("livraison.class.php::valid ".$this->error);
 			return -1;
 		}
 
 		$this->db->commit();
-		dolibarr_syslog("livraison.class.php::valid commit");
+		dol_syslog("livraison.class.php::valid commit");
 		return 1;
 	}
 
@@ -633,7 +633,7 @@ class Livraison extends CommonObject
 		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on p.rowid = ld.fk_product";
 		$sql.= " WHERE ld.fk_origin_line = cd.rowid AND ld.fk_livraison = ".$this->id;
 
-		dolibarr_syslog("Livraison::fetch_lignes sql=".$sql);
+		dol_syslog("Livraison::fetch_lignes sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 1618d8795ab..ebf950d7dd7 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -809,8 +809,8 @@ function top_menu($head, $title='', $target='')
 	$htmltext.='<br><b>'.$langs->trans("Type").'</b>: '.($user->societe_id?$langs->trans("External"):$langs->trans("Internal"));
 	$htmltext.='<br>';
 	$htmltext.='<br><u>'.$langs->trans("Connection").'</u>';
-	$htmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dolibarr_print_date($user->datelastlogin,"dayhour");
-	$htmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dolibarr_print_date($user->datepreviouslogin,"dayhour");
+	$htmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour");
+	$htmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dol_print_date($user->datepreviouslogin,"dayhour");
 	$htmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"];
 	$htmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
 	$htmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.$langs->getDefaultLang();
@@ -1048,6 +1048,10 @@ function llxFooter($foot='',$limitIEbug=1)
 
 	print "\n";
     if ($foot) print '<!-- '.$foot.' -->'."\n";
+
+    // Add Xdebug coverage of code
+    if (defined('XDEBUGCOVERAGE')) { var_dump(xdebug_get_code_coverage()); }
+
 	print "</body>\n";
 	print "</html>\n";
 }
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index bf406b74a67..59468f834cb 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -33,6 +33,10 @@
 define('DOL_VERSION','2.6-beta');	// Also defined in htdocs/install/inc.php
 define('EURO',chr(128));
 
+// Add Xdebug coverage of code
+//define('XDEBUGCOVERAGE',1);
+if (defined('XDEBUGCOVERAGE')) { xdebug_start_code_coverage(); }
+
 // La fonction clearstatcache ne doit pas etre appel�e de mani�re globale car ralenti.
 // Elle doit etre appel�e uniquement par les pages qui ont besoin d'un cache fichier vid�
 // comme par exemple document.php
diff --git a/htdocs/notify.class.php b/htdocs/notify.class.php
index 4b8fd2c35e9..75ef3fab689 100644
--- a/htdocs/notify.class.php
+++ b/htdocs/notify.class.php
@@ -90,7 +90,7 @@ class Notify
         $sql.= " AND n.fk_action = ".$action;
         $sql.= " AND s.rowid = ".$socid;
 
-		dolibarr_syslog("Notify.class::countDefinedNotifications $action, $socid");
+		dol_syslog("Notify.class::countDefinedNotifications $action, $socid");
 
         $resql = $this->db->query($sql);
         if ($resql)
@@ -120,7 +120,7 @@ class Notify
         $sql .= " AND n.fk_soc = s.rowid AND n.fk_action = ".$action;
         $sql .= " AND s.rowid = ".$socid;
 
-		dolibarr_syslog("Notify.class::send $action, $socid, $texte, $objet_type, $objet_id, $file");
+		dol_syslog("Notify.class::send $action, $socid, $texte, $objet_type, $objet_id, $file");
 
         $result = $this->db->query($sql);
         if ($result)
@@ -160,7 +160,7 @@ class Notify
                         $sql.= " VALUES (".$this->db->idate(mktime()).", ".$action." ,".$obj->rowid." , '".$objet_type."', ".$objet_id.");";
                         if (! $this->db->query($sql) )
                         {
-                            dolibarr_print_error($db);
+                            dol_print_error($db);
                         }
                     }
                     else
diff --git a/htdocs/oscommerce_ws/clients/fiche.php b/htdocs/oscommerce_ws/clients/fiche.php
index f25742a965d..bd37ee16b18 100644
--- a/htdocs/oscommerce_ws/clients/fiche.php
+++ b/htdocs/oscommerce_ws/clients/fiche.php
@@ -65,7 +65,7 @@ if ($action == '' && !$cancel) {
 	{
 	  	print "\n<div class=\"tabsAction\">\n";
 		  print "<p>ERROR 1c</p>\n";
-	  	  dolibarr_print_error('',"erreur webservice ".$osc_cust->error);
+	  	  dol_print_error('',"erreur webservice ".$osc_cust->error);
     	  print '<a class="butAction" href="index.php">'.$langs->trans("Retour").'</a>';
 		print "\n</div><br>\n";
 	}
diff --git a/htdocs/oscommerce_ws/clients/index.php b/htdocs/oscommerce_ws/clients/index.php
index b4d45dec585..a6ccdd59b78 100644
--- a/htdocs/oscommerce_ws/clients/index.php
+++ b/htdocs/oscommerce_ws/clients/index.php
@@ -50,7 +50,7 @@ $result = $client->call("get_Client",$parameters );
 //		echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
 
 if ($client->fault) {
-  		dolibarr_print_error('',"erreur de connexion ");
+  		dol_print_error('',"erreur de connexion ");
 }
 elseif (!($err = $client->getError()) )
 {
@@ -97,11 +97,11 @@ elseif (!($err = $client->getError()) )
 		print "</table></p>";
 	}
 	else {
-  		dolibarr_print_error('',"Aucun client trouv�");
+  		dol_print_error('',"Aucun client trouv�");
 	}
 }
 else {
-	dolibarr_print_error('',"Erreur service web ".$err); 
+	dol_print_error('',"Erreur service web ".$err); 
 }
 
 print "</TABLE>";
diff --git a/htdocs/oscommerce_ws/clients/osc_customer.class.php b/htdocs/oscommerce_ws/clients/osc_customer.class.php
index 195c9470a09..feee9c7d4ff 100644
--- a/htdocs/oscommerce_ws/clients/osc_customer.class.php
+++ b/htdocs/oscommerce_ws/clients/osc_customer.class.php
@@ -80,7 +80,7 @@ class Osc_customer
 		global $conf;
 	
 		$this->error = '';
-		dolibarr_syslog("Osc_customer::fetch $id=$id ref=$ref");
+		dol_syslog("Osc_customer::fetch $id=$id ref=$ref");
       // Verification parametres
       if (! $id )
         {
@@ -149,7 +149,7 @@ class Osc_customer
         else
         {
 //			print "suppression rate ".$sql."  * ".$result;
-            dolibarr_syslog("osc_customer::transcode echec suppression");
+            dol_syslog("osc_customer::transcode echec suppression");
 //            $this->db->rollback();
 //            return -1;
 		}
@@ -163,7 +163,7 @@ class Osc_customer
         else
         {
 //			print "insertion rate ".$sql." , ".$result;
-            dolibarr_syslog("osc_customer::transcode echec insert");
+            dol_syslog("osc_customer::transcode echec insert");
 //            $this->db->rollback();
 //            return -1;
 		}
diff --git a/htdocs/oscommerce_ws/commandes/fiche.php b/htdocs/oscommerce_ws/commandes/fiche.php
index ba5df9f06f3..127c1654166 100644
--- a/htdocs/oscommerce_ws/commandes/fiche.php
+++ b/htdocs/oscommerce_ws/commandes/fiche.php
@@ -74,7 +74,7 @@ if ($action == '' && !$cancel) {
 	{
 	  print "\n<div class=\"tabsAction\">\n";
 		  print "<p>ERROR 1c</p>\n";
-		  dolibarr_print_error('',"erreur webservice ".$osc_order->error);
+		  dol_print_error('',"erreur webservice ".$osc_order->error);
 		  print '<a class="butAction" href="index.php">'.$langs->trans("Retour").'</a>';
 	  print "\n</div><br>\n";
 	}
diff --git a/htdocs/oscommerce_ws/commandes/index.php b/htdocs/oscommerce_ws/commandes/index.php
index bd769a8eb46..cb6ac643240 100644
--- a/htdocs/oscommerce_ws/commandes/index.php
+++ b/htdocs/oscommerce_ws/commandes/index.php
@@ -51,7 +51,7 @@ $result = $client->call("get_Order",$parameters );
 //		echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
 
 if ($client->fault) {
-  		dolibarr_print_error('',"erreur de connexion ");
+  		dol_print_error('',"erreur de connexion ");
 }
 elseif (!($err = $client->getError()) )
 {
@@ -98,11 +98,11 @@ elseif (!($err = $client->getError()) )
 		print "</table></p>";
 	}
 	else {
-  		dolibarr_print_error('',"Aucune commande trouv�e");
+  		dol_print_error('',"Aucune commande trouv�e");
 	}
 }
 else {
-	dolibarr_print_error('',"Erreur service web ".$err); 
+	dol_print_error('',"Erreur service web ".$err); 
 }
 
 print "</TABLE>";
diff --git a/htdocs/oscommerce_ws/commandes/osc_order.class.php b/htdocs/oscommerce_ws/commandes/osc_order.class.php
index 9cf623926d5..1e65a72238a 100644
--- a/htdocs/oscommerce_ws/commandes/osc_order.class.php
+++ b/htdocs/oscommerce_ws/commandes/osc_order.class.php
@@ -79,7 +79,7 @@ class Osc_order
 		global $conf;
 	
 		$this->error = '';
-		dolibarr_syslog("Osc_order::fetch $id=$id ");
+		dol_syslog("Osc_order::fetch $id=$id ");
       // Verification parametres
       if (! $id )
         {
@@ -208,7 +208,7 @@ class Osc_order
         else
         {
 //			print "suppression rate ".$sql."  * ".$result;
-            dolibarr_syslog("osc_order::transcode echec suppression");
+            dol_syslog("osc_order::transcode echec suppression");
 //            $this->db->rollback();
 //            return -1;
 		}
@@ -222,7 +222,7 @@ class Osc_order
         else
         {
 //			print "insertion rate ".$sql." , ".$result;
-            dolibarr_syslog("osc_product::transcode echec insert");
+            dol_syslog("osc_product::transcode echec insert");
 //            $this->db->rollback();
 //            return -1;
 		}
diff --git a/htdocs/oscommerce_ws/index.php b/htdocs/oscommerce_ws/index.php
index 52cc6a8270f..963d40115d0 100644
--- a/htdocs/oscommerce_ws/index.php
+++ b/htdocs/oscommerce_ws/index.php
@@ -72,7 +72,7 @@ print '<td align="right">'.$langs->trans("Total").'</td></tr>';
 // Call the WebService and store its result in $result.
 $result = $client->call("get_CAmensuel",$parameters );
 if ($client->fault) {
-  dolibarr_print_error('',"Erreur de connexion ");
+  dol_print_error('',"Erreur de connexion ");
   print_r($client->faultstring);
 }
 elseif (!($err = $client->getError()) )
@@ -98,7 +98,7 @@ elseif (!($err = $client->getError()) )
 }
 else
 {
-  dolibarr_print_error('',"Erreur du service web ".$err);
+  dol_print_error('',"Erreur du service web ".$err);
 }
 
 
@@ -121,7 +121,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM);
 $result = $client->call("get_orders",$parameters );
 
 if ($client->fault) {
-  dolibarr_print_error('',"Erreur de connexion ");
+  dol_print_error('',"Erreur de connexion ");
 }
 elseif (!($err = $client->getError()) ) {
 	$num=0;
@@ -141,7 +141,7 @@ elseif (!($err = $client->getError()) ) {
     }
 }
 else {
-  dolibarr_print_error('',"Erreur du service web ".$err);
+  dol_print_error('',"Erreur du service web ".$err);
 }
 
 print "</table><br>";
@@ -158,7 +158,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM, "status"=>OSC_ORDWAIT);
 $result = $client->call("get_orders",$parameters );
 
 if ($client->fault) {
-  dolibarr_print_error('',"Erreur webservice ".$client->faultstring);
+  dol_print_error('',"Erreur webservice ".$client->faultstring);
 }
 elseif (!($err = $client->getError()) ) {
   $var=True;
@@ -179,7 +179,7 @@ elseif (!($err = $client->getError()) ) {
   }
 }
 else {
-  dolibarr_print_error('',"Erreur du service web ".$err);
+  dol_print_error('',"Erreur du service web ".$err);
 }
 
 print "</table><br>";
@@ -195,7 +195,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM, "status"=>OSC_ORDPROCESS);
 $result = $client->call("get_orders",$parameters );
 
 if ($client->fault) {
-  dolibarr_print_error('',"Erreur webservice ".$client->faultstring);
+  dol_print_error('',"Erreur webservice ".$client->faultstring);
 }
 elseif (!($err = $client->getError()) ) {
   $var=True;
@@ -216,7 +216,7 @@ elseif (!($err = $client->getError()) ) {
     }
 }
 else {
-  dolibarr_print_error('',"Erreur du service web ".$err);
+  dol_print_error('',"Erreur du service web ".$err);
 }
 
 print "</table><br>";
@@ -234,7 +234,7 @@ $parameters = array("limit"=>OSC_MAXNBCOM);
 $result = $client->call("get_lastOrderClients",$parameters );
 
 if ($client->fault) {
-  dolibarr_print_error('',"Erreur webservice ".$client->faultstring);
+  dol_print_error('',"Erreur webservice ".$client->faultstring);
 }
 elseif (!($err = $client->getError()) ) {
   $var=True;
@@ -256,7 +256,7 @@ elseif (!($err = $client->getError()) ) {
     }
 }
 else {
-  dolibarr_print_error('',"Erreur du service web ".$err);
+  dol_print_error('',"Erreur du service web ".$err);
 }
 
 
diff --git a/htdocs/oscommerce_ws/produits/OSCvente.php b/htdocs/oscommerce_ws/produits/OSCvente.php
index 0d0b7e93518..17a55b36d36 100644
--- a/htdocs/oscommerce_ws/produits/OSCvente.php
+++ b/htdocs/oscommerce_ws/produits/OSCvente.php
@@ -87,7 +87,7 @@ if ($_GET["action"] == 'vendre' )
 		{
 			if ($img[0]['photo_vignette']) $filename=$img[0]['photo_vignette'];
 		   else $filename=$img[0]['photo']; 
-		   $prod['image'] = dolibarr_trunc($filename,16);
+		   $prod['image'] = dol_trunc($filename,16);
 		}
 
 //		print_r($prod);
diff --git a/htdocs/oscommerce_ws/produits/categories.php b/htdocs/oscommerce_ws/produits/categories.php
index 13f9d988ffb..51e1e129591 100644
--- a/htdocs/oscommerce_ws/produits/categories.php
+++ b/htdocs/oscommerce_ws/produits/categories.php
@@ -241,7 +241,7 @@ else
 
 	print_barre_liste("Correspondance des cat�gories", $page, "categories.php");
 
-	dolibarr_syslog("Osc_Categorie.class::get_Osccat sql=".$sql);
+	dol_syslog("Osc_Categorie.class::get_Osccat sql=".$sql);
    $resql=$db->query($sql);
    if ($resql)
 	{
@@ -275,7 +275,7 @@ else
 	}
 	else
 	{
-  		dolibarr_print_error();
+  		dol_print_error();
 	}
 }	
 	//WebService Client.
@@ -294,7 +294,7 @@ $result = $client->call("get_categorylist",$parameters );
 
 if ($client->fault) {
 	if ($client->faultcode == 'Server') print '<p>Il n\'y a pas de cat�gorie fille pour la cat�gorie '.$catid.'</p>';
-	else dolibarr_print_error('',"erreur de connexion ".$client->getError());
+	else dol_print_error('',"erreur de connexion ".$client->getError());
   		
 }
 elseif ( !($err = $client->getError()) )
diff --git a/htdocs/oscommerce_ws/produits/fiche.php b/htdocs/oscommerce_ws/produits/fiche.php
index cd9ffd8a0cf..9a6e9215c4a 100644
--- a/htdocs/oscommerce_ws/produits/fiche.php
+++ b/htdocs/oscommerce_ws/produits/fiche.php
@@ -62,7 +62,7 @@ if ($action == '' && !$cancel) {
 		else
 		{
 	  print "<p>ERROR 1</p>\n";
-	  dolibarr_print_error('',"erreur webservice ".$osc_prod->error);
+	  dol_print_error('',"erreur webservice ".$osc_prod->error);
 		}
 	}
 	else
diff --git a/htdocs/oscommerce_ws/produits/index.php b/htdocs/oscommerce_ws/produits/index.php
index 3b9d08e6de0..d988ff23f22 100644
--- a/htdocs/oscommerce_ws/produits/index.php
+++ b/htdocs/oscommerce_ws/produits/index.php
@@ -47,7 +47,7 @@ $client = new soapclient_nusoap(OSCWS_DIR."ws_articles.php");
 
 $result = $client->call("get_listearticles",$parameters );
 if ($client->fault) {
-  		dolibarr_print_error('',"erreur de connexion ");
+  		dol_print_error('',"erreur de connexion ");
 }
 elseif (!($err = $client->getError()) )
 {
@@ -93,11 +93,11 @@ elseif (!($err = $client->getError()) )
 		print "</table></p>";
 	}
 	else {
-  		dolibarr_print_error('',"Aucun article trouvé");
+  		dol_print_error('',"Aucun article trouvé");
 	}
 }
 else {
-	dolibarr_print_error('',"Erreur service web ".$client->faultstring); 
+	dol_print_error('',"Erreur service web ".$client->faultstring); 
 }
 
 print "</TABLE>";
diff --git a/htdocs/oscommerce_ws/produits/osc_categories.class.php b/htdocs/oscommerce_ws/produits/osc_categories.class.php
index 626e2956d07..a5661da8c94 100644
--- a/htdocs/oscommerce_ws/produits/osc_categories.class.php
+++ b/htdocs/oscommerce_ws/produits/osc_categories.class.php
@@ -80,7 +80,7 @@ class Osc_Categorie
         $sql.= " '".$this->dolicatid."',";
         $sql.= " '".$this->osccatid."'";
 		$sql.= ")";
-	   	dolibarr_syslog("Osc_Categorie.class::create sql=".$sql);
+	   	dol_syslog("Osc_Categorie.class::create sql=".$sql);
 
         $resql=$this->db->query($sql);
         if ($resql)
@@ -109,7 +109,7 @@ class Osc_Categorie
         {
             $this->error=$this->db->lasterror();
             $this->error .= "erreur ".$sql;
-            dolibarr_syslog("Osc_Categorie.class::create ".$this->error);
+            dol_syslog("Osc_Categorie.class::create ".$this->error);
             return -1;
         }
     }
@@ -133,7 +133,7 @@ class Osc_Categorie
         $sql.= " dolicatid='".addslashes($this->dolicatid)."',";
         $sql.= " osccatid='".addslashes($this->osccatid)."'";
         $sql.= " WHERE rowid=".$this->id;
-        dolibarr_syslog("Osc_Categorie.class::update sql=".$sql,LOG_DEBUG);
+        dol_syslog("Osc_Categorie.class::update sql=".$sql,LOG_DEBUG);
     
         $resql = $this->db->query($sql);
         if (! $resql)
@@ -169,7 +169,7 @@ class Osc_Categorie
         $sql.= " FROM ".MAIN_DB_PREFIX."osc_categories as t";
         $sql.= " WHERE c.rowid = ".$id;
     
-    	dolibarr_syslog("Osc_Categorie.class::fetch sql=".$sql);
+    	dol_syslog("Osc_Categorie.class::fetch sql=".$sql);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -188,7 +188,7 @@ class Osc_Categorie
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Osc_Categorie.class::fetch ".$this->error);
+            dol_syslog("Osc_Categorie.class::fetch ".$this->error);
             return -1;
         }
     }
@@ -206,7 +206,7 @@ class Osc_Categorie
         $sql.= " FROM ".MAIN_DB_PREFIX."osc_categories as t";
         $sql.= " WHERE t.osccatid = ".$oscid;
     
-    	dolibarr_syslog("Osc_Categorie.class::fetch_osccat sql=".$sql);
+    	dol_syslog("Osc_Categorie.class::fetch_osccat sql=".$sql);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -227,7 +227,7 @@ class Osc_Categorie
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Osc_Categorie.class::fetch_osccat ".$this->error);
+            dol_syslog("Osc_Categorie.class::fetch_osccat ".$this->error);
             return -1;
         }
     } 
@@ -245,7 +245,7 @@ class Osc_Categorie
         $sql.= " FROM ".MAIN_DB_PREFIX."osc_categories as t";
         $sql.= " WHERE t.dolicatid = ".$doliid;
     
-    	dolibarr_syslog("Osc_Categorie.class::fetch_dolicat sql=".$sql);
+    	dol_syslog("Osc_Categorie.class::fetch_dolicat sql=".$sql);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -264,7 +264,7 @@ class Osc_Categorie
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog("Osc_Categorie.class::fetch_dolicat ".$this->error);
+            dol_syslog("Osc_Categorie.class::fetch_dolicat ".$this->error);
             return -1;
         }
     }
@@ -281,7 +281,7 @@ class Osc_Categorie
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."osc_categories";
 		$sql.= " WHERE rowid=".$this->id;
 	
-	   	dolibarr_syslog("Osc_Categorie.class::delete sql=".$sql);
+	   	dol_syslog("Osc_Categorie.class::delete sql=".$sql);
 		$resql = $this->db->query($sql);
 		if (! $resql)
 		{
diff --git a/htdocs/oscommerce_ws/produits/osc_product.class.php b/htdocs/oscommerce_ws/produits/osc_product.class.php
index 5c354bb6360..f960dc4d1a6 100644
--- a/htdocs/oscommerce_ws/produits/osc_product.class.php
+++ b/htdocs/oscommerce_ws/produits/osc_product.class.php
@@ -76,7 +76,7 @@ class Osc_product
 		global $conf;
 	
 		$this->error = '';
-		dolibarr_syslog("Osc_product::fetch $id=$id ref=$ref");
+		dol_syslog("Osc_product::fetch $id=$id ref=$ref");
       	// Verification parametres
       	if (! $id && ! $ref)
         {
@@ -166,7 +166,7 @@ class Osc_product
 		}
         else
         {
-            dolibarr_syslog("osc_product::transcode echec suppression");
+            dol_syslog("osc_product::transcode echec suppression");
 //            $this->db->rollback();
 //            return -1;
 		}
@@ -178,7 +178,7 @@ class Osc_product
 		}
         else
         {
-            dolibarr_syslog("osc_product::transcode echec insert");
+            dol_syslog("osc_product::transcode echec insert");
 //            $this->db->rollback();
 //            return -1;
 		}
diff --git a/htdocs/paiement.class.php b/htdocs/paiement.class.php
index 2277f126a69..0db2e0c742f 100644
--- a/htdocs/paiement.class.php
+++ b/htdocs/paiement.class.php
@@ -77,7 +77,7 @@ class Paiement
 		$sql.= ' WHERE p.fk_paiement = c.id';
 		$sql.= ' AND p.rowid = '.$id;
 
-		dolibarr_syslog("Paiement::fetch sql=".$sql);
+		dol_syslog("Paiement::fetch sql=".$sql);
 		$result = $this->db->query($sql);
 		
 		if ($result)
@@ -108,7 +108,7 @@ class Paiement
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -144,7 +144,7 @@ class Paiement
 			$sql.= ' VALUES ('.$this->db->idate(mktime()).', '.$this->db->idate($this->datepaye).', \''.$this->total.'\', '.$this->paiementid.', \''.$this->num_paiement.'\', \''.addslashes($this->note).'\', '.$user->id.')';
 			$resql = $this->db->query($sql);
 
-			dolibarr_syslog("Paiement::Create insert paiement sql=".$sql);
+			dol_syslog("Paiement::Create insert paiement sql=".$sql);
 			if ($resql)
 			{
 				$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'paiement');
@@ -159,18 +159,18 @@ class Paiement
 						$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement_facture (fk_facture, fk_paiement, amount)';
 						$sql .= ' VALUES ('.$facid.','. $this->id.',\''.$amount.'\')';
 
-						dolibarr_syslog("Paiement::Create insert paiement_facture sql=".$sql);
+						dol_syslog("Paiement::Create insert paiement_facture sql=".$sql);
 						$resql=$this->db->query($sql);
 						if (! $resql)
 						{
 							$this->error=$this->db->error();
-							dolibarr_syslog('Paiement::Create insert paiement_facture error='.$this->error, LOG_ERR);
+							dol_syslog('Paiement::Create insert paiement_facture error='.$this->error, LOG_ERR);
 							$error++;
 						}
 					}
 					else
 					{
-						dolibarr_syslog('Paiement::Create Montant non num�rique');
+						dol_syslog('Paiement::Create Montant non num�rique');
 					}
 				}
 				
@@ -187,7 +187,7 @@ class Paiement
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog('Paiement::Create insert paiement error='.$this->error, LOG_ERR);
+				dol_syslog('Paiement::Create insert paiement error='.$this->error, LOG_ERR);
 				$error++;
 			}
 		}
@@ -305,7 +305,7 @@ class Paiement
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return 0;
 		}
 	}
@@ -318,7 +318,7 @@ class Paiement
 	{
 		$sql = 'UPDATE '.MAIN_DB_PREFIX.'paiement SET statut = 1 WHERE rowid = '.$this->id;
 
-		dolibarr_syslog('Paiement::valide sql='.$sql);
+		dol_syslog('Paiement::valide sql='.$sql);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -326,7 +326,7 @@ class Paiement
 		}
 		else
 		{
-			dolibarr_syslog('Paiement::valide Error -1');
+			dol_syslog('Paiement::valide Error -1');
 			return -1;
 		}
 	}
@@ -342,7 +342,7 @@ class Paiement
 		$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement as c';
 		$sql .= ' WHERE c.rowid = '.$id;
 
-		dolibarr_syslog('Paiement::info sql='.$sql);
+		dol_syslog('Paiement::info sql='.$sql);
 		$result = $this->db->query($sql);
 		
 		if ($result)
@@ -370,7 +370,7 @@ class Paiement
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 	
@@ -404,7 +404,7 @@ class Paiement
 		else
 		{
             $this->error=$this->db->error();
-			dolibarr_syslog('Paiement::getBillsArray Error '.$this->error.' - sql='.$sql);
+			dol_syslog('Paiement::getBillsArray Error '.$this->error.' - sql='.$sql);
 			return -1;
 		}
 	}
diff --git a/htdocs/phenix/phenix.class.php b/htdocs/phenix/phenix.class.php
index 0fe5d95160e..fea08da2119 100644
--- a/htdocs/phenix/phenix.class.php
+++ b/htdocs/phenix/phenix.class.php
@@ -81,14 +81,14 @@ class Phenix {
     {
     	global $langs;
         
-      dolibarr_syslog("Phenix::add user=".$user->id);
+      dol_syslog("Phenix::add user=".$user->id);
       
       // Test si login phenix d�fini pour le user
       if (! $user->phenix_login)
       {
       	$langs->load("other");
       	$this->error=$langs->transnoentities("ErrorPhenixLoginNotDefined","<a href=\"".DOL_URL_ROOT."/user/fiche.php?id=".$user->id."\">".$user->login."</a>");
-      	dolibarr_syslog("Phenix::add ERROR ".$this->error);
+      	dol_syslog("Phenix::add ERROR ".$this->error);
       	return -4; 
       }
       
@@ -117,7 +117,7 @@ class Phenix {
         $sql = "INSERT INTO px_agenda (age_id, age_createur_id, cal_date, cal_time, cal_mod_date, cal_mod_time, cal_duration, cal_priority, cal_type, cal_access, cal_name,cal_description)";
         $sql.= " VALUES ($age_id, '$age_createur_id', '$cal_date', '$cal_time', '$cal_mod_date', '$cal_mod_time', $cal_duration, $cal_priority, '$cal_type', '$cal_access', '$cal_name','$cal_description')";
         
-        dolibarr_syslog("Phenix::add sql=".$sql);
+        dol_syslog("Phenix::add sql=".$sql);
         $resql=$this->localdb->query($sql);
         if ($resql)
         {
@@ -135,7 +135,7 @@ class Phenix {
         	{
         		$this->localdb->rollback();
         		$this->error = $this->localdb->error() . '<br>' .$sql;
-        		dolibarr_syslog("Phenix::add ERROR ".$this->error);
+        		dol_syslog("Phenix::add ERROR ".$this->error);
         		return -1;
         	}
         }
@@ -143,7 +143,7 @@ class Phenix {
         {
         	$this->localdb->rollback();
           $this->error = $this->localdb->error() . '<br>' .$sql;
-          dolibarr_syslog("Phenix::add ERROR ".$this->error);
+          dol_syslog("Phenix::add ERROR ".$this->error);
           return -2;
         }
       }
@@ -151,7 +151,7 @@ class Phenix {
       {
       	$this->localdb->rollback();
         $this->error = $this->localdb->error() . '<br>' .$sql;
-        dolibarr_syslog("Phenix::add ERROR ".$this->error);
+        dol_syslog("Phenix::add ERROR ".$this->error);
         return -3;
       }
     }
diff --git a/htdocs/postnuke/articles/index.php b/htdocs/postnuke/articles/index.php
index 3f83a377ccb..35576a223d3 100644
--- a/htdocs/postnuke/articles/index.php
+++ b/htdocs/postnuke/articles/index.php
@@ -74,7 +74,7 @@ if ( $db->query($sql) )
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/product.class.php b/htdocs/product.class.php
index b9e26700c39..301023c3f50 100644
--- a/htdocs/product.class.php
+++ b/htdocs/product.class.php
@@ -207,7 +207,7 @@ class Product extends CommonObject
 			return -1;
 		}
 
-		dolibarr_syslog("Product::Create ref=".$this->ref." price=".$this->price." price_ttc=".$this->price_ttc." tva_tx=".$this->tva_tx." price_base_type=".$this->price_base_type." Category : ".$this->catid, LOG_DEBUG);
+		dol_syslog("Product::Create ref=".$this->ref." price=".$this->price." price_ttc=".$this->price_ttc." tva_tx=".$this->tva_tx." price_base_type=".$this->price_base_type." Category : ".$this->catid, LOG_DEBUG);
 
 		if ($this->ref)
 		{
@@ -242,7 +242,7 @@ class Product extends CommonObject
 					$sql.= "'".$this->canvas."',";
 					$sql.= " ".$this->finished.")";
 
-					dolibarr_syslog("Product::Create sql=".$sql);
+					dol_syslog("Product::Create sql=".$sql);
 					$result = $this->db->query($sql);
 					if ( $result )
 					{
@@ -335,7 +335,7 @@ class Product extends CommonObject
 	function _setErrNo($func, $num, $error='')
 	{
 		$this->errno = $num;
-		dolibarr_syslog(get_class($this)."::".$func." - ERRNO(".$this->errno.")".($error?' - '.$error:''), LOG_ERR);
+		dol_syslog(get_class($this)."::".$func." - ERRNO(".$this->errno.")".($error?' - '.$error:''), LOG_ERR);
 	}
 
 	/**
@@ -393,7 +393,7 @@ class Product extends CommonObject
 		$sql .= ",duration = '" . $this->duration_value . $this->duration_unit ."'";
 		$sql .= " WHERE rowid = " . $id;
 
-		dolibarr_syslog("Product::update sql=".$sql);
+		dol_syslog("Product::update sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -665,12 +665,12 @@ class Product extends CommonObject
 		$sql.= " ".$this->price_min.",".$this->price_min_ttc;
 		$sql.= ")";
 
-		dolibarr_syslog("Product::_log_price sql=".$sql);
+		dol_syslog("Product::_log_price sql=".$sql);
 		$resql=$this->db->query($sql);
 		if(! $resql)
 		{
 			$this->error=$this->db->error();
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 		else
@@ -691,7 +691,7 @@ class Product extends CommonObject
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_price";
 		$sql.= " WHERE rowid=".$rowid;
 
-		dolibarr_syslog("Product::log_price_delete sql=".$sql, LOG_DEBUG);
+		dol_syslog("Product::log_price_delete sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -723,7 +723,7 @@ class Product extends CommonObject
 		$sql.= " AND pfp.rowid = ".$prodfournprice;
 		$sql.= " AND pfp.quantity <= ".$qty;
 
-		dolibarr_syslog("Product::get_buyprice sql=".$sql);
+		dol_syslog("Product::get_buyprice sql=".$sql);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -749,7 +749,7 @@ class Product extends CommonObject
 				$sql.= " ORDER BY pfp.quantity DESC";
 				$sql.= " LIMIT 1";
 
-				dolibarr_syslog("Product::get_buyprice sql=".$sql);
+				dol_syslog("Product::get_buyprice sql=".$sql);
 				$resql = $this->db->query($sql);
 				if ($resql)
 				{
@@ -798,7 +798,7 @@ class Product extends CommonObject
 	{
 		global $conf,$langs;
 
-		dolibarr_syslog("Product::update_price id=".$id." newprice=".$newprice." newpricebase=".$newpricebase." newminprice=".$newminprice." level=".$level, LOG_DEBUG);
+		dol_syslog("Product::update_price id=".$id." newprice=".$newprice." newpricebase=".$newpricebase." newminprice=".$newminprice." level=".$level, LOG_DEBUG);
 
 		if ($newvat == '') $newvat=$this->tva_tx;
 
@@ -853,7 +853,7 @@ class Product extends CommonObject
 			$sql.= " tva_tx='".price2num($newvat)."'";
 			$sql.= " WHERE rowid = " . $id;
 
-			dolibarr_syslog("Product::update_price sql=".$sql);
+			dol_syslog("Product::update_price sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -868,7 +868,7 @@ class Product extends CommonObject
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 			}
 		}
 
@@ -887,13 +887,13 @@ class Product extends CommonObject
 		global $langs;
 		global $conf;
 
-		dolibarr_syslog("Product::fetch id=$id ref=$ref");
+		dol_syslog("Product::fetch id=$id ref=$ref");
 
 		// Verification parametres
 		if (! $id && ! $ref)
 		{
 			$this->error=$langs->trans('ErrorWrongParameters');
-			dolibarr_print_error("Product::fetch ".$this->error);
+			dol_print_error("Product::fetch ".$this->error);
 			return -1;
 		}
 
@@ -905,7 +905,7 @@ class Product extends CommonObject
 		if ($id) $sql.= " WHERE rowid = '".$id."'";
 		if ($ref) $sql.= " WHERE ref = '".addslashes($ref)."'";
 
-		dolibarr_syslog("Product::fetch sql=".$sql);
+		dol_syslog("Product::fetch sql=".$sql);
 		$result = $this->db->query($sql);
 		if ( $result )
 		{
@@ -971,7 +971,7 @@ class Product extends CommonObject
 					}
 					else
 					{
-						dolibarr_print_error($this->db);
+						dol_print_error($this->db);
 						return -1;
 					}
 				}
@@ -1001,7 +1001,7 @@ class Product extends CommonObject
 					}
 					else
 					{
-						dolibarr_print_error($this->db);
+						dol_print_error($this->db);
 						return -1;
 					}
 				}
@@ -1013,7 +1013,7 @@ class Product extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -1343,7 +1343,7 @@ class Product extends CommonObject
 
 		for ($j = 0 ; $j < 12 ; $j++)
 		{
-			$idx=ucfirst(substr(dolibarr_print_date(dolibarr_mktime(12,0,0,$month,1,$year),"%b"),0,3) );
+			$idx=ucfirst(substr(dol_print_date(dol_mktime(12,0,0,$month,1,$year),"%b"),0,3) );
 			$monthnum=sprintf("%02s",$month);
 
 			$result[$j] = array($idx,isset($tab[$year.$month])?$tab[$year.$month]:0);
@@ -1482,7 +1482,7 @@ class Product extends CommonObject
 		$sql .= ' WHERE fk_product_pere  = "'.$id_pere.'" and fk_product_fils = "'.$id_fils.'"';
 		if (! $this->db->query($sql))
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 		else
@@ -1491,7 +1491,7 @@ class Product extends CommonObject
 			$sql .= ' WHERE fk_product_pere  = "'.$id_fils.'" and fk_product_fils = "'.$id_pere.'"';
 			if (! $this->db->query($sql))
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				return -1;
 			}
 			else
@@ -1511,7 +1511,7 @@ class Product extends CommonObject
 						$sql .= ' VALUES ("'.$id_pere.'","'.$id_fils.'","'.$qty.'")';
 						if (! $this->db->query($sql))
 						{
-							dolibarr_print_error($this->db);
+							dol_print_error($this->db);
 							return -1;
 						}
 						else
@@ -1536,7 +1536,7 @@ class Product extends CommonObject
 		$sql .= ' WHERE fk_product_pere  = "'.$id_pere.'" and fk_product_fils = "'.$id_fils.'"';
 		if (! $this->db->query($sql))
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 		else
@@ -1555,7 +1555,7 @@ class Product extends CommonObject
 		$sql .= ' WHERE fk_product_pere  = "'.$id_pere.'" and fk_product_fils = "'.$id_fils.'"';
 		if (! $this->db->query($sql))
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 		else
@@ -1619,7 +1619,7 @@ class Product extends CommonObject
 			$sql .= ' VALUES ("'.$this->id.'","'.$id_sub.'")';
 			if (! $this->db->query($sql))
 	  {
-	  	dolibarr_print_error($this->db);
+	  	dol_print_error($this->db);
 	  	return -1;
 	  }
 	  else
@@ -1730,7 +1730,7 @@ class Product extends CommonObject
 		$list = $this->list_suppliers();
 		if (sizeof($list) > 0)
 		{
-			dolibarr_syslog("Product::fastappro");
+			dol_syslog("Product::fastappro");
 			$fournisseur = new Fournisseur($this->db);
 			$fournisseur->fetch($this->fourn_appro_open);
 
@@ -1758,7 +1758,7 @@ class Product extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -1952,7 +1952,7 @@ class Product extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -1981,7 +1981,7 @@ class Product extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error ($this->db);
+			dol_print_error ($this->db);
 			return -1;
 		}
 	}
@@ -2030,7 +2030,7 @@ class Product extends CommonObject
 			$lienfin='</a>';
 		}
 		$newref=$this->ref;
-		if ($maxlength) $newref=dolibarr_trunc($newref,$maxlength,'middle');
+		if ($maxlength) $newref=dol_trunc($newref,$maxlength,'middle');
 
 		if ($withpicto) {
 			if ($this->type == 0) $result.=($lien.img_object($langs->trans("ShowProduct").' '.$this->ref,'product').$lienfin.' ');
@@ -2150,7 +2150,7 @@ class Product extends CommonObject
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				$this->db->rollback();
 				return -1;
 			}
@@ -2555,7 +2555,7 @@ class Product extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -2579,7 +2579,7 @@ class Product extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -2602,7 +2602,7 @@ class Product extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
diff --git a/htdocs/product/barcode.php b/htdocs/product/barcode.php
index a42866e7003..97227d209bb 100644
--- a/htdocs/product/barcode.php
+++ b/htdocs/product/barcode.php
@@ -81,7 +81,7 @@ if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
 
 $head=product_prepare_head($product, $user);
 $titre=$langs->trans("CardProduct".$product->type);
-dolibarr_fiche_head($head, 'barcode', $titre);
+dol_fiche_head($head, 'barcode', $titre);
 
 
 print '<table class="border" width="100%">';
diff --git a/htdocs/product/canvas/product.livre.class.php b/htdocs/product/canvas/product.livre.class.php
index 00fbb411cf9..73c09ae751f 100644
--- a/htdocs/product/canvas/product.livre.class.php
+++ b/htdocs/product/canvas/product.livre.class.php
@@ -184,7 +184,7 @@ class ProductLivre extends Product
 		else
 		{
 			$this->db->rollback();
-			dolibarr_syslog("ProductLivre::Create ROLLBACK ERRNO (".$this->errno.")");
+			dol_syslog("ProductLivre::Create ROLLBACK ERRNO (".$this->errno.")");
 			return -1;
 		}
 	}
@@ -256,7 +256,7 @@ class ProductLivre extends Product
 	 */
 	function UpdateCanvas($datas)
 	{
-		dolibarr_syslog("ProductLivre::UpdateCanvas ID : ".$this->id, LOG_DEBUG);
+		dol_syslog("ProductLivre::UpdateCanvas ID : ".$this->id, LOG_DEBUG);
 
 		$isbna = trim($datas["isbna"]);
 		$isbnb = trim($datas["isbnb"]);
@@ -290,17 +290,17 @@ class ProductLivre extends Product
 		$sql.= " SET isbn = '$isbn'";
 		$sql.= " , ean = '$ean'";
 		$sql.= " , pages         = '".$this->pages."'";
-		$sql.= " , px_feuillet   = '".$this->px_feuillet."'";
-		$sql.= " , px_revient    = '".price2num($this->px_revient)."'";
-		$sql.= " , px_reliure = '".price2num($this->px_reliure)."'";
-		$sql.= " , px_couverture = '".price2num($this->px_couverture)."'";
+		$sql.= " , px_feuillet   = ".($this->px_feuillet?price2num($this->px_feuillet):'null');
+		$sql.= " , px_revient    = ".($this->px_revient?price2num($this->px_revient):'null');
+		$sql.= " , px_reliure    = ".($this->px_reliure?price2num($this->px_reliure):'null');
+		$sql.= " , px_couverture = ".($this->px_couverture?price2num($this->px_couverture):'null');
 		$sql.= " , fk_couverture = '".$this->couverture->id."'";
 		$sql.= " , fk_contrat    = '".$this->contrat->id."'";
 		$sql.= " , fk_auteur     = '".$datas["auteur"]."'";
 		$sql.= " , format        = '$format'";
 		$sql.= " WHERE rowid = " . $this->id;
 
-		dolibarr_syslog("ProductLivre::UpdateCanvas sql=".$sql, LOG_DEBUG);
+		dol_syslog("ProductLivre::UpdateCanvas sql=".$sql, LOG_DEBUG);
 		if ( $this->db->query($sql) )
 		{
 			$this->errno = 0;
@@ -328,7 +328,7 @@ class ProductLivre extends Product
 	 */
 	function _calculate_prix_revient($pages, $couv, $feuil, $price_ht, $reliure, $taux)
 	{
-		dolibarr_syslog("ProductLivre::UpdateCanvas $pages, $couv, $feuil, $price_ht, $taux", LOG_DEBUG);
+		dol_syslog("ProductLivre::UpdateCanvas $pages, $couv, $feuil, $price_ht, $taux", LOG_DEBUG);
 
 		$cost = ($pages / 2 * $feuil) + $couv + $reliure + ($price_ht * $taux / 100);
 
diff --git a/htdocs/product/canvas/product.livrecontrat.class.php b/htdocs/product/canvas/product.livrecontrat.class.php
index d56b7682e04..d66f9909a22 100644
--- a/htdocs/product/canvas/product.livrecontrat.class.php
+++ b/htdocs/product/canvas/product.livrecontrat.class.php
@@ -153,7 +153,7 @@ class ProductLivreContrat extends Product
    */
   function UpdateCanvas($datas)
   {
-    dolibarr_syslog("ProductLivreContrat::UpdateCanvas");
+    dol_syslog("ProductLivreContrat::UpdateCanvas");
 
     $taux   = ereg_replace(',','.',trim($datas["contrat_taux"]));
     $quant  = trim($datas["contrat_quant"]);
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index ca905a8a353..331f7db422e 100755
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -125,7 +125,7 @@ if ($product->id)
 
 	$head=product_prepare_head($product, $user);
 	$titre=$langs->trans("CardProduct".$product->type);
-	dolibarr_fiche_head($head, 'documents', $titre);
+	dol_fiche_head($head, 'documents', $titre);
 
 
 	// Construit liste des fichiers
diff --git a/htdocs/product/droitpret/modules_droitpret.php b/htdocs/product/droitpret/modules_droitpret.php
index ba11284b155..11a3c62d55d 100644
--- a/htdocs/product/droitpret/modules_droitpret.php
+++ b/htdocs/product/droitpret/modules_droitpret.php
@@ -69,7 +69,7 @@ class ModeleDroitPret
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 			return -1;
 		}              
     
diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index c93af7d3235..c4be4ea17ad 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -241,12 +241,12 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
 					$_GET["action"] = "";
 
 					$mesg='<div class="error">'.$langs->trans("ErrorProductAlreadyExists",$product->ref).'</div>';
-					//dolibarr_print_error($product->db);
+					//dol_print_error($product->db);
 				}
 				else
 				{
 					$db->rollback();
-					dolibarr_print_error($product->db);
+					dol_print_error($product->db);
 				}
 			}
 		}
@@ -254,7 +254,7 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
 	else
 	{
 		$db->rollback();
-		dolibarr_print_error($product->db);
+		dol_print_error($product->db);
 	}
 }
 
@@ -289,7 +289,7 @@ if ($_POST["action"] == 'addinpropal')
 	$result=$propal->fetch($_POST["propalid"]);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$propal->error);
+		dol_print_error($db,$propal->error);
 		exit;
 	}
 
@@ -297,7 +297,7 @@ if ($_POST["action"] == 'addinpropal')
 	$result=$soc->fetch($propal->socid,$user);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$soc->error);
+		dol_print_error($db,$soc->error);
 		exit;
 	}
 
@@ -305,7 +305,7 @@ if ($_POST["action"] == 'addinpropal')
 	$result=$prod->fetch($_GET['id']);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$prod->error);
+		dol_print_error($db,$prod->error);
 		exit;
 	}
 
@@ -370,7 +370,7 @@ if ($_POST["action"] == 'addincommande')
 	$result=$commande->fetch($_POST["commandeid"]);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$commande->error);
+		dol_print_error($db,$commande->error);
 		exit;
 	}
 
@@ -378,7 +378,7 @@ if ($_POST["action"] == 'addincommande')
 	$result=$soc->fetch($commande->socid,$user);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$soc->error);
+		dol_print_error($db,$soc->error);
 		exit;
 	}
 
@@ -386,7 +386,7 @@ if ($_POST["action"] == 'addincommande')
 	$result=$prod->fetch($_GET['id']);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$prod->error);
+		dol_print_error($db,$prod->error);
 		exit;
 	}
 
@@ -450,7 +450,7 @@ if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer)
 	$result=$facture->fetch($_POST["factureid"]);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$facture->error);
+		dol_print_error($db,$facture->error);
 		exit;
 	}
 
@@ -458,7 +458,7 @@ if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer)
 	$soc->fetch($facture->socid,$user);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$soc->error);
+		dol_print_error($db,$soc->error);
 		exit;
 	}
 
@@ -466,7 +466,7 @@ if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer)
 	$result = $prod->fetch($_GET["id"]);
 	if ($result <= 0)
 	{
-		dolibarr_print_error($db,$prod->error);
+		dol_print_error($db,$prod->error);
 		exit;
 	}
 
@@ -789,7 +789,7 @@ if ($_GET["id"] || $_GET["ref"])
 		{
 			$head=product_prepare_head($product, $user);
 			$titre=$langs->trans("CardProduct".$product->type);
-			dolibarr_fiche_head($head, 'card', $titre);
+			dol_fiche_head($head, 'card', $titre);
 			print "\n<!-- CUT HERE -->\n";
 			// Confirmation de la suppression de la facture
 			if ($_GET["action"] == 'delete')
@@ -1234,8 +1234,8 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
 	  		print "<td nowrap>";
 	  		print '<input type="hidden" name="action" value="addinpropal">';
 	  		print "<a href=\"../comm/propal.php?propalid=".$objp->propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a></td>\n";
-	  		print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
-	  		print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->dp,"%d %b")."</td>\n";
+	  		print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dol_trunc($objp->nom,18)."</a></td>\n";
+	  		print "<td nowrap=\"nowrap\">".dol_print_date($objp->dp,"%d %b")."</td>\n";
 	  		print '<td><input type="hidden" name="propalid" value="'.$objp->propalid.'">';
 	  		print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
 	  		print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
@@ -1347,8 +1347,8 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
 	  		print "<td nowrap>";
 	  		print '<input type="hidden" name="action" value="addincommande">';
 	  		print "<a href=\"../commande/fiche.php?id=".$objc->commandeid."\">".img_object($langs->trans("ShowOrder"),"order")." ".$objc->ref."</a></td>\n";
-	  		print "<td><a href=\"../comm/fiche.php?socid=".$objc->socid."\">".dolibarr_trunc($objc->nom,18)."</a></td>\n";
-	  		print "<td nowrap=\"nowrap\">".dolibarr_print_date($objc->dc,"%d %b")."</td>\n";
+	  		print "<td><a href=\"../comm/fiche.php?socid=".$objc->socid."\">".dol_trunc($objc->nom,18)."</a></td>\n";
+	  		print "<td nowrap=\"nowrap\">".dol_print_date($objc->dc,"%d %b")."</td>\n";
 	  		print '<td><input type="hidden" name="commandeid" value="'.$objc->commandeid.'">';
 	  		print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
 	  		print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
@@ -1456,8 +1456,8 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
 	  		print "<td nowrap>";
 	  		print '<input type="hidden" name="action" value="addinfacture">';
 	  		print "<a href=\"../compta/facture.php?facid=".$objp->factureid."\">".img_object($langs->trans("ShowBills"),"bill")." ".$objp->facnumber."</a></td>\n";
-	  		print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
-	  		print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->df,"%d %b")."</td>\n";
+	  		print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dol_trunc($objp->nom,18)."</a></td>\n";
+	  		print "<td nowrap=\"nowrap\">".dol_print_date($objp->df,"%d %b")."</td>\n";
 	  		print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
 	  		print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
 	  		print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
@@ -1479,7 +1479,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
 		}
 		else
 		{
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 		}
 
 		print '</td>';
@@ -1512,7 +1512,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
 		    print '<form method="POST" action="fiche.php?id='.$product->id.'">';
 		    print "<tr $bc[$var]>";
 		    print "<td><a href=\"../compta/facture.php?facid=".$objp->factureid."\">$objp->facnumber</a></td>\n";
-		    print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dolibarr_trunc($objp->nom,24)."</a></td>\n";
+		    print "<td><a href=\"../comm/fiche.php?socid=".$objp->socid."\">".dol_trunc($objp->nom,24)."</a></td>\n";
 		    print "<td colspan=\"2\">".$langs->trans("Qty");
 		    print '<input type="hidden" name="action" value="addinfacture">';
 		    print "</td>";
@@ -1537,7 +1537,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
 	  }
 	  else
 	  {
-	  	dolibarr_print_error($db);
+	  	dol_print_error($db);
 	  }
 		}
 
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 1f720aa6012..2f2b9129cf3 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -188,7 +188,7 @@ if ($_GET["id"] || $_GET["ref"])
 
 			$head=product_prepare_head($product, $user);
 			$titre=$langs->trans("CardProduct".$product->type);
-			dolibarr_fiche_head($head, 'suppliers', $titre);
+			dol_fiche_head($head, 'suppliers', $titre);
 
 
 			print '<table class="border" width="100%">';
@@ -399,7 +399,7 @@ if ($_GET["id"] || $_GET["ref"])
 					$db->free($resql);
 				}
 				else {
-					dolibarr_print_error($db);
+					dol_print_error($db);
 				}
 				
 				print '</table>';
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 6228c043b41..ac5e9a8f190 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -184,9 +184,9 @@ if ($result)
 	  $staticproduct->type=$objp->fk_product_type;
 	  print $staticproduct->getNomUrl(1,'',16);
 	  print "</td>\n";
-	  print '<td>'.dolibarr_trunc($objp->label,32).'</td>';
+	  print '<td>'.dol_trunc($objp->label,32).'</td>';
 	  print "<td>";
-	  print dolibarr_print_date($objp->datem,'day');
+	  print dol_print_date($objp->datem,'day');
 	  print "</td>";
 	  print '<td align="right" nowrap="nowrap">';
 	  print $staticproduct->LibStatut($objp->envente,5);
@@ -202,7 +202,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print '</td></tr></table>';
diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php
index 999d672af0c..8d963cbadb1 100644
--- a/htdocs/product/liste.php
+++ b/htdocs/product/liste.php
@@ -287,10 +287,10 @@ if ($resql)
 			print "</td>\n";
 
 			// Label
-			print '<td>'.dolibarr_trunc($objp->label,40).'</td>';
+			print '<td>'.dol_trunc($objp->label,40).'</td>';
 			
 			// Date
-			print '<td align="center">'.dolibarr_print_date($objp->datem,'day')."</td>\n";
+			print '<td align="center">'.dol_print_date($objp->datem,'day')."</td>\n";
 
 			// Duration
 			if ($conf->service->enabled && $type != 0) 
@@ -359,7 +359,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php
index 6fd0dcca844..e4dceaed813 100644
--- a/htdocs/product/photos.php
+++ b/htdocs/product/photos.php
@@ -97,7 +97,7 @@ if ($_GET["id"] || $_GET["ref"])
        */
        $head=product_prepare_head($product, $user);
        $titre=$langs->trans("CardProduct".$product->type);
-       dolibarr_fiche_head($head, 'photos', $titre);
+       dol_fiche_head($head, 'photos', $titre);
        
        /*
         * Confirmation de la suppression de photo
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index e0a40b5bb14..7a5dabf1dd1 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -112,7 +112,7 @@ llxHeader("","",$langs->trans("CardProduct".$product->type));
 
 $head=product_prepare_head($product, $user);
 $titre=$langs->trans("CardProduct".$product->type);
-dolibarr_fiche_head($head, 'price', $titre);
+dol_fiche_head($head, 'price', $titre);
 
 
 print '<table class="border" width="100%">';
@@ -401,7 +401,7 @@ if ($result)
 			$var=!$var;
 			print "<tr $bc[$var]>";
 			// Date
-			print "<td>".dolibarr_print_date($objp->dp,"dayhour")."</td>";
+			print "<td>".dol_print_date($objp->dp,"dayhour")."</td>";
 
 			// Price level
 			if ($conf->global->PRODUIT_MULTIPRICES)
@@ -443,7 +443,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index d6c3e2864d8..68ed4b1f404 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -286,7 +286,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/product/sousproduits/fiche.php b/htdocs/product/sousproduits/fiche.php
index 0157565fbc4..4fe27255643 100644
--- a/htdocs/product/sousproduits/fiche.php
+++ b/htdocs/product/sousproduits/fiche.php
@@ -138,7 +138,7 @@ if ($mesg) {
 
 $head=product_prepare_head($product, $user);
 $titre=$langs->trans("CardProduct".$product->type);
-dolibarr_fiche_head($head, 'subproduct', $titre);
+dol_fiche_head($head, 'subproduct', $titre);
 
 /*
  * Fiche produit
@@ -316,7 +316,7 @@ if ($id || $ref)
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 			print '<input type="hidden" name="max_prod" value="'.$i.'">';
 			if($num > 0)
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index c87b8848e14..b792381d4b7 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -87,7 +87,7 @@ if ($_GET["id"] || $_GET["ref"])
          */
 		$head=product_prepare_head($product, $user);
 		$titre=$langs->trans("CardProduct".$product->type);
-		dolibarr_fiche_head($head, 'referers', $titre);
+		dol_fiche_head($head, 'referers', $titre);
 
 
         print '<table class="border" width="100%">';
@@ -175,10 +175,10 @@ if ($_GET["id"] || $_GET["ref"])
                     print '<td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->commandeid.'">'.img_object($langs->trans("ShowOrder"),"order").' ';
                     print $objp->ref;
                     print "</a></td>\n";
-                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
+                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
                     print "<td>".$objp->code_client."</td>\n";
                     print "<td align=\"center\">";
-                    print dolibarr_print_date($objp->date)."</td>";
+                    print dol_print_date($objp->date)."</td>";
                     print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
                     print '<td align="right">'.$commandestatic->LibStatut($objp->statut,$objp->facture,5).'</td>';
                     print "</tr>\n";
@@ -188,7 +188,7 @@ if ($_GET["id"] || $_GET["ref"])
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
         print '<br>';
@@ -197,7 +197,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-    dolibarr_print_error();
+    dol_print_error();
 }
 
 $db->close();
diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php
index 157e66d2367..bb70543b470 100644
--- a/htdocs/product/stats/commande_fournisseur.php
+++ b/htdocs/product/stats/commande_fournisseur.php
@@ -85,7 +85,7 @@ if ($_GET["id"] || $_GET["ref"])
        */
       $head=product_prepare_head($product, $user);
       $titre=$langs->trans("CardProduct".$product->type);
-      dolibarr_fiche_head($head, 'referers', $titre);
+      dol_fiche_head($head, 'referers', $titre);
             
       print '<table class="border" width="100%">';
       
@@ -168,10 +168,10 @@ if ($_GET["id"] || $_GET["ref"])
 		  print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$objp->commandeid.'">'.img_object($langs->trans("ShowOrder"),"order").' ';
 		  print $objp->ref;
 		  print "</a></td>\n";
-		  print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
+		  print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
 		  print "<td>".$objp->code_client."</td>\n";
 		  print "<td align=\"center\">";
-		  print dolibarr_print_date($objp->date)."</td>";
+		  print dol_print_date($objp->date)."</td>";
 		  print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
 		  print '<td align="right">'.$commandestatic->LibStatut($objp->statut,$objp->facture,5).'</td>';
 		  print "</tr>\n";
@@ -181,7 +181,7 @@ if ($_GET["id"] || $_GET["ref"])
         }
       else
         {
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
         }
       print "</table>";
       print '<br>';
@@ -190,7 +190,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-  dolibarr_print_error();
+  dol_print_error();
 }
 
 $db->close();
diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php
index 5464cb8bde3..56d1bdb5150 100644
--- a/htdocs/product/stats/contrat.php
+++ b/htdocs/product/stats/contrat.php
@@ -87,7 +87,7 @@ if ($_GET["id"] || $_GET["ref"])
          */
       $head=product_prepare_head($product,$user);
       $titre=$langs->trans("CardProduct".$product->type);
-      dolibarr_fiche_head($head, 'referers', $titre);
+      dol_fiche_head($head, 'referers', $titre);
 
       print '<table class="border" width="100%">';
 
@@ -180,10 +180,10 @@ if ($_GET["id"] || $_GET["ref"])
                     print '<td><a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowContract"),"contract").' ';
                     print $objp->rowid;
                     print "</a></td>\n";
-                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
+                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
                     print "<td>".$objp->code_client."</td>\n";
                     print "<td align=\"center\">";
-                    print dolibarr_print_date($objp->date)."</td>";
+                    print dol_print_date($objp->date)."</td>";
                     //print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
                     //print '<td align="right">';
                     print '<td align="center">'.($objp->nb_initial>0?$objp->nb_initial:'').'</td>';
@@ -197,7 +197,7 @@ if ($_GET["id"] || $_GET["ref"])
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
         print '<br>';
@@ -206,7 +206,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-    dolibarr_print_error();
+    dol_print_error();
 }
 
 $db->close();
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index cd098d8b8d1..cea8a22dee3 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -83,7 +83,7 @@ if ($_GET["id"] || $_GET["ref"])
          */
 		$head=product_prepare_head($product, $user);
 		$titre=$langs->trans("CardProduct".$product->type);
-		dolibarr_fiche_head($head, 'referers', $titre);
+		dol_fiche_head($head, 'referers', $titre);
 
 
         print '<table class="border" width="100%">';
@@ -171,10 +171,10 @@ if ($_GET["id"] || $_GET["ref"])
                     $invoicestatic->ref=$objp->facnumber;
 					print $invoicestatic->getNomUrl(1);
                     print "</td>\n";
-                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
+                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
                     print "<td>".$objp->code_client."</td>\n";
                     print "<td align=\"center\">";
-                    print dolibarr_print_date($objp->date)."</td>";
+                    print dol_print_date($objp->date)."</td>";
                     print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
                     print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
                     print "</tr>\n";
@@ -184,7 +184,7 @@ if ($_GET["id"] || $_GET["ref"])
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
         print '<br>';
@@ -193,7 +193,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-    dolibarr_print_error();
+    dol_print_error();
 }
 
 $db->close();
diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php
index a03cfc02cbf..2b0ccd44055 100644
--- a/htdocs/product/stats/facture_fournisseur.php
+++ b/htdocs/product/stats/facture_fournisseur.php
@@ -83,7 +83,7 @@ if ($_GET["id"] || $_GET["ref"])
          */
 		$head=product_prepare_head($product, $user);
 		$titre=$langs->trans("CardProduct".$product->type);
-		dolibarr_fiche_head($head, 'referers', $titre);
+		dol_fiche_head($head, 'referers', $titre);
 
 
         print '<table class="border" width="100%">';
@@ -171,10 +171,10 @@ if ($_GET["id"] || $_GET["ref"])
                     $supplierinvoicestatic->ref=$objp->facnumber;
 					print $supplierinvoicestatic->getNomUrl(1);
                     print "</td>\n";
-                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
+                    print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
                     print "<td>".$objp->code_client."</td>\n";
                     print "<td align=\"center\">";
-                    print dolibarr_print_date($objp->date)."</td>";
+                    print dol_print_date($objp->date)."</td>";
                     print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
                     $fac=new Facture($db);
                     print '<td align="right">'.$fac->LibStatut($objp->paye,$objp->statut,5).'</td>';
@@ -185,7 +185,7 @@ if ($_GET["id"] || $_GET["ref"])
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
         print '<br>';
@@ -194,7 +194,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-    dolibarr_print_error();
+    dol_print_error();
 }
 
 $db->close();
diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php
index 7b34bf5f402..29c7e1667ce 100644
--- a/htdocs/product/stats/fiche.php
+++ b/htdocs/product/stats/fiche.php
@@ -70,7 +70,7 @@ if ($_GET["id"] || $_GET["ref"])
 	{
 		$head=product_prepare_head($product, $user);
 		$titre=$langs->trans("CardProduct".$product->type);
-		dolibarr_fiche_head($head, 'stats', $titre);
+		dol_fiche_head($head, 'stats', $titre);
 
 
 		print '<table class="border" width="100%">';
@@ -199,7 +199,7 @@ if ($_GET["id"] || $_GET["ref"])
 				}
 				else
 				{
-					dolibarr_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
+					dol_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
 				}
 			}
 		}
@@ -239,7 +239,7 @@ if ($_GET["id"] || $_GET["ref"])
 			print '<tr>';
 			if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file']) && ! $px->isGraphKo())
 			{
-				print '<td>'.$langs->trans("GeneratedOn",dolibarr_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).'</td>';
+				print '<td>'.$langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).'</td>';
 			}
 			else
 			{
@@ -269,7 +269,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-	dolibarr_print_error();
+	dol_print_error();
 }
 
 
diff --git a/htdocs/product/stats/index.php b/htdocs/product/stats/index.php
index 18c7a379a7a..4adba2a6213 100644
--- a/htdocs/product/stats/index.php
+++ b/htdocs/product/stats/index.php
@@ -185,7 +185,7 @@ if ($db->query($sql))
 	}
 }
 else {
-	dolibarr_print_error($db);	
+	dol_print_error($db);	
 }
 print "</table>\n";
 $db->free();
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index 2e97d52e1e2..8e76590b69a 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -85,7 +85,7 @@ if ($_GET["id"] || $_GET["ref"])
          */
 		$head=product_prepare_head($product, $user);
 		$titre=$langs->trans("CardProduct".$product->type);
-		dolibarr_fiche_head($head, 'referers', $titre);
+		dol_fiche_head($head, 'referers', $titre);
 
 
         print '<table class="border" width="100%">';
@@ -171,9 +171,9 @@ if ($_GET["id"] || $_GET["ref"])
                     print '<td><a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' ';
                     print $objp->ref;
                     print "</a></td>\n";
-                    print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
+                    print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
                     print "<td align=\"center\">";
-                    print dolibarr_print_date($objp->date)."</td>";
+                    print dol_print_date($objp->date)."</td>";
                     print "<td align=\"right\">".price($objp->amount)."</td>\n";
                     print '<td align="right">'.$propalstatic->LibStatut($objp->statut,5).'</td>';
                     print "</tr>\n";
@@ -183,7 +183,7 @@ if ($_GET["id"] || $_GET["ref"])
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
         print "</table>";
         print '<br>';
@@ -192,7 +192,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-    dolibarr_print_error();
+    dol_print_error();
 }
 
 $db->close();
diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php
index 63c9e6697bf..4b122a7b6b4 100644
--- a/htdocs/product/stock/entrepot.class.php
+++ b/htdocs/product/stock/entrepot.class.php
@@ -83,7 +83,7 @@ class Entrepot extends CommonObject
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (datec, fk_user_author, label)";
 		$sql .= " VALUES (".$this->db->idate(mktime()).",".$user->id.",'".addslashes($this->libelle)."')";
 
-		dolibarr_syslog("Entrepot::create sql=".$sql);
+		dol_syslog("Entrepot::create sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -99,21 +99,21 @@ class Entrepot extends CommonObject
 				}
 				else
 				{
-					dolibarr_syslog("Entrepot::Create return -3");
+					dol_syslog("Entrepot::Create return -3");
 					$this->db->rollback();
 					return -3;
 				}
 			}
 			else {
 				$this->error="Failed to get insert id";
-				dolibarr_syslog("Entrepot::Create return -2");
+				dol_syslog("Entrepot::Create return -2");
 				return -2;
 			}
 		}
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Entrepot::Create Error ".$this->db->error());
+			dol_syslog("Entrepot::Create Error ".$this->db->error());
 			$this->db->rollback();
 			return -1;
 		}
@@ -154,8 +154,8 @@ class Entrepot extends CommonObject
 		else
 		{
 	  $this->error=$this->db->error()." sql=$sql";;
-	  dolibarr_syslog("Entrepot::Update return -1");
-	  dolibarr_syslog("Entrepot::Update ".$this->error);
+	  dol_syslog("Entrepot::Update return -1");
+	  dol_syslog("Entrepot::Update ".$this->error);
 	  return -1;
 		}
 	}
@@ -197,7 +197,7 @@ class Entrepot extends CommonObject
 	  	}
 	  	else
 	  	{
-	  		dolibarr_print_error($db);
+	  		dol_print_error($db);
 	  	}
 	  	$this->pays=$objp->libelle;
 	  }
@@ -256,7 +256,7 @@ class Entrepot extends CommonObject
 		}
 		else
 		{
-	  dolibarr_print_error($this->db);
+	  dol_print_error($this->db);
 		}
 	}
 
diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php
index fe72b4aa8ae..cf7b192dd4c 100644
--- a/htdocs/product/stock/fiche-valo.php
+++ b/htdocs/product/stock/fiche-valo.php
@@ -49,7 +49,7 @@ if ($_GET["id"])
 	$result = $entrepot->fetch($_GET["id"]);
 	if ($result < 0)
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	/*
@@ -84,7 +84,7 @@ if ($_GET["id"])
 	$head[$h][1] = $langs->trans("Info");
 	$h++;
 
-	dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse"));
+	dol_fiche_head($head, $hselected, $langs->trans("Warehouse"));
 
 	print '<table class="border" width="100%">';
 
diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php
index 8857e6a863c..334fe774441 100644
--- a/htdocs/product/stock/fiche.php
+++ b/htdocs/product/stock/fiche.php
@@ -196,7 +196,7 @@ else
 		$result = $entrepot->fetch($_GET["id"]);
 		if ($result < 0)
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		/*
@@ -237,7 +237,7 @@ else
 			$head[$h][1] = $langs->trans("Info");
 			$h++;
 
-			dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse"));
+			dol_fiche_head($head, $hselected, $langs->trans("Warehouse"));
 
 			print '<table class="border" width="100%">';
 
@@ -282,11 +282,11 @@ else
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 
 			print '<tr><td valign="top">'.$langs->trans("LastMovement").'</td><td colspan="3">';
-			print '<a href="mouvement.php?id='.$entrepot->id.'">'.dolibarr_print_date($row[0]).'</a>';
+			print '<a href="mouvement.php?id='.$entrepot->id.'">'.dol_print_date($row[0]).'</a>';
 			print "</td></tr>";
 
 			print "</table>";
@@ -373,7 +373,7 @@ else
 					}
 
 					$var=!$var;
-					//print '<td>'.dolibarr_print_date($objp->datem).'</td>';
+					//print '<td>'.dol_print_date($objp->datem).'</td>';
 					print "<tr $bc[$var]>";
 					print "<td><a href=\"../fiche.php?id=$objp->rowid\">";
 					print img_object($langs->trans("ShowProduct"),"product").' '.$objp->ref;
@@ -405,7 +405,7 @@ else
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 			print "</table>\n";
 		}
diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php
index 92203b4fbd3..8d16dd81057 100644
--- a/htdocs/product/stock/index.php
+++ b/htdocs/product/stock/index.php
@@ -89,7 +89,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 print '</td><td valign="top" width="70%" class="notopnoleft">';
@@ -113,7 +113,7 @@ if ($conf->categorie->enabled && !$user->rights->categorie->voir)
 $sql .= " ORDER BY datem DESC";
 $sql .= $db->plimit($max,0);
 
-dolibarr_syslog("Index:list stock movements sql=".$sql, LOG_DEBUG);
+dol_syslog("Index:list stock movements sql=".$sql, LOG_DEBUG);
 $resql = $db->query($sql) ;
 if ($resql)
 {
@@ -134,7 +134,7 @@ if ($resql)
 		$objp = $db->fetch_object($resql);
 		$var=!$var;
 		print "<tr $bc[$var]>";
-		print '<td>'.dolibarr_print_date($objp->datem,'dayhour').'</td>';
+		print '<td>'.dol_print_date($objp->datem,'dayhour').'</td>';
 		print "<td><a href=\"../fiche.php?id=$objp->rowid\">";
 		print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit;
 		print "</a></td>\n";
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index 16c85e63570..236118c3026 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -67,7 +67,7 @@ $head[$h][1] = $langs->trans("Info");
 $hselected=$h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse"));
+dol_fiche_head($head, $hselected, $langs->trans("Warehouse"));
 
 
 print '<table width="100%"><tr><td>';
diff --git a/htdocs/product/stock/liste.php b/htdocs/product/stock/liste.php
index 3290cb54d60..1ded8c4247b 100644
--- a/htdocs/product/stock/liste.php
+++ b/htdocs/product/stock/liste.php
@@ -103,7 +103,7 @@ if ($result)
 }
 else
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 3a749027d0f..57db6d3d8e6 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -77,7 +77,7 @@ if ($resql)
 		$result = $entrepot->fetch($_GET["id"]);
 		if ($result < 0)
 		{
-	  		dolibarr_print_error($db);
+	  		dol_print_error($db);
 		}
 	}
 
@@ -121,7 +121,7 @@ if ($resql)
 		$head[$h][1] = $langs->trans("Info");
 		$h++;
 
-		dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse"));
+		dol_fiche_head($head, $hselected, $langs->trans("Warehouse"));
 
 		print '<table class="border" width="100%">';
 
@@ -159,7 +159,7 @@ if ($resql)
 		$objp = $db->fetch_object($resql);
 		$var=!$var;
 		print "<tr $bc[$var]>";
-		print '<td>'.dolibarr_print_date($objp->datem,'dayhour').'</td>';
+		print '<td>'.dol_print_date($objp->datem,'dayhour').'</td>';
 		print "<td><a href=\"../fiche.php?id=$objp->rowid\">";
 		print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit;
 		print "</a></td>\n";
@@ -179,7 +179,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/product/stock/mouvementstock.class.php b/htdocs/product/stock/mouvementstock.class.php
index 79bd9eda19d..aeda63dba37 100644
--- a/htdocs/product/stock/mouvementstock.class.php
+++ b/htdocs/product/stock/mouvementstock.class.php
@@ -47,7 +47,7 @@ class MouvementStock
 		global $conf;
 
 		$error = 0;
-		dolibarr_syslog("MouvementStock::_create $user->id, $fk_product, $entrepot_id, qty=$qty, type=$type, $price");
+		dol_syslog("MouvementStock::_create $user->id, $fk_product, $entrepot_id, qty=$qty, type=$type, $price");
 
 		$this->db->begin();
 
@@ -58,14 +58,14 @@ class MouvementStock
 			$sql.= " VALUES (".$this->db->idate(gmmktime()).", ".$fk_product.", ".$entrepot_id.", ".$qty.", ".$type.", ".$user->id;
 			$sql.= ",'".price2num($price)."')";
 
-			dolibarr_syslog("MouvementStock::_create sql=".$sql, LOG_DEBUG);
+			dol_syslog("MouvementStock::_create sql=".$sql, LOG_DEBUG);
 			if ($resql = $this->db->query($sql))
 			{
 				$mvid = $this->db->last_insert_id($resql);
 			}
 			else
 			{
-				dolibarr_syslog("MouvementStock::_create ".$this->error);
+				dol_syslog("MouvementStock::_create ".$this->error);
 				$error = -1;
 			}
 
@@ -83,7 +83,7 @@ class MouvementStock
 				}
 				else
 				{
-					dolibarr_syslog("MouvementStock::_create echec update ".$this->error);
+					dol_syslog("MouvementStock::_create echec update ".$this->error);
 					$error = -2;
 				}
 			}
@@ -103,13 +103,13 @@ class MouvementStock
 					$sql.= " (".$qty.",".$entrepot_id.",".$fk_product.")";
 				}
 
-				dolibarr_syslog("MouvementStock::_create sql=".$sql, LOG_DEBUG);
+				dol_syslog("MouvementStock::_create sql=".$sql, LOG_DEBUG);
 				if ($this->db->query($sql))
 				{
 					$sql = "UPDATE ".MAIN_DB_PREFIX."product SET stock = stock + ".$qty;
 					$sql.= " WHERE rowid = ".$fk_product;
 
-					dolibarr_syslog("MouvementStock::_create sql=".$sql, LOG_DEBUG);
+					dol_syslog("MouvementStock::_create sql=".$sql, LOG_DEBUG);
 					if ($this->db->query($sql))
 					{
 
@@ -118,14 +118,14 @@ class MouvementStock
 					}
 					else
 					{
-						dolibarr_syslog("MouvementStock::_create ".$this->error, LOG_ERR);
+						dol_syslog("MouvementStock::_create ".$this->error, LOG_ERR);
 						$error = -4;
 					}
 
 				}
 				else
 				{
-					dolibarr_syslog("MouvementStock::_create ".$this->error, LOG_ERR);
+					dol_syslog("MouvementStock::_create ".$this->error, LOG_ERR);
 					$error = -3;
 				}
 			}
@@ -165,7 +165,7 @@ class MouvementStock
 		{
 			$this->db->rollback();
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("MouvementStock::_create ".$this->error);
+			dol_syslog("MouvementStock::_create ".$this->error);
 			return -2;
 		}
 	}
@@ -185,7 +185,7 @@ class MouvementStock
 		$sql.= " FROM ".MAIN_DB_PREFIX."product_association";
 		$sql.= " WHERE fk_product_pere = ".$idProduct;
 
-		dolibarr_syslog("MouvementStock::_createSubProduct sql=".$sql, LOG_DEBUG);
+		dol_syslog("MouvementStock::_createSubProduct sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -200,7 +200,7 @@ class MouvementStock
 		}
 		else
 		{
-			dolibarr_syslog("MouvementStock::_createSubProduct ".$this->error, LOG_ERR);
+			dol_syslog("MouvementStock::_createSubProduct ".$this->error, LOG_ERR);
 			$error = -2;
 		}
 
@@ -220,7 +220,7 @@ class MouvementStock
 	 */
 	function _createProductComposition($user, $fk_product, $entrepot_id, $qty, $type, $price=0)
 	{
-		dolibarr_syslog("MouvementStock::_createComposition $user->id, $fk_product, $entrepot_id, $qty, $type, $price");
+		dol_syslog("MouvementStock::_createComposition $user->id, $fk_product, $entrepot_id, $qty, $type, $price");
 		$products_compo = array();
 
 		$sql = "SELECT fk_product_composition, qte, etat_stock";
@@ -239,7 +239,7 @@ class MouvementStock
 		}
 		else
 		{
-			dolibarr_syslog("MouvementStock::_Create echec update ".$this->error);
+			dol_syslog("MouvementStock::_Create echec update ".$this->error);
 			return -1;
 		}
 
@@ -301,7 +301,7 @@ class MouvementStock
 	function CalculateEntrepotValoPmp($user, $entrepot_id, $valo_mouvement)
 	{
 		$error = 0;
-		dolibarr_syslog("MouvementStock::CalculateEntrepotValoPmp $user->id, $entrepot_id, $valo_mouvement");
+		dol_syslog("MouvementStock::CalculateEntrepotValoPmp $user->id, $entrepot_id, $valo_mouvement");
 
 		if ( $valo_mouvement <> 0 )
 		{
@@ -324,7 +324,7 @@ class MouvementStock
 				else
 				{
 					$error = -26;
-					dolibarr_syslog("MouvementStock::CalculateEntrepotValoPmp ERRORSQL[$error]");
+					dol_syslog("MouvementStock::CalculateEntrepotValoPmp ERRORSQL[$error]");
 				}
 			}
 
@@ -356,7 +356,7 @@ class MouvementStock
 				else
 				{
 					$error = -27;
-					dolibarr_syslog("MouvementStock::CalculateEntrepotValoPmp ERRORSQL[$error]");
+					dol_syslog("MouvementStock::CalculateEntrepotValoPmp ERRORSQL[$error]");
 				}
 			}
 
@@ -373,7 +373,7 @@ class MouvementStock
 				else
 				{
 					$error = -28;
-					dolibarr_syslog("MouvementStock::CalculateEntrepotValoPmp ERRORSQL[$error]");
+					dol_syslog("MouvementStock::CalculateEntrepotValoPmp ERRORSQL[$error]");
 				}
 			}
 
@@ -383,7 +383,7 @@ class MouvementStock
 			}
 			else
 			{
-				dolibarr_syslog("MouvementStock::CalculateEntrepotValoPmp RETURN IN ERROR[$error]");
+				dol_syslog("MouvementStock::CalculateEntrepotValoPmp RETURN IN ERROR[$error]");
 				return $error;
 			}
 		}
@@ -407,7 +407,7 @@ class MouvementStock
 	function CalculateValoPmp($mvid, $fk_product, $qty, $price=0, &$value_ope)
 	{
 		$error = 0;
-		dolibarr_syslog("MouvementStock::CalculateValoPmp $mvid, $fk_product, $qty, $price");
+		dol_syslog("MouvementStock::CalculateValoPmp $mvid, $fk_product, $qty, $price");
 
 		if ( $qty <> 0 )
 		{
@@ -432,7 +432,7 @@ class MouvementStock
 				}
 				else
 				{
-					dolibarr_syslog("MouvementStock::CalculateValoPmp ERRORSQL[1] ".$this->error);
+					dol_syslog("MouvementStock::CalculateValoPmp ERRORSQL[1] ".$this->error);
 					$error = -16;
 				}
 			}
@@ -478,7 +478,7 @@ class MouvementStock
 				}
 				else
 				{
-					dolibarr_syslog("MouvementStock::CalculateValoPmp ERRORSQL[2] insert ".$this->error);
+					dol_syslog("MouvementStock::CalculateValoPmp ERRORSQL[2] insert ".$this->error);
 					$error = -17;
 				}
 			}
@@ -489,7 +489,7 @@ class MouvementStock
 			}
 			else
 			{
-				dolibarr_syslog("MouvementStock::CalculateValoPmp ERROR : $error");
+				dol_syslog("MouvementStock::CalculateValoPmp ERROR : $error");
 				return -21;
 			}
 		}
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index f0e51c99c1c..6eb93067eaa 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -122,7 +122,7 @@ if ($_GET["id"] || $_GET["ref"])
 	{
 		$head=product_prepare_head($product, $user);
 		$titre=$langs->trans("CardProduct".$product->type);
-		dolibarr_fiche_head($head, 'stock', $titre);
+		dol_fiche_head($head, 'stock', $titre);
 
 		$html = new Form($db);
 
@@ -171,13 +171,13 @@ if ($_GET["id"] || $_GET["ref"])
 			if ($conf->commande->enabled)
 			{
 				$result=$product->load_stats_commande(0,'1,2');
-				if ($result < 0) dolibarr_print_error($db,$product->error);
+				if ($result < 0) dol_print_error($db,$product->error);
 				$stock_commande_client=$product->stats_commande['qty'];
 			}
 			if ($conf->fournisseur->enabled)
 			{
 				$result=$product->load_stats_commande_fournisseur(0,'3');
-				if ($result < 0) dolibarr_print_error($db,$product->error);
+				if ($result < 0) dol_print_error($db,$product->error);
 				$stock_commande_fournisseur=$product->stats_commande_fournisseur['qty'];
 			}
 
@@ -207,7 +207,7 @@ if ($_GET["id"] || $_GET["ref"])
 				if ($found) print '<br>'; else $found=1;
 				print $langs->trans("CustomersOrdersRunning").': '.($stock_commande_client+$stock_sending_client);
 				$result=$product->load_stats_commande(0,'0');
-				if ($result < 0) dolibarr_print_error($db,$product->error);
+				if ($result < 0) dol_print_error($db,$product->error);
 				print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')';
 				//print '<br>';
 				//print $langs->trans("CustomersSendingRunning").': '.$stock_sending_client;
@@ -219,7 +219,7 @@ if ($_GET["id"] || $_GET["ref"])
 				if ($found) print '<br>'; else $found=1;
 				print $langs->trans("SuppliersOrdersRunning").': '.$stock_commande_fournisseur;
 				$result=$product->load_stats_commande_fournisseur(0,'0,1,2');
-				if ($result < 0) dolibarr_print_error($db,$product->error);
+				if ($result < 0) dol_print_error($db,$product->error);
 				print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')';
 			}
 			print '</td></tr>';
@@ -310,7 +310,7 @@ if ($_GET["id"] || $_GET["ref"])
 }
 else
 {
-	dolibarr_print_error();
+	dol_print_error();
 }
 
 
diff --git a/htdocs/product/stock/user.php b/htdocs/product/stock/user.php
index 07cc50dc355..06553fe5264 100644
--- a/htdocs/product/stock/user.php
+++ b/htdocs/product/stock/user.php
@@ -66,7 +66,7 @@ $form=new Form($db);
       $result = $entrepot->fetch($_GET["id"]);
       if ($result < 0)
         {
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
         }
       
       /*
@@ -101,7 +101,7 @@ $form=new Form($db);
 	  $head[$h][1] = $langs->trans("Info");
 	  $h++;
 
-	  dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
+	  dol_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
 	  
 	  print '<table class="border" width="100%">';
 	  
@@ -190,7 +190,7 @@ $form=new Form($db);
             }
 	  else
             {
-	      dolibarr_print_error($db);
+	      dol_print_error($db);
             }
 	  print "</table>\n";
         }
diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php
index e29b2219e4f..aac41622852 100644
--- a/htdocs/product/stock/valo.php
+++ b/htdocs/product/stock/valo.php
@@ -137,7 +137,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 71d1e64f5dd..2f925d472bd 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -136,7 +136,7 @@ $html = new Form($db);
 
 $head=product_prepare_head($product, $user);
 $titre=$langs->trans("CardProduct".$product->type);
-dolibarr_fiche_head($head, 'translation', $titre);
+dol_fiche_head($head, 'translation', $titre);
 
 print '<table class="border" width="100%">';
 
diff --git a/htdocs/project.class.php b/htdocs/project.class.php
index c9db0aa62b0..b30c1013ef2 100644
--- a/htdocs/project.class.php
+++ b/htdocs/project.class.php
@@ -66,7 +66,7 @@ class Project extends CommonObject
 		if (! trim($this->ref))
 		{
 			$this->error='ErrorFieldsRequired';
-			dolibarr_syslog("Project::Create error -1 ref null");
+			dol_syslog("Project::Create error -1 ref null");
 			return -1;
 		}
 
@@ -77,7 +77,7 @@ class Project extends CommonObject
 		$sql.= " ".($this->user_resp_id>0?$this->user_resp_id:'null').",";
 		$sql.= " ".$this->db->idate(mktime()).", 0)";
 
-		dolibarr_syslog("Project::create sql=".$sql,LOG_DEBUG);
+		dol_syslog("Project::create sql=".$sql,LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -86,7 +86,7 @@ class Project extends CommonObject
 		}
 		else
 		{
-			dolibarr_syslog("Project::Create error -2");
+			dol_syslog("Project::Create error -2");
 			$this->error=$this->db->error();
 			$result = -2;
 		}
@@ -106,20 +106,20 @@ class Project extends CommonObject
 			$sql.= ", fk_user_resp = ".$this->user_resp_id;
 			$sql.= " WHERE rowid = ".$this->id;
 
-			dolibarr_syslog("Project::update sql=".$sql,LOG_DEBUG);
+			dol_syslog("Project::update sql=".$sql,LOG_DEBUG);
 			if ($this->db->query($sql) )
 			{
 				$result = 0;
 			}
 			else
 			{
-				dolibarr_syslog($this->db->error());
+				dol_syslog($this->db->error());
 				$result = -2;
 			}
 		}
 		else
 		{
-			dolibarr_syslog("Project::Update ref null");
+			dol_syslog("Project::Update ref null");
 			$result = -1;
 		}
 
@@ -140,7 +140,7 @@ class Project extends CommonObject
 		if ($ref) $sql.= " WHERE ref='".$ref."'";
 		else $sql.= " WHERE rowid=".$id;
 
-		dolibarr_syslog("Project::fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("Project::fetch sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -234,7 +234,7 @@ class Project extends CommonObject
 		if ($type == 'contract')         $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."contrat WHERE fk_projet=".$this->id;
 		if (! $sql) return -1;
 
-		dolibarr_syslog("Project::get_element_list sql=".$sql);
+		dol_syslog("Project::get_element_list sql=".$sql);
 		$result=$this->db->query($sql);
 		if ($result)
 		{
@@ -258,7 +258,7 @@ class Project extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -271,7 +271,7 @@ class Project extends CommonObject
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet";
 		$sql.= " WHERE rowid=".$this->id;
 
-		dolibarr_syslog("Project::delete sql=".$sql, LOG_DEBUG);
+		dol_syslog("Project::delete sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -280,7 +280,7 @@ class Project extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("Project::delete ".$this->error, LOG_ERR);
+			dol_syslog("Project::delete ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -305,7 +305,7 @@ class Project extends CommonObject
 			$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (fk_projet, title, fk_user_creat, fk_task_parent, duration_effective)";
 			$sql.= " VALUES (".$this->id.",'".addslashes($title)."', ".$user->id.",".($parent>0?$parent:'0').", 0)";
 
-			dolibarr_syslog("Project::CreateTask sql=".$sql, LOG_DEBUG);
+			dol_syslog("Project::CreateTask sql=".$sql, LOG_DEBUG);
 			if ($this->db->query($sql))
 			{
 				$task_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task");
@@ -314,7 +314,7 @@ class Project extends CommonObject
 			else
 			{
 				$this->error=$this->db->lasterror();
-				dolibarr_syslog("Project::CreateTask error -1 ".$this->error, LOG_ERR);
+				dol_syslog("Project::CreateTask error -1 ".$this->error, LOG_ERR);
 				$result = -1;
 			}
 
@@ -325,7 +325,7 @@ class Project extends CommonObject
 					$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_actors (fk_projet_task, fk_user)";
 					$sql.= " VALUES (".$task_id.",".($id_resp>0?$id_resp:'null').")";
 
-					dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG);
+					dol_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG);
 					if ($this->db->query($sql) )
 					{
 						$this->db->commit();
@@ -334,7 +334,7 @@ class Project extends CommonObject
 					else
 					{
 						$this->error=$this->db->lasterror();
-						dolibarr_syslog("Project::CreateTask error -3 ".$this->error,LOG_ERR);
+						dol_syslog("Project::CreateTask error -3 ".$this->error,LOG_ERR);
 						$this->db->rollback();
 						return -3;
 					}
@@ -347,14 +347,14 @@ class Project extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR);
+				dol_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR);
 				$this->db->rollback();
 				return -2;
 			}
 		}
 		else
 		{
-			dolibarr_syslog("Project::CreateTask error -1 ref null");
+			dol_syslog("Project::CreateTask error -1 ref null");
 			$result = -1;
 		}
 
@@ -375,7 +375,7 @@ class Project extends CommonObject
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_time (fk_task, task_date, task_duration, fk_user)";
 		$sql .= " VALUES (".$task.",'".$this->db->idate($date)."',".$time.", ".$user->id.")";
 
-		dolibarr_syslog("Project::TaskAddTime sql=".$sql, LOG_DEBUG);
+		dol_syslog("Project::TaskAddTime sql=".$sql, LOG_DEBUG);
 		if ($this->db->query($sql) )
 		{
 			$task_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task");
@@ -383,7 +383,7 @@ class Project extends CommonObject
 		}
 		else
 		{
-			dolibarr_syslog("Project::TaskAddTime error -2",LOG_ERR);
+			dol_syslog("Project::TaskAddTime error -2",LOG_ERR);
 			$this->error=$this->db->error();
 			$result = -2;
 		}
@@ -394,14 +394,14 @@ class Project extends CommonObject
 			$sql .= " SET duration_effective = duration_effective + '".price2num($time)."'";
 			$sql .= " WHERE rowid = '".$task."';";
 
-			dolibarr_syslog("Project::TaskAddTime sql=".$sql, LOG_DEBUG);
+			dol_syslog("Project::TaskAddTime sql=".$sql, LOG_DEBUG);
 			if ($this->db->query($sql) )
 			{
 				$result = 0;
 			}
 			else
 			{
-				dolibarr_syslog("Project::TaskAddTime error -3",LOG_ERR);
+				dol_syslog("Project::TaskAddTime error -3",LOG_ERR);
 				$this->error=$this->db->error();
 				$result = -2;
 			}
@@ -440,7 +440,7 @@ class Project extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 		return $tasksrole;
@@ -500,7 +500,7 @@ class Project extends CommonObject
 			$sql.= " ORDER BY p.ref, t.title";
 		}
 
-		dolibarr_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
+		dol_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -524,7 +524,7 @@ class Project extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 		return $tasks;
diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php
index 91819876833..2ab4bd2cafa 100644
--- a/htdocs/projet/activity/index.php
+++ b/htdocs/projet/activity/index.php
@@ -106,7 +106,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print "</table>";
 
@@ -150,7 +150,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print '<tr class="liste_total">';
 print '<td>'.$langs->trans('Total').'</td>';
@@ -198,7 +198,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print '<tr class="liste_total">';
 print '<td>'.$langs->trans('Total').'</td>';
@@ -247,7 +247,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print '<tr class="liste_total">';
 print '<td>'.$langs->trans('Total').'</td>';
@@ -258,7 +258,7 @@ print "</table><br />";
 /* Affichage de la liste des projets du mois */
 print '<table class="noborder" width="100%">';
 print '<tr class="liste_titre">';
-print '<td>'.$langs->trans("ActivityOnProjectThisMonth").': '.dolibarr_print_date($now,"%B %Y").'</td>';
+print '<td>'.$langs->trans("ActivityOnProjectThisMonth").': '.dol_print_date($now,"%B %Y").'</td>';
 print '<td align="right">'.$langs->trans("Time").'</td>';
 print "</tr>\n";
 
@@ -292,7 +292,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print "</table>";
 
@@ -333,7 +333,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print "</table>";
 
diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php
index dcfb970c495..b32775638b3 100644
--- a/htdocs/projet/activity/list.php
+++ b/htdocs/projet/activity/list.php
@@ -77,7 +77,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
 				$project = new Project($db);
 				$result = $project->fetch($task->fk_projet);
 
-		  		$date = dolibarr_mktime(12,0,0,$_POST["$id"."month"],$_POST["$id"."day"],$_POST["$id"."year"]);
+		  		$date = dol_mktime(12,0,0,$_POST["$id"."month"],$_POST["$id"."day"],$_POST["$id"."year"]);
 		  		$project->TaskAddTime($user, $id , $post, $date);
 		  	}
 		  	else
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 53f9a2991fd..6387297f88b 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -71,7 +71,7 @@ if ($projet->user_resp_id > 0)
 }
 
 $head=project_prepare_head($projet);
-dolibarr_fiche_head($head, 'element', $langs->trans("Project"));
+dol_fiche_head($head, 'element', $langs->trans("Project"));
 
 
 print '<table class="border" width="100%">';
@@ -169,7 +169,7 @@ foreach ($listofreferent as $key => $value)
 		        $date=$element->date;
 				if (empty($date)) $date=$element->datep;
 				if (empty($date)) $date=$element->date_contrat;
-				print '<td>'.dolibarr_print_date($date,'day').'</td>';
+				print '<td>'.dol_print_date($date,'day').'</td>';
 		        print '<td align="right">'.(isset($element->total_ht)?price($element->total_ht):'&nbsp;').'</td>';
 		        print '<td align="right">'.$element->getLibStatut(5).'</td>';
 		        print '</tr>';
diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php
index 12076d3d074..61493d2d3b5 100644
--- a/htdocs/projet/fiche.php
+++ b/htdocs/projet/fiche.php
@@ -196,7 +196,7 @@ else
 	if ($projet->user_resp_id > 0) $result=$projet->fetch_user($projet->user_resp_id);
 
 	$head=project_prepare_head($projet);
-	dolibarr_fiche_head($head, 'project', $langs->trans("Project"));
+	dol_fiche_head($head, 'project', $langs->trans("Project"));
 
 	if ($_GET["action"] == 'delete')
 	{
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 159a99241a5..bbec383fa33 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -95,7 +95,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print "</table>";
 
@@ -145,7 +145,7 @@ if ( $resql )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 print "</table>";
 
diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php
index 1826bfa0b85..06bbd4fcbb2 100644
--- a/htdocs/projet/liste.php
+++ b/htdocs/projet/liste.php
@@ -149,7 +149,7 @@ if ($resql)
 
 		// Title
 		print '<td>';
-		print dolibarr_trunc($objp->title,24);
+		print dol_trunc($objp->title,24);
 		print '</td>';
 
 		// Company
@@ -184,7 +184,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 print "</table>";
diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php
index b604b2994f0..da145d27fdb 100644
--- a/htdocs/projet/tasks/fiche.php
+++ b/htdocs/projet/tasks/fiche.php
@@ -103,7 +103,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
 
 					$id = ereg_replace("task","",$key);
 
-					$date = dolibarr_mktime(12,0,0,$_POST["$id"."month"],$_POST["$id"."day"],$_POST["$id"."year"]);
+					$date = dol_mktime(12,0,0,$_POST["$id"."month"],$_POST["$id"."day"],$_POST["$id"."year"]);
 					$project->TaskAddTime($user, $id , $post, $date);
 				}
 			}
@@ -185,7 +185,7 @@ else
 	if ($_REQUEST["mode"]=='mine') $tab='mytasks';
 
 	$head=project_prepare_head($projet);
-	dolibarr_fiche_head($head, $tab, $langs->trans("Project"));
+	dol_fiche_head($head, $tab, $langs->trans("Project"));
 
 	$param=($_REQUEST["mode"]=='mine'?'&mode=mine':'');
 
diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php
index ca7d725cb1c..67a453630ae 100644
--- a/htdocs/projet/tasks/index.php
+++ b/htdocs/projet/tasks/index.php
@@ -77,7 +77,7 @@ $head[$h][1] = $title;
 $head[$h][2] = 'tasks';
 $h++;
 
-dolibarr_fiche_head($head, 'tasks', $title);
+dol_fiche_head($head, 'tasks', $title);
 
 $projet = new Project($db);
 $tasksarray=$projet->getTasksArray($_GET["mode"]=='mine'?$user:0);
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 21fbea9e979..cde131b79b1 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -86,7 +86,7 @@ if ($_GET["id"] > 0)
 
 		$head=task_prepare_head($task);
 
-		dolibarr_fiche_head($head, 'tasks', $langs->trans("Task"));
+		dol_fiche_head($head, 'tasks', $langs->trans("Task"));
 
 		if ($mesg) print $mesg.'<br>';
 
@@ -138,7 +138,7 @@ if ($_GET["id"] > 0)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print '</table></form>';
@@ -172,7 +172,7 @@ if ($_GET["id"] > 0)
   		    print "<tr ".$bc[$var].">";
 		    
   		    // Date
-  		    print '<td>'.dolibarr_print_date($db->jdate($task_time->task_date),'day').' '.dolibarr_print_date($db->jdate($task_time->task_date),'%A').'</td>';
+  		    print '<td>'.dol_print_date($db->jdate($task_time->task_date),'day').' '.dol_print_date($db->jdate($task_time->task_date),'%A').'</td>';
 
 		    // Time spent
 		    $heure = intval($task_time->task_duration);
diff --git a/htdocs/projet/tasks/who.php b/htdocs/projet/tasks/who.php
index 9ec31a82e18..5696dd89bd3 100644
--- a/htdocs/projet/tasks/who.php
+++ b/htdocs/projet/tasks/who.php
@@ -63,7 +63,7 @@ if ($_GET["id"] > 0)
 
 		$head=task_prepare_head($task);
 
-		dolibarr_fiche_head($head, 'who', $langs->trans("Task"));
+		dol_fiche_head($head, 'who', $langs->trans("Task"));
 
 		if ($mesg) print $mesg.'<br>';
 
@@ -112,7 +112,7 @@ if ($_GET["id"] > 0)
 		}
 		else
 		{
-			dolibarr_print_error($db);
+			dol_print_error($db);
 		}
 
 		print '</table></form>';
diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php
index 68c641c3a3f..4578eb2f72c 100644
--- a/htdocs/propal.class.php
+++ b/htdocs/propal.class.php
@@ -139,7 +139,7 @@ class Propal extends CommonObject
 
 		if (! $qty) $qty = 1;
 
-		dolibarr_syslog("Propal::add_product $idproduct, $qty, $remise_percent");
+		dol_syslog("Propal::add_product $idproduct, $qty, $remise_percent");
 		if ($idproduct > 0)
 		{
 			$prod=new Product($this->db);
@@ -267,7 +267,7 @@ class Propal extends CommonObject
 	{
 		global $conf;
 
-		dolibarr_syslog("Propal::Addline propalid=$propalid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits");
+		dol_syslog("Propal::Addline propalid=$propalid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits");
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
 
 		if ($this->statut == 0)
@@ -357,7 +357,7 @@ class Propal extends CommonObject
 				else
 				{
 					$this->error=$this->db->error();
-					dolibarr_syslog("Error sql=$sql, error=".$this->error,LOG_ERR);
+					dol_syslog("Error sql=$sql, error=".$this->error,LOG_ERR);
 					$this->db->rollback();
 					return -1;
 				}
@@ -388,7 +388,7 @@ class Propal extends CommonObject
 	{
 		global $conf;
 
-		dolibarr_syslog("Propal::UpdateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits");
+		dol_syslog("Propal::UpdateLine $rowid, $pu, $qty, $remise_percent, $txtva, $desc, $price_base_type, $info_bits");
 		include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
 
 		if ($this->statut == 0)
@@ -455,13 +455,13 @@ class Propal extends CommonObject
 			{
 				$this->error=$this->db->error();
 				$this->db->rollback();
-				dolibarr_syslog("Propal::UpdateLine Erreur sql=$sql, error=".$this->error);
+				dol_syslog("Propal::UpdateLine Erreur sql=$sql, error=".$this->error);
 				return -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog("Propal::UpdateLigne Erreur -2 Propal en mode incompatible pour cette action");
+			dol_syslog("Propal::UpdateLigne Erreur -2 Propal en mode incompatible pour cette action");
 			return -2;
 		}
 	}
@@ -536,7 +536,7 @@ class Propal extends CommonObject
 		$sql.= " ".($this->date_livraison!=''?$this->db->idate($this->date_livraison):'null');
 		$sql.= ")";
 
-		dolibarr_syslog("Propal::create sql=".$sql, LOG_DEBUG);
+		dol_syslog("Propal::create sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -563,7 +563,7 @@ class Propal extends CommonObject
 						if ($resql < 0)
 						{
 							$this->error=$this->db->error;
-							dolibarr_print_error($this->db);
+							dol_print_error($this->db);
 							break;
 						}
 				}
@@ -596,13 +596,13 @@ class Propal extends CommonObject
 						// Fin appel triggers
 
 						$this->db->commit();
-						dolibarr_syslog("Propal::ass::Create done id=".$this->id);
+						dol_syslog("Propal::ass::Create done id=".$this->id);
 						return $this->id;
 					}
 					else
 					{
 						$this->error=$this->db->error();
-						dolibarr_syslog("Propal::Create -2 ".$this->error);
+						dol_syslog("Propal::Create -2 ".$this->error);
 						$this->db->rollback();
 						return -2;
 					}
@@ -612,13 +612,13 @@ class Propal extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Propal::Create -1 ".$this->error);
+			dol_syslog("Propal::Create -1 ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
 
 		$this->db->commit();
-		dolibarr_syslog("Propal::Create done id=".$this->id);
+		dol_syslog("Propal::Create done id=".$this->id);
 		return $this->id;
 	}
 
@@ -724,7 +724,7 @@ class Propal extends CommonObject
 		if ($ref) $sql.= " AND p.ref='".$ref."'";
 		else $sql.= " AND p.rowid=".$rowid;
 
-		dolibarr_syslog("Propal::fecth sql=".$sql, LOG_DEBUG);
+		dol_syslog("Propal::fecth sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -822,7 +822,7 @@ class Propal extends CommonObject
 						$ligne->ref              = $objp->ref;
 
 						$this->lignes[$i]        = $ligne;
-						//dolibarr_syslog("1 ".$ligne->fk_product);
+						//dol_syslog("1 ".$ligne->fk_product);
 						//print "xx $i ".$this->lignes[$i]->fk_product;
 						$i++;
 					}
@@ -831,7 +831,7 @@ class Propal extends CommonObject
 				else
 				{
 					$this->error=$this->db->error();
-					dolibarr_syslog("Propal::Fetch Error ".$this->error, LOG_ERR);
+					dol_syslog("Propal::Fetch Error ".$this->error, LOG_ERR);
 					return -1;
 				}
 
@@ -844,7 +844,7 @@ class Propal extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("Propal::Fetch Error ".$this->error, LOG_ERR);
+			dol_syslog("Propal::Fetch Error ".$this->error, LOG_ERR);
 			return -1;
 		}
 	}
@@ -909,7 +909,7 @@ class Propal extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Propal::set_echeance Erreur SQL");
+				dol_syslog("Propal::set_echeance Erreur SQL");
 				return -1;
 			}
 		}
@@ -937,7 +937,7 @@ class Propal extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Propal::set_date_livraison Erreur SQL");
+				dol_syslog("Propal::set_date_livraison Erreur SQL");
 				return -1;
 			}
 		}
@@ -964,7 +964,7 @@ class Propal extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Propal::set_adresse_livraison Erreur SQL");
+				dol_syslog("Propal::set_adresse_livraison Erreur SQL");
 				return -1;
 			}
 		}
@@ -980,7 +980,7 @@ class Propal extends CommonObject
 	{
 		if ($user->rights->propale->creer)
 		{
-			dolibarr_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
+			dol_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
 
 			$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET ref_client = '.(empty($ref_client) ? 'NULL' : '\''.addslashes($ref_client).'\'');
 			$sql.= ' WHERE rowid = '.$this->id;
@@ -992,7 +992,7 @@ class Propal extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog('Propale::set_ref_client Erreur '.$this->error.' - '.$sql);
+				dol_syslog('Propale::set_ref_client Erreur '.$this->error.' - '.$sql);
 				return -2;
 			}
 		}
@@ -1028,7 +1028,7 @@ class Propal extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Propal::set_remise_percent Error sql=$sql");
+				dol_syslog("Propal::set_remise_percent Error sql=$sql");
 				return -1;
 			}
 		}
@@ -1062,7 +1062,7 @@ class Propal extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Propal::set_remise_absolue Error sql=$sql");
+				dol_syslog("Propal::set_remise_absolue Error sql=$sql");
 				return -1;
 			}
 		}
@@ -1159,7 +1159,7 @@ class Propal extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1305,7 +1305,7 @@ class Propal extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1384,12 +1384,12 @@ class Propal extends CommonObject
 
 		//$sql = "SELECT fk_facture FROM ".MAIN_DB_PREFIX."fa_pr as fp";
 		//$sql .= " WHERE fk_propal = " . $id;
-		dolibarr_syslog("Propal::InvoiceArrayList sql=".$sql);
+		dol_syslog("Propal::InvoiceArrayList sql=".$sql);
 		$resql=$this->db->query($sql);
 		$resql2=null;
 		if ($resql)
 		{
-			dolibarr_syslog("Propal::InvoiceArrayList sql2=".$sql2);
+			dol_syslog("Propal::InvoiceArrayList sql2=".$sql2);
 			$resql2=$this->db->query($sql2);
 		}
 		if ($resql2)
@@ -1482,7 +1482,7 @@ class Propal extends CommonObject
 					}
 				}
 
-				dolibarr_syslog("Suppression de la proposition $this->id par $user->id", LOG_DEBUG);
+				dol_syslog("Suppression de la proposition $this->id par $user->id", LOG_DEBUG);
 				$this->db->commit();
 				return 1;
 			}
@@ -1507,7 +1507,7 @@ class Propal extends CommonObject
 	 */
 	function cond_reglement($cond_reglement_id)
 	{
-		dolibarr_syslog('Propale::cond_reglement('.$cond_reglement_id.')');
+		dol_syslog('Propale::cond_reglement('.$cond_reglement_id.')');
 		if ($this->statut >= 0)
 		{
 			$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal';
@@ -1520,14 +1520,14 @@ class Propal extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog('Propale::cond_reglement Erreur '.$sql.' - '.$this->db->error());
+				dol_syslog('Propale::cond_reglement Erreur '.$sql.' - '.$this->db->error());
 				$this->error=$this->db->error();
 				return -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('Propale::cond_reglement, etat propale incompatible');
+			dol_syslog('Propale::cond_reglement, etat propale incompatible');
 			$this->error='Etat propale incompatible '.$this->statut;
 			return -2;
 		}
@@ -1541,7 +1541,7 @@ class Propal extends CommonObject
 	 */
 	function mode_reglement($mode_reglement_id)
 	{
-		dolibarr_syslog('Propale::mode_reglement('.$mode_reglement_id.')');
+		dol_syslog('Propale::mode_reglement('.$mode_reglement_id.')');
 		if ($this->statut >= 0)
 		{
 			$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal';
@@ -1554,14 +1554,14 @@ class Propal extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog('Propale::mode_reglement Erreur '.$sql.' - '.$this->db->error());
+				dol_syslog('Propale::mode_reglement Erreur '.$sql.' - '.$this->db->error());
 				$this->error=$this->db->error();
 				return -1;
 			}
 		}
 		else
 		{
-			dolibarr_syslog('Propale::mode_reglement, etat propale incompatible');
+			dol_syslog('Propale::mode_reglement, etat propale incompatible');
 			$this->error='Etat facture incompatible '.$this->statut;
 			return -2;
 		}
@@ -1619,7 +1619,7 @@ class Propal extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1849,7 +1849,7 @@ class Propal extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			$this->error=$this->db->error();
 			return -1;
 		}
@@ -1908,7 +1908,7 @@ class Propal extends CommonObject
 			}
 			else
 			{
-				dolibarr_print_error($db,"Propale::getNextNumRef ".$obj->error);
+				dol_print_error($db,"Propale::getNextNumRef ".$obj->error);
 				return "";
 			}
 		}
@@ -2059,7 +2059,7 @@ class PropaleLigne
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -2069,7 +2069,7 @@ class PropaleLigne
 	 */
 	function insert()
 	{
-		dolibarr_syslog("PropaleLigne::insert rang=".$this->rang);
+		dol_syslog("PropaleLigne::insert rang=".$this->rang);
 		$this->db->begin();
 
 		// Nettoyage parameteres
@@ -2091,7 +2091,7 @@ class PropaleLigne
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				$this->db->rollback();
 				return -1;
 			}
@@ -2124,7 +2124,7 @@ class PropaleLigne
 		$sql.= ' '.$rangtouse;
 		$sql.= ')';
 
-		dolibarr_syslog("PropaleLigne::insert sql=$sql");
+		dol_syslog("PropaleLigne::insert sql=$sql");
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -2136,7 +2136,7 @@ class PropaleLigne
 		else
 		{
 			$this->error=$this->db->error()." sql=".$sql;
-			dolibarr_syslog("PropaleLigne::insert Error ".$this->error);
+			dol_syslog("PropaleLigne::insert Error ".$this->error);
 			$this->db->rollback();
 			return -1;
 		}
@@ -2171,7 +2171,7 @@ class PropaleLigne
 		$sql.= ",marque_tx='".$this->marque_tx."'";
 		$sql.= " WHERE rowid = ".$this->rowid;
 
-		dolibarr_syslog("PropaleLigne::update sql=$sql");
+		dol_syslog("PropaleLigne::update sql=$sql");
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -2182,7 +2182,7 @@ class PropaleLigne
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("PropaleLigne::update Error ".$this->error);
+			dol_syslog("PropaleLigne::update Error ".$this->error);
 			$this->db->rollback();
 			return -2;
 		}
@@ -2204,7 +2204,7 @@ class PropaleLigne
 		$sql.= ",total_ttc=".price2num($this->total_ttc,'MT')."";
 		$sql.= " WHERE rowid = ".$this->rowid;
 
-		dolibarr_syslog("PropaleLigne::update_total sql=$sql");
+		dol_syslog("PropaleLigne::update_total sql=$sql");
 
 		$resql=$this->db->query($sql);
 		if ($resql)
@@ -2215,7 +2215,7 @@ class PropaleLigne
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("PropaleLigne::update_total Error ".$this->error);
+			dol_syslog("PropaleLigne::update_total Error ".$this->error);
 			$this->db->rollback();
 			return -2;
 		}
diff --git a/htdocs/prospect.class.php b/htdocs/prospect.class.php
index 2247d8f1e03..f8001997ffa 100644
--- a/htdocs/prospect.class.php
+++ b/htdocs/prospect.class.php
@@ -87,7 +87,7 @@ class Prospect extends Societe
         }
         else 
         {
-            dolibarr_print_error($this->db);
+            dol_print_error($this->db);
             $this->error=$this->db->error();
             return -1;
         }
diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php
index c77eee5b879..eae1ddf719c 100644
--- a/htdocs/public/donations/donateurs_code.php
+++ b/htdocs/public/donations/donateurs_code.php
@@ -63,7 +63,7 @@ if ( $db->query( $sql) )
 	    {
 	      print "<td>Anonyme Anonyme</td>\n";
 	    }
-	  print "<td>".dolibarr_print_date($objp->datedon)."</td>\n";
+	  print "<td>".dol_print_date($objp->datedon)."</td>\n";
 	  print '<td align="right">'.number_format($objp->amount,2,'.',' ').' '.$langs->trans("Currency".$conf->monnaie).'</td>';
 	  print "</tr>";
 	  $i++;
@@ -78,7 +78,7 @@ if ( $db->query( $sql) )
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php
index ddfea193fbe..b4fd45fdb4b 100644
--- a/htdocs/public/members/public_list.php
+++ b/htdocs/public/members/public_list.php
@@ -129,7 +129,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 
diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php
index 3a8267f55f3..543fbb57901 100644
--- a/htdocs/public/paybox/newpayment.php
+++ b/htdocs/public/paybox/newpayment.php
@@ -52,18 +52,18 @@ if (empty($_REQUEST["currency"])) $currency=$conf->global->MAIN_MONNAIE;
 else $currency=$_REQUEST["currency"];
 if (empty($_REQUEST["amount"]))
 {
-	dolibarr_print_error('','ErrorBadParameters');
+	dol_print_error('','ErrorBadParameters');
 	exit;
 }
 $amount=$_REQUEST["amount"];
 if (is_numeric($amount) && empty($_REQUEST["tag"]))
 {
-	dolibarr_print_error('','ErrorBadParameters');
+	dol_print_error('','ErrorBadParameters');
 	exit;
 }
 if (! is_numeric($amount) && empty($_REQUEST["ref"]))
 {
-	dolibarr_print_error('','ErrorBadParameters');
+	dol_print_error('','ErrorBadParameters');
 	exit;
 }
 
@@ -353,7 +353,7 @@ if ($_REQUEST["amount"] == 'contractline')
 		$amount=$pu_ttc;
 		if (empty($amount))
 		{
-			dolibarr_print_error('','ErrorNoPriceDefinedForThisProduct');
+			dol_print_error('','ErrorNoPriceDefinedForThisProduct');
 			exit;
 		}
 	}
@@ -385,13 +385,13 @@ if ($_REQUEST["amount"] == 'contractline')
 	if ($contractline->description) $text.='<br>'.dol_htmlentitiesbr($contractline->description);
 	//if ($contractline->date_fin_validite) {
 	//	$text.='<br>'.$langs->trans("DateEndPlanned").': ';
-	//	$text.=dolibarr_print_date($contractline->date_fin_validite);
+	//	$text.=dol_print_date($contractline->date_fin_validite);
 	//}
 	if ($contractline->date_fin_validite)
 	{
 		//$dateactend = dol_time_plus_duree ($contractline->date_fin_validite, $product->duration_value, $product->duration_unit);
-		//print ', '.$langs->trans("DateEndPlanned").': '.dolibarr_print_date($contractline->date_fin_validite);
-		$text.='<br>'.$langs->trans("ExpiredSince").': '.dolibarr_print_date($contractline->date_fin_validite);
+		//print ', '.$langs->trans("DateEndPlanned").': '.dol_print_date($contractline->date_fin_validite);
+		$text.='<br>'.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_fin_validite);
 	}
 
 	print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
diff --git a/htdocs/rapport/Atome.class.php b/htdocs/rapport/Atome.class.php
index 33b015dff65..304e086d799 100644
--- a/htdocs/rapport/Atome.class.php
+++ b/htdocs/rapport/Atome.class.php
@@ -75,7 +75,7 @@ class Atome
                     $value = $this->datas[$index];
                 }
     
-                $libelle = ucfirst(strftime("%b", dolibarr_mktime(12,0,0,($i+1),1,2004)));
+                $libelle = ucfirst(strftime("%b", dol_mktime(12,0,0,($i+1),1,2004)));
     
                 $this->graph_values[$i] = array($libelle, $value);
             }
diff --git a/htdocs/searchpostalcode.php b/htdocs/searchpostalcode.php
index 7c6dfe5b152..1ed5358c0f2 100644
--- a/htdocs/searchpostalcode.php
+++ b/htdocs/searchpostalcode.php
@@ -63,7 +63,7 @@ function run_request($table)
     $result=$db->query($sql);
     if (!$result)
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     //  print $sql;
 }
diff --git a/htdocs/service.class.php b/htdocs/service.class.php
index d2264bd9e45..2f8e2715e7f 100644
--- a/htdocs/service.class.php
+++ b/htdocs/service.class.php
@@ -227,7 +227,7 @@ class Service
         }
         else 
         {
-            dolibarr_print_error($this->db);
+            dol_print_error($this->db);
             $this->error=$this->db->error();
             return -1;
         }
diff --git a/htdocs/soc.php b/htdocs/soc.php
index 9bd030a2f9a..9d5e1ac8425 100644
--- a/htdocs/soc.php
+++ b/htdocs/soc.php
@@ -143,7 +143,7 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"])
 			{
 				if ($soc->particulier)
 				{
-					dolibarr_syslog("This thirdparty is a personal people",LOG_DEBUG);
+					dol_syslog("This thirdparty is a personal people",LOG_DEBUG);
 					$contact=new Contact($db);
 
 					$contact->civilite_id = $soc->civilite_id;
@@ -339,7 +339,7 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create')
 			}
 			else
 			{
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 			$soc->pays_code=$obj->code;
 			$soc->pays=$obj->libelle;
@@ -689,7 +689,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
 				}
 				else
 				{
-					dolibarr_print_error($db);
+					dol_print_error($db);
 				}
 				$soc->pays_code=$obj->code;
 				$soc->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
@@ -938,13 +938,13 @@ else
 	$result=$soc->fetch($socid);
 	if ($result < 0)
 	{
-		dolibarr_print_error($db,$soc->error);
+		dol_print_error($db,$soc->error);
 		exit;
 	}
 
 	$head = societe_prepare_head($soc);
 
-	dolibarr_fiche_head($head, 'company', $langs->trans("ThirdParty"));
+	dol_fiche_head($head, 'company', $langs->trans("ThirdParty"));
 
 
 	// Confirmation de la suppression de la facture
@@ -1203,7 +1203,7 @@ else
 		print $obj->nb?($obj->nb):$langs->trans("NoSalesRepresentativeAffected");
 	}
 	else {
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	print '</td></tr>';
 
diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php
index 5e42a2c3a67..ce8f5a5c15f 100644
--- a/htdocs/societe.class.php
+++ b/htdocs/societe.class.php
@@ -141,7 +141,7 @@ class Societe extends CommonObject
 		// clean parameters
 		$this->nom=trim($this->nom);
 
-		dolibarr_syslog("Societe::create ".$this->nom);
+		dol_syslog("Societe::create ".$this->nom);
 
 		$this->db->begin();
 
@@ -158,7 +158,7 @@ class Societe extends CommonObject
 			$sql.= " ".($user->id > 0 ? "'".$user->id."'":"null");
 			$sql.= ")";
 
-			dolibarr_syslog("Societe::create sql=".$sql);
+			dol_syslog("Societe::create sql=".$sql);
 			$result=$this->db->query($sql);
 			if ($result)
 			{
@@ -191,13 +191,13 @@ class Societe extends CommonObject
 					if ($result < 0) { $error++; $this->errors=$interface->errors; }
 					// Fin appel triggers
 
-					dolibarr_syslog("Societe::Create success id=".$this->id);
+					dol_syslog("Societe::Create success id=".$this->id);
 					$this->db->commit();
 					return 0;
 				}
 				else
 				{
-					dolibarr_syslog("Societe::Create echec update");
+					dol_syslog("Societe::Create echec update");
 					$this->db->rollback();
 					return -3;
 				}
@@ -211,7 +211,7 @@ class Societe extends CommonObject
 				}
 				else
 				{
-					dolibarr_syslog("Societe::Create echec insert sql=".$sql);
+					dol_syslog("Societe::Create echec insert sql=".$sql);
 				}
 				$this->db->rollback();
 				return -2;
@@ -221,7 +221,7 @@ class Societe extends CommonObject
 		else
 		{
 			$this->db->rollback();
-			dolibarr_syslog("Societe::Create echec verify sql=".$sql);
+			dol_syslog("Societe::Create echec verify sql=".$sql);
 			return -1;
 		}
 	}
@@ -311,7 +311,7 @@ class Societe extends CommonObject
 	{
 		global $langs,$conf;
 
-		dolibarr_syslog("Societe::Update id=".$id." call_trigger=".$call_triger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur);
+		dol_syslog("Societe::Update id=".$id." call_trigger=".$call_triger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur);
 
 		// Clean parameters
 		$this->id=$id;
@@ -358,7 +358,7 @@ class Societe extends CommonObject
 
 		if ($result >= 0)
 		{
-			dolibarr_syslog("Societe::Update verify ok");
+			dol_syslog("Societe::Update verify ok");
 
 			$sql = "UPDATE ".MAIN_DB_PREFIX."societe";
 			$sql.= " SET nom = '" . addslashes($this->nom) ."'"; // Champ obligatoire
@@ -426,7 +426,7 @@ class Societe extends CommonObject
 			$sql .= " WHERE rowid = '" . $id ."'";
 
 
-			dolibarr_syslog("Societe::update sql=".$sql);
+			dol_syslog("Societe::update sql=".$sql);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -457,7 +457,7 @@ class Societe extends CommonObject
 				{
 
 					$this->error = $langs->trans("Error sql=".$sql);
-					dolibarr_syslog("Societe::Update echec sql=".$sql);
+					dol_syslog("Societe::Update echec sql=".$sql);
 					$result =  -2;
 				}
 			}
@@ -609,7 +609,7 @@ class Societe extends CommonObject
 			}
 			else
 			{
-				dolibarr_syslog('Erreur Societe::Fetch aucune societe avec id='.$this->id.' - '.$sql);
+				dol_syslog('Erreur Societe::Fetch aucune societe avec id='.$this->id.' - '.$sql);
 				$this->error='Erreur Societe::Fetch aucune societe avec id='.$this->id.' - '.$sql;
 				$result = -2;
 			}
@@ -618,8 +618,8 @@ class Societe extends CommonObject
 		}
 		else
 		{
-			dolibarr_syslog('Erreur Societe::Fetch echec sql='.$sql);
-			dolibarr_syslog('Erreur Societe::Fetch '.$this->db->error());
+			dol_syslog('Erreur Societe::Fetch echec sql='.$sql);
+			dol_syslog('Erreur Societe::Fetch '.$this->db->error());
 			$this->error=$this->db->error();
 			$result = -3;
 		}
@@ -689,7 +689,7 @@ class Societe extends CommonObject
 	{
 		global $user,$langs,$conf;
 
-		dolibarr_syslog("Societe::Delete", LOG_DEBUG);
+		dol_syslog("Societe::Delete", LOG_DEBUG);
 		$sqr = 0;
 
 		// Check if third party can be deleted
@@ -710,7 +710,7 @@ class Societe extends CommonObject
 		else
 		{
 			$this->error .= $this->db->lasterror();
-			dolibarr_syslog("Societe::Delete erreur -1 ".$this->error);
+			dol_syslog("Societe::Delete erreur -1 ".$this->error);
 			return -1;
 		}
 
@@ -747,7 +747,7 @@ class Societe extends CommonObject
 			// Remove contacts
 			$sql = "DELETE from ".MAIN_DB_PREFIX."socpeople";
 			$sql.= " WHERE fk_soc = " . $id;
-			dolibarr_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
+			dol_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
 			if ($this->db->query($sql))
 			{
 				$sqr++;
@@ -755,13 +755,13 @@ class Societe extends CommonObject
 			else
 			{
 				$this->error .= $this->db->lasterror();
-				dolibarr_syslog("Societe::Delete erreur -1 ".$this->error);
+				dol_syslog("Societe::Delete erreur -1 ".$this->error);
 			}
 
 			// Update link in member table
 			$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
 			$sql.= " SET fk_soc = NULL where fk_soc = " . $id;
-			dolibarr_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
+			dol_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
 			if ($this->db->query($sql))
 			{
 				$sqr++;
@@ -769,13 +769,13 @@ class Societe extends CommonObject
 			else
 			{
 				$this->error .= $this->db->lasterror();
-				dolibarr_syslog("Societe::Delete erreur -1 ".$this->error);
+				dol_syslog("Societe::Delete erreur -1 ".$this->error);
 			}
 
 			// Remove ban
 			$sql = "DELETE from ".MAIN_DB_PREFIX."societe_rib";
 			$sql.= " WHERE fk_soc = " . $id;
-			dolibarr_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
+			dol_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
 			if ($this->db->query($sql))
 			{
 				$sqr++;
@@ -783,13 +783,13 @@ class Societe extends CommonObject
 			else
 			{
 				$this->error = $this->db->lasterror();
-				dolibarr_syslog("Societe::Delete erreur -2 ".$this->error);
+				dol_syslog("Societe::Delete erreur -2 ".$this->error);
 			}
 
 			// Remove third party
 			$sql = "DELETE from ".MAIN_DB_PREFIX."societe";
 			$sql.= " WHERE rowid = " . $id;
-			dolibarr_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
+			dol_syslog("Societe::Delete sql=".$sql, LOG_DEBUG);
 			if ($this->db->query($sql))
 			{
 				$sqr++;
@@ -797,7 +797,7 @@ class Societe extends CommonObject
 			else
 			{
 				$this->error = $this->db->lasterror();
-				dolibarr_syslog("Societe::Delete erreur -3 ".$this->error);
+				dol_syslog("Societe::Delete erreur -3 ".$this->error);
 			}
 
 			if ($sqr == 4)
@@ -897,19 +897,19 @@ class Societe extends CommonObject
 						}
 						else
 						{
-							dolibarr_print_error($this->db);
+							dol_print_error($this->db);
 						}
 					}
 				}
 				else
 				{
-					dolibarr_print_error($this->db);
+					dol_print_error($this->db);
 				}
 			}
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $prefix;
 	}
@@ -986,7 +986,7 @@ class Societe extends CommonObject
 			return -2;
 		}
 
-		dolibarr_syslog("Societe::set_remise_client ".$remise.", ".$note.", ".$user->id);
+		dol_syslog("Societe::set_remise_client ".$remise.", ".$note.", ".$user->id);
 
 		if ($this->id)
 		{
@@ -1144,7 +1144,7 @@ class Societe extends CommonObject
 
 			if (! $this->db->query($sql) )
 	  {
-	  	dolibarr_print_error($this->db);
+	  	dol_print_error($this->db);
 	  }
 
 		}
@@ -1169,7 +1169,7 @@ class Societe extends CommonObject
 
 			if (! $this->db->query($sql) )
 	  {
-	  	dolibarr_syslog("Societe::add_commercial Erreur");
+	  	dol_syslog("Societe::add_commercial Erreur");
 	  }
 
 		}
@@ -1189,7 +1189,7 @@ class Societe extends CommonObject
 
 			if (! $this->db->query($sql) )
 	  {
-	  	dolibarr_syslog("Societe::del_commercial Erreur");
+	  	dol_syslog("Societe::del_commercial Erreur");
 	  }
 
 		}
@@ -1240,7 +1240,7 @@ class Societe extends CommonObject
 			$lienfin='</a>';
 		}
 		if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin.' ');
-		$result.=$lien.($maxlen?dolibarr_trunc($this->nom,$maxlen):$this->nom).$lienfin;
+		$result.=$lien.($maxlen?dol_trunc($this->nom,$maxlen):$this->nom).$lienfin;
 
 		return $result;
 	}
@@ -1268,7 +1268,7 @@ class Societe extends CommonObject
 			$this->db->free();
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 	}
@@ -1286,7 +1286,7 @@ class Societe extends CommonObject
 		if ($this->email)
 		{
 			// TODO: Tester si email non deja present dans tableau contact
-			$contact_email[-1]=$langs->trans("ThirdParty").': '.dolibarr_trunc($this->nom,16)." &lt;".$this->email."&gt;";
+			$contact_email[-1]=$langs->trans("ThirdParty").': '.dol_trunc($this->nom,16)." &lt;".$this->email."&gt;";
 		}
 		return $contact_email;
 	}
@@ -1319,7 +1319,7 @@ class Societe extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $contact_email;
 	}
@@ -1351,7 +1351,7 @@ class Societe extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $contacts;
 	}
@@ -1382,7 +1382,7 @@ class Societe extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 
 	}
@@ -1450,7 +1450,7 @@ class Societe extends CommonObject
 			$this->code_client = $mod->getNextValue($objsoc,$type);
 			$this->prefixCustomerIsRequired = $mod->prefixIsRequired;
 
-			dolibarr_syslog("Societe::get_codeclient code_client=".$this->code_client." module=".$var);
+			dol_syslog("Societe::get_codeclient code_client=".$this->code_client." module=".$var);
 		}
 	}
 
@@ -1470,7 +1470,7 @@ class Societe extends CommonObject
 			$this->code_fournisseur = $mod->getNextValue($objsoc,$type);
 			$this->prefixSupplierIsRequired = $mod->prefixIsRequired;
 
-			dolibarr_syslog("Societe::get_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$var);
+			dol_syslog("Societe::get_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$var);
 		}
 	}
 
@@ -1490,7 +1490,7 @@ class Societe extends CommonObject
 
 			$mod = new $var;
 
-			dolibarr_syslog("Societe::codeclient_modifiable code_client=".$this->code_client." module=".$var);
+			dol_syslog("Societe::codeclient_modifiable code_client=".$this->code_client." module=".$var);
 			if ($mod->code_modifiable_null && ! $this->code_client) return 1;
 			if ($mod->code_modifiable_invalide && $this->check_codeclient() < 0) return 1;
 			if ($mod->code_modifiable) return 1;	// A mettre en dernier
@@ -1518,7 +1518,7 @@ class Societe extends CommonObject
 
 			$mod = new $var;
 
-			dolibarr_syslog("Societe::codefournisseur_modifiable code_founisseur=".$this->code_fournisseur." module=".$var);
+			dol_syslog("Societe::codefournisseur_modifiable code_founisseur=".$this->code_fournisseur." module=".$var);
 			if ($mod->code_modifiable_null && ! $this->code_fournisseur) return 1;
 			if ($mod->code_modifiable_invalide && $this->check_codefournisseur() < 0) return 1;
 			if ($mod->code_modifiable) return 1;	// A mettre en dernier
@@ -1546,7 +1546,7 @@ class Societe extends CommonObject
 
 			$mod = new $var;
 
-			dolibarr_syslog("Societe::check_codeclient code_client=".$this->code_client." module=".$var);
+			dol_syslog("Societe::check_codeclient code_client=".$this->code_client." module=".$var);
 			$result = $mod->verif($this->db, $this->code_client, $this, 0);
 			return $result;
 		}
@@ -1571,7 +1571,7 @@ class Societe extends CommonObject
 
 			$mod = new $var;
 
-			dolibarr_syslog("Societe::check_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$var);
+			dol_syslog("Societe::check_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$var);
 			$result = $mod->verif($this->db, $this->code_fournisseur, $this ,1);
 			return $result;
 		}
@@ -1813,7 +1813,7 @@ class Societe extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
@@ -1991,7 +1991,7 @@ class Societe extends CommonObject
 			$sql.= " SET fk_soc=".$this->id;
 			$sql.= " WHERE rowid=".$member->id;
 
-			dolibarr_syslog("Societe::create_from_member sql=".$sql, LOG_DEBUG);
+			dol_syslog("Societe::create_from_member sql=".$sql, LOG_DEBUG);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -2001,7 +2001,7 @@ class Societe extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("Societe::create_from_member - 1 - ".$this->error, LOG_ERR);
+				dol_syslog("Societe::create_from_member - 1 - ".$this->error, LOG_ERR);
 
 				$this->db->rollback();
 				return -1;
@@ -2010,7 +2010,7 @@ class Societe extends CommonObject
 		else
 		{
 			// $this->error deja positionne
-			dolibarr_syslog("Societe::create_from_member - 2 - ".$this->error, LOG_ERR);
+			dol_syslog("Societe::create_from_member - 2 - ".$this->error, LOG_ERR);
 
 			$this->db->rollback();
 			return $result;
diff --git a/htdocs/societe.php b/htdocs/societe.php
index 9e93a827882..0966a91074d 100644
--- a/htdocs/societe.php
+++ b/htdocs/societe.php
@@ -341,7 +341,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php
index c0e4439c6d3..19a7fdc3693 100644
--- a/htdocs/societe/ajaxcompanies.php
+++ b/htdocs/societe/ajaxcompanies.php
@@ -46,7 +46,7 @@ if (! empty($_POST['newcompany']) || ! empty($_POST['socid']) || ! empty($_POST[
 	if (! empty($_GET["filter"])) $sql.= " AND ".$_GET["filter"]; // Add other filters
 	$sql.= " ORDER BY nom ASC";
 	
-	//dolibarr_syslog("ajaxcompanies sql=".$sql);
+	//dol_syslog("ajaxcompanies sql=".$sql);
 	$resql=$db->query($sql);
 	if ($resql)
 	{
diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php
index 9dde1911a82..b4f0224c149 100644
--- a/htdocs/societe/checkvat/checkVatPopup.php
+++ b/htdocs/societe/checkvat/checkVatPopup.php
@@ -65,11 +65,11 @@ else
 						"vatNumber" => $_REQUEST["vatNumber"]);
 	
 	// Set the WebService URL
-	dolibarr_syslog("Create soapclient_nusoap for URL=".$WS_DOL_URL);
+	dol_syslog("Create soapclient_nusoap for URL=".$WS_DOL_URL);
 	$soapclient = new soapclient_nusoap($WS_DOL_URL);
 	
 	// Call the WebService and store its result in $result.
-	dolibarr_syslog("Call method ".$WS_METHOD);
+	dol_syslog("Call method ".$WS_METHOD);
 	$result = $soapclient->call($WS_METHOD,$parameters);
 
 //	print "x".is_array($result)."i";
diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php
index dd2070224d1..0c2ad851abe 100644
--- a/htdocs/societe/commerciaux.php
+++ b/htdocs/societe/commerciaux.php
@@ -94,7 +94,7 @@ if ($_GET["socid"])
     
     $head=societe_prepare_head2($soc);
 	
-    dolibarr_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"));
+    dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"));
     
     /*
     * Fiche soci�t� en mode visu
@@ -169,7 +169,7 @@ if ($_GET["socid"])
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); }
 
@@ -232,7 +232,7 @@ if ($_GET["socid"])
         }
         else
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
     }
 
diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php
index c5816fb523a..dfbc5fd944f 100644
--- a/htdocs/societe/document.php
+++ b/htdocs/societe/document.php
@@ -124,7 +124,7 @@ if ($socid > 0)
 		
 		$html=new Form($db);
 		
-		dolibarr_fiche_head($head, 'document', $langs->trans("ThirdParty"));
+		dol_fiche_head($head, 'document', $langs->trans("ThirdParty"));
 		
 
 		// Construit liste des fichiers
@@ -218,7 +218,7 @@ if ($socid > 0)
 					print "</td>\n";
 
 					print '<td align="right">'.filesize($courrier_dir."/".$file). ' '.$langs->trans("bytes").'</td>';
-					print '<td align="center">'.dolibarr_print_date(filemtime($courrier_dir."/".$file),"dayhour").'</td>';
+					print '<td align="center">'.dol_print_date(filemtime($courrier_dir."/".$file),"dayhour").'</td>';
 					print "</tr>\n";
 				}
 			}
@@ -227,12 +227,12 @@ if ($socid > 0)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 }
 else
 {
-	dolibarr_print_error();
+	dol_print_error();
 }
 
 $db->close();
diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php
index 758d61d09a7..84f409e8116 100644
--- a/htdocs/societe/info.php
+++ b/htdocs/societe/info.php
@@ -53,7 +53,7 @@ $soc->info($socid);
  */
 $head = societe_prepare_head($soc);
 
-dolibarr_fiche_head($head, 'info', $langs->trans("ThirdParty"));
+dol_fiche_head($head, 'info', $langs->trans("ThirdParty"));
 
 
 
diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php
index 7b6f478045f..3c8763fa1b6 100644
--- a/htdocs/societe/lien.php
+++ b/htdocs/societe/lien.php
@@ -96,7 +96,7 @@ if($_GET["socid"])
     
     $head=societe_prepare_head2($soc);
     
-    dolibarr_fiche_head($head, 'links', $langs->trans("ThirdParty"));
+    dol_fiche_head($head, 'links', $langs->trans("ThirdParty"));
     
     /*
      * Fiche soci�t� en mode visu
@@ -270,7 +270,7 @@ if($_GET["socid"])
             }
             else
             {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
     }
diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php
index 36e5a7f1a54..28b514e0453 100644
--- a/htdocs/societe/notify/fiche.php
+++ b/htdocs/societe/notify/fiche.php
@@ -66,12 +66,12 @@ if ($_POST["action"] == 'add')
 	}
       else
 	{
-      dolibarr_print_error($db);
+      dol_print_error($db);
 	}
     }
   else
     {
-      dolibarr_print_error($db);
+      dol_print_error($db);
     }
 }
 
@@ -102,7 +102,7 @@ if ( $soc->fetch($soc->id) )
 	 */
 	$head = societe_prepare_head($soc);
 
-	dolibarr_fiche_head($head, 'notify', $soc->nom);
+	dol_fiche_head($head, 'notify', $soc->nom);
 
     
     print '<table class="border"width="100%">';
@@ -125,7 +125,7 @@ if ( $soc->fetch($soc->id) )
         }
     }
     else {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     print $nb;
     print '</td></tr>';
@@ -170,7 +170,7 @@ if ( $soc->fetch($soc->id) )
 	    }
 	    else
 	    {
-	        dolibarr_print_error($db);
+	        dol_print_error($db);
 	    }
 	    
 	    $var=false;
@@ -234,7 +234,7 @@ if ( $soc->fetch($soc->id) )
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
     
     print '</table>';
diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php
index 5740735d338..577a857bf2c 100644
--- a/htdocs/societe/notify/index.php
+++ b/htdocs/societe/notify/index.php
@@ -105,7 +105,7 @@ if ($result)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php
index 00643b430d6..104280d9a66 100644
--- a/htdocs/societe/rib.php
+++ b/htdocs/societe/rib.php
@@ -91,7 +91,7 @@ llxHeader();
 
 $head=societe_prepare_head2($soc);
 
-dolibarr_fiche_head($head, 'rib', $langs->trans("ThirdParty"));
+dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"));
 
 $account = new CompanyBankAccount($db);
 $account->socid=$soc->id;
diff --git a/htdocs/societe/socnote.php b/htdocs/societe/socnote.php
index cde98edd3df..64c0cf77d01 100644
--- a/htdocs/societe/socnote.php
+++ b/htdocs/societe/socnote.php
@@ -64,7 +64,7 @@ if ($socid > 0)
 	 */
 	$head = societe_prepare_head($societe);
 
-	dolibarr_fiche_head($head, 'note', $langs->trans("ThirdParty"));
+	dol_fiche_head($head, 'note', $langs->trans("ThirdParty"));
 	
 	
 	print "<form method=\"post\" action=\"".DOL_URL_ROOT."/societe/socnote.php\">";
diff --git a/htdocs/stats.class.php b/htdocs/stats.class.php
index f9b43a5a092..22004e76f90 100644
--- a/htdocs/stats.class.php
+++ b/htdocs/stats.class.php
@@ -116,7 +116,7 @@ class Stats
 	{
 		$result = array();
 		
-		dolibarr_syslog("Stats::_getNbByYear sql=".$sql);
+		dol_syslog("Stats::_getNbByYear sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -131,7 +131,7 @@ class Stats
 			$this->db->free($resql);
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $result;
 	}
@@ -145,7 +145,7 @@ class Stats
 	{
 		$result = array();
 		
-		dolibarr_syslog("Stats::_getAllByYear sql=".$sql);
+		dol_syslog("Stats::_getAllByYear sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -163,7 +163,7 @@ class Stats
 			$this->db->free($resql);
 		}
 		else {
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $result;
 	}	
@@ -176,7 +176,7 @@ class Stats
 	{
 		$result = array();
 
-		dolibarr_syslog("Stats::_getNbByMonth sql=".$sql);
+		dol_syslog("Stats::_getNbByMonth sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -193,7 +193,7 @@ class Stats
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		
 		for ($i = 1 ; $i < 13 ; $i++)
@@ -205,7 +205,7 @@ class Stats
 
 		for ($i = 1 ; $i < 13 ; $i++)
 		{
-			$month=dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b");
+			$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b");
 			$month=dol_substr($month,0,3);
 			$data[$i-1] = array(ucfirst($month), $res[$i]);
 		}
@@ -222,7 +222,7 @@ class Stats
 	{
 		$result = array();
 
-		dolibarr_syslog("Stats::_getAmountByMonth sql=".$sql);
+		dol_syslog("Stats::_getAmountByMonth sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -247,7 +247,7 @@ class Stats
 
 		for ($i = 1 ; $i < 13 ; $i++)
 		{
-			$month=dolibarr_print_date(dolibarr_mktime(12,0,0,$i,1,$year),"%b");
+			$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b");
 			$month=dol_substr($month,0,3);
 			$data[$i-1] = array(ucfirst($month), $res[$i]);
 		}
@@ -263,7 +263,7 @@ class Stats
 	{
 		$result = array();
 
-		dolibarr_syslog("Stats::_getAverageByMonth sql=".$sql);
+		dol_syslog("Stats::_getAverageByMonth sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php
index 198e2d46e13..6afca5b1a19 100644
--- a/htdocs/support/inc.php
+++ b/htdocs/support/inc.php
@@ -228,7 +228,7 @@ function pFooter($nonext=0,$setuplang='')
 function dolibarr_support_syslog($message, $level=LOG_DEBUG)
 {
 	if (! defined('LOG_DEBUG')) define('LOG_DEBUG',6);
-	dolibarr_syslog($message,$level);
+	dol_syslog($message,$level);
 }
 
 ?>
\ No newline at end of file
diff --git a/htdocs/task.class.php b/htdocs/task.class.php
index 21865b49b35..fbda91af4d0 100644
--- a/htdocs/task.class.php
+++ b/htdocs/task.class.php
@@ -120,7 +120,7 @@ class Task // extends CommonObject
 
 		$this->db->begin();
 		
-	   	dolibarr_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
+	   	dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
         
@@ -147,7 +147,7 @@ class Task // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
@@ -184,7 +184,7 @@ class Task // extends CommonObject
         $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as t";
         $sql.= " WHERE t.rowid = ".$id;
     
-    	dolibarr_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
+    	dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
         $resql=$this->db->query($sql);
         if ($resql)
         {
@@ -211,7 +211,7 @@ class Task // extends CommonObject
         else
         {
       	    $this->error="Error ".$this->db->lasterror();
-            dolibarr_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
+            dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
             return -1;
         }
     }
@@ -259,7 +259,7 @@ class Task // extends CommonObject
 
 		$this->db->begin();
         
-		dolibarr_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
+		dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
         $resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
         
@@ -284,7 +284,7 @@ class Task // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
@@ -313,7 +313,7 @@ class Task // extends CommonObject
 		
 		if ($this->hasChildren() > 0)
 		{
-			dolibarr_syslog(get_class($this)."::delete Can't delete record as it has some child", LOG_WARNING);
+			dol_syslog(get_class($this)."::delete Can't delete record as it has some child", LOG_WARNING);
 			$this->error='ErrorRecordHasChildren';
 			$this->db->rollback();
 			return 0;
@@ -322,7 +322,7 @@ class Task // extends CommonObject
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task";
 		$sql.= " WHERE rowid=".$this->id;
 		
-		dolibarr_syslog(get_class($this)."::delete sql=".$sql);
+		dol_syslog(get_class($this)."::delete sql=".$sql);
 		$resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
 		
@@ -347,7 +347,7 @@ class Task // extends CommonObject
 		{
 			foreach($this->errors as $errmsg)
 			{
-	            dolibarr_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
+	            dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
 	            $this->error.=($this->error?', '.$errmsg:$errmsg);
 			}	
 			$this->db->rollback();
@@ -371,7 +371,7 @@ class Task // extends CommonObject
 		$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."projet_task";
 		$sql.= " WHERE fk_task_parent=".$this->id;
 		
-		dolibarr_syslog(get_class($this)."::hasChildren sql=".$sql, LOG_DEBUG);
+		dol_syslog(get_class($this)."::hasChildren sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
     	if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
 		else
diff --git a/htdocs/telephonie/adsl/fiche.php b/htdocs/telephonie/adsl/fiche.php
index 1183b3ced76..483deb14625 100644
--- a/htdocs/telephonie/adsl/fiche.php
+++ b/htdocs/telephonie/adsl/fiche.php
@@ -644,7 +644,7 @@ else
 	      $head[$h][1] = $langs->trans('Historique');
 	      $h++;
 
-	      dolibarr_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero);
+	      dol_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero);
 
 	      print_fiche_titre('Fiche Liaison ADSL', $mesg);
       
@@ -659,7 +659,7 @@ else
 	      print $client->nom.'</a></td><td>'.$client->code_client;
 	      print '</td></tr>';
 
-	      print '<tr><td width="20%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero,0,0,true).'</td>';
+	      print '<tr><td width="20%">Num�ro</td><td>'.dol_print_phone($ligne->numero,0,0,true).'</td>';
 	      print '<td>&nbsp;</td></tr>';
 
 	      print '<tr><td width="20%">D�bit de la liaison</td><td>'.$ligne->type.'</td>';
diff --git a/htdocs/telephonie/adsl/fournisseurxdsl.class.php b/htdocs/telephonie/adsl/fournisseurxdsl.class.php
index 85e49bd252f..f04773ee232 100644
--- a/htdocs/telephonie/adsl/fournisseurxdsl.class.php
+++ b/htdocs/telephonie/adsl/fournisseurxdsl.class.php
@@ -59,13 +59,13 @@ class FournisseurXdsl {
 	  }
 	else
 	  {
-	    dolibarr_syslog("FournisseurXdsl::Create Error -3");
+	    dol_syslog("FournisseurXdsl::Create Error -3");
 	    return -3;	    
 	  }
       }
     else
       {
-	dolibarr_syslog("FournisseurXdsl::Create Error -2");
+	dol_syslog("FournisseurXdsl::Create Error -2");
 	return -2;
       }
   }
@@ -86,7 +86,7 @@ class FournisseurXdsl {
       }
     else
       {
-	dolibarr_syslog("FournisseurXdsl::SwithCommandeActive Error -20", LOG_ERR);
+	dol_syslog("FournisseurXdsl::SwithCommandeActive Error -20", LOG_ERR);
 	return -20;
       }
 
@@ -117,7 +117,7 @@ class FournisseurXdsl {
       }
     else 
       {
-	dolibarr_print_error($this->db);
+	dol_print_error($this->db);
 	$this->error=$this->db->error();
 
       }
diff --git a/htdocs/telephonie/adsl/history.php b/htdocs/telephonie/adsl/history.php
index 31d6cad9a77..2fa4f2fc66f 100644
--- a/htdocs/telephonie/adsl/history.php
+++ b/htdocs/telephonie/adsl/history.php
@@ -54,11 +54,11 @@ if ($_GET["id"])
       $hselected = $h;
       $h++;
 	  
-      dolibarr_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero);
+      dol_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero);
 
       print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 
-      print '<tr><td width="20%">Num�ro de support</td><td colspan="2">'.dolibarr_print_phone($ligne->numero,0,0,true).'</td></tr>';
+      print '<tr><td width="20%">Num�ro de support</td><td colspan="2">'.dol_print_phone($ligne->numero,0,0,true).'</td></tr>';
 
 	      	     
       $client = new Societe($db, $ligne->client_id);
diff --git a/htdocs/telephonie/adsl/ligneadsl.class.php b/htdocs/telephonie/adsl/ligneadsl.class.php
index 230cdf2b964..79496cbd5e8 100644
--- a/htdocs/telephonie/adsl/ligneadsl.class.php
+++ b/htdocs/telephonie/adsl/ligneadsl.class.php
@@ -120,14 +120,14 @@ class LigneAdsl {
 	    if ($lex->fetch($this->numero) == 1)
 	      {
 		$this->error_message = "Echec de la cr�ation de la ligne, cette ligne existe d�j� !";
-		dolibarr_syslog("LigneAdsl::Create Error -3");
+		dol_syslog("LigneAdsl::Create Error -3");
 		return -3;
 	      }
 	    else
 	      {
 		$this->error_message = "Echec de la cr�ation de la ligne";
-		dolibarr_syslog("LigneAdsl::Create Error -1");
-		dolibarr_syslog("LigneAdsl::Create $sql");
+		dol_syslog("LigneAdsl::Create Error -1");
+		dol_syslog("LigneAdsl::Create $sql");
 		return -1;
 	      }
 	  }
@@ -135,7 +135,7 @@ class LigneAdsl {
     else
       {
 	$this->error_message = "Echec de la cr�ation de la ligne, le num�ro de la ligne est incorrect !";
-	dolibarr_syslog("LigneAdsl::Create Error -2");
+	dol_syslog("LigneAdsl::Create Error -2");
 	return -2;
       }
   }
@@ -165,13 +165,13 @@ class LigneAdsl {
 	    }
 	  else
 	    {
-	      dolibarr_syslog("LigneAdsl::Delete Error -1");
+	      dol_syslog("LigneAdsl::Delete Error -1");
 	      return -1;
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("LigneAdsl::Delete Error -2");
+	  dol_syslog("LigneAdsl::Delete Error -2");
 	  return -2;
 	}
     }
diff --git a/htdocs/telephonie/adsl/liste.php b/htdocs/telephonie/adsl/liste.php
index ebb60ddc26b..c7857c6d914 100644
--- a/htdocs/telephonie/adsl/liste.php
+++ b/htdocs/telephonie/adsl/liste.php
@@ -131,7 +131,7 @@ if ($resql)
       print img_file();      
       print '</a>&nbsp;';
 
-      print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->numero_ligne,0,0,true)."</a></td>\n";
+      print '<a href="fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->numero_ligne,0,0,true)."</a></td>\n";
 
       print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("Fiche Compta"),"bill")."</a> ";
 
diff --git a/htdocs/telephonie/adsl/productxdsl.class.php b/htdocs/telephonie/adsl/productxdsl.class.php
index d745b08c51d..308faf9c3e6 100644
--- a/htdocs/telephonie/adsl/productxdsl.class.php
+++ b/htdocs/telephonie/adsl/productxdsl.class.php
@@ -59,13 +59,13 @@ class ProductXdsl {
 	  }
 	else
 	  {
-	    dolibarr_syslog("ProductXdsl::Create Error -3");
+	    dol_syslog("ProductXdsl::Create Error -3");
 	    return -3;	    
 	  }
       }
     else
       {
-	dolibarr_syslog("ProductXdsl::Create Error -2");
+	dol_syslog("ProductXdsl::Create Error -2");
 	return -2;
       }
   }
@@ -86,7 +86,7 @@ class ProductXdsl {
       }
     else
       {
-	dolibarr_syslog("ProductXdsl::SwithCommandeActive Error -20", LOG_ERR);
+	dol_syslog("ProductXdsl::SwithCommandeActive Error -20", LOG_ERR);
 	return -20;
       }
 
@@ -117,7 +117,7 @@ class ProductXdsl {
       }
     else 
       {
-	dolibarr_print_error($this->db);
+	dol_print_error($this->db);
 	$this->error=$this->db->error();
 
       }
diff --git a/htdocs/telephonie/ca/index.php b/htdocs/telephonie/ca/index.php
index b115f2150f9..a10b55b310b 100644
--- a/htdocs/telephonie/ca/index.php
+++ b/htdocs/telephonie/ca/index.php
@@ -83,7 +83,7 @@ if ($resql)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 print '</td><td valign="top" width="50%">'."\n";
diff --git a/htdocs/telephonie/client/commentaires.php b/htdocs/telephonie/client/commentaires.php
index adc0e130f69..d894d696b17 100644
--- a/htdocs/telephonie/client/commentaires.php
+++ b/htdocs/telephonie/client/commentaires.php
@@ -107,15 +107,15 @@ if ($_GET["id"])
 	  $h++;
 	}
       
-      dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
+      dol_fiche_head($head, $hselected, 'Client : '.$soc->nom);
       
       print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
       print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Code client').'</td><td>'.$soc->code_client.'</td></tr>';
       
       print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$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><a href="'.DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id.'">'.img_edit() ."</a>&nbsp;";
       print $langs->trans('RIB').'</td><td colspan="3">';
diff --git a/htdocs/telephonie/client/facture.php b/htdocs/telephonie/client/facture.php
index 7cf5d379025..296eca45f13 100644
--- a/htdocs/telephonie/client/facture.php
+++ b/htdocs/telephonie/client/facture.php
@@ -147,18 +147,18 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance')
 	  else
             {
 	      $msg='<div class="error">'.$langs->trans("ErrorMailRecipientIsEmpty").'</div>';
-	      dolibarr_syslog("Le mail du destinataire est vide");
+	      dol_syslog("Le mail du destinataire est vide");
             }
 
         }
       else
         {
-	  dolibarr_syslog("Impossible de lire :".$file);
+	  dol_syslog("Impossible de lire :".$file);
         }
     }
     else
       {
-        dolibarr_syslog("Impossible de lire les donn�es de la facture. Le fichier facture n'a peut-�tre pas �t� g�n�r�.");
+        dol_syslog("Impossible de lire les donn�es de la facture. Le fichier facture n'a peut-�tre pas �t� g�n�r�.");
       }
 }
 
@@ -202,7 +202,7 @@ if ($_GET["facid"] > 0)
 	  $hselected = $h;
 	  $h++;
 	  
-	  dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref");
+	  dol_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref");
 	  
 	  /*
 	   *   Facture
@@ -215,8 +215,8 @@ if ($_GET["facid"] > 0)
 	  print "<td>Conditions de r�glement</td><td>" . $fac->cond_reglement ."</td></tr>";
 	  
 	  print '<tr><td>'.$langs->trans("Date").'</td>';
-	  print "<td colspan=\"3\">".dolibarr_print_date($fac->date,"dayhourtext")."</td>\n";
-	  print '<td>'.$langs->trans("DateMaxPayment").'</td><td>' . dolibarr_print_date($fac->date_lim_reglement,"dayhourtext");
+	  print "<td colspan=\"3\">".dol_print_date($fac->date,"dayhourtext")."</td>\n";
+	  print '<td>'.$langs->trans("DateMaxPayment").'</td><td>' . dol_print_date($fac->date_lim_reglement,"dayhourtext");
 	  print "</td></tr>";
 	  
 	  print '<tr>';
@@ -294,7 +294,7 @@ if ($_GET["facid"] > 0)
 	  print "</table>";
 	  $db->free($result);
 	} else {
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 	}
 
       print "</td></tr>";
@@ -387,17 +387,17 @@ if ($_GET["facid"] > 0)
 		      if ($objp->fk_product_type==1) print img_object($langs->trans("ShowService"),"service");
 		      else print img_object($langs->trans("ShowProduct"),"product");
 		      print ' '.stripslashes(nl2br($objp->description)).'</a>';
-		      if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; }
-		      if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; }
-		      if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; }
+		      if ($objp->date_start && $objp->date_end) { print " (Du ".dol_print_date($objp->date_start)." au ".dol_print_date($objp->date_end).")"; }
+		      if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dol_print_date($objp->date_start).")"; }
+		      if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dol_print_date($objp->date_end).")"; }
 		      print '</td>';
 		    }
 		  else
 		    {
 		      print "<td>".stripslashes(nl2br($objp->description));
-		      if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; }
-		      if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; }
-		      if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; }
+		      if ($objp->date_start && $objp->date_end) { print " (Du ".dol_print_date($objp->date_start)." au ".dol_print_date($objp->date_end).")"; }
+		      if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dol_print_date($objp->date_start).")"; }
+		      if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dol_print_date($objp->date_end).")"; }
 		      print "</td>\n";
 		    }
 		  
@@ -454,7 +454,7 @@ if ($_GET["facid"] > 0)
 	}
       else
 	{
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 	}
       /*
        * Ajouter une ligne
@@ -566,7 +566,7 @@ if ($_GET["facid"] > 0)
 		  $var=!$var;
 		  print "<tr $bc[$var]>";
 		  print '<td><a href="propal.php?propalid='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a></td>';
-		  print "<td>".dolibarr_print_date($objp->dp)."</td>\n";
+		  print "<td>".dol_print_date($objp->dp)."</td>\n";
 		  print '<td align="right">'.price($objp->price).'</td>';
 		  print "</tr>";
 		  $total = $total + $objp->price;
@@ -578,7 +578,7 @@ if ($_GET["facid"] > 0)
 	}
       else
 	{
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 	}
 
 
@@ -616,7 +616,7 @@ if ($_GET["facid"] > 0)
 		  $var=!$var;
 		  print "<tr $bc[$var]>";
 		  print '<td>'.img_object($langs->trans("ShowTask"),"task").' '.$objp->id.'</td>';
-		  print '<td>'.dolibarr_print_date($objp->da)."</td>\n";
+		  print '<td>'.dol_print_date($objp->da)."</td>\n";
 		  print '<td>'.stripslashes($objp->label).'</td>';
 		  print '<td>'.$objp->login.'</td>';
 		  print "</tr>\n";
@@ -627,7 +627,7 @@ if ($_GET["facid"] > 0)
 	}
       else
 	{
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 	}
 
       print "</td></tr></table>";
diff --git a/htdocs/telephonie/client/factures.php b/htdocs/telephonie/client/factures.php
index 4b336df857d..3440f85ba9b 100644
--- a/htdocs/telephonie/client/factures.php
+++ b/htdocs/telephonie/client/factures.php
@@ -79,15 +79,15 @@ if ($_GET["id"])
 	  $head[$h][1] = $langs->trans("Tarifs (".$row[0].")");	       
 	  $h++;
 	  	
-	  dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
+	  dol_fiche_head($head, $hselected, 'Client : '.$soc->nom);
 
 	  print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
 	  print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Code Client').'</td><td>'.$soc->code_client.'</td></tr>';
 	  
 	  print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$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 '</table><br />';
 
diff --git a/htdocs/telephonie/client/fiche.php b/htdocs/telephonie/client/fiche.php
index a921b2deb11..5cdc2e911c3 100644
--- a/htdocs/telephonie/client/fiche.php
+++ b/htdocs/telephonie/client/fiche.php
@@ -113,15 +113,15 @@ if ($_GET["id"])
 	      $h++;
 	    }
 
-	  dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
+	  dol_fiche_head($head, $hselected, 'Client : '.$soc->nom);
 
 	  print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
 	  print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Code client').'</td><td>'.$soc->code_client.'</td></tr>';
 	  
 	  print '<tr><td valign="top">'.$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$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><a href="'.DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id.'">'.img_edit() ."</a>&nbsp;";
 	  print $langs->trans('RIB').'</td><td colspan="3">';
diff --git a/htdocs/telephonie/client/lignes.php b/htdocs/telephonie/client/lignes.php
index df94e23f854..d6c9ae6fe6d 100644
--- a/htdocs/telephonie/client/lignes.php
+++ b/htdocs/telephonie/client/lignes.php
@@ -93,7 +93,7 @@ if ($_GET["id"])
 	  $h++;
 
 
-	  dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
+	  dol_fiche_head($head, $hselected, 'Client : '.$soc->nom);
 
 	  print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
 	  print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Code client').'</td><td>'.$soc->code_client.'</td></tr>';
@@ -101,14 +101,14 @@ if ($_GET["id"])
 	  
 	  print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$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 '</table><br />';
 
 	  print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 	  
-	  //print '<tr><td width="20%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero).'</td>';
+	  //print '<tr><td width="20%">Num�ro</td><td>'.dol_print_phone($ligne->numero).'</td>';
 	  //print '<td>Factur�e : '.$ligne->facturable.'</td></tr>';
 	  
 	  /* Lignes */
@@ -157,7 +157,7 @@ if ($_GET["id"])
       
 		      print '</a>&nbsp;';
 
-		      print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+		      print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 
 		      print '<td>'.$obj->code_client."</td>\n";
 		      print '<td>'.$obj->agence."</td>\n";
diff --git a/htdocs/telephonie/client/new.php b/htdocs/telephonie/client/new.php
index 15bc572b46c..bfbd08e8943 100644
--- a/htdocs/telephonie/client/new.php
+++ b/htdocs/telephonie/client/new.php
@@ -615,7 +615,7 @@ $form = new Form($db);
 if ($user->rights->telephonie->ligne->creer)
 {
 
-	dolibarr_fiche_head($head, $hselected, 'Nouveau client');
+	dol_fiche_head($head, $hselected, 'Nouveau client');
 	/*
 
 	*/
@@ -663,7 +663,7 @@ if ($user->rights->telephonie->ligne->creer)
 		}
 		else
 		{
-	  dolibarr_print_error($db);
+	  dol_print_error($db);
 		}
 		$soc->pays_code=$obj->code;
 		$soc->pays=$obj->libelle;
diff --git a/htdocs/telephonie/client/permissions.php b/htdocs/telephonie/client/permissions.php
index 07c359be7c3..a2d1a717b96 100644
--- a/htdocs/telephonie/client/permissions.php
+++ b/htdocs/telephonie/client/permissions.php
@@ -102,15 +102,15 @@ if ($soc->id)
   $hselected = $h;
   $h++;
   
-  dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
+  dol_fiche_head($head, $hselected, 'Client : '.$soc->nom);
   
   print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
   print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Code client').'</td><td>'.$soc->code_client.'</td></tr>';
   
   print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$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 '</table><br />';
   print '<form method="POST" action="permissions.php?id='.$soc->id.'">';
diff --git a/htdocs/telephonie/client/stats.php b/htdocs/telephonie/client/stats.php
index b16d93a1f3d..f46144457ee 100644
--- a/htdocs/telephonie/client/stats.php
+++ b/htdocs/telephonie/client/stats.php
@@ -81,7 +81,7 @@ if ($_GET["id"])
 	  $head[$h][1] = $langs->trans("Tarifs (".$row[0].")");	       
 	  $h++;
 	  	
-	  dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
+	  dol_fiche_head($head, $hselected, 'Client : '.$soc->nom);
 
 	  print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
 	  print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td>';
diff --git a/htdocs/telephonie/client/tarifs.php b/htdocs/telephonie/client/tarifs.php
index 733250a2a3b..806cb02aa27 100644
--- a/htdocs/telephonie/client/tarifs.php
+++ b/htdocs/telephonie/client/tarifs.php
@@ -202,15 +202,15 @@ if ($_GET["id"])
 	  $hselected = $h;
 	  $h++;
 	  	  
-	  dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
+	  dol_fiche_head($head, $hselected, 'Client : '.$soc->nom);
 
 	  print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
 	  print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Code client').'</td><td>'.$soc->code_client.'</td></tr>';
 	  
 	  print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$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 "</table>\n<br />\n";
 
diff --git a/htdocs/telephonie/communication.class.php b/htdocs/telephonie/communication.class.php
index c39f32e5535..a698fec49e9 100644
--- a/htdocs/telephonie/communication.class.php
+++ b/htdocs/telephonie/communication.class.php
@@ -105,14 +105,14 @@ class CommunicationTelephonique {
 	/* Fin Numeros speciaux */
 	if ($tarif_achat->cout($num, $this->cout_temp_achat, $this->cout_fixe_achat, $tarif_libelle_achat) == 0)
 	  {
-	    dolibarr_syslog("CommunicationTelephonique::Cout Tarif achat manquant pour $num");
+	    dol_syslog("CommunicationTelephonique::Cout Tarif achat manquant pour $num");
 	    array_push($this->messages, array('warning',"Tarif achat manquant pour le numero $this->numero"));
 	    //$error++;
 	  }
 	
 	if ($tarif_vente->cout($num, $this->cout_temp_vente, $this->cout_fixe_vente, $this->tarif_libelle_vente) == 0)
 	  {
-	    dolibarr_syslog("CommunicationTelephonique::Cout Tarif vente manquant pour $num");
+	    dol_syslog("CommunicationTelephonique::Cout Tarif vente manquant pour $num");
 	    array_push($this->messages, array('error',"Tarif vente manquant pour le numero $this->numero"));
 	    $error++;
 	  }
@@ -196,8 +196,8 @@ class CommunicationTelephonique {
 
     if (! $db->query($sql))
       {
-	dolibarr_syslog("CommunicationTelephonique::logsql Erreur");
-	dolibarr_syslog("CommunicationTelephonique::logsql ".$db->error());
+	dol_syslog("CommunicationTelephonique::logsql Erreur");
+	dol_syslog("CommunicationTelephonique::logsql ".$db->error());
 	return 1;
       }
     else
diff --git a/htdocs/telephonie/config/perms.php b/htdocs/telephonie/config/perms.php
index a3c0f45c86f..f8ae4ff20e0 100644
--- a/htdocs/telephonie/config/perms.php
+++ b/htdocs/telephonie/config/perms.php
@@ -93,7 +93,7 @@ $head[$h][1] = $langs->trans("Specials");
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Definitions des permissions");
+dol_fiche_head($head, $hselected, "Definitions des permissions");
 
 print_titre("Actions speciales");
 
diff --git a/htdocs/telephonie/config/xdsl.php b/htdocs/telephonie/config/xdsl.php
index 4e25d0880c6..e4c7ededd3e 100644
--- a/htdocs/telephonie/config/xdsl.php
+++ b/htdocs/telephonie/config/xdsl.php
@@ -76,7 +76,7 @@ $head[$h][1] = $langs->trans("Workflow");
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Configuration des liens xDSL");
+dol_fiche_head($head, $hselected, "Configuration des liens xDSL");
 
 print_titre("Fournisseurs");
 print '<form method="post" action="xdsl.php?action=addfourn">';
diff --git a/htdocs/telephonie/config/xdsl_product.php b/htdocs/telephonie/config/xdsl_product.php
index e40eb17f510..4cded85cbca 100644
--- a/htdocs/telephonie/config/xdsl_product.php
+++ b/htdocs/telephonie/config/xdsl_product.php
@@ -76,7 +76,7 @@ $head[$h][1] = $langs->trans("Workflow");
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Configuration des liens xDSL");
+dol_fiche_head($head, $hselected, "Configuration des liens xDSL");
 $form = new Form($db);
 print_titre($langs->trans("Products"));
 print '<form method="post" action="xdsl_product.php?action=addproduct">';
diff --git a/htdocs/telephonie/config/xdsl_wkf.php b/htdocs/telephonie/config/xdsl_wkf.php
index 122e455796d..ec048205ef2 100644
--- a/htdocs/telephonie/config/xdsl_wkf.php
+++ b/htdocs/telephonie/config/xdsl_wkf.php
@@ -78,7 +78,7 @@ $hselected = $h;
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Configuration des liens xDSL");
+dol_fiche_head($head, $hselected, "Configuration des liens xDSL");
 
 print_titre("Workflow");
 print '<form method="post" action="xdsl_wkf.php?action=add">';
diff --git a/htdocs/telephonie/contrat/fiche.php b/htdocs/telephonie/contrat/fiche.php
index 7415b06fef1..7055d7b3974 100644
--- a/htdocs/telephonie/contrat/fiche.php
+++ b/htdocs/telephonie/contrat/fiche.php
@@ -466,7 +466,7 @@ else
 		  if($plugin->tabs($head,$h))
 		    $h++;
 		  else
-		    dolibarr_syslog("$var::tabs error");
+		    dol_syslog("$var::tabs error");
 		}
 	      
 	      $head[$h][0] = DOL_URL_ROOT."/telephonie/contrat/stats.php?id=".$contrat->id;
@@ -480,7 +480,7 @@ else
 	      $contrat->load_previous_next_id();
 	      $previous_ref = $contrat->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?id='.$contrat->ref_previous.'">'.img_previous().'</a>':'';
 	      $next_ref     = $contrat->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?id='.$contrat->ref_next.'">'.img_next().'</a>':'';
-	      dolibarr_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
+	      dol_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
 
 	      //print_fiche_titre('Fiche Contrat', $mesg);
 
@@ -644,7 +644,7 @@ else
 			  
 			  print '</a>&nbsp;';
 			  
-			  print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+			  print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 			  
 			  print '<td>'.$obj->code_client."&nbsp;".$obj->agence."</td>\n";
 			  print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n";
@@ -749,7 +749,7 @@ else
 	      $hselected = $h;
 	      $h++;
 	      
-	      dolibarr_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
+	      dol_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
 
 	      print_fiche_titre('Edition du contrat', $mesg);
 	      
diff --git a/htdocs/telephonie/contrat/info.php b/htdocs/telephonie/contrat/info.php
index c3c798ec75b..516e9f7d67e 100644
--- a/htdocs/telephonie/contrat/info.php
+++ b/htdocs/telephonie/contrat/info.php
@@ -79,7 +79,7 @@ if ($_GET["id"])
 	  $hselected = $h;
 	  $h++;
 
-	  dolibarr_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
+	  dol_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
 	  
 	  print_fiche_titre('Fiche Contrat', $mesg);
 	  
diff --git a/htdocs/telephonie/contrat/services.php b/htdocs/telephonie/contrat/services.php
index ca9dd464791..1f000e7a3f7 100644
--- a/htdocs/telephonie/contrat/services.php
+++ b/htdocs/telephonie/contrat/services.php
@@ -101,7 +101,7 @@ if ($_GET["id"])
 	  $head[$h][1] = $langs->trans("Infos");
 	  $h++;
 	  
-	  dolibarr_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
+	  dol_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
 	  
 	  print_fiche_titre('Fiche Contrat', $mesg);
 	  
diff --git a/htdocs/telephonie/contrat/stats.php b/htdocs/telephonie/contrat/stats.php
index d4f02f9bbf7..ad01e9cf8e2 100644
--- a/htdocs/telephonie/contrat/stats.php
+++ b/htdocs/telephonie/contrat/stats.php
@@ -74,7 +74,7 @@ if ($_GET["id"])
 	  $head[$h][1] = $langs->trans("Infos");
 	  $h++;
 	  
-	  dolibarr_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
+	  dol_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref);
 	  
 	  print_fiche_titre('Fiche Contrat', $mesg);
 
diff --git a/htdocs/telephonie/distributeurs/comm/ca.php b/htdocs/telephonie/distributeurs/comm/ca.php
index d935383ecf5..7e6eb98caf2 100644
--- a/htdocs/telephonie/distributeurs/comm/ca.php
+++ b/htdocs/telephonie/distributeurs/comm/ca.php
@@ -80,7 +80,7 @@ if ($_GET["id"] && $_GET["did"])
   $head[$h][1] = "Statistiques";
   $h++;
   */
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/distributeurs/comm/commercial.php b/htdocs/telephonie/distributeurs/comm/commercial.php
index 7c9b3dd532b..8a0adb2aaeb 100644
--- a/htdocs/telephonie/distributeurs/comm/commercial.php
+++ b/htdocs/telephonie/distributeurs/comm/commercial.php
@@ -69,7 +69,7 @@ if ($_GET["id"] && $_GET["did"])
   $head[$h][1] = "Statistiques";
   $h++;
   */
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/distributeurs/commissions.php b/htdocs/telephonie/distributeurs/commissions.php
index 62ab0a497f4..a70095b7388 100644
--- a/htdocs/telephonie/distributeurs/commissions.php
+++ b/htdocs/telephonie/distributeurs/commissions.php
@@ -70,7 +70,7 @@ if ($_GET["id"])
   $head[$h][1] = "Statistiques";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
 
   /* Conso */
diff --git a/htdocs/telephonie/distributeurs/contrat.php b/htdocs/telephonie/distributeurs/contrat.php
index ed89ebb59fa..6221c6e896c 100644
--- a/htdocs/telephonie/distributeurs/contrat.php
+++ b/htdocs/telephonie/distributeurs/contrat.php
@@ -70,7 +70,7 @@ $h = 0;
   $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Distributeurs");
+dol_fiche_head($head, $hselected, "Distributeurs");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/distributeurs/distributeur.php b/htdocs/telephonie/distributeurs/distributeur.php
index b2de131f3c3..8abfb553b88 100644
--- a/htdocs/telephonie/distributeurs/distributeur.php
+++ b/htdocs/telephonie/distributeurs/distributeur.php
@@ -65,7 +65,7 @@ if ($_GET["id"])
       $h++;
     }
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/distributeurs/fiche.php b/htdocs/telephonie/distributeurs/fiche.php
index 988293bdea4..6b4cdd17a8f 100644
--- a/htdocs/telephonie/distributeurs/fiche.php
+++ b/htdocs/telephonie/distributeurs/fiche.php
@@ -83,7 +83,7 @@ if ($_GET["action"] == 'create_commercial')
   $hselected = $h;
   $h++;
   
-  dolibarr_fiche_head($head, $hselected, $distri->nom);
+  dol_fiche_head($head, $hselected, $distri->nom);
 
   print '<form method="POST" action="fiche.php?distri='.$_GET["distri"].'">';
   print '<input type="hidden" name="action" value="add_commercial"></td></tr>';
@@ -117,7 +117,7 @@ $head[$h][1] = "Nouveau distributeur";
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Distributeurs");
+dol_fiche_head($head, $hselected, "Distributeurs");
 
   print '<form method="POST" action="fiche.php">';
   print '<input type="hidden" name="action" value="add"></td></tr>';
diff --git a/htdocs/telephonie/distributeurs/index.php b/htdocs/telephonie/distributeurs/index.php
index 0e754075d3f..0dabf4953a5 100644
--- a/htdocs/telephonie/distributeurs/index.php
+++ b/htdocs/telephonie/distributeurs/index.php
@@ -38,7 +38,7 @@ $head[$h][1] = "Liste";
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Distributeurs");
+dol_fiche_head($head, $hselected, "Distributeurs");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/distributeurs/po.php b/htdocs/telephonie/distributeurs/po.php
index fcd2143f1a4..133b6c4295d 100644
--- a/htdocs/telephonie/distributeurs/po.php
+++ b/htdocs/telephonie/distributeurs/po.php
@@ -71,7 +71,7 @@ if ($_GET["id"])
   $head[$h][1] = "Statistiques";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
   
   if ($page == -1) { $page = 0 ; }
 
diff --git a/htdocs/telephonie/distributeurs/remav.php b/htdocs/telephonie/distributeurs/remav.php
index 33fec60ed8d..38aeeff7c75 100644
--- a/htdocs/telephonie/distributeurs/remav.php
+++ b/htdocs/telephonie/distributeurs/remav.php
@@ -75,7 +75,7 @@ if ($_GET["id"])
   $head[$h][1] = "Statistiques";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
   print '<tr><td width="70%" valign="top">';  
diff --git a/htdocs/telephonie/distributeurs/remconso.php b/htdocs/telephonie/distributeurs/remconso.php
index d3e2005ee5b..1b500690d76 100644
--- a/htdocs/telephonie/distributeurs/remconso.php
+++ b/htdocs/telephonie/distributeurs/remconso.php
@@ -75,7 +75,7 @@ if ($_GET["id"])
   $head[$h][1] = "Statistiques";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
   print '<tr><td width="70%" valign="top">';  
diff --git a/htdocs/telephonie/distributeurs/remuneration.php b/htdocs/telephonie/distributeurs/remuneration.php
index 95ada13444c..1e98aadf0bf 100644
--- a/htdocs/telephonie/distributeurs/remuneration.php
+++ b/htdocs/telephonie/distributeurs/remuneration.php
@@ -71,7 +71,7 @@ if ($_GET["id"])
   $head[$h][1] = "Statistiques";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
   print '<tr><td width="40%" valign="top">';  
diff --git a/htdocs/telephonie/distributeurs/stats.php b/htdocs/telephonie/distributeurs/stats.php
index 0372fa30453..15c7b72fe99 100644
--- a/htdocs/telephonie/distributeurs/stats.php
+++ b/htdocs/telephonie/distributeurs/stats.php
@@ -68,7 +68,7 @@ if ($_GET["id"])
   $hselected = $h;
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/distributeurtel.class.php b/htdocs/telephonie/distributeurtel.class.php
index 534956a1acd..9f7e8d00614 100644
--- a/htdocs/telephonie/distributeurtel.class.php
+++ b/htdocs/telephonie/distributeurtel.class.php
@@ -131,7 +131,7 @@ class DistributeurTelephonie {
 	    }
 	  else
 	    {
-	      dolibarr_syslog("DistributeurTelephonie::Create");
+	      dol_syslog("DistributeurTelephonie::Create");
 	      $this->error_string["prelev"] = "Erreur SQL : $sql";
 	      $this->error_string["autre"] = $this->db->error();
 	      $error++;
@@ -177,13 +177,13 @@ class DistributeurTelephonie {
 	    }
 	  else
 	    {
-	      dolibarr_syslog("DistributeurTelephonie::Fetch Erreur id=".$this->id);
+	      dol_syslog("DistributeurTelephonie::Fetch Erreur id=".$this->id);
 	      return -1;
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("DistributeurTelephonie::Fetch Erreur SQL id=".$this->id);
+	  dol_syslog("DistributeurTelephonie::Fetch Erreur SQL id=".$this->id);
 	  return -2;
 	}
     }
diff --git a/htdocs/telephonie/dolibarrmail.class.php b/htdocs/telephonie/dolibarrmail.class.php
index 83233600aab..98e4ac3a560 100644
--- a/htdocs/telephonie/dolibarrmail.class.php
+++ b/htdocs/telephonie/dolibarrmail.class.php
@@ -156,7 +156,7 @@ class DolibarrMail
       }
     else
       {
-	dolibarr_syslog("DolibarrMail::encode_file Erreur");
+	dol_syslog("DolibarrMail::encode_file Erreur");
       }
     return $encoded;
   }
@@ -178,12 +178,12 @@ class DolibarrMail
 
     if ($this->errors_to)
       {
-	//dolibarr_syslog("DolibarrMail::sendfile with errorsto : ".$this->errors_to);
+	//dol_syslog("DolibarrMail::sendfile with errorsto : ".$this->errors_to);
 	$res = mail($this->addr_to,$this->subject,stripslashes($message_comp),$headers,"-f".$this->errors_to);
       }
     else
       {
-	//dolibarr_syslog("DolibarrMail::sendfile without errorsto");
+	//dol_syslog("DolibarrMail::sendfile without errorsto");
 	$res = mail($this->addr_to,$this->subject,stripslashes($message_comp),$headers);
       }
 
@@ -226,7 +226,7 @@ class DolibarrMail
       }
     else
       {
-	//dolibarr_syslog("DolibarrMail::write_body");
+	//dol_syslog("DolibarrMail::write_body");
       }
 
     $out = $out . $this->message . "\n\n";
diff --git a/htdocs/telephonie/facturation/FacturationCalcul.class.php b/htdocs/telephonie/facturation/FacturationCalcul.class.php
index d7374e1c8a7..6ad245acb7a 100644
--- a/htdocs/telephonie/facturation/FacturationCalcul.class.php
+++ b/htdocs/telephonie/facturation/FacturationCalcul.class.php
@@ -88,13 +88,13 @@ class FacturationCalcul {
 	$num = $this->db->num_rows($resql);
 	$row = $this->db->fetch_row($resql);
 	
-	dolibarr_syslog("FacturationCalcul::Calcul Communications a traiter ".$row[0],LOG_INFO);
+	dol_syslog("FacturationCalcul::Calcul Communications a traiter ".$row[0],LOG_INFO);
 	$this->db->free($resql);
       }
     else
       {
 	$error = 1;
-	dolibarr_syslog("FacturationCalcul Erreur ".$error);
+	dol_syslog("FacturationCalcul Erreur ".$error);
       }
     
     /**********************************************************
@@ -111,13 +111,13 @@ class FacturationCalcul {
       {
 	$row = $this->db->fetch_row($resql);
 	
-	dolibarr_syslog("FacturationCalcul Max rowid avant facture ".$row[0]);
+	dol_syslog("FacturationCalcul Max rowid avant facture ".$row[0]);
 	$this->db->free($resql);
       }
     else
       {
 	$error = 2;
-	dolibarr_syslog("FacturationCalcul Erreur ".$error);
+	dol_syslog("FacturationCalcul Erreur ".$error);
       }
     
     /**
@@ -145,12 +145,12 @@ class FacturationCalcul {
 		$i++;
 	      }            
 	    $this->db->free($resql);
-	    dolibarr_syslog(sizeof($lines_keys)." lignes trouvees");
+	    dol_syslog(sizeof($lines_keys)." lignes trouvees");
 	  }
 	else
 	  {
 	    $error = 3;
-	    dolibarr_syslog("FacturationCalcul Erreur ".$error);
+	    dol_syslog("FacturationCalcul Erreur ".$error);
 	  }
       }
 
@@ -170,12 +170,12 @@ class FacturationCalcul {
 	  {
 	    $batch_id = $this->db->last_insert_id(MAIN_DB_PREFIX."telephonie_facturation_batch");
 	    
-	    dolibarr_syslog("FacturationCalcul Batch ID ".$batch_id);
+	    dol_syslog("FacturationCalcul Batch ID ".$batch_id);
 	  }
 	else
 	  {
 	    $error = 20;
-	    dolibarr_syslog("FacturationCalcul Erreur ".$error);
+	    dol_syslog("FacturationCalcul Erreur ".$error);
 	  }  
       }
     
@@ -200,14 +200,14 @@ class FacturationCalcul {
 		    if ($ligne->socid == 0)
 		      {
 			$error = 4;
-			dolibarr_syslog("FacturationCalcul Error ($error)");
+			dol_syslog("FacturationCalcul Error ($error)");
 		      }	  	  
 		  }
 		else
 		  {
 		    
 		    $error = 5;	  
-		    dolibarr_syslog("FacturationCalcul Error ($error): Aucune societe rattachee a la ligne : $line_key");
+		    dol_syslog("FacturationCalcul Error ($error): Aucune societe rattachee a la ligne : $line_key");
 		  }
 		
 		
@@ -225,7 +225,7 @@ class FacturationCalcul {
 		    else
 		      {
 			$error = 6;
-			dolibarr_syslog("FacturationCalcul FacturationCalcul Error ($error)");
+			dol_syslog("FacturationCalcul FacturationCalcul Error ($error)");
 		      }
 		  }
 		
@@ -260,9 +260,9 @@ class FacturationCalcul {
 		    else
 		      {
 			$error++;
-			dolibarr_syslog("FacturationCalcul Erreur d'insertion dans llx_telephonie_facture");
-			dolibarr_syslog($this->db->error());
-			dolibarr_syslog($sql);
+			dol_syslog("FacturationCalcul Erreur d'insertion dans llx_telephonie_facture");
+			dol_syslog($this->db->error());
+			dol_syslog($sql);
 		      }
 		  }	 
 		/*
@@ -279,7 +279,7 @@ class FacturationCalcul {
 		    if ($this->CalculateBill($this->db, $ligne, $facid, $total_achat, $total_vente, $total_fourn) <> 0)
 		      {
 			$error++;
-			dolibarr_syslog("FacturationCalcul Erreur de calcul de la facture pour la ligne $line_key $ligne->numero");
+			dol_syslog("FacturationCalcul Erreur de calcul de la facture pour la ligne $line_key $ligne->numero");
 			array_push($this->messages, array('error',"Erreur de calcul de la facture pour la ligne $ligne->numero (id=$line_key)"));
 		      }	  
 		  }	  
@@ -323,9 +323,9 @@ class FacturationCalcul {
 		    else
 		      {
 			$error++;
-			dolibarr_syslog("FacturationCalcul Erreur de mise a jour dans llx_telephonie_facture");
-			dolibarr_syslog($this->db->error());
-			dolibarr_syslog($sql);
+			dol_syslog("FacturationCalcul Erreur de mise a jour dans llx_telephonie_facture");
+			dol_syslog($this->db->error());
+			dol_syslog($sql);
 		      }
 		  }
 	  
@@ -342,7 +342,7 @@ class FacturationCalcul {
 		    if (! $this->db->query($sql))
 		      {
 			$error++;
-			dolibarr_syslog("FacturationCalcul Erreur de suppression dans llx_telephonie_import_cdr");
+			dol_syslog("FacturationCalcul Erreur de suppression dans llx_telephonie_import_cdr");
 		      }
 		  }
 	  
@@ -355,18 +355,18 @@ class FacturationCalcul {
 		  {
 		    $this->db->query("COMMIT");
 		    $nbcommit++;
-		    dolibarr_syslog("FacturationCalcul Ligne $ligne->numero - COMMIT");
+		    dol_syslog("FacturationCalcul Ligne $ligne->numero - COMMIT");
 		    array_push($this->messages, "Facturation ligne ".$ligne->numero." reussie");
 		  }
 		else
 		  {
 		    $this->db->query("ROLLBACK");
-		    dolibarr_syslog("FacturationCalcul Ligne $ligne->numero - ROLLBACK de la transaction");	      
+		    dol_syslog("FacturationCalcul Ligne $ligne->numero - ROLLBACK de la transaction");	      
 		  }
 	      }
 	    else
 	      {
-		dolibarr_syslog("FacturationCalcul Erreur ouverture Transaction SQL");
+		dol_syslog("FacturationCalcul Erreur ouverture Transaction SQL");
 	      }
 	  } /* fin de la boucle */
 
@@ -389,7 +389,7 @@ class FacturationCalcul {
       {
 	$row = $this->db->fetch_row($resql);
 
-	dolibarr_syslog("FacturationCalcul Max rowid apr�s facture ".$row[0]);
+	dol_syslog("FacturationCalcul Max rowid apr�s facture ".$row[0]);
 	$this->db->free($resql);
       }
     else
@@ -403,7 +403,7 @@ class FacturationCalcul {
      *
      ***********************************************************/
 
-    dolibarr_syslog($nbcommit." facture emises");
+    dol_syslog($nbcommit." facture emises");
 
     /**********************************************************
      *
@@ -418,7 +418,7 @@ class FacturationCalcul {
       {
 	$row = $this->db->fetch_row($resql);
 
-	dolibarr_syslog($row[0]. " communications restantes dans la table d'import");
+	dol_syslog($row[0]. " communications restantes dans la table d'import");
 	$this->db->free($resql);
       }
     else
@@ -426,7 +426,7 @@ class FacturationCalcul {
 	$error++;
       }
 
-    dolibarr_syslog("FacturationCalcul Fin Batch ID ".$batch_id);
+    dol_syslog("FacturationCalcul Fin Batch ID ".$batch_id);
   }
   /******************************************************************************
    *
@@ -471,7 +471,7 @@ class FacturationCalcul {
 
     $fournisseur_id = $ligne->fournisseur_id;
     
-    dolibarr_syslog("FacturationCalcul::CalculateBill Utilisation du tarif ".$tarif_spec." pour la ligne ".$ligne->id);
+    dol_syslog("FacturationCalcul::CalculateBill Utilisation du tarif ".$tarif_spec." pour la ligne ".$ligne->id);
     
     $tarif_achat = new TelephonieTarif($db, $tarif_spec, "achat", $fournisseur_id);
     $tarif_vente = new TelephonieTarif($db, $tarif_spec, "vente", $tarif_spec, $ligne->client_comm_id);
@@ -519,7 +519,7 @@ class FacturationCalcul {
     else
       {
 	$error++;
-	dolibarr_syslog("FacturationCalcul::CalculateBill Erreur dans Calcul() Probleme SQL");
+	dol_syslog("FacturationCalcul::CalculateBill Erreur dans Calcul() Probleme SQL");
       }
 
     for ($ii = 0 ; $ii < $num_sql ; $ii++)
@@ -542,7 +542,7 @@ class FacturationCalcul {
 
 
 
-    dolibarr_syslog("FacturationCalcul::CalculateBill return $error", LOG_DEBUG);
+    dol_syslog("FacturationCalcul::CalculateBill return $error", LOG_DEBUG);
     return $error;
   }
 
diff --git a/htdocs/telephonie/facturation/FacturationEmission.class.php b/htdocs/telephonie/facturation/FacturationEmission.class.php
index 4206b502597..0b0eb73c678 100644
--- a/htdocs/telephonie/facturation/FacturationEmission.class.php
+++ b/htdocs/telephonie/facturation/FacturationEmission.class.php
@@ -71,7 +71,7 @@ class FacturationEmission {
     else
       {
 	$this->error = 1;
-	dolibarr_syslog("Erreur ".$error);
+	dol_syslog("Erreur ".$error);
       }
     return $this->error;
   }
@@ -113,13 +113,13 @@ class FacturationEmission {
 	
 	$batch_id = $row[0];
 	
-	dolibarr_syslog("FacturationEmission::Emission Traitement du batch ".$batch_id);
+	dol_syslog("FacturationEmission::Emission Traitement du batch ".$batch_id);
 	$this->db->free($resql);
       }
     else
       {
 	$error = 1;
-	dolibarr_syslog("FacturationEmission::Emission Erreur ".$error);
+	dol_syslog("FacturationEmission::Emission Erreur ".$error);
       }
 
     /*
@@ -136,7 +136,7 @@ class FacturationEmission {
 	 *
 	 ***************************************************************/
 	
-	dolibarr_syslog("FacturationEmission::Emission Lecture des contrats",LOG_DEBUG);
+	dol_syslog("FacturationEmission::Emission Lecture des contrats",LOG_DEBUG);
 	
 	$sql = "SELECT distinct(c.rowid)";
 	$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_facture as f";
@@ -152,7 +152,7 @@ class FacturationEmission {
 	if (strlen($optcontrat) >  0)
 	  {
 	    $sql .= " AND c.rowid=".$optcontrat;
-	    dolibarr_syslog("Limite sur le contrat : ".$optcontrat);
+	    dol_syslog("Limite sur le contrat : ".$optcontrat);
 	  }
 	
 	$contrats = array();
@@ -172,7 +172,7 @@ class FacturationEmission {
 	else
 	  {
 	    $error = 2;
-	    dolibarr_syslog("FacturationEmission::Emission Erreur $error",LOG_ERR);
+	    dol_syslog("FacturationEmission::Emission Erreur $error",LOG_ERR);
 	  }
       }
     /*
@@ -181,7 +181,7 @@ class FacturationEmission {
      */
     if (!$error)
       { 
-	dolibarr_syslog("FacturationEmission::Emission Nombre de contrats � facturer ".sizeof($contrats),LOG_DEBUG);
+	dol_syslog("FacturationEmission::Emission Nombre de contrats � facturer ".sizeof($contrats),LOG_DEBUG);
 	array_push($this->messages, "Nombre de contrats � facturer : ".sizeof($contrats));
 	$xcli = 0;
 	$xclis = sizeof($contrats);
@@ -191,7 +191,7 @@ class FacturationEmission {
 	    $xcli++;
 	    
 	    /* Lecture des factures t�l�phoniques du contrat */
-	    dolibarr_syslog("FacturationEmission::Emission ".$xcli."/".$xclis." Contrat � facturer id=".$contrat." (".memory_get_usage() .")",LOG_DEBUG);
+	    dol_syslog("FacturationEmission::Emission ".$xcli."/".$xclis." Contrat � facturer id=".$contrat." (".memory_get_usage() .")",LOG_DEBUG);
 	    array_push($this->messages, $xcli."/".$xclis." Contrat � facturer id=".$contrat.",batch=".$batch_id);
 	    $sql = "SELECT f.rowid FROM ";     
 	    $sql .=     MAIN_DB_PREFIX."telephonie_facture as f";
@@ -219,7 +219,7 @@ class FacturationEmission {
 		  }            
 		$this->db->free($resql);
 		
-		dolibarr_syslog("FacturationEmission::Emission Contrat $contrat, $i factures trouv�es � g�n�rer", LOG_DEBUG);
+		dol_syslog("FacturationEmission::Emission Contrat $contrat, $i factures trouv�es � g�n�rer", LOG_DEBUG);
 		array_push($this->messages, "Contrat $contrat, $i factures trouv�es � g�n�rer");
 		
 		$factures_prev = array();
@@ -243,7 +243,7 @@ class FacturationEmission {
 	    else
 	      {
 		$error = 1;
-		dolibarr_syslog("FacturationEmission::Emission Error ".$error, LOG_ERR);
+		dol_syslog("FacturationEmission::Emission Error ".$error, LOG_ERR);
 		array_push($this->messages, "Erreur base de donnees");
 	      }     
 	  }
@@ -279,7 +279,7 @@ class FacturationEmission {
 	else
 	  {
 	    $error++;
-	    dolibarr_syslog("FacturationEmission::facture_contrat Impossible de lire le contrat");
+	    dol_syslog("FacturationEmission::facture_contrat Impossible de lire le contrat");
 	    array_push($this->messages, array('error',"Impossible de lire le contrat : $contrat_id"));
 	  }
       }
@@ -292,7 +292,7 @@ class FacturationEmission {
 	
 	if ($soc->fetch($contrat->client_facture_id) )
 	  {
-	    if ($verbose) dolibarr_syslog($soc->nom);
+	    if ($verbose) dol_syslog($soc->nom);
 	  }
 	else
 	  {
@@ -307,7 +307,7 @@ class FacturationEmission {
      */	      
     if (!$error)
       {
-	if ($verbose) dolibarr_syslog("FacturationEmission::facture_contrat Cr�ation facture pour $soc->nom", LOG_DEBUG);
+	if ($verbose) dol_syslog("FacturationEmission::facture_contrat Cr�ation facture pour $soc->nom", LOG_DEBUG);
 	
 	$fac = new Facture($db, $soc->id);
 	$cancel_facture = 1;
@@ -323,7 +323,7 @@ class FacturationEmission {
 	  }
 	else
 	  {
-	    dolibarr_syslog("FacturationEmission::facture_contrat Erreur cr�ation objet facture erreur : $facid",LOG_ERR);
+	    dol_syslog("FacturationEmission::facture_contrat Erreur cr�ation objet facture erreur : $facid",LOG_ERR);
 	    array_push($this->messages, array('error',"Erreur cr�ation objet facture erreur : $facid"));
 	    $error = 16;
 	  }		  
@@ -346,7 +346,7 @@ class FacturationEmission {
 	      }
 	    else
 	      {
-		dolibarr_syslog("FacturationEmission::facture_contrat Erreur lecture facture t�l�phonique $factel_id");
+		dol_syslog("FacturationEmission::facture_contrat Erreur lecture facture t�l�phonique $factel_id");
 		array_push($this->messages, array('error',"Erreur lecture facture t�l�phonique (id=$factel_id)"));
 		$error = 17;
 	      }
@@ -360,7 +360,7 @@ class FacturationEmission {
 	      }
 	    else
 	      {
-		dolibarr_syslog("ERREUR lecture ligne $factel->ligne");
+		dol_syslog("ERREUR lecture ligne $factel->ligne");
 		$error = 18;
 	      }
 	  
@@ -465,7 +465,7 @@ class FacturationEmission {
 	else
 	  {
 	    $error = 20;
-	    dolibarr_syslog("FacturationEmission Erreur $error", LOG_ERR);
+	    dol_syslog("FacturationEmission Erreur $error", LOG_ERR);
 	  }
       }
      
@@ -511,8 +511,8 @@ class FacturationEmission {
 	else
 	  {
 	    $error = 21;
-	    dolibarr_syslog($db->error());
-	    dolibarr_syslog("Erreur rejet prelevement");
+	    dol_syslog($db->error());
+	    dol_syslog("Erreur rejet prelevement");
 	  }
       }
 
@@ -543,8 +543,8 @@ class FacturationEmission {
 	else
 	  {
 	    $error = 32;
-	    dolibarr_syslog("Erreur remise exceptionnelle");
-	    dolibarr_syslog($sql);
+	    dol_syslog("Erreur remise exceptionnelle");
+	    dol_syslog($sql);
 	  }
       
 	//print "remise $remise_exceptionnelle \n";
@@ -673,7 +673,7 @@ class FacturationEmission {
       {
 	if (!$error && !$cancel_facture)
 	  {
-	    if ($verbose) dolibarr_syslog("Validation de la facture : $facid");
+	    if ($verbose) dol_syslog("Validation de la facture : $facid");
 	  
 	    $y = substr($year, -1);
 	    $m = substr("00".$month, -2);
@@ -713,7 +713,7 @@ class FacturationEmission {
 	      }
 	    else
 	      {
-		dolibarr_syslog("ERREUR lecture facture t�l�phonique $factel_id");
+		dol_syslog("ERREUR lecture facture t�l�phonique $factel_id");
 		$error = 17;
 	      }
 	  
@@ -726,7 +726,7 @@ class FacturationEmission {
 	      }
 	    else
 	      {
-		dolibarr_syslog("ERREUR lecture ligne $factel->ligne");
+		dol_syslog("ERREUR lecture ligne $factel->ligne");
 		$error = 18;
 	      }
 
@@ -755,7 +755,7 @@ class FacturationEmission {
 		  }
 		else
 		  {
-		    dolibarr_syslog("FacturationEmission::facture_contrat ERREUR lors de G�n�ration du pdf d�taill� ($modele)");
+		    dol_syslog("FacturationEmission::facture_contrat ERREUR lors de G�n�ration du pdf d�taill� ($modele)");
 		    $error = 19;
 		  } 
 	      }
@@ -798,7 +798,7 @@ class FacturationEmission {
   
     if (!$error && !$cancel_facture && $valid_ok == 1)
       {
-	if ($verbose) dolibarr_syslog("G�n�ration du pdf facture : $facid");
+	if ($verbose) dol_syslog("G�n�ration du pdf facture : $facid");
       
 	$fac->fetch($facid);
 	$fac->fetch_client();
@@ -812,7 +812,7 @@ class FacturationEmission {
 	    $message .= $fac->client->bank_account->number."\n";
 	  }
       
-	if ($verbose) dolibarr_syslog("Cr�ation du pdf facture : $facid");
+	if ($verbose) dol_syslog("Cr�ation du pdf facture : $facid");
       
 	if (! facture_pdf_create($db, $facid, $message))
 	  {
@@ -838,16 +838,16 @@ class FacturationEmission {
 	      }
 	    else
 	      {
-		dolibarr_syslog("facture $facid non preleve, RIB incorrect");
+		dol_syslog("facture $facid non preleve, RIB incorrect");
 	      }	  
 	  }
       
-	if ($verbose) dolibarr_syslog("Commit de la transaction");;
+	if ($verbose) dol_syslog("Commit de la transaction");;
       }
     else
       {
 	$db->query("ROLLBACK");
-	dolibarr_syslog("ROLLBACK de la transaction $error");
+	dol_syslog("ROLLBACK de la transaction $error");
       }    
   }
   /**
@@ -858,8 +858,8 @@ class FacturationEmission {
    */
   function _prelevements($db, $user, $factures_prev)
   { 
-    dolibarr_syslog("FacturationEmission::_prelevements Debut demande de prelevement", LOG_DEBUG);
-    dolibarr_syslog("FacturationEmission::_prelevements Nombre de factures ".sizeof($factures_prev),LOG_DEBUG); 
+    dol_syslog("FacturationEmission::_prelevements Debut demande de prelevement", LOG_DEBUG);
+    dol_syslog("FacturationEmission::_prelevements Nombre de factures ".sizeof($factures_prev),LOG_DEBUG); 
     if (sizeof($factures_prev) > 0)
       {
 	foreach ($factures_prev as $fac)
@@ -870,7 +870,7 @@ class FacturationEmission {
 	    $fact->demande_prelevement($user);
 	  }
       }
-    dolibarr_syslog("FacturationEmission::_prelevements Fin demande de prelevement", LOG_DEBUG);
+    dol_syslog("FacturationEmission::_prelevements Fin demande de prelevement", LOG_DEBUG);
   }
 
 
@@ -909,7 +909,7 @@ class FacturationEmission {
 		  }
 		$sendto = substr($sendto,0,strlen($sendto) - 1);
 
-		dolibarr_syslog("[EM] Envoi email � ".html_entity_decode($sendto) );
+		dol_syslog("[EM] Envoi email � ".html_entity_decode($sendto) );
 
 		$subject = ereg_replace("#FACREF#",$fact->ref,TELEPHONIE_MAIL_FACTURATION_SUJET);
 		$subject = ereg_replace("#CONTRAT#",$contrat->ref, $subject);
@@ -999,7 +999,7 @@ class FacturationEmission {
 	      }
 	    else
 	      {
-		dolibarr_syslog("Aucun email trouv�");
+		dol_syslog("Aucun email trouv�");
 	      }
 	  }
       }
diff --git a/htdocs/telephonie/facturation/FacturationImportCdr.class.php b/htdocs/telephonie/facturation/FacturationImportCdr.class.php
index fb6c6210365..d06f1f1a73f 100644
--- a/htdocs/telephonie/facturation/FacturationImportCdr.class.php
+++ b/htdocs/telephonie/facturation/FacturationImportCdr.class.php
@@ -71,12 +71,12 @@ class FacturationImportCdr {
 		if (is_file($dir.$xfile) && substr($xfile, -4) == ".csv")
 		  {
 		    $files[$i] = $dir.$xfile;
-		    dolibarr_syslog("FacturationImportCdr::Import ".$xfile." ajoute");
+		    dol_syslog("FacturationImportCdr::Import ".$xfile." ajoute");
 		    $i++;
 		  }
 		else
 		  {
-		    dolibarr_syslog("FacturationImportCdr::Import ".$xfile." ignore");
+		    dol_syslog("FacturationImportCdr::Import ".$xfile." ignore");
 		  }
 	      }
 	    
@@ -84,13 +84,13 @@ class FacturationImportCdr {
 	  }
 	else
 	  {
-	    dolibarr_syslog("FacturationImportCdr::Import Impossible de lire $dir");
+	    dol_syslog("FacturationImportCdr::Import Impossible de lire $dir");
 	    exit ;
 	  }
       }
     else
       {
-	dolibarr_syslog("FacturationImportCdr::Import Impossible de lire $file");
+	dol_syslog("FacturationImportCdr::Import Impossible de lire $file");
 	exit ;
       }
     
@@ -102,7 +102,7 @@ class FacturationImportCdr {
         
     if ($fourn->fetch($id_fourn) <> 0)
       {  
-	dolibarr_syslog("FacturationImportCdr::Import Erreur recherche fournisseur", LOG_ERR);
+	dol_syslog("FacturationImportCdr::Import Erreur recherche fournisseur", LOG_ERR);
       }
     
     /*
@@ -122,7 +122,7 @@ class FacturationImportCdr {
       }
     else
       {
-	dolibarr_syslog("FacturationImportCdr::Import Erreur recherche si fichiers deja charges");
+	dol_syslog("FacturationImportCdr::Import Erreur recherche si fichiers deja charges");
       }
 
     /*
@@ -141,7 +141,7 @@ class FacturationImportCdr {
       }
     else
       {
-	dolibarr_syslog("FacturationImportCdr::Import Erreur recherche si fichiers deja traites");
+	dol_syslog("FacturationImportCdr::Import Erreur recherche si fichiers deja traites");
       }
 
     /*
@@ -166,7 +166,7 @@ class FacturationImportCdr {
       }
     else
       {
-	dolibarr_syslog("FacturationImportCdr::Import Erreur chargement des lignes", LOG_DEBUG);
+	dol_syslog("FacturationImportCdr::Import Erreur chargement des lignes", LOG_DEBUG);
 	exit ;
       }
     
@@ -187,7 +187,7 @@ class FacturationImportCdr {
 	    if ( $this->_verif($this->db, $xfile, $fichiers) == 0)
 	      {      
 		$error = 0;
-		dolibarr_syslog("FacturationImportCdr::Import Lecture du fichier $xfile", LOG_DEBUG);
+		dol_syslog("FacturationImportCdr::Import Lecture du fichier $xfile", LOG_DEBUG);
 		array_push($this->messages,array('info',"Fichier ".basename($xfile)." : utilisation format ".$cdrformat->nom));
 
 		$error = $cdrformat->ReadFile($xfile);
@@ -238,27 +238,27 @@ class FacturationImportCdr {
 				      }
 				    else
 				      {
-					dolibarr_syslog("FacturationImportCdr::Import Erreur de traitement de ligne $index", LOG_ERR);
-					dolibarr_syslog("FacturationImportCdr::Import $sql", LOG_DEBUG);
+					dol_syslog("FacturationImportCdr::Import Erreur de traitement de ligne $index", LOG_ERR);
+					dol_syslog("FacturationImportCdr::Import $sql", LOG_DEBUG);
 					$error++;
 				      }
 				  }
 				else
 				  {
-				    dolibarr_syslog("FacturationImportCdr::Import Ligne : $cont ignoree", LOG_INFO);
+				    dol_syslog("FacturationImportCdr::Import Ligne : $cont ignoree", LOG_INFO);
 				    $error++;
 				  }
 			      }
 			    else
 			      {
-				dolibarr_syslog("FacturationImportCdr::Import Duree nulle Ligne : $cont ignoree", LOG_INFO);
+				dol_syslog("FacturationImportCdr::Import Duree nulle Ligne : $cont ignoree", LOG_INFO);
 			      }
 			  }
 			else
 			  {
 			    if (!in_array($ligne, $unknown_lines))
 			      {
-				dolibarr_syslog("FacturationImportCdr::Import Ligne $ligne inconnue Ligne : $cont ignoree", LOG_INFO);
+				dol_syslog("FacturationImportCdr::Import Ligne $ligne inconnue Ligne : $cont ignoree", LOG_INFO);
 				array_push($this->messages,array('warning',"Ligne $ligne inconnue"));
 			      }
 			    array_push($unknown_lines, $ligne);
@@ -266,10 +266,10 @@ class FacturationImportCdr {
 			$line++;
 		      }		    
 
-		    dolibarr_syslog("FacturationImportCdr::Import $line lignes traitees dans le fichier", LOG_INFO);
+		    dol_syslog("FacturationImportCdr::Import $line lignes traitees dans le fichier", LOG_INFO);
 		    $level = ($line > 0) ? 'info':'warning';
 		    array_push($this->messages,array($level,"$line lignes traitees dans le fichier"));		
-		    dolibarr_syslog("FacturationImportCdr::Import $line_inserted insert effectues", LOG_INFO);
+		    dol_syslog("FacturationImportCdr::Import $line_inserted insert effectues", LOG_INFO);
 		    $level = ($line_inserted > 0) ? 'info':'warning';
 		    array_push($this->messages,array($level,"$line_inserted ajout dans la table des CDR a traiter"));
 		    
@@ -289,7 +289,7 @@ class FacturationImportCdr {
 		    else
 		      {
 			$this->db->query("ROLLBACK");
-			dolibarr_syslog("ROLLBACK");
+			dol_syslog("ROLLBACK");
 			array_push($this->messages, array('error',"Fichier ".basename($xfile)." : echec de l'importation"));
 		      }		    
 		  }
@@ -302,7 +302,7 @@ class FacturationImportCdr {
 	else
 	  {
 	    print "Erreur lecture : $xfile";
-	    dolibarr_syslog($xfile . " not readable");
+	    dol_syslog($xfile . " not readable");
 	    array_push($this->messages, "Fichier ".basename($xfile)." not readable");
 	  }
       }	
@@ -319,7 +319,7 @@ class FacturationImportCdr {
 
     if (in_array (basename($file), $fichiers))
       {
-	dolibarr_syslog ("Fichier ".basename($file)." deja charge/traite");
+	dol_syslog ("Fichier ".basename($file)." deja charge/traite");
 	array_push($this->messages, array('warning',"Fichier ".basename($file)." deja charge/traite"));
 	$result = -1;
       }
diff --git a/htdocs/telephonie/facturation/FacturationVerifCdr.class.php b/htdocs/telephonie/facturation/FacturationVerifCdr.class.php
index dc942d880fb..c9536b8cd5c 100644
--- a/htdocs/telephonie/facturation/FacturationVerifCdr.class.php
+++ b/htdocs/telephonie/facturation/FacturationVerifCdr.class.php
@@ -40,7 +40,7 @@ class FacturationVerifCdr {
     if ( $this->db->query($sql) )
       {
 	$row = $this->db->fetch_row();
-	dolibarr_syslog("facturation-verif.php ".$row[0]." lignes de communications a verifier");
+	dol_syslog("facturation-verif.php ".$row[0]." lignes de communications a verifier");
       }
 
     /*******************************************************************************
@@ -52,7 +52,7 @@ class FacturationVerifCdr {
     
     $tarif_vente = new TelephonieTarif($this->db, $grille_vente, "vente");
     
-    dolibarr_syslog("facturation-verif.php Grille : $grille contient ".$tarif_vente->num_tarifs." tarifs");
+    dol_syslog("facturation-verif.php Grille : $grille contient ".$tarif_vente->num_tarifs." tarifs");
     
     $sql = "SELECT distinct(num) FROM ".MAIN_DB_PREFIX."telephonie_import_cdr";
     
diff --git a/htdocs/telephonie/facture/liste.php b/htdocs/telephonie/facture/liste.php
index 9bcb6efadc2..62d1975a77d 100644
--- a/htdocs/telephonie/facture/liste.php
+++ b/htdocs/telephonie/facture/liste.php
@@ -156,7 +156,7 @@ if ($result)
       print '</a>&nbsp;';
 
       print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socid.'">'.$obj->nom."</a></td>\n";
-      print '<td><a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?numero='.$obj->ligne.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<td><a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?numero='.$obj->ligne.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
       print '<td align="center">'.$obj->date."</td>\n";
       print '<td align="right">'.sprintf("%01.4f",$obj->cout_vente)."</td>\n";
 
diff --git a/htdocs/telephonie/facturetel.class.php b/htdocs/telephonie/facturetel.class.php
index c59766809a9..2350e26c915 100644
--- a/htdocs/telephonie/facturetel.class.php
+++ b/htdocs/telephonie/facturetel.class.php
@@ -58,7 +58,7 @@ class FactureTel {
 	    }
 	  else
 	    {
-	      dolibarr_syslog("FactureTel::Fetch() Error aucune facture avec cet id=$id", LOG_ERR);
+	      dol_syslog("FactureTel::Fetch() Error aucune facture avec cet id=$id", LOG_ERR);
 	      $result = -2;
 	    }
 
@@ -67,7 +67,7 @@ class FactureTel {
       else
 	{
 	  /* Erreur select SQL */
-	  dolibarr_syslog("FactureTel::Fetch() Error SQL id=$id", LOG_ERR);
+	  dol_syslog("FactureTel::Fetch() Error SQL id=$id", LOG_ERR);
 	  $result = -1;
 	}
 
@@ -94,7 +94,7 @@ class FactureTel {
     else
       {
 	/* Erreur select SQL */
-	dolibarr_syslog("FactureTel::affect_num_facture_compta() Error SQL id=$facid", LOG_ERR);
+	dol_syslog("FactureTel::affect_num_facture_compta() Error SQL id=$facid", LOG_ERR);
 	$result = -1;
 	return 1;
       }
diff --git a/htdocs/telephonie/fournisseur/cdrformat/cdrformat.fructidor.class.php b/htdocs/telephonie/fournisseur/cdrformat/cdrformat.fructidor.class.php
index 468d4f37e07..e3f871c1dd1 100644
--- a/htdocs/telephonie/fournisseur/cdrformat/cdrformat.fructidor.class.php
+++ b/htdocs/telephonie/fournisseur/cdrformat/cdrformat.fructidor.class.php
@@ -50,7 +50,7 @@ class CdrFormatFructidor
   function ReadFile($file)
   {
     $this->messages = array();
-    dolibarr_syslog("CdrFormatFructidor::ReadFile($file)", LOG_DEBUG);
+    dol_syslog("CdrFormatFructidor::ReadFile($file)", LOG_DEBUG);
     $badformat = 0;
     $error = 0;
     $i = 0;
@@ -85,7 +85,7 @@ class CdrFormatFructidor
 	      }	  
 	    else
 	      {
-		dolibarr_syslog("CdrFormatFructidor::ReadFile Mauvais format de fichier ligne $line", LOG_ERR);
+		dol_syslog("CdrFormatFructidor::ReadFile Mauvais format de fichier ligne $line", LOG_ERR);
 		$badformat++;
 	      }  
 	    $line++;
@@ -99,7 +99,7 @@ class CdrFormatFructidor
 	array_push($this->messages,array('error',"$badformat lignes ont un mauvais format dans le fichier"));
       }
 
-    dolibarr_syslog("CdrFormatFructidor::ReadFile read $i lines", LOG_DEBUG);
+    dol_syslog("CdrFormatFructidor::ReadFile read $i lines", LOG_DEBUG);
 
     return $error;
   }
diff --git a/htdocs/telephonie/fournisseur/cdrformat/cdrformat.messidor.class.php b/htdocs/telephonie/fournisseur/cdrformat/cdrformat.messidor.class.php
index bdb17181eac..d20126674d2 100644
--- a/htdocs/telephonie/fournisseur/cdrformat/cdrformat.messidor.class.php
+++ b/htdocs/telephonie/fournisseur/cdrformat/cdrformat.messidor.class.php
@@ -48,7 +48,7 @@ class CdrFormatMessidor
 
   function ReadFile($file)
   {
-    dolibarr_syslog("CdrFormatMessidor::ReadFile($file)", LOG_DEBUG);
+    dol_syslog("CdrFormatMessidor::ReadFile($file)", LOG_DEBUG);
     
     $error = 0;
     $i = 0;
@@ -77,13 +77,13 @@ class CdrFormatMessidor
 	      }	  
 	    else
 	      {
-		dolibarr_syslog("CdrFormatMessidor::ReadFile Mauvais format de fichier ligne $line");
+		dol_syslog("CdrFormatMessidor::ReadFile Mauvais format de fichier ligne $line");
 	      }  
 	  }
 	$line++;
       }
     fclose($hf);
     array_push($this->messages,array('info',"Fichier ".basename($file)." : $line lignes lues dans le fichier"));
-    dolibarr_syslog("CdrFormatMessidor::ReadFile read $i lines", LOG_DEBUG);
+    dol_syslog("CdrFormatMessidor::ReadFile read $i lines", LOG_DEBUG);
   }
 }
diff --git a/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php b/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php
index 85bdc03bfbe..5d2187064b4 100644
--- a/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php
+++ b/htdocs/telephonie/fournisseur/commande/commande.tableur.class.php
@@ -32,7 +32,7 @@ class CommandeMethodeTableur extends CommandeMethode
 
   function CommandeMethodeTableur ($DB, $USER=0, $fourn=0)
   {
-    dolibarr_syslog("CommandeMethodeTableur::CommandeMethodeTableur");
+    dol_syslog("CommandeMethodeTableur::CommandeMethodeTableur");
 
 
     $this->nom = "M�thode Tableur joint";
@@ -48,8 +48,8 @@ class CommandeMethodeTableur extends CommandeMethode
 
   function Create()
   {
-    dolibarr_syslog("CommandeMethodeTableur::Create Fournisseur id : ".$this->fourn->id);
-    dolibarr_syslog("CommandeMethodeTableur::Create Fournisseur email : ".$this->fourn->email_commande);
+    dol_syslog("CommandeMethodeTableur::Create Fournisseur id : ".$this->fourn->id);
+    dol_syslog("CommandeMethodeTableur::Create Fournisseur email : ".$this->fourn->email_commande);
 
     $this->date = time();
 
@@ -75,7 +75,7 @@ class CommandeMethodeTableur extends CommandeMethode
 	$res = $res + $this->MailFile($fname);
       }
 
-    dolibarr_syslog("CommandeMethodeTableur::CommandeMethodeTableur Return $res");
+    dol_syslog("CommandeMethodeTableur::CommandeMethodeTableur Return $res");
 
     return $res;
   }
@@ -133,7 +133,7 @@ class CommandeMethodeTableur extends CommandeMethode
       }
     else
       {
-	dolibarr_syslog("CommandeMethodeTableur::MailFile Erreur send");
+	dol_syslog("CommandeMethodeTableur::MailFile Erreur send");
       }
 
   }
@@ -275,7 +275,7 @@ class CommandeMethodeTableur extends CommandeMethode
       }
     else 
       {
-	dolibarr_syslog("CommandeMethodeTableur::CreateFile Erreur SQL 1");
+	dol_syslog("CommandeMethodeTableur::CreateFile Erreur SQL 1");
       }
 
     /*
@@ -324,7 +324,7 @@ class CommandeMethodeTableur extends CommandeMethode
       }
     else 
       {
-	dolibarr_syslog("CommandeMethodeTableur::CreateFile Erreur SQL 2");
+	dol_syslog("CommandeMethodeTableur::CreateFile Erreur SQL 2");
       }
    
     $workbook->close();
diff --git a/htdocs/telephonie/fournisseur/commande/methode.commande.class.php b/htdocs/telephonie/fournisseur/commande/methode.commande.class.php
index 7851816a4e0..714d3e95205 100644
--- a/htdocs/telephonie/fournisseur/commande/methode.commande.class.php
+++ b/htdocs/telephonie/fournisseur/commande/methode.commande.class.php
@@ -50,14 +50,14 @@ class CommandeMethode
 	    if (! $this->db->query($sql) )
 	      {
 		$error++;
-		dolibarr_syslog($sql);
+		dol_syslog($sql);
 	      }
 	  }
       }
     else
       {
 	$error++;
-	dolibarr_syslog($sql);
+	dol_syslog($sql);
       }
 
     return $error;
diff --git a/htdocs/telephonie/fournisseur/fiche.php b/htdocs/telephonie/fournisseur/fiche.php
index 7e088771146..d2ab01125c7 100644
--- a/htdocs/telephonie/fournisseur/fiche.php
+++ b/htdocs/telephonie/fournisseur/fiche.php
@@ -232,7 +232,7 @@ if ($_GET["id"] > 0)
 	$head[$h][1] = $langs->trans("CDR");
 	$h++;
 	*/
-	dolibarr_fiche_head($head, $hselected, 'Fournisseur : '.$fourn->nom);
+	dol_fiche_head($head, $hselected, 'Fournisseur : '.$fourn->nom);
 	
 	print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 	
diff --git a/htdocs/telephonie/fournisseurtel.class.php b/htdocs/telephonie/fournisseurtel.class.php
index 20a0fa0de12..44edd61bf57 100644
--- a/htdocs/telephonie/fournisseurtel.class.php
+++ b/htdocs/telephonie/fournisseurtel.class.php
@@ -140,13 +140,13 @@ class FournisseurTelephonie {
 	    }
 	  else
 	    {
-	      dolibarr_syslog("FournisseurTelephonie::Fetch Erreur id=".$this->id);
+	      dol_syslog("FournisseurTelephonie::Fetch Erreur id=".$this->id);
 	      return -1;
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("FournisseurTelephonie::Fetch Erreur SQL id=".$this->id);
+	  dol_syslog("FournisseurTelephonie::Fetch Erreur SQL id=".$this->id);
 	  return -2;
 	}
     }
@@ -255,7 +255,7 @@ class FournisseurTelephonie {
    */
   function CreateCommande($user)
   {
-    dolibarr_syslog("FournisseurTelephonie::CreateCommande User:$user->id");
+    dol_syslog("FournisseurTelephonie::CreateCommande User:$user->id");
 
     $fileclass = $this->classdir.'commande.'.$this->class_commande.'.class.php';
 
@@ -263,7 +263,7 @@ class FournisseurTelephonie {
 
     $classname = "CommandeMethode".ucfirst($this->class_commande);
 
-    dolibarr_syslog("FournisseurTelephonie::CreateCommande user $classname");
+    dol_syslog("FournisseurTelephonie::CreateCommande user $classname");
 
     $ct = new $classname($this->db, $user, $this);
 	
diff --git a/htdocs/telephonie/ligne/commande.php b/htdocs/telephonie/ligne/commande.php
index 4f5a569fdbe..07584908cd5 100644
--- a/htdocs/telephonie/ligne/commande.php
+++ b/htdocs/telephonie/ligne/commande.php
@@ -70,13 +70,13 @@ if ($_GET["id"] or $_GET["numero"])
       $head[$h][1] = $langs->trans('Stats');
       $h++;
 
-      dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+      dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
 
       print_fiche_titre('Factures Ligne', $mesg);
       
       print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 
-      print '<tr><td width="25%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero,0,0,true).'</td></tr>';
+      print '<tr><td width="25%">Num�ro</td><td>'.dol_print_phone($ligne->numero,0,0,true).'</td></tr>';
 	      	     
       $client = new Societe($db, $ligne->client_id);
       $client->fetch($ligne->client_id);
diff --git a/htdocs/telephonie/ligne/commande/archives.php b/htdocs/telephonie/ligne/commande/archives.php
index 83445d9cb0e..2204aa7f9d0 100644
--- a/htdocs/telephonie/ligne/commande/archives.php
+++ b/htdocs/telephonie/ligne/commande/archives.php
@@ -104,7 +104,7 @@ if ($result)
 }
 else 
 {
-  dolibarr_print_error($db);
+  dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/telephonie/ligne/commande/fiche.php b/htdocs/telephonie/ligne/commande/fiche.php
index 565fea0666a..9f4dd46a0d4 100644
--- a/htdocs/telephonie/ligne/commande/fiche.php
+++ b/htdocs/telephonie/ligne/commande/fiche.php
@@ -162,7 +162,7 @@ if ($db->query($sql))
       $socf->fetch($obj->sfidp);
 
       print "<tr $bc[$var]>";
-      print '<td><a href="../fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<td><a href="../fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
       print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n";
       print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>';
       print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->sfidp.'">'.$obj->sfnom.'</a></td>';
diff --git a/htdocs/telephonie/ligne/commande/historique.php b/htdocs/telephonie/ligne/commande/historique.php
index 4bfec7f77cb..98a65ba59cf 100644
--- a/htdocs/telephonie/ligne/commande/historique.php
+++ b/htdocs/telephonie/ligne/commande/historique.php
@@ -142,7 +142,7 @@ if ($result)
       print img_file();      
       print '</a>&nbsp;';
 
-      print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 
       print '<td><a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socid.'">'.$obj->nom.'</a></td>';
 
diff --git a/htdocs/telephonie/ligne/commande/liste.php b/htdocs/telephonie/ligne/commande/liste.php
index 94436697889..c36aeadd8cb 100644
--- a/htdocs/telephonie/ligne/commande/liste.php
+++ b/htdocs/telephonie/ligne/commande/liste.php
@@ -139,7 +139,7 @@ if ($result)
 	}
       else
 	{
-	  print dolibarr_print_phone($obj->ligne,0,0,true);
+	  print dol_print_phone($obj->ligne,0,0,true);
 	  $ok_commande = 1;
 	}
 
diff --git a/htdocs/telephonie/ligne/commande/retour/atraiter.php b/htdocs/telephonie/ligne/commande/retour/atraiter.php
index 27278ead54d..93bf80ef63b 100644
--- a/htdocs/telephonie/ligne/commande/retour/atraiter.php
+++ b/htdocs/telephonie/ligne/commande/retour/atraiter.php
@@ -78,7 +78,7 @@ if ($resql)
 	print "<tr $bc[$var]><td>";
 	print '<img src="'.DOL_URL_ROOT.'/telephonie/ligne/graph'.$ligne->statut.'.png">&nbsp;';
 	print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?numero='.$obj->cli.'">';
-	print dolibarr_print_phone($obj->cli,0,0,true)."</a></td>\n";
+	print dol_print_phone($obj->cli,0,0,true)."</a></td>\n";
 	print '<td>'.$obj->mode."</td>\n";
 	print '<td align="center">'.$obj->situation."</td>\n";
 	print '<td align="center">'.$obj->date_mise_service."</td>\n";
diff --git a/htdocs/telephonie/ligne/commande/retour/liste.php b/htdocs/telephonie/ligne/commande/retour/liste.php
index 3b754334e56..88666c1fef4 100644
--- a/htdocs/telephonie/ligne/commande/retour/liste.php
+++ b/htdocs/telephonie/ligne/commande/retour/liste.php
@@ -75,7 +75,7 @@ if ($db->query($sql))
 	print "<tr $bc[$var]><td>";
 	print '<img src="'.DOL_URL_ROOT.'/telephonie/ligne/graph'.$ligne->statut.'.png">&nbsp;';
 	print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?numero='.$obj->cli.'">';
-	print dolibarr_print_phone($obj->cli,0,0,true)."</a></td>\n";
+	print dol_print_phone($obj->cli,0,0,true)."</a></td>\n";
 	print '<td>'.$obj->mode."</td>\n";
 	print '<td align="center">'.$obj->situation."</td>\n";
 	print '<td align="center">'.$obj->date_mise_service."</td>\n";
diff --git a/htdocs/telephonie/ligne/commentaires.php b/htdocs/telephonie/ligne/commentaires.php
index fffabdff746..1d58c616994 100644
--- a/htdocs/telephonie/ligne/commentaires.php
+++ b/htdocs/telephonie/ligne/commentaires.php
@@ -126,7 +126,7 @@ if ($_GET["id"])
       $head[$h][1] = $langs->trans('Stats');
       $h++;
       
-      dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+      dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
       
 
       print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
@@ -148,7 +148,7 @@ if ($_GET["id"])
       print $client_comm->nom.'</a></td><td>'.$client_comm->code_client;
       print '</td></tr>';
       
-      print '<tr><td width="20%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero,0,0,true).'</td>';
+      print '<tr><td width="20%">Num�ro</td><td>'.dol_print_phone($ligne->numero,0,0,true).'</td>';
       print '<td>Factur�e : '.$ligne->facturable.'</td></tr>';
       
       $client = new Societe($db, $ligne->client_id);
diff --git a/htdocs/telephonie/ligne/conso.php b/htdocs/telephonie/ligne/conso.php
index 513c9c2d39b..ee5add5e979 100644
--- a/htdocs/telephonie/ligne/conso.php
+++ b/htdocs/telephonie/ligne/conso.php
@@ -93,13 +93,13 @@ if ($_GET["id"] or $_GET["numero"])
 	  $head[$h][1] = $langs->trans('Stats');
 	  $h++;
 	      
-	  dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+	  dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
 
 	  print_fiche_titre('Fiche Ligne', $mesg);
       
 	  print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 
-	  print '<tr><td width="25%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero,0,0,true).'</td>';
+	  print '<tr><td width="25%">Num�ro</td><td>'.dol_print_phone($ligne->numero,0,0,true).'</td>';
 	  print '<td>Factur�e : '.$ligne->facturable.'</td><td>&nbsp;</td></tr>';
 	      	     
 	  $client = new Societe($db, $ligne->client_id);
diff --git a/htdocs/telephonie/ligne/factures.php b/htdocs/telephonie/ligne/factures.php
index bf3075ce977..ba20ddc29d7 100644
--- a/htdocs/telephonie/ligne/factures.php
+++ b/htdocs/telephonie/ligne/factures.php
@@ -132,13 +132,13 @@ if ($_GET["id"] or $_GET["numero"])
 	  $facnum = 1;
 	}
             
-      dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+      dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
 
       print_fiche_titre('Factures Ligne', $mesg);
       
       print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 
-      print '<tr><td width="25%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero,0,0,true).'</td>';
+      print '<tr><td width="25%">Num�ro</td><td>'.dol_print_phone($ligne->numero,0,0,true).'</td>';
       print '<td>';
 
       if ($facnum > 1)
diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php
index b5466bef404..55a64ab9961 100644
--- a/htdocs/telephonie/ligne/fiche.php
+++ b/htdocs/telephonie/ligne/fiche.php
@@ -578,7 +578,7 @@ else
 	      $previous_ref = $ligne->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?id='.$ligne->ref_previous.'">'.img_previous().'</a>':'';
 	      $next_ref     = $ligne->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?id='.$ligne->ref_next.'">'.img_next().'</a>':'';
 
-	      dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+	      dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
 
 	      print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">Fiche Ligne '.$mesg.'</td>';
 	      print '<td class="nobordernopadding"><a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
@@ -591,7 +591,7 @@ else
 		{		  
 		  $html = new Form($db);
 
-		  $html->form_confirm("fiche.php"."?id=".$_GET["id"],"Suppression de ligne","Etes-vous s�r de vouloir supprimer la ligne : ".dolibarr_print_phone($ligne->numero,0,0,true)." ?","confirm_delete");
+		  $html->form_confirm("fiche.php"."?id=".$_GET["id"],"Suppression de ligne","Etes-vous s�r de vouloir supprimer la ligne : ".dol_print_phone($ligne->numero,0,0,true)." ?","confirm_delete");
 		  print '<br />';
 		}
 
@@ -618,7 +618,7 @@ else
 	      print $client_comm->nom.'</a></td><td>'.$client_comm->code_client;
 	      print '</td></tr>';
 
-	      print '<tr><td width="20%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero).'</td>';
+	      print '<tr><td width="20%">Num�ro</td><td>'.dol_print_phone($ligne->numero).'</td>';
 	      //print " ".$ligne->support.
 
 	      print '<td>Factur�e : '.$ligne->facturable.'</td></tr>';
@@ -940,7 +940,7 @@ else
 	      $head[$h][1] = $langs->trans('Conso');
 	      $h++;
 	      
-	      dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+	      dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
 
 	      print_fiche_titre('Edition de la ligne', $mesg);
 	      
@@ -965,7 +965,7 @@ else
 	      else
 		{
 		  print '<input type="hidden" name="numero" value="'.$ligne->numero.'">';
-		  print dolibarr_print_phone($ligne->numero);
+		  print dol_print_phone($ligne->numero);
 		}
 	      print '</td></tr>';
 
diff --git a/htdocs/telephonie/ligne/groupe.php b/htdocs/telephonie/ligne/groupe.php
index 92e45e2ec5e..a0385495289 100644
--- a/htdocs/telephonie/ligne/groupe.php
+++ b/htdocs/telephonie/ligne/groupe.php
@@ -162,7 +162,7 @@ if ($result)
       print img_file();      
       print '</a>&nbsp;';
 
-      print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<a href="fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 
       print '<td>'.$obj->nom.'</td>';
       print '<td>'.$obj->nom_facture.'</td>';
diff --git a/htdocs/telephonie/ligne/history.php b/htdocs/telephonie/ligne/history.php
index 1c5c943264b..aea2d00b2b1 100644
--- a/htdocs/telephonie/ligne/history.php
+++ b/htdocs/telephonie/ligne/history.php
@@ -93,13 +93,13 @@ llxHeader("","","Historique Ligne");
 	      $head[$h][1] = $langs->trans('Stats');
 	      $h++;
 
-	      dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+	      dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
 
 	      print_fiche_titre('Fiche Ligne', $mesg);
       
 	      print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 
-	      print '<tr><td width="20%">Num�ro</td><td colspan="3">'.dolibarr_print_phone($ligne->numero,0,0,true).'</td></tr>';
+	      print '<tr><td width="20%">Num�ro</td><td colspan="3">'.dol_print_phone($ligne->numero,0,0,true).'</td></tr>';
 	      	     
 	      $client = new Societe($db, $ligne->client_id);
 	      $client->fetch($ligne->client_id);
diff --git a/htdocs/telephonie/ligne/index.php b/htdocs/telephonie/ligne/index.php
index 26023a4fb78..904d60e69ec 100644
--- a/htdocs/telephonie/ligne/index.php
+++ b/htdocs/telephonie/ligne/index.php
@@ -204,7 +204,7 @@ if ($resql)
       print img_file();      
       print '</a>&nbsp;';
 
-      print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<a href="fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 
       $nom = stripslashes($obj->nom);
       if (strlen(stripslashes($obj->nom)) > 20)
diff --git a/htdocs/telephonie/ligne/infoc.php b/htdocs/telephonie/ligne/infoc.php
index c86e094e2c2..2c1ade503ee 100644
--- a/htdocs/telephonie/ligne/infoc.php
+++ b/htdocs/telephonie/ligne/infoc.php
@@ -125,13 +125,13 @@ if ($_GET["id"] or $_GET["numero"])
 	  $head[$h][1] = $langs->trans('Stats');
 	  $h++;
 	  
-	  dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+	  dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
 	  
 	  print_fiche_titre('Informations compl�mentaires', $mesg);
 	  
 	  print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 	  
-	  print '<tr><td width="20%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero,0,0,true).'</td>';
+	  print '<tr><td width="20%">Num�ro</td><td>'.dol_print_phone($ligne->numero,0,0,true).'</td>';
 	  print '<td>Factur�e : '.$ligne->facturable.'</td></tr>';
 	  
 	  $client = new Societe($db, $ligne->client_id);
diff --git a/htdocs/telephonie/ligne/liste.php b/htdocs/telephonie/ligne/liste.php
index bb1c5c96e93..a1e3142304f 100644
--- a/htdocs/telephonie/ligne/liste.php
+++ b/htdocs/telephonie/ligne/liste.php
@@ -193,7 +193,7 @@ if ($result)
       print img_file();      
       print '</a>&nbsp;';
 
-      print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<a href="fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 
       print '<td><a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socid.'">'.stripslashes($obj->nom).'</a></td>';
       //print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->sfidp.'">'.stripslashes($obj->nom_facture).'</a></td>';
diff --git a/htdocs/telephonie/ligne/listecommande.php b/htdocs/telephonie/ligne/listecommande.php
index 3d1111440ab..9c954c11715 100644
--- a/htdocs/telephonie/ligne/listecommande.php
+++ b/htdocs/telephonie/ligne/listecommande.php
@@ -134,7 +134,7 @@ if ($resql)
       
       print '</a>&nbsp;';
 
-      print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<a href="fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
       print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>';
       print '<td align="center">'.$obj->date_commande_last."</td>\n";
 
diff --git a/htdocs/telephonie/ligne/numdata.php b/htdocs/telephonie/ligne/numdata.php
index 4b21ab58700..c87c47a9bff 100644
--- a/htdocs/telephonie/ligne/numdata.php
+++ b/htdocs/telephonie/ligne/numdata.php
@@ -185,7 +185,7 @@ if ($result)
 
       print "<tr $bc[$var]><td>";
 
-      print dolibarr_print_phone($obj->numero,0,0,true)."</td>\n";
+      print dol_print_phone($obj->numero,0,0,true)."</td>\n";
       print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>';
 
       print '<td align="center"><a href="'.DOL_URL_ROOT.'/telephonie/ligne/numdata.php?action=delete&amp;id='.$obj->rowid.'">';
diff --git a/htdocs/telephonie/ligne/remises.php b/htdocs/telephonie/ligne/remises.php
index 6ba934d5516..60af17d5bf3 100644
--- a/htdocs/telephonie/ligne/remises.php
+++ b/htdocs/telephonie/ligne/remises.php
@@ -66,13 +66,13 @@ if ($result == 1 && $client_comm->perm_read)
       $hselected=$h;
       $h++;
       
-      dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+      dol_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
       
       print_fiche_titre('Fiche Ligne', $mesg);
       
       print '<table class="border" width="100%">';
 
-      print '<tr><td width="20%">Num�ro</td><td colspan="2">'.dolibarr_print_phone($ligne->numero,0,0,true).'</td></tr>';
+      print '<tr><td width="20%">Num�ro</td><td colspan="2">'.dol_print_phone($ligne->numero,0,0,true).'</td></tr>';
 	      	     
       $client = new Societe($db, $ligne->client_id);
       $client->fetch($ligne->client_id);
diff --git a/htdocs/telephonie/ligne/stat.php b/htdocs/telephonie/ligne/stat.php
index de47681f701..30d2130ddd2 100644
--- a/htdocs/telephonie/ligne/stat.php
+++ b/htdocs/telephonie/ligne/stat.php
@@ -87,7 +87,7 @@ if ($_GET["id"] or $_GET["numero"])
 	  $previous_ref = $ligne->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?id='.$ligne->ref_previous.'">'.img_previous().'</a>':'';
 	  $next_ref     = $ligne->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?id='.$ligne->ref_next.'">'.img_next().'</a>':'';
 
-	  dolibarr_fiche_head($head, $hselected, 'Statistiques ligne');
+	  dol_fiche_head($head, $hselected, 'Statistiques ligne');
 
 	  print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">Statistiques '.$mesg.'</td>';
 	  print '<td class="nobordernopadding"><a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
@@ -95,7 +95,7 @@ if ($_GET["id"] or $_GET["numero"])
 	        
 	  print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 
-	  print '<tr><td width="25%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero,0,0,true).'</td>';
+	  print '<tr><td width="25%">Num�ro</td><td>'.dol_print_phone($ligne->numero,0,0,true).'</td>';
 	  print '<td>Factur�e : '.$ligne->facturable.'</td><td>&nbsp;</td></tr>';
 	      	     
 	  $client = new Societe($db, $ligne->client_id);
diff --git a/htdocs/telephonie/lignetel.class.php b/htdocs/telephonie/lignetel.class.php
index 657f4615f6b..7cf09cba591 100644
--- a/htdocs/telephonie/lignetel.class.php
+++ b/htdocs/telephonie/lignetel.class.php
@@ -180,7 +180,7 @@ class LigneTel {
 
 	if (!$this->db->begin())
 	  {
-	    dolibarr_syslog("LigneTel::SetRemise Error -5");
+	    dol_syslog("LigneTel::SetRemise Error -5");
 	    $error++;
 	  }
 
@@ -194,7 +194,7 @@ class LigneTel {
 	    
 	    if (! $this->db->query($sql) )
 	      {
-		dolibarr_syslog("LigneTel::SetRemise Error -3");
+		dol_syslog("LigneTel::SetRemise Error -3");
 		$error++;
 	      }
 	  }
@@ -207,7 +207,7 @@ class LigneTel {
 	    
 	    if (! $this->db->query($sql) )
 	      {
-		dolibarr_syslog("LigneTel::SetRemise Error -4");
+		dol_syslog("LigneTel::SetRemise Error -4");
 		$error++;
 	      }
 	  }
@@ -225,7 +225,7 @@ class LigneTel {
       }
     else
       {
-	dolibarr_syslog("LigneTel::SetRemise Error -2");
+	dol_syslog("LigneTel::SetRemise Error -2");
 	return -2;
       }
   }
@@ -274,15 +274,15 @@ class LigneTel {
 	    if ($lex->fetch($this->numero) == 1)
 	      {
 		$this->error_message = "Echec de la cr�ation de la ligne, cette ligne existe d�j� !";
-		dolibarr_syslog("LigneTel::Create Error -3");
+		dol_syslog("LigneTel::Create Error -3");
 		return -3;
 	      }
 	    else
 	      {
 		$this->error_message = "Echec de la cr�ation de la ligne";
-		dolibarr_syslog("LigneTel::Create Error -1");
-		dolibarr_syslog("LigneTel::Create ".$this->db->error());
-		dolibarr_syslog("LigneTel::Create $sql");
+		dol_syslog("LigneTel::Create Error -1");
+		dol_syslog("LigneTel::Create ".$this->db->error());
+		dol_syslog("LigneTel::Create $sql");
 		return -1;
 	      }
 	  }
@@ -290,7 +290,7 @@ class LigneTel {
     else
       {
 	$this->error_message = "Echec de la cr�ation de la ligne, le num�ro de la ligne est incorrect !";
-	dolibarr_syslog("LigneTel::Create Error -2 ($this->numero)");
+	dol_syslog("LigneTel::Create Error -2 ($this->numero)");
 	return -2;
       }
   }
@@ -325,8 +325,8 @@ class LigneTel {
 	    
 	    if (!$resqlu)
 	      {
-		dolibarr_syslog("LigneTel::DefineClientOption Error");
-		dolibarr_syslog("LigneTel::DefineClientOption $sqlu");
+		dol_syslog("LigneTel::DefineClientOption Error");
+		dol_syslog("LigneTel::DefineClientOption $sqlu");
 	      }
 	
 
@@ -335,7 +335,7 @@ class LigneTel {
       }
     else
       {
-	dolibarr_syslog("LigneTel::DefineClientOption Error");
+	dol_syslog("LigneTel::DefineClientOption Error");
       }
   }
   /*
@@ -564,9 +564,9 @@ class LigneTel {
 
 	if (!$this->db->query($sql))
 	  {
-	    dolibarr_syslog("LigneTel::set_statut Error -5");
-	    dolibarr_syslog($this->db->error());
-	    dolibarr_syslog($sql);
+	    dol_syslog("LigneTel::set_statut Error -5");
+	    dol_syslog($this->db->error());
+	    dol_syslog($sql);
 	  }
 	/* 
 	 * Mise � jour des logs
@@ -594,9 +594,9 @@ class LigneTel {
 
 	if (!$this->db->query($sql))
 	  {
-	    dolibarr_syslog("LigneTel::set_statut Error -6");
-	    dolibarr_syslog($this->db->error());
-	    dolibarr_syslog($sql);
+	    dol_syslog("LigneTel::set_statut Error -6");
+	    dol_syslog($this->db->error());
+	    dol_syslog($sql);
 	  }
       }
 
@@ -760,7 +760,7 @@ class LigneTel {
 	
 	    if (!$this->db->query($sql))
 	      {
-		dolibarr_syslog("LigneTel::Delete Error -5");
+		dol_syslog("LigneTel::Delete Error -5");
 		$error++;
 	      }
 
@@ -769,7 +769,7 @@ class LigneTel {
 	
 	    if (!$this->db->query($sql))
 	      {
-		dolibarr_syslog("LigneTel::Delete Error -4");
+		dol_syslog("LigneTel::Delete Error -4");
 		$error++;
 	      }
 
@@ -778,7 +778,7 @@ class LigneTel {
 	
 	    if (!$this->db->query($sql))
 	      {
-		dolibarr_syslog("LigneTel::Delete Error -3");
+		dol_syslog("LigneTel::Delete Error -3");
 		$error++;
 	      }
 
@@ -787,7 +787,7 @@ class LigneTel {
 	    
 	    if (!$this->db->query($sql))
 	      {
-		dolibarr_syslog("LigneTel::Delete Error -2");
+		dol_syslog("LigneTel::Delete Error -2");
 		$error++;
 	      }
 	    
@@ -924,7 +924,7 @@ class LigneTel {
       }
     else 
       {
-	dolibarr_print_error($this->db);
+	dol_print_error($this->db);
 	$this->error=$this->db->error();
 	return -1;
       }    
diff --git a/htdocs/telephonie/pdf/pdfdetail_nodet.modules.php b/htdocs/telephonie/pdf/pdfdetail_nodet.modules.php
index 3afbc6b6365..52caafa9e0b 100644
--- a/htdocs/telephonie/pdf/pdfdetail_nodet.modules.php
+++ b/htdocs/telephonie/pdf/pdfdetail_nodet.modules.php
@@ -243,8 +243,8 @@ class pdfdetail_nodet {
 		}
 	      else
 		{
-		  dolibarr_syslog("Erreur SQl");
-		  dolibarr_syslog($this->db->error());
+		  dol_syslog("Erreur SQl");
+		  dol_syslog($this->db->error());
 		}
 
 	      $h = floor($total_duree / 3600);
@@ -413,7 +413,7 @@ class pdfdetail_nodet {
 		{
 		  $pdf->Close();	      
 		  $pdf->Output($file);
-		  dolibarr_syslog("Write $file");
+		  dol_syslog("Write $file");
 		}
 	      $this->filename = $file;
 
diff --git a/htdocs/telephonie/pdf/pdfdetail_papier.modules.php b/htdocs/telephonie/pdf/pdfdetail_papier.modules.php
index a2dc82f8abb..d16c067e66f 100644
--- a/htdocs/telephonie/pdf/pdfdetail_papier.modules.php
+++ b/htdocs/telephonie/pdf/pdfdetail_papier.modules.php
@@ -266,7 +266,7 @@ class pdfdetail_papier {
 		}
 	      else
 		{
-		  dolibarr_syslog("Erreur lecture des communications");
+		  dol_syslog("Erreur lecture des communications");
 		}
 
 	      /*
diff --git a/htdocs/telephonie/pdf/pdfdetail_papier1.modules.php b/htdocs/telephonie/pdf/pdfdetail_papier1.modules.php
index c1e5d5cf7b1..cd817d5d5ad 100644
--- a/htdocs/telephonie/pdf/pdfdetail_papier1.modules.php
+++ b/htdocs/telephonie/pdf/pdfdetail_papier1.modules.php
@@ -233,7 +233,7 @@ class pdfdetail_papier {
 		}
 	      else
 		{
-		  dolibarr_syslog("Erreur lecture des communications");
+		  dol_syslog("Erreur lecture des communications");
 		}
 
 	      /*
diff --git a/htdocs/telephonie/pdf/pdfdetail_standard.modules.php b/htdocs/telephonie/pdf/pdfdetail_standard.modules.php
index 466c282c12e..964d06fc83a 100644
--- a/htdocs/telephonie/pdf/pdfdetail_standard.modules.php
+++ b/htdocs/telephonie/pdf/pdfdetail_standard.modules.php
@@ -223,8 +223,8 @@ class pdfdetail_standard {
 		}
 	      else
 		{
-		  dolibarr_syslog("Erreur SQl");
-		  dolibarr_syslog($this->db->error());
+		  dol_syslog("Erreur SQl");
+		  dol_syslog($this->db->error());
 		}
 	      /*
 	       * Appels les plus important
@@ -459,7 +459,7 @@ class pdfdetail_standard {
 		}
 	      else
 		{
-		  dolibarr_syslog("Erreur lecture des communications");
+		  dol_syslog("Erreur lecture des communications");
 		}
 
 	      /*
@@ -471,7 +471,7 @@ class pdfdetail_standard {
 
 	      $this->filename = $file;
 
-	      dolibarr_syslog("Write $file");
+	      dol_syslog("Write $file");
 
 	      if(file_exists($file_graph))
 		{
diff --git a/htdocs/telephonie/pdf/xlsdetail_nodet.modules.php b/htdocs/telephonie/pdf/xlsdetail_nodet.modules.php
index bd22cf7ab99..40d2028cd73 100644
--- a/htdocs/telephonie/pdf/xlsdetail_nodet.modules.php
+++ b/htdocs/telephonie/pdf/xlsdetail_nodet.modules.php
@@ -38,7 +38,7 @@ class xlsdetail_nodet {
     $dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
     $fname = $dir . $fac->ref . "-".$ligne->numero."-".$ligne->code_analytique."-detail.xls";
 
-    //dolibarr_syslog("Open file : $fname");
+    //dol_syslog("Open file : $fname");
     
     $workbook = &new writeexcel_workbook($fname);
 
@@ -83,7 +83,7 @@ class xlsdetail_nodet {
 	$i = 0;
 	$numsql = $this->db->num_rows($resql);
 
-	//dolibarr_syslog($this->ligne->numero . " : ".$numsql);
+	//dol_syslog($this->ligne->numero . " : ".$numsql);
 
 	while ($i < $numsql)
 	  {
@@ -104,11 +104,11 @@ class xlsdetail_nodet {
       }
     else
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
     
     $workbook->close();
-    //dolibarr_syslog("Close $fname");
+    //dol_syslog("Close $fname");
 
     return $error;
   }
diff --git a/htdocs/telephonie/script/analyse-traffic.php b/htdocs/telephonie/script/analyse-traffic.php
index f4bb02387d9..d4df5080dbb 100644
--- a/htdocs/telephonie/script/analyse-traffic.php
+++ b/htdocs/telephonie/script/analyse-traffic.php
@@ -69,7 +69,7 @@ if ($resql)
     }
   $db->free($resql);
 }
-dolibarr_syslog(sizeof($lignes)." lignes actives");
+dol_syslog(sizeof($lignes)." lignes actives");
 /*
  * Lecture des comms
  *
@@ -90,7 +90,7 @@ if ($resql)
     }
   $db->free($resql);
 }
-dolibarr_syslog(sizeof($lignes_traffic)." lignes avec traffic");
+dol_syslog(sizeof($lignes_traffic)." lignes avec traffic");
 
 /*
  * Croisement des donn�es
diff --git a/htdocs/telephonie/script/api/presel-activation-manuelle.php b/htdocs/telephonie/script/api/presel-activation-manuelle.php
index d746f46ec72..0e574526ea1 100644
--- a/htdocs/telephonie/script/api/presel-activation-manuelle.php
+++ b/htdocs/telephonie/script/api/presel-activation-manuelle.php
@@ -86,7 +86,7 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
@@ -97,7 +97,7 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
       fwrite($fp, $out);
       
       if ($verbose > 2)
-	dolibarr_syslog("Data sent, waiting for response");
+	dol_syslog("Data sent, waiting for response");
 
       $parse = 0;
       $result = "error";
@@ -109,7 +109,7 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
 	  $line = fgets($fp, 1024);
 	  
 	  if ($verbose > 2)
-	    dolibarr_syslog($line);
+	    dol_syslog($line);
 
 	  if ($parse == 1)
 	    {
@@ -132,12 +132,12 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
   
   if (substr($result,0,2) == "OK")
     {
-      dolibarr_syslog("Activation r贳sie ligne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Activation r贳sie ligne ".$ligne." id client ".$id_person." $result\n");
       return 0;
     }
   else
     {
-      dolibarr_syslog("Activation 袨ou裠ligne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Activation 袨ou裠ligne ".$ligne." id client ".$id_person." $result\n");
 
       return -1;
     }
diff --git a/htdocs/telephonie/script/api/presel-resiliation-manuelle.php b/htdocs/telephonie/script/api/presel-resiliation-manuelle.php
index 996ca694a68..81273abea37 100644
--- a/htdocs/telephonie/script/api/presel-resiliation-manuelle.php
+++ b/htdocs/telephonie/script/api/presel-resiliation-manuelle.php
@@ -86,7 +86,7 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
@@ -97,7 +97,7 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
       fwrite($fp, $out);
       
       if ($verbose > 2)
-	dolibarr_syslog("Data sent, waiting for response");
+	dol_syslog("Data sent, waiting for response");
 
       $parse = 0;
       $result = "error";
@@ -109,7 +109,7 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
 	  $line = fgets($fp, 1024);
 	  
 	  if ($verbose > 2)
-	    dolibarr_syslog($line);
+	    dol_syslog($line);
 
 	  if ($parse == 1)
 	    {
@@ -132,12 +132,12 @@ function ActivationPreselection($host, $user_login, $user_passwd, $ligne, $id_pe
   
   if (substr($result,0,2) == "OK")
     {
-      dolibarr_syslog("Resiliation r贳sie ligne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Resiliation r贳sie ligne ".$ligne." id client ".$id_person." $result\n");
       return 0;
     }
   else
     {
-      dolibarr_syslog("Resiliation 袨ou裠ligne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Resiliation 袨ou裠ligne ".$ligne." id client ".$id_person." $result\n");
 
       return -1;
     }
diff --git a/htdocs/telephonie/script/api/presel-resiliation.php b/htdocs/telephonie/script/api/presel-resiliation.php
index 6ace132c09f..e807e4f9f64 100644
--- a/htdocs/telephonie/script/api/presel-resiliation.php
+++ b/htdocs/telephonie/script/api/presel-resiliation.php
@@ -95,7 +95,7 @@ if ($resql)
 function ResiliationPreselection($host, $user_login, $user_passwd, $ligne, $id_person)
 {  
   global $verbose;
-  //dolibarr_syslog("Appel de DeletePreselection($host, $user_login, ****, $ligne, $id_person)");
+  //dol_syslog("Appel de DeletePreselection($host, $user_login, ****, $ligne, $id_person)");
 
   $url = "/AzurApp_websvc_b3gdb/account.asmx/UpdatePreselection?";
 
@@ -106,20 +106,20 @@ function ResiliationPreselection($host, $user_login, $user_passwd, $ligne, $id_p
   $url .= "&okPreselection=false";
 
   if ($verbose > 2)
-    dolibarr_syslog("$host");
+    dol_syslog("$host");
 
   if ($verbose > 2)
-    dolibarr_syslog("$url");
+    dol_syslog("$url");
 
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
       if ($verbose > 2)
-	dolibarr_syslog("Socket Opened send data");
+	dol_syslog("Socket Opened send data");
 
       $out = "GET $url HTTP/1.1\r\n";
       $out .= "Host: $host\r\n";
@@ -128,7 +128,7 @@ function ResiliationPreselection($host, $user_login, $user_passwd, $ligne, $id_p
       fwrite($fp, $out);
       
       if ($verbose > 2)
-	dolibarr_syslog("Data sent, waiting for response");
+	dol_syslog("Data sent, waiting for response");
 
       $parse = 0;
       $result = "error";
@@ -140,14 +140,14 @@ function ResiliationPreselection($host, $user_login, $user_passwd, $ligne, $id_p
 	  $line = fgets($fp, 1024);
 	  
 	  if ($verbose > 2)
-	    dolibarr_syslog($line);
+	    dol_syslog($line);
 
 	  if ($parse == 1)
 	    {
 	      preg_match('/^<string xmlns=".*">(.*)<\/string>$/', $line, $results);
 	      
 	      $result = $results[1];
-	      //dolibarr_syslog($line);
+	      //dol_syslog($line);
 	      $parse = 0;
 	    }
 	  
@@ -163,16 +163,16 @@ function ResiliationPreselection($host, $user_login, $user_passwd, $ligne, $id_p
     }
   
   if ($verbose > 1)
-    dolibarr_syslog("result = ".$result);
+    dol_syslog("result = ".$result);
 
   if (substr($result,0,2) == "OK")
     {
-      dolibarr_syslog("Resiliation r贳sie ligne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Resiliation r贳sie ligne ".$ligne." id client ".$id_person." $result\n");
       return 0;
     }
   else
     {
-      dolibarr_syslog("Resiliation 袨ou裠ligne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Resiliation 袨ou裠ligne ".$ligne." id client ".$id_person." $result\n");
 
       $fp = fopen("/tmp/$ligne.delete","w");
       if ($fp)
diff --git a/htdocs/telephonie/script/bascule.php b/htdocs/telephonie/script/bascule.php
index 9ae759ead57..3da65d45609 100644
--- a/htdocs/telephonie/script/bascule.php
+++ b/htdocs/telephonie/script/bascule.php
@@ -92,7 +92,7 @@ if ( $resql )
 else
 {
   $error = 1;
-  dolibarr_syslog("Verification Erreur ".$error);
+  dol_syslog("Verification Erreur ".$error);
 }
 
 print "lignes : $lignes\n";
diff --git a/htdocs/telephonie/script/commande_presel.php b/htdocs/telephonie/script/commande_presel.php
index 2958910151b..36a0698be34 100644
--- a/htdocs/telephonie/script/commande_presel.php
+++ b/htdocs/telephonie/script/commande_presel.php
@@ -163,20 +163,20 @@ function CreatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
     }
 
   if ($verbose > 2)
-    dolibarr_syslog("$host");
+    dol_syslog("$host");
 
   if ($verbose > 2)
-    dolibarr_syslog("$url");
+    dol_syslog("$url");
 
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
       if ($verbose > 2)
-	dolibarr_syslog("Socket Opened send data");
+	dol_syslog("Socket Opened send data");
 
       $out = "GET $url HTTP/1.1\r\n";
       $out .= "Host: $host\r\n";
@@ -185,7 +185,7 @@ function CreatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
       fwrite($fp, $out);
       
       if ($verbose > 2)
-	dolibarr_syslog("Data sent, waiting for response");
+	dol_syslog("Data sent, waiting for response");
 
       $parse = 0;
       $result = "error";
@@ -197,14 +197,14 @@ function CreatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
 	  $line = fgets($fp, 1024);
 	  
 	  if ($verbose > 2)
-	    dolibarr_syslog($line);
+	    dol_syslog($line);
 
 	  if ($parse == 1)
 	    {
 	      preg_match('/^<string xmlns=".*">(.*)<\/string>$/', $line, $results);
 	      
 	      $result = $results[1];
-	      //dolibarr_syslog($line);
+	      //dol_syslog($line);
 	      $parse = 0;
 	    }
 	  
@@ -220,18 +220,18 @@ function CreatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
     }
   
   if ($verbose > 1)
-    dolibarr_syslog("result = ".$result);
+    dol_syslog("result = ".$result);
 
   if (substr($result,0,2) == "OK")
     {
       if ($verbose > 1)
-	dolibarr_syslog("Presel OK  ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
+	dol_syslog("Presel OK  ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
       return 0;
     }
   else
     {
       if ($verbose > 1)
-	dolibarr_syslog("Presel ERR ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
+	dol_syslog("Presel ERR ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
 
       $fp = fopen("/tmp/".$lint->numero.".presel","w");
       if ($fp)
@@ -246,7 +246,7 @@ function CreatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
 
 function GetNumAbonne($db, $socid, $fournid)
 {
-  //dolibarr_syslog("Appel de GetNumAbonne($socid, $fournid)");
+  //dol_syslog("Appel de GetNumAbonne($socid, $fournid)");
 
   $sql = "SELECT fourn_id";
   $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_fournid";
@@ -269,7 +269,7 @@ function GetNumAbonne($db, $socid, $fournid)
     }
   else
     {
-      dolibarr_syslog("Erreur dans GetNumAbonne($socid, $fournid)");
+      dol_syslog("Erreur dans GetNumAbonne($socid, $fournid)");
       return -1;
     }
 }
@@ -288,7 +288,7 @@ function SetNumAbonne($db, $socid, $soc_fourn_id, $fournid)
     }
   else
     {
-      dolibarr_syslog("Erreur dans SetNumAbonne($socid, $soc_fourn_id, $fournid)");
+      dol_syslog("Erreur dans SetNumAbonne($socid, $soc_fourn_id, $fournid)");
       return -1;
     }
 }
@@ -316,7 +316,7 @@ function CreateAbonne($host, $user_login, $user_passwd, $user_contract, $societe
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
@@ -341,7 +341,7 @@ function CreateAbonne($host, $user_login, $user_passwd, $user_contract, $societe
 	      $result = $results[1];
 	      $client_id = $results[2];
 	      if ($verbose > 1)
-		dolibarr_syslog($line);
+		dol_syslog($line);
 	    }
 	  
 	  if (substr($line,0,38) == '<?xml version="1.0" encoding="utf-8"?>')
@@ -353,12 +353,12 @@ function CreateAbonne($host, $user_login, $user_passwd, $user_contract, $societe
     }
   
   if ($verbose > 1)
-    dolibarr_syslog("$result:$client_id");
+    dol_syslog("$result:$client_id");
 
   if ($result == "OK")
     {
       if ($verbose > 1)
-	dolibarr_syslog("Commande r贳sie id client ".$client_id);
+	dol_syslog("Commande r贳sie id client ".$client_id);
       return $client_id;
     }
   else
diff --git a/htdocs/telephonie/script/commission.php b/htdocs/telephonie/script/commission.php
index 4495f7dd72c..3ad1143d52e 100644
--- a/htdocs/telephonie/script/commission.php
+++ b/htdocs/telephonie/script/commission.php
@@ -111,7 +111,7 @@ if ( $resql )
 else
 {
   $error = 1;
-  dolibarr_syslog("Verification Erreur ".$error);
+  dol_syslog("Verification Erreur ".$error);
 }
 
 /********************************************************
@@ -120,7 +120,7 @@ else
  *
  *
  ********************************************************/
-dolibarr_syslog("Calcul avance");
+dol_syslog("Calcul avance");
 $sql = "SELECT rowid, fk_distributeur, fk_contrat, datepo, montant";
 $sql .= " , avance_pourcent, rem_pour_prev, rem_pour_autr, mode_paiement";
 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre";
@@ -167,9 +167,9 @@ if ( $resql )
       if (! $db->query($sqli))
 	{
 	  $error = 2;
-	  dolibarr_syslog("Calcul avance Erreur ");
-	  dolibarr_syslog($db->error());
-	  dolibarr_syslog("$sqli");
+	  dol_syslog("Calcul avance Erreur ");
+	  dol_syslog($db->error());
+	  dol_syslog("$sqli");
 	}
       
       $i++;
@@ -179,7 +179,7 @@ if ( $resql )
 else
 {
   $error = 3;
-  dolibarr_syslog("Erreur ".$db->error());
+  dol_syslog("Erreur ".$db->error());
 }
  
 
@@ -255,12 +255,12 @@ if ( $resql )
       if (! $db->query($sqli))
 	{
 	  $error = 4;
-	  dolibarr_syslog("Calcul conso Erreur");
-	  dolibarr_syslog($db->error());
-	  dolibarr_syslog("$sqli");
+	  dol_syslog("Calcul conso Erreur");
+	  dol_syslog($db->error());
+	  dol_syslog("$sqli");
 	}
 
-      //dolibarr_syslog("Conso po : ".$obj->rowid . " ".$comm);
+      //dol_syslog("Conso po : ".$obj->rowid . " ".$comm);
               
       $i++;
     }
@@ -269,7 +269,7 @@ if ( $resql )
 else
 {
   $error = 5;
-  dolibarr_syslog("Erreur ".$db->error());
+  dol_syslog("Erreur ".$db->error());
 }
 
 /********************************************************
@@ -305,7 +305,7 @@ if ( $resql )
 else
 {
   $error = 6;
-  dolibarr_syslog("Erreur regul avances ".$error);
+  dol_syslog("Erreur regul avances ".$error);
 }
 
 $avan_regul = array();
@@ -331,7 +331,7 @@ foreach ($distri_av as $distributeur_id)
       while ($ia < $numa)
 	{
 	  $rowa = $db->fetch_row($resqla);
- 	  dolibarr_syslog("* Regul des avances de la po " .$rowa[0] . " ".strftime("%Y%m",$rowa[1]));
+ 	  dol_syslog("* Regul des avances de la po " .$rowa[0] . " ".strftime("%Y%m",$rowa[1]));
 	  $ia++;
 
 	  /* Calcul des sommes avanc�es */
@@ -347,7 +347,7 @@ foreach ($distri_av as $distributeur_id)
 	  if ( $resql )
 	    {
 	      $num = $db->num_rows($resql);
-	      dolibarr_syslog("* Regul des avances de la po ".$rowa[0]." ".strftime("%Y%m",$rowa[1]).", $num avances");
+	      dol_syslog("* Regul des avances de la po ".$rowa[0]." ".strftime("%Y%m",$rowa[1]).", $num avances");
 	      $i = 0;	      
 	      while ($i < $num)
 		{
@@ -369,18 +369,18 @@ foreach ($distri_av as $distributeur_id)
 		  if (!$resqlir)
 		    {
 		      $error = 32;
-		      dolibarr_syslog("Erreur insertion regul avances (error $error)");
-		      dolibarr_syslog($sqlir);
+		      dol_syslog("Erreur insertion regul avances (error $error)");
+		      dol_syslog($sqlir);
 		    }
 
-		  dolibarr_syslog("* Avance ".$row[0] . " statut : ".$row[2]);
+		  dol_syslog("* Avance ".$row[0] . " statut : ".$row[2]);
 		  
 		  /* Communications relatives */
 		  $datup = $year_prev.$month_prev;
 		  $datdo = strftime("%Y%m",$rowa[1]);
 		  if ($row[2] <> 6)
 		    {
-		      dolibarr_syslog("* Communications <= $datup >= $datdo ");
+		      dol_syslog("* Communications <= $datup >= $datdo ");
 		      $sqlc = "SELECT sum(montant)";
 		      $sqlc .= " FROM ".MAIN_DB_PREFIX."telephonie_commission_conso";
 		      $sqlc .= " WHERE fk_contrat = ". $row[1];
@@ -393,7 +393,7 @@ foreach ($distri_av as $distributeur_id)
 			  while ($rowc = $db->fetch_row($resqlc))
 			    {
 			      $comm_regul[$distributeur_id] = $comm_regul[$distributeur_id] + $rowc[0];
-			      dolibarr_syslog("* Conso g�n�r�e ".$rowc[0]);
+			      dol_syslog("* Conso g�n�r�e ".$rowc[0]);
 
 			      $sqlir = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_commission_regul";
 			      $sqlir .= " (date, fk_distributeur, fk_contrat, montant, type)";
@@ -405,8 +405,8 @@ foreach ($distri_av as $distributeur_id)
 			      if (!$resqlir)
 				{
 				  $error = 31;
-				  dolibarr_syslog("Erreur insertion regul avances conso (error $error)");
-				  dolibarr_syslog($sqlir);
+				  dol_syslog("Erreur insertion regul avances conso (error $error)");
+				  dol_syslog($sqlir);
 				}
 			    }
 			  $db->free($resqlc);
@@ -414,7 +414,7 @@ foreach ($distri_av as $distributeur_id)
 		      else
 			{
 			  $error = 10;
-			  dolibarr_syslog("Erreur regul avances conso ".$error);
+			  dol_syslog("Erreur regul avances conso ".$error);
 			}
 		    }
 		  else
@@ -436,7 +436,7 @@ foreach ($distri_av as $distributeur_id)
 		      if (! $resqlc )
 			{
 			  $error = 11;
-			  dolibarr_syslog("Erreur regul avances conso ".$error);
+			  dol_syslog("Erreur regul avances conso ".$error);
 			}
 		    }
 		  
@@ -447,15 +447,15 @@ foreach ($distri_av as $distributeur_id)
 	  else
 	    {
 	      $error = 12;
-	      dolibarr_syslog("Erreur regul avances ".$db->error());
+	      dol_syslog("Erreur regul avances ".$db->error());
 	    }	  	  	  	 	  
 	}
     }
   else
     {
       $error = 13;
-      dolibarr_syslog("Erreur regul avances aaaa".$db->error());
-      dolibarr_syslog($sqla);
+      dol_syslog("Erreur regul avances aaaa".$db->error());
+      dol_syslog($sqla);
     }
 }
 
@@ -484,7 +484,7 @@ if ( $resql )
 else
 {
   $error = 14;
-  dolibarr_syslog("Erreur calcul des commission sur conso ".$error);
+  dol_syslog("Erreur calcul des commission sur conso ".$error);
 }
 
 $comm_conso = array();
@@ -508,14 +508,14 @@ foreach ($distri_co as $distributeur_id)
       while ($ia < $numa)
 	{
 	  $rowa = $db->fetch_row($resqla);
-	  dolibarr_syslog("** Calcul des consos po " .$rowa[0] . " ".strftime("%Y%m",$rowa[1]));
+	  dol_syslog("** Calcul des consos po " .$rowa[0] . " ".strftime("%Y%m",$rowa[1]));
 	  $ia++;
 
 	  /* Communications relatives */
 
 	  $datup = $year_prev.$month_prev;
 	  
-	  dolibarr_syslog("** Communications  $datup");
+	  dol_syslog("** Communications  $datup");
 		  
 	  $sqlc = "SELECT sum(montant)";
 	  $sqlc .= " FROM ".MAIN_DB_PREFIX."telephonie_commission_conso";
@@ -529,27 +529,27 @@ foreach ($distri_co as $distributeur_id)
 	      if ( $rowc = $db->fetch_row($resqlc) )
 		{
 		  $comm_conso[$distributeur_id] = $comm_conso[$distributeur_id] + $rowc[0];		  
-		  dolibarr_syslog("** Conso g�n�r�e ".$rowc[0]);
+		  dol_syslog("** Conso g�n�r�e ".$rowc[0]);
 		}
 	      else
 		{
 		  $error = 151;
-		  dolibarr_syslog("Erreur regul conso");
+		  dol_syslog("Erreur regul conso");
 		}
 	      $db->free($resqlc);
 	    }
 	  else
 	    {
 	      $error = 15;
-	      dolibarr_syslog("Erreur regul conso");
+	      dol_syslog("Erreur regul conso");
 	    }
 	}	  		      
     }
   else
     {
       $error = 16;
-      dolibarr_syslog("Erreur regul conso".$db->error());
-      dolibarr_syslog($sqla);
+      dol_syslog("Erreur regul conso".$db->error());
+      dol_syslog($sqla);
     }
 }
 
@@ -564,7 +564,7 @@ foreach ($distributeurs as $distributeur_id)
   $distributeur = new DistributeurTelephonie($db);
   $distributeur->fetch($distributeur_id);
 
-  dolibarr_syslog($distributeur->nom . " : ".$month_prev."-".$year_prev);
+  dol_syslog($distributeur->nom . " : ".$month_prev."-".$year_prev);
 
   $amount = 0;
 
@@ -616,10 +616,10 @@ foreach ($distributeurs as $distributeur_id)
 	  if (! $db->query($sqli))
 	    {
 	      $error = 17;
-	      dolibarr_syslog("Erreur insertion Commission finale");
+	      dol_syslog("Erreur insertion Commission finale");
 	    }
 
-	  dolibarr_syslog("Commission finale ".$amount);
+	  dol_syslog("Commission finale ".$amount);
 
 	  fputs($fp, "DIS : ".$distributeur_id);
 	  fputs($fp, " Comm final : ".substr($space.$amount,-15)."\n");
@@ -627,27 +627,27 @@ foreach ($distributeurs as $distributeur_id)
       else
 	{
 	  $error = 18;
-	  dolibarr_syslog("Erreur lecture avances");
+	  dol_syslog("Erreur lecture avances");
 	}
       $db->free($resql);
     }
   else
     {
       $error = 19;
-      dolibarr_syslog("Erreur ".$error);
+      dol_syslog("Erreur ".$error);
     }
 }
 
 if ($error == 0)
 {
   $db->commit();
-  dolibarr_syslog("Commit");
+  dol_syslog("Commit");
 }
 else
 {
   $db->rollback();
-  dolibarr_syslog("Rollback", LOG_ERR);
+  dol_syslog("Rollback", LOG_ERR);
 }
-dolibarr_syslog("----------------");
+dol_syslog("----------------");
 fclose($fp);
 ?>
diff --git a/htdocs/telephonie/script/cron/presel-resiliation.php b/htdocs/telephonie/script/cron/presel-resiliation.php
index b2ba8b3a4b6..a28a78ab6b1 100644
--- a/htdocs/telephonie/script/cron/presel-resiliation.php
+++ b/htdocs/telephonie/script/cron/presel-resiliation.php
@@ -95,7 +95,7 @@ if ($resql)
 function ResiliationPreselection($db, $user, $host, $user_login, $user_passwd, $ligne_num, $id_person, $verbose)
 {  
   if ($verbose)
-    dolibarr_syslog("Appel de DeletePreselection($host, $user_login, ****, $ligne_num, $id_person)");
+    dol_syslog("Appel de DeletePreselection($host, $user_login, ****, $ligne_num, $id_person)");
 
   $url = "/AzurApp_websvc_b3gdb/account.asmx/UpdatePreselection?";
 
@@ -106,20 +106,20 @@ function ResiliationPreselection($db, $user, $host, $user_login, $user_passwd, $
   $url .= "&okPreselection=false";
 
   if ($verbose > 2)
-    dolibarr_syslog("$host");
+    dol_syslog("$host");
 
   if ($verbose > 2)
-    dolibarr_syslog("$url");
+    dol_syslog("$url");
 
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
       if ($verbose > 2)
-	dolibarr_syslog("Socket Opened send data");
+	dol_syslog("Socket Opened send data");
 
       $out = "GET $url HTTP/1.1\r\n";
       $out .= "Host: $host\r\n";
@@ -128,7 +128,7 @@ function ResiliationPreselection($db, $user, $host, $user_login, $user_passwd, $
       fwrite($fp, $out);
       
       if ($verbose > 2)
-	dolibarr_syslog("Data sent, waiting for response");
+	dol_syslog("Data sent, waiting for response");
 
       $parse = 0;
       $result = "error";
@@ -140,14 +140,14 @@ function ResiliationPreselection($db, $user, $host, $user_login, $user_passwd, $
 	  $line = fgets($fp, 1024);
 	  
 	  if ($verbose > 2)
-	    dolibarr_syslog($line);
+	    dol_syslog($line);
 
 	  if ($parse == 1)
 	    {
 	      preg_match('/^<string xmlns=".*">(.*)<\/string>$/', $line, $results);
 	      
 	      $result = $results[1];
-	      //dolibarr_syslog($line);
+	      //dol_syslog($line);
 	      $parse = 0;
 	    }
 	  
@@ -163,12 +163,12 @@ function ResiliationPreselection($db, $user, $host, $user_login, $user_passwd, $
     }
   
   if ($verbose > 1)
-    dolibarr_syslog("result = ".$result);
+    dol_syslog("result = ".$result);
 
   if (substr($result,0,2) == "OK")
     {
       if ($verbose)
-	dolibarr_syslog("Resiliation r贳sie ligne ".$ligne_num." id client ".$id_person." $result\n");
+	dol_syslog("Resiliation r贳sie ligne ".$ligne_num." id client ".$id_person." $result\n");
 
       $ligne = new LigneTel($db);
       $ligne->fetch($ligne_num);
@@ -178,7 +178,7 @@ function ResiliationPreselection($db, $user, $host, $user_login, $user_passwd, $
     }
   else
     {
-      dolibarr_syslog("Resiliation 袨ou裠ligne ".$ligne_num." id client ".$id_person." $result\n");
+      dol_syslog("Resiliation 袨ou裠ligne ".$ligne_num." id client ".$id_person." $result\n");
 
       $fp = fopen("/tmp/$ligne.delete","w");
       if ($fp)
diff --git a/htdocs/telephonie/script/delete_presel.php b/htdocs/telephonie/script/delete_presel.php
index 709d2ebd8b0..493053df067 100644
--- a/htdocs/telephonie/script/delete_presel.php
+++ b/htdocs/telephonie/script/delete_presel.php
@@ -95,7 +95,7 @@ if ($resql)
 function DeletePreselection($host, $user_login, $user_passwd, $ligne, $id_person)
 {  
   global $verbose;
-  //dolibarr_syslog("Appel de DeletePreselection($host, $user_login, ****, $ligne, $id_person)");
+  //dol_syslog("Appel de DeletePreselection($host, $user_login, ****, $ligne, $id_person)");
 
   $url = "/AzurApp_websvc_b3gdb/account.asmx/DeletePreselection?";
 
@@ -104,20 +104,20 @@ function DeletePreselection($host, $user_login, $user_passwd, $ligne, $id_person
   $url .= "&telnum=".$ligne;
 
   if ($verbose > 2)
-    dolibarr_syslog("$host");
+    dol_syslog("$host");
 
   if ($verbose > 2)
-    dolibarr_syslog("$url");
+    dol_syslog("$url");
 
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
       if ($verbose > 2)
-	dolibarr_syslog("Socket Opened send data");
+	dol_syslog("Socket Opened send data");
 
       $out = "GET $url HTTP/1.1\r\n";
       $out .= "Host: $host\r\n";
@@ -126,7 +126,7 @@ function DeletePreselection($host, $user_login, $user_passwd, $ligne, $id_person
       fwrite($fp, $out);
       
       if ($verbose > 2)
-	dolibarr_syslog("Data sent, waiting for response");
+	dol_syslog("Data sent, waiting for response");
 
       $parse = 0;
       $result = "error";
@@ -138,14 +138,14 @@ function DeletePreselection($host, $user_login, $user_passwd, $ligne, $id_person
 	  $line = fgets($fp, 1024);
 	  
 	  if ($verbose > 2)
-	    dolibarr_syslog($line);
+	    dol_syslog($line);
 
 	  if ($parse == 1)
 	    {
 	      preg_match('/^<string xmlns=".*">(.*)<\/string>$/', $line, $results);
 	      
 	      $result = $results[1];
-	      //dolibarr_syslog($line);
+	      //dol_syslog($line);
 	      $parse = 0;
 	    }
 	  
@@ -161,16 +161,16 @@ function DeletePreselection($host, $user_login, $user_passwd, $ligne, $id_person
     }
   
   if ($verbose > 1)
-    dolibarr_syslog("result = ".$result);
+    dol_syslog("result = ".$result);
 
   if (substr($result,0,2) == "OK")
     {
-      dolibarr_syslog("Delete r贳si ligne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Delete r贳si ligne ".$ligne." id client ".$id_person." $result\n");
       return 0;
     }
   else
     {
-      dolibarr_syslog("Delete 袨ou矬igne ".$ligne." id client ".$id_person." $result\n");
+      dol_syslog("Delete 袨ou矬igne ".$ligne." id client ".$id_person." $result\n");
 
       $fp = fopen("/tmp/$ligne.delete","w");
       if ($fp)
diff --git a/htdocs/telephonie/script/envoi-emails-speciaux.php b/htdocs/telephonie/script/envoi-emails-speciaux.php
index 1bbd13b3d61..f2414ed2370 100644
--- a/htdocs/telephonie/script/envoi-emails-speciaux.php
+++ b/htdocs/telephonie/script/envoi-emails-speciaux.php
@@ -38,7 +38,7 @@ require_once (DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
 require_once (DOL_DOCUMENT_ROOT."/telephonie/pdfdetail_ibreizh.modules.php");
 require_once (DOL_DOCUMENT_ROOT."/telephonie/dolibarrmail.class.php");
 
-dolibarr_syslog("Debut envoie de mail");
+dol_syslog("Debut envoie de mail");
 
 $clientid = 52;
 $contactid = 151;
@@ -62,7 +62,7 @@ $resql = $db->query($sql);
 if ($resql)
 {
   $row = $db->fetch_row($resql);
-  dolibarr_syslog($row[0]);
+  dol_syslog($row[0]);
 
   array_push($emails, $row[0]);
 
@@ -94,7 +94,7 @@ if ($resql)
 {
   $num = $db->num_rows($resql);
   $i = 0;
-  dolibarr_syslog($num . " Factures");
+  dol_syslog($num . " Factures");
 
   while ($i < $num)
     {
@@ -133,7 +133,7 @@ if ($resql)
 {
   $num = $db->num_rows($resql);
   $i = 0;
-  dolibarr_syslog($num . " Factures");
+  dol_syslog($num . " Factures");
 
   while ($i < $num)
     {
@@ -160,8 +160,8 @@ if (sizeof($factures_a_mailer) > 0)
     {
       $fact = new Facture($db);
 
-      dolibarr_syslog("Facture ".$factures_a_mailer[$i]);
-      dolibarr_syslog("ligne ".$factures_lignes[$factures_a_mailer[$i]]);
+      dol_syslog("Facture ".$factures_a_mailer[$i]);
+      dol_syslog("ligne ".$factures_lignes[$factures_a_mailer[$i]]);
 
       if ($fact->fetch($factures_a_mailer[$i]) == 1)
 	{
@@ -178,7 +178,7 @@ if (sizeof($factures_a_mailer) > 0)
 		}
 	      $sendto = substr($sendto,0,strlen($sendto) - 1);
 	      
-	      dolibarr_syslog("Envoi email � ".html_entity_decode($sendto) );
+	      dol_syslog("Envoi email � ".html_entity_decode($sendto) );
 	      
 	      
 	      $subject = "Facture ibreizh ";
@@ -273,7 +273,7 @@ if (sizeof($factures_a_mailer) > 0)
 	  else
 	    {
 	      print  "Aucun email trouv�\n";
-	      dolibarr_syslog("import.php aucun email trouv�");
+	      dol_syslog("import.php aucun email trouv�");
 	    }
 	}
     }
diff --git a/htdocs/telephonie/script/facturation-alerte.php b/htdocs/telephonie/script/facturation-alerte.php
index 24aa43d97a1..d787f7c79f6 100644
--- a/htdocs/telephonie/script/facturation-alerte.php
+++ b/htdocs/telephonie/script/facturation-alerte.php
@@ -70,7 +70,7 @@ if ( $resql )
 else
 {
   $error = 1;
-  dolibarr_syslog("Erreur ".$error);
+  dol_syslog("Erreur ".$error);
 }
 
 /*
@@ -85,7 +85,7 @@ $error = 0;
 
 $fname = $dir . "alertes-factures.xls";
 
-dolibarr_syslog("Open $fname");
+dol_syslog("Open $fname");
     
 $workbook = &new writeexcel_workbook($fname);
 
@@ -184,7 +184,7 @@ if (!$error)
   else
     {
       $error = 2;
-      dolibarr_syslog("Erreur $error ".$db->error());
+      dol_syslog("Erreur $error ".$db->error());
     }
 }
 /*
@@ -306,7 +306,7 @@ if (!$error)
   else
     {
       $error = 2;
-      dolibarr_syslog("Erreur $error ".$db->error());
+      dol_syslog("Erreur $error ".$db->error());
     }
 }
 
diff --git a/htdocs/telephonie/script/facturation-analyse.php b/htdocs/telephonie/script/facturation-analyse.php
index 237f88ea1c4..22de45153bb 100644
--- a/htdocs/telephonie/script/facturation-analyse.php
+++ b/htdocs/telephonie/script/facturation-analyse.php
@@ -163,7 +163,7 @@ $dir = "/tmp/";
 $fname = $dir . "facturation-analyse.xls";
 
 if ($verbose > 0)
-  dolibarr_syslog("Open $fname");
+  dol_syslog("Open $fname");
     
 $workbook = &new writeexcel_workbook($fname);
 
diff --git a/htdocs/telephonie/script/facturation-calcul.php b/htdocs/telephonie/script/facturation-calcul.php
index 3f3dae3a806..61937f356a6 100644
--- a/htdocs/telephonie/script/facturation-calcul.php
+++ b/htdocs/telephonie/script/facturation-calcul.php
@@ -82,13 +82,13 @@ if ( $resql )
   $num = $db->num_rows($resql);
   $row = $db->fetch_row($resql);
 
-  dolibarr_syslog("Communications � traiter ".$row[0]);
+  dol_syslog("Communications � traiter ".$row[0]);
   $db->free($resql);
 }
 else
 {
   $error = 1;
-  dolibarr_syslog("Erreur ".$error);
+  dol_syslog("Erreur ".$error);
 }
 
 /**********************************************************
@@ -105,13 +105,13 @@ if ( $resql )
 {
   $row = $db->fetch_row($resql);
 
-  dolibarr_syslog("Max rowid avant facture ".$row[0]);
+  dol_syslog("Max rowid avant facture ".$row[0]);
   $db->free($resql);
 }
 else
 {
   $error = 2;
-  dolibarr_syslog("Erreur ".$error);
+  dol_syslog("Erreur ".$error);
 }
 
 /**
@@ -145,12 +145,12 @@ if (!$error)
 	  $i++;
 	}            
       $db->free();
-      dolibarr_syslog(sizeof($lines_keys)." lignes trouv�es");
+      dol_syslog(sizeof($lines_keys)." lignes trouv�es");
     }
   else
     {
       $error = 3;
-      dolibarr_syslog("Erreur ".$error);
+      dol_syslog("Erreur ".$error);
     }
 }
 
@@ -173,12 +173,12 @@ if (sizeof($lines_keys) > 0)
     {
       $batch_id = $db->last_insert_id(MAIN_DB_PREFIX."telephonie_facturation_batch");
       
-      dolibarr_syslog("Batch ID ".$batch_id);
+      dol_syslog("Batch ID ".$batch_id);
     }
   else
     {
       $error = 20;
-      dolibarr_syslog("Erreur ".$error);
+      dol_syslog("Erreur ".$error);
     }  
 }
 
@@ -204,14 +204,14 @@ if (!$error)
 	      if ($ligne->socid == 0)
 		{
 		  $error = 4;
-		  dolibarr_syslog("Error ($error)");
+		  dol_syslog("Error ($error)");
 		}	  	  
 	    }
 	  else
 	    {
 
 	      $error = 5;	  
-	      dolibarr_syslog("Error ($error): Aucune soci�t� rattach�e � la ligne : $line_key");
+	      dol_syslog("Error ($error): Aucune soci�t� rattach�e � la ligne : $line_key");
 	    }
 
 	  
@@ -229,7 +229,7 @@ if (!$error)
 	      else
 		{
 		  $error = 6;
-		  dolibarr_syslog("Error ($error)");
+		  dol_syslog("Error ($error)");
 		}
 	    }
 	  
@@ -264,9 +264,9 @@ if (!$error)
 	      else
 		{
 		  $error++;
-		  dolibarr_syslog("Erreur d'insertion dans llx_telephonie_facture");
-		  dolibarr_syslog($db->error());
-		  dolibarr_syslog($sql);
+		  dol_syslog("Erreur d'insertion dans llx_telephonie_facture");
+		  dol_syslog($db->error());
+		  dol_syslog($sql);
 		}
 	    }	 
 	  /*
@@ -283,7 +283,7 @@ if (!$error)
 	      if (calcul($db, $ligne, $facid, $total_achat, $total_vente, $total_fourn) <> 0)
 		{
 		  $error++;
-		  dolibarr_syslog("Erreur de calcul de la facture pour la ligne $line_key $ligne->numero");
+		  dol_syslog("Erreur de calcul de la facture pour la ligne $line_key $ligne->numero");
 		}	  
 	    }	  
 	  
@@ -326,9 +326,9 @@ if (!$error)
 	      else
 		{
 		  $error++;
-		  dolibarr_syslog("Erreur de mise � jour dans llx_telephonie_facture");
-		  dolibarr_syslog($db->error());
-		  dolibarr_syslog($sql);
+		  dol_syslog("Erreur de mise � jour dans llx_telephonie_facture");
+		  dol_syslog($db->error());
+		  dol_syslog($sql);
 		}
 	    }
 	  
@@ -345,7 +345,7 @@ if (!$error)
 	      if (! $db->query($sql))
 		{
 		  $error++;
-		  dolibarr_syslog("Erreur de suppression dans llx_telephonie_import_cdr");
+		  dol_syslog("Erreur de suppression dans llx_telephonie_import_cdr");
 		}
 	    }
 	  
@@ -358,17 +358,17 @@ if (!$error)
 	    {
 	      $db->query("COMMIT");
 	      $nbcommit++;
-	      dolibarr_syslog("Ligne $ligne->numero - COMMIT");
+	      dol_syslog("Ligne $ligne->numero - COMMIT");
 	    }
 	  else
 	    {
 	      $db->query("ROLLBACK");
-	      dolibarr_syslog("Ligne $ligne->numero - ROLLBACK de la transaction");	      
+	      dol_syslog("Ligne $ligne->numero - ROLLBACK de la transaction");	      
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("Erreur ouverture Transaction SQL");
+	  dol_syslog("Erreur ouverture Transaction SQL");
 	}
     } /* fin de la boucle */
 
@@ -391,7 +391,7 @@ if ( $resql )
 {
   $row = $db->fetch_row($resql);
 
-  dolibarr_syslog("Max rowid apr�s facture ".$row[0]);
+  dol_syslog("Max rowid apr�s facture ".$row[0]);
   $db->free($resql);
 }
 else
@@ -405,7 +405,7 @@ else
 *
 ***********************************************************/
 
-dolibarr_syslog($nbcommit." facture �mises");
+dol_syslog($nbcommit." facture �mises");
 
 /**********************************************************
 *
@@ -420,7 +420,7 @@ if ( $resql )
 {
   $row = $db->fetch_row($resql);
 
-  dolibarr_syslog($row[0]. " communications restantes dans la table d'import");
+  dol_syslog($row[0]. " communications restantes dans la table d'import");
   $db->free($resql);
 }
 else
@@ -431,7 +431,7 @@ else
 
 $db->close();
 
-dolibarr_syslog("Fin Batch ID ".$batch_id);
+dol_syslog("Fin Batch ID ".$batch_id);
 
 // FIN
 
@@ -479,7 +479,7 @@ function calcul($db, $ligne, $facture_id, &$total_cout_achat, &$total_cout_vente
       $db->free($resql);
     }
   
-  dolibarr_syslog("Utilisation du tarif ".$tarif_spec." pour la ligne ".$ligne->id);
+  dol_syslog("Utilisation du tarif ".$tarif_spec." pour la ligne ".$ligne->id);
 
   $tarif_achat = new TelephonieTarif($db, $tarif_spec, "achat", $fournisseur_id);
   $tarif_vente = new TelephonieTarif($db, $tarif_spec, "vente", $tarif_spec, $ligne->client_comm_id);
@@ -527,7 +527,7 @@ function calcul($db, $ligne, $facture_id, &$total_cout_achat, &$total_cout_vente
   else
     {
       $error++;
-      dolibarr_syslog("Erreur dans Calcul() Probl�me SQL");
+      dol_syslog("Erreur dans Calcul() Probl�me SQL");
     }
 
   for ($ii = 0 ; $ii < $num_sql ; $ii++)
diff --git a/htdocs/telephonie/script/facturation-correction-import.php b/htdocs/telephonie/script/facturation-correction-import.php
index 0d32549cd5e..71c0d559d22 100644
--- a/htdocs/telephonie/script/facturation-correction-import.php
+++ b/htdocs/telephonie/script/facturation-correction-import.php
@@ -52,7 +52,7 @@ if ( $resql )
 } 
 else
 {
-  dolibarr_syslog("Erreur SQL");
+  dol_syslog("Erreur SQL");
 }
 
 ?>
diff --git a/htdocs/telephonie/script/facturation-details-tableur.php b/htdocs/telephonie/script/facturation-details-tableur.php
index 5ecf676cd8e..591ae7f290e 100644
--- a/htdocs/telephonie/script/facturation-details-tableur.php
+++ b/htdocs/telephonie/script/facturation-details-tableur.php
@@ -72,7 +72,7 @@ for ($i = 1; $i < sizeof($GLOBALS["argv"]); $i++)
 }
 
  
-dolibarr_syslog("Mois $month Ann�e $year");  
+dol_syslog("Mois $month Ann�e $year");  
 
 /*
  * Lectures de diff�rentes lignes
@@ -105,7 +105,7 @@ if (!$error)
   else
     {
       $error = 1;
-      dolibarr_syslog($db->error());
+      dol_syslog($db->error());
     }
 }
 
@@ -123,7 +123,7 @@ if (!$error)
 	      
       if ($resg <> 0)
 	{
-	  dolibarr_syslog("ERREUR lors de G�n�ration du d�tail tableur two");
+	  dol_syslog("ERREUR lors de G�n�ration du d�tail tableur two");
 	  $error = 19;
 	}
 
@@ -150,7 +150,7 @@ if (!$error)
 	      
 	      if ($resg <> 0)
 		{
-		  dolibarr_syslog("ERREUR lors de G�n�ration du d�tail tableur one");
+		  dol_syslog("ERREUR lors de G�n�ration du d�tail tableur one");
 		  $error = 19;
 		}
 	      
@@ -161,12 +161,12 @@ if (!$error)
       else
 	{
 	  $error = 1;
-	  dolibarr_syslog($db->error());
+	  dol_syslog($db->error());
 	}           
     }
 }
 
 $db->close();
 
-dolibarr_syslog("Conso m�moire ".memory_get_usage() );
+dol_syslog("Conso m�moire ".memory_get_usage() );
 ?>
diff --git a/htdocs/telephonie/script/facturation-details.php b/htdocs/telephonie/script/facturation-details.php
index 43b816f518b..b7181d13d34 100644
--- a/htdocs/telephonie/script/facturation-details.php
+++ b/htdocs/telephonie/script/facturation-details.php
@@ -59,7 +59,7 @@ else
   $error++;
 }
 
-dolibarr_syslog("G�n�re les factures d�taill�es pour : ".$date);
+dol_syslog("G�n�re les factures d�taill�es pour : ".$date);
 
 /*
  * Lectures de diff�rentes factures
@@ -91,12 +91,12 @@ if (!$error)
 	  $i++;
 	}            
       $db->free($resql);
-      dolibarr_syslog("$i lignes trouv�es");
+      dol_syslog("$i lignes trouv�es");
     }
   else
     {
       $error = 1;
-      dolibarr_syslog($db->error());
+      dol_syslog($db->error());
     }
 }
 
@@ -137,15 +137,15 @@ if (!$error && sizeof($factures))
 		}
 	      else
 		{
-		  dolibarr_syslog("ERREUR lors de G�n�ration du pdf d�taill�");
+		  dol_syslog("ERREUR lors de G�n�ration du pdf d�taill�");
 		  $error = 19;
 		}
 	    }
 	}
     }
 
-   dolibarr_syslog(sizeof($factures)." factures trait�es");
-   dolibarr_syslog($facok." factures g�n�r�es");
+   dol_syslog(sizeof($factures)." factures trait�es");
+   dol_syslog($facok." factures g�n�r�es");
 }
 
 $db->close();
diff --git a/htdocs/telephonie/script/facturation-emission.php b/htdocs/telephonie/script/facturation-emission.php
index b6ba051290a..8c238524db9 100644
--- a/htdocs/telephonie/script/facturation-emission.php
+++ b/htdocs/telephonie/script/facturation-emission.php
@@ -91,13 +91,13 @@ if ( $resql )
 
   $batch_id = $row[0];
 
-  dolibarr_syslog("Traitement du batch ".$batch_id);
+  dol_syslog("Traitement du batch ".$batch_id);
   $db->free($resql);
 }
 else
 {
   $error = 1;
-  dolibarr_syslog("Erreur ".$error);
+  dol_syslog("Erreur ".$error);
 }
 
 /*
@@ -114,7 +114,7 @@ if (!$error)
    *
    ***************************************************************/
 
-  dolibarr_syslog("Lecture des contrats");
+  dol_syslog("Lecture des contrats");
       
   $sql = "SELECT distinct(c.rowid)";
   $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_facture as f";
@@ -130,7 +130,7 @@ if (!$error)
   if (strlen($optcontrat) >  0)
     {
       $sql .= " AND c.rowid=".$optcontrat;
-      dolibarr_syslog("Limite sur le contrat : ".$optcontrat);
+      dol_syslog("Limite sur le contrat : ".$optcontrat);
     }
   else
     {
@@ -157,7 +157,7 @@ if (!$error)
   else
     {
       $error = 2;
-      dolibarr_syslog("Erreur $error");
+      dol_syslog("Erreur $error");
     }
 }
 /*
@@ -166,7 +166,7 @@ if (!$error)
  */
 if (!$error)
 { 
-  dolibarr_syslog("Nombre de contrats � facturer ".sizeof($contrats));
+  dol_syslog("Nombre de contrats � facturer ".sizeof($contrats));
   
   $xcli = 0;
   $xclis = sizeof($contrats);
@@ -176,7 +176,7 @@ if (!$error)
       $xcli++;
       
       /* Lecture des factures t�l�phoniques du contrat */
-      dolibarr_syslog($xcli."/".$xclis." Contrat � facturer id=".$contrat." (".memory_get_usage() .")");
+      dol_syslog($xcli."/".$xclis." Contrat � facturer id=".$contrat." (".memory_get_usage() .")");
 
       $sql = "SELECT f.rowid, s.rowid as socid";    
       $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_facture as f";
@@ -212,7 +212,7 @@ if (!$error)
 	    }            
 	  $db->free();
 	  
-	  dolibarr_syslog("Contrat $contrat : $i factures trouv�es � g�n�rer");
+	  dol_syslog("Contrat $contrat : $i factures trouv�es � g�n�rer");
 
 	  $factures_prev = array();
 	  $factures_a_mailer = array();
@@ -271,7 +271,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
       else
 	{
 	  $error++;
-	  dolibarr_syslog("Impossible de lire le contrat");	  
+	  dol_syslog("Impossible de lire le contrat");	  
 	}
     }
 
@@ -283,7 +283,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 
       if ($soc->fetch($contrat->client_facture_id) )
 	{
-	  if ($verbose) dolibarr_syslog($soc->nom);
+	  if ($verbose) dol_syslog($soc->nom);
 	}
       else
 	{
@@ -297,7 +297,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
    */	      
   if (!$error)
     {
-      if ($verbose) dolibarr_syslog("Cr�ation facture pour $soc->nom");
+      if ($verbose) dol_syslog("Cr�ation facture pour $soc->nom");
 
       $fac = new Facture($db, $soc->id);
       $cancel_facture = 1;
@@ -313,7 +313,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 	}
       else
 	{
-	  dolibarr_syslog("Erreur cr�ation objet facture erreur : $facid");
+	  dol_syslog("Erreur cr�ation objet facture erreur : $facid");
 	  $error = 16;
 	}		  
     }
@@ -335,7 +335,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 	    }
 	  else
 	    {
-	      dolibarr_syslog("ERREUR lecture facture t�l�phonique $factel_id");
+	      dol_syslog("ERREUR lecture facture t�l�phonique $factel_id");
 	      $error = 17;
 	    }
 	  
@@ -348,7 +348,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 	    }
 	  else
 	    {
-	      dolibarr_syslog("ERREUR lecture ligne $factel->ligne");
+	      dol_syslog("ERREUR lecture ligne $factel->ligne");
 	      $error = 18;
 	    }
 	  
@@ -457,7 +457,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
       else
 	{
 	  $error = 20;
-	  dolibarr_syslog("Erreur $error");
+	  dol_syslog("Erreur $error");
 	}
     }
      
@@ -503,8 +503,8 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
       else
 	{
 	  $error = 21;
-	  dolibarr_syslog($db->error());
-	  dolibarr_syslog("Erreur rejet prelevement");
+	  dol_syslog($db->error());
+	  dol_syslog("Erreur rejet prelevement");
 	}
     }
 
@@ -535,8 +535,8 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
       else
 	{
 	  $error = 32;
-	  dolibarr_syslog("Erreur remise exceptionnelle");
-	  dolibarr_syslog($sql);
+	  dol_syslog("Erreur remise exceptionnelle");
+	  dol_syslog($sql);
 	}
       
       print "remise $remise_exceptionnelle \n";
@@ -664,7 +664,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
   
   if (!$error && !$cancel_facture)
     {
-      if ($verbose) dolibarr_syslog("Validation de la facture : $fac->id");
+      if ($verbose) dol_syslog("Validation de la facture : $fac->id");
       
       $y = substr($year, -1);
       $m = substr("00".$month, -2);
@@ -699,7 +699,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 	    }
 	  else
 	    {
-	      dolibarr_syslog("ERREUR lecture facture t�l�phonique $factel_id");
+	      dol_syslog("ERREUR lecture facture t�l�phonique $factel_id");
 	      $error = 17;
 	    }
 	  
@@ -712,7 +712,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 	    }
 	  else
 	    {
-	      dolibarr_syslog("ERREUR lecture ligne $factel->ligne");
+	      dol_syslog("ERREUR lecture ligne $factel->ligne");
 	      $error = 18;
 	    }
 
@@ -741,7 +741,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 		}
 	      else
 		{
-		  dolibarr_syslog("ERREUR lors de G�n�ration du pdf d�taill�");
+		  dol_syslog("ERREUR lors de G�n�ration du pdf d�taill�");
 		  $error = 19;
 		} 
 	    }
@@ -784,7 +784,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
   
   if (!$error && !$cancel_facture && $valid_ok == 1)
     {
-      if ($verbose) dolibarr_syslog("G�n�ration du pdf facture : $facid");
+      if ($verbose) dol_syslog("G�n�ration du pdf facture : $facid");
       
       $fac->fetch($facid);
       $fac->fetch_client();
@@ -798,7 +798,7 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 	  $message .= $fac->client->bank_account->number."\n";
 	}
       
-      if ($verbose) dolibarr_syslog("Cr�ation du pdf facture : $facid");
+      if ($verbose) dol_syslog("Cr�ation du pdf facture : $facid");
       
       if (! facture_pdf_create($db, $facid, $message))
 	{
@@ -825,11 +825,11 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact
 	    }
 	  else
 	    {
-	      dolibarr_syslog("facture $facid non preleve, RIB incorrect");
+	      dol_syslog("facture $facid non preleve, RIB incorrect");
 	    }	  
 	}
       
-      if ($verbose) dolibarr_syslog("Commit de la transaction");;
+      if ($verbose) dol_syslog("Commit de la transaction");;
     }
   else
     {
@@ -846,8 +846,8 @@ function _prelevements($db, $user, $factures_prev)
    *                                                                  *
    *                                                                  *
    ********************************************************************/  
-  //dolibarr_syslog("[PR] Debut demande de prelevement");
-  //dolibarr_syslog("[PR] Nombre de factures ".sizeof($factures_prev)); 
+  //dol_syslog("[PR] Debut demande de prelevement");
+  //dol_syslog("[PR] Nombre de factures ".sizeof($factures_prev)); 
   if (sizeof($factures_prev) > 0)
     {
       foreach ($factures_prev as $fac)
@@ -858,7 +858,7 @@ function _prelevements($db, $user, $factures_prev)
 	  $fact->demande_prelevement($user);
 	}
     }
-  //dolibarr_syslog("[PR] Fin demande de prelevement");
+  //dol_syslog("[PR] Fin demande de prelevement");
 }
 
 
@@ -901,7 +901,7 @@ function _emails($db, $user, $contrat_id, $factures_a_mailer)
 	      $sendto = substr($sendto,0,strlen($sendto) - 1);
 
 
-	      dolibarr_syslog("[EM] Envoi email � ".html_entity_decode($sendto) );
+	      dol_syslog("[EM] Envoi email � ".html_entity_decode($sendto) );
 
 	      $subject = ereg_replace("#FACREF#",$fact->ref,TELEPHONIE_MAIL_FACTURATION_SUJET);
 	      $subject = ereg_replace("#CONTRAT#",$contrat->ref, $subject);
@@ -998,7 +998,7 @@ function _emails($db, $user, $contrat_id, $factures_a_mailer)
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Aucun email trouv�");
+	      dol_syslog("Aucun email trouv�");
 	    }
 	}
     }
@@ -1010,6 +1010,6 @@ function _emails($db, $user, $contrat_id, $factures_a_mailer)
 
 $db->close();
 
-dolibarr_syslog("Conso m�moire ".memory_get_usage() );
+dol_syslog("Conso m�moire ".memory_get_usage() );
 
 ?>
diff --git a/htdocs/telephonie/script/facturation-import-cdr.php b/htdocs/telephonie/script/facturation-import-cdr.php
index 85cb397663b..0668f920f83 100644
--- a/htdocs/telephonie/script/facturation-import-cdr.php
+++ b/htdocs/telephonie/script/facturation-import-cdr.php
@@ -50,18 +50,18 @@ if ($db->query($sql))
   if ($num == 1)
     {
       $row = $db->fetch_row();
-      dolibarr_syslog ("facturation-import-cdr.php Import fichier ".$file);
-      dolibarr_syslog("facturation-import-cdr.php Fournisseur [".$row[0]."] ".$row[1]);
+      dol_syslog ("facturation-import-cdr.php Import fichier ".$file);
+      dol_syslog("facturation-import-cdr.php Fournisseur [".$row[0]."] ".$row[1]);
     }
   else
     {
-      dolibarr_syslog("facturation-import-cdr.php Erreur Fournisseur inexistant : ".$id_fourn);
+      dol_syslog("facturation-import-cdr.php Erreur Fournisseur inexistant : ".$id_fourn);
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("facturation-import-cdr.php Erreur recherche fournisseur");
+  dol_syslog("facturation-import-cdr.php Erreur recherche fournisseur");
   exit ;
 }
 
@@ -83,20 +83,20 @@ if ($db->query($sql))
       $row = $db->fetch_row();
       if ($row[0] > 0)
 	{
-	  dolibarr_syslog ("facturation-import-cdr.php Fichier ".$file." d�j� charg� dans import-log");
+	  dol_syslog ("facturation-import-cdr.php Fichier ".$file." d�j� charg� dans import-log");
 
 	  exit ;
 	}
     }
   else
     {
-      dolibarr_syslog("facturation-import-cdr.php Erreur v�rif du fichier");
+      dol_syslog("facturation-import-cdr.php Erreur v�rif du fichier");
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("facturation-import-cdr.php Erreur SQL v�rification du fichier");
+  dol_syslog("facturation-import-cdr.php Erreur SQL v�rification du fichier");
   exit ;
 }
 
@@ -118,20 +118,20 @@ if ($db->query($sql))
       $row = $db->fetch_row();
       if ($row[0] > 0)
 	{
-	  dolibarr_syslog ("facturation-import-cdr.php Fichier ".$file." d�j� trait�");
+	  dol_syslog ("facturation-import-cdr.php Fichier ".$file." d�j� trait�");
 	  exit ;
 	}
     }
   else
     {
-      dolibarr_syslog("facturation-import-cdr.php Erreur v�rif du fichier dans les comm");
+      dol_syslog("facturation-import-cdr.php Erreur v�rif du fichier dans les comm");
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("facturation-import-cdr.php Erreur SQL v�rification du fichier dans les comm");
-  dolibarr_syslog("facturation-import-cdr.php ".$sql);
+  dol_syslog("facturation-import-cdr.php Erreur SQL v�rification du fichier dans les comm");
+  dol_syslog("facturation-import-cdr.php ".$sql);
   exit ;
 }
 
@@ -148,7 +148,7 @@ $resql = $db->query($sql);
 if ($resql)
 {  
   $num = $db->num_rows($resql);
-  dolibarr_syslog ("facturation-import-cdr.php ".$num." lignes charg�es");
+  dol_syslog ("facturation-import-cdr.php ".$num." lignes charg�es");
   $i = 0;
   $ligneids = array();
 
@@ -161,8 +161,8 @@ if ($resql)
 }
 else
 {
-  dolibarr_syslog("facturation-import-cdr.php Erreur chargement des lignes");
-  dolibarr_syslog($sql);
+  dol_syslog("facturation-import-cdr.php Erreur chargement des lignes");
+  dol_syslog($sql);
   exit ;
 }
 
@@ -173,7 +173,7 @@ else
 
 if (is_readable($file))
 {
-  dolibarr_syslog("facturation-import-cdr.php Lecture du fichier $file");
+  dol_syslog("facturation-import-cdr.php Lecture du fichier $file");
   
   $error = 0;
   $line = 0;
@@ -233,9 +233,9 @@ if (is_readable($file))
 			    }
 			  else
 			    {
-			      dolibarr_syslog("facturation-import-cdr.php Erreur de traitement de ligne $index");
-			      dolibarr_syslog("facturation-import-cdr.php ".$db->error());
-			      dolibarr_syslog("facturation-import-cdr.php ".$sql);
+			      dol_syslog("facturation-import-cdr.php Erreur de traitement de ligne $index");
+			      dol_syslog("facturation-import-cdr.php ".$db->error());
+			      dol_syslog("facturation-import-cdr.php ".$sql);
 			      $error++;
 			    }
 			}
@@ -247,32 +247,32 @@ if (is_readable($file))
 		    }
 		  else
 		    {
-		      dolibarr_syslog("facturation-import-cdr.php Ligne : $ligne ignor�e!");
+		      dol_syslog("facturation-import-cdr.php Ligne : $ligne ignor�e!");
 		      $error++;
 		    }
 		  
 		}
 	      else
 		{
-		  dolibarr_syslog("facturation-import-cdr.php Mauvais format de fichier ligne $line");
+		  dol_syslog("facturation-import-cdr.php Mauvais format de fichier ligne $line");
 		  $error++;
 		}
 	    }
 	  $line++;
 	}
       
-      dolibarr_syslog("facturation-import-cdr.php ".($line -1 )." lignes trait�es dans le fichier");
-      dolibarr_syslog("facturation-import-cdr.php ".$line_inserted." insert effectu�s");
+      dol_syslog("facturation-import-cdr.php ".($line -1 )." lignes trait�es dans le fichier");
+      dol_syslog("facturation-import-cdr.php ".$line_inserted." insert effectu�s");
       
       if ($error == 0)
 	{	  
 	  $db->query("COMMIT");
-	  dolibarr_syslog("facturation-import-cdr.php COMMIT");
+	  dol_syslog("facturation-import-cdr.php COMMIT");
 	}
       else
 	{
 	  $db->query("ROLLBACK");
-	  dolibarr_syslog("facturation-import-cdr.php ROLLBACK");
+	  dol_syslog("facturation-import-cdr.php ROLLBACK");
 	}
       
     }
@@ -282,7 +282,7 @@ if (is_readable($file))
 else
 {
   print "Erreur lecture : $file";
-  dolibarr_syslog("facturation-import-cdr.php ".$file." not readable");
+  dol_syslog("facturation-import-cdr.php ".$file." not readable");
 }
 
 
diff --git a/htdocs/telephonie/script/facturation-impression.php b/htdocs/telephonie/script/facturation-impression.php
index b400b4a4dd0..db03a16833f 100644
--- a/htdocs/telephonie/script/facturation-impression.php
+++ b/htdocs/telephonie/script/facturation-impression.php
@@ -83,14 +83,14 @@ $sql .= " AND date_format(f.date,'%m%Y') = '".$month.$year."'";
 
 $resql = $db->query($sql);
   
-dolibarr_syslog("Impression des factures de ".$month.$year);
+dol_syslog("Impression des factures de ".$month.$year);
 
 if ( $resql )
 {
   $num = $db->num_rows($resql);
   $i = 0;
 
-  dolibarr_syslog("$num factures a imprimer");
+  dol_syslog("$num factures a imprimer");
 
   $pdf = new FPDI_Protection('P','mm','A4');
                  		
@@ -164,17 +164,17 @@ if ( $resql )
 
   $pdf->Close();	      
   $pdf->Output($file);
-  dolibarr_syslog("Generation de ".$pages_facture." envois");
-  dolibarr_syslog("Generation de ".$pages." pages");
-  dolibarr_syslog("Generation de ".$total_feuilles." feuilles");
-  dolibarr_syslog("Ecriture de : ".$file);
+  dol_syslog("Generation de ".$pages_facture." envois");
+  dol_syslog("Generation de ".$pages." pages");
+  dol_syslog("Generation de ".$total_feuilles." feuilles");
+  dol_syslog("Ecriture de : ".$file);
   $db->free($resql);
 }
 else
 {
   $error = 1;
-  dolibarr_syslog("Erreur ".$error);
-  dolibarr_syslog($db->error());
+  dol_syslog("Erreur ".$error);
+  dol_syslog($db->error());
 }
 
 $db->close();
@@ -198,14 +198,14 @@ $sql .= " AND date_format(f.date,'%m%Y') = '".$month.$year."'";
 
 $resql = $db->query($sql);
   
-dolibarr_syslog("Impression des factures de ".$month.$year);
+dol_syslog("Impression des factures de ".$month.$year);
 
 if ( $resql )
 {
   $num = $db->num_rows($resql);
   $i = 0;
 
-  dolibarr_syslog("$num factures a imprimer");
+  dol_syslog("$num factures a imprimer");
 
   while ($i < $num)
     {
@@ -215,7 +215,7 @@ if ( $resql )
 
       if (! copy($file,"/tmp/facture/".$row[1].".pdf"))
 	{
-	  dolibarr_syslog("Error copy $file");
+	  dol_syslog("Error copy $file");
 	}
 
       $i++;
@@ -226,8 +226,8 @@ if ( $resql )
 else
 {
   $error = 1;
-  dolibarr_syslog("Erreur ".$error);
-  dolibarr_syslog($db->error());
+  dol_syslog("Erreur ".$error);
+  dol_syslog($db->error());
 }
 
 $db->close();
diff --git a/htdocs/telephonie/script/facturation-pre-consolidation.php b/htdocs/telephonie/script/facturation-pre-consolidation.php
index c834ebeccc8..294e7ab1cf5 100644
--- a/htdocs/telephonie/script/facturation-pre-consolidation.php
+++ b/htdocs/telephonie/script/facturation-pre-consolidation.php
@@ -39,8 +39,8 @@ $resql = $db->query($sql);
 if (! $resql )
 {
   $error = 1;
-  dolibarr_syslog("Erreur ".$error);
-  dolibarr_syslog($db->error());
+  dol_syslog("Erreur ".$error);
+  dol_syslog($db->error());
 }
 
 $sql = "UPDATE ";
@@ -52,8 +52,8 @@ $resql = $db->query($sql);
 if (! $resql )
 {
   $error = 1;
-  dolibarr_syslog("Erreur ".$error);
-  dolibarr_syslog($db->error());
+  dol_syslog("Erreur ".$error);
+  dol_syslog($db->error());
 }
 
 $db->close();
diff --git a/htdocs/telephonie/script/facturation-verif.php b/htdocs/telephonie/script/facturation-verif.php
index 35fcfd43144..addc771fb76 100644
--- a/htdocs/telephonie/script/facturation-verif.php
+++ b/htdocs/telephonie/script/facturation-verif.php
@@ -24,7 +24,7 @@
 
 require ("../../master.inc.php");
 
-dolibarr_syslog("facturation-verif.php BEGIN"); 
+dol_syslog("facturation-verif.php BEGIN"); 
 
 require_once (DOL_DOCUMENT_ROOT."/societe.class.php");
 require_once (DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php");
@@ -39,7 +39,7 @@ $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."telephonie_import_cdr";
 if ( $db->query($sql) )
 {
   $row = $db->fetch_row();
-  dolibarr_syslog("facturation-verif.php ".$row[0]." lignes de communications a verifier");
+  dol_syslog("facturation-verif.php ".$row[0]." lignes de communications a verifier");
 }
 
 /*******************************************************************************
@@ -51,7 +51,7 @@ $grille_vente = TELEPHONIE_GRILLE_VENTE_DEFAUT_ID;
 
 $tarif_vente = new TelephonieTarif($db, $grille_vente, "vente");
 
-dolibarr_syslog("facturation-verif.php Grille : $grille contient ".$tarif_vente->num_tarifs." tarifs");
+dol_syslog("facturation-verif.php Grille : $grille contient ".$tarif_vente->num_tarifs." tarifs");
 
 $sql = "SELECT distinct(num) FROM ".MAIN_DB_PREFIX."telephonie_import_cdr";
 
@@ -99,7 +99,7 @@ if ( $resql )
     }
   $db->free($resql);
 }
-dolibarr_syslog($error ." erreurs trouv�es"); 
+dol_syslog($error ." erreurs trouv�es"); 
 
-dolibarr_syslog("facturation-verif.php END"); 
+dol_syslog("facturation-verif.php END"); 
 ?>
diff --git a/htdocs/telephonie/script/facture-detail-tableur-one.class.php b/htdocs/telephonie/script/facture-detail-tableur-one.class.php
index 506f09b153f..b8b540836ae 100644
--- a/htdocs/telephonie/script/facture-detail-tableur-one.class.php
+++ b/htdocs/telephonie/script/facture-detail-tableur-one.class.php
@@ -53,12 +53,12 @@ class FactureDetailTableurOne {
 	  }
 	else
 	  {
-	    //dolibarr_syslog("Pas de facture pour ".$this->ligne->id);
+	    //dol_syslog("Pas de facture pour ".$this->ligne->id);
 	  }
       }
     else
       {
-	dolibarr_syslog("Error");
+	dol_syslog("Error");
       }
 
 
@@ -76,7 +76,7 @@ class FactureDetailTableurOne {
 
 	$fname = $dir . $facid . "-detail.xls";
 	
-	dolibarr_syslog("Open ".$facid."-detail.xls");
+	dol_syslog("Open ".$facid."-detail.xls");
 	
 	$workbook = &new writeexcel_workbook($fname);
 	
@@ -123,7 +123,7 @@ class FactureDetailTableurOne {
 	    $i = 0;
 	    $numsql = $this->db->num_rows($resql);
 	    
-	    dolibarr_syslog("Ligne : ".$this->ligne->id . " : ".$numsql);
+	    dol_syslog("Ligne : ".$this->ligne->id . " : ".$numsql);
 	    
 	    while ($i < $numsql)
 	      {
@@ -144,11 +144,11 @@ class FactureDetailTableurOne {
 	  }
 	else
 	  {
-	    dolibarr_syslog($this->db->error());
+	    dol_syslog($this->db->error());
 	  }
 	
 	$workbook->close();
-	//dolibarr_syslog("Close $fname");
+	//dol_syslog("Close $fname");
       }
     
     return $error;
diff --git a/htdocs/telephonie/script/facture-detail-tableur-two.class.php b/htdocs/telephonie/script/facture-detail-tableur-two.class.php
index 5ebf4c688a0..2df9c9f96af 100644
--- a/htdocs/telephonie/script/facture-detail-tableur-two.class.php
+++ b/htdocs/telephonie/script/facture-detail-tableur-two.class.php
@@ -51,7 +51,7 @@ class FactureDetailTableurTwo {
     
     $fname = $dir . $contrat_id . "-$month-$year-detail.xls";
     
-    dolibarr_syslog("Open ".$fname);
+    dol_syslog("Open ".$fname);
     
     $workbook = &new writeexcel_workbook($fname);
     
@@ -98,7 +98,7 @@ class FactureDetailTableurTwo {
       {    
 	$num = $this->db->num_rows($resql);
 	$total = 0;
-	dolibarr_syslog($num." lignes trouv�es");
+	dol_syslog($num." lignes trouv�es");
 	$xx = 1;
 	while ($row = $this->db->fetch_row($resql))
 	  {
@@ -115,7 +115,7 @@ class FactureDetailTableurTwo {
 		$i = 0;
 		$numsq = $this->db->num_rows($resq);
 		$total = $total + $numsq;
-		dolibarr_syslog("Ligne : ".$row[1] . " : ".$numsq . " Total : ".$total);
+		dol_syslog("Ligne : ".$row[1] . " : ".$numsq . " Total : ".$total);
 		
 		while ($i < $numsq)
 		  {
@@ -135,12 +135,12 @@ class FactureDetailTableurTwo {
 	      }
 	    else
 	      {
-		dolibarr_syslog($this->db->error());
+		dol_syslog($this->db->error());
 	      }
 	  }
 	
 	$workbook->close();
-	//dolibarr_syslog("Close $fname");
+	//dol_syslog("Close $fname");
       }
     
     return $error;
diff --git a/htdocs/telephonie/script/import-cdr-bt.php b/htdocs/telephonie/script/import-cdr-bt.php
index 6665ed26d01..867762b5cbe 100644
--- a/htdocs/telephonie/script/import-cdr-bt.php
+++ b/htdocs/telephonie/script/import-cdr-bt.php
@@ -57,12 +57,12 @@ if (is_dir($file))
 	      if (substr($xfile, -4) == ".csv")
 		{
 		  $files[$i] = $file.$xfile;
-		  dolibarr_syslog($file.$xfile." ajout�");
+		  dol_syslog($file.$xfile." ajout�");
 		  $i++;
 		}
 	      else
 		{
-		  dolibarr_syslog($file.$xfile." ignor�");
+		  dol_syslog($file.$xfile." ignor�");
 		}
 	    }
 	}
@@ -71,7 +71,7 @@ if (is_dir($file))
     }
   else
     {
-      dolibarr_syslog("Impossible de libre $file");
+      dol_syslog("Impossible de libre $file");
       exit ;
     }
 }
@@ -81,7 +81,7 @@ elseif (is_file($file))
 }
 else
 {
-  dolibarr_syslog("Impossible de libre $file");
+  dol_syslog("Impossible de libre $file");
   exit ;
 }
 
@@ -108,13 +108,13 @@ foreach ($files as $xfile)
 {
   if (is_readable($xfile))
     {
-      dolibarr_syslog("Traitement de ".basename($xfile));
+      dol_syslog("Traitement de ".basename($xfile));
       $newname = str_replace(".csv","-$month$year.csv",$xfile);
       if (substr($xfile,-9) <> "-$month$year.csv")
 	{
 	  if (rename($xfile, $newname))
 	    {
-	      dolibarr_syslog("Renomme en ".$newname);
+	      dol_syslog("Renomme en ".$newname);
 	      $newfiles[$j] = $newname;
 	      $j++;
 	    }
@@ -148,18 +148,18 @@ if ($db->query($sql))
   if ($num == 1)
     {
       $row = $db->fetch_row();
-      dolibarr_syslog ("Import fichier ".$file);
-      dolibarr_syslog("Fournisseur [".$row[0]."] ".$row[1]);
+      dol_syslog ("Import fichier ".$file);
+      dol_syslog("Fournisseur [".$row[0]."] ".$row[1]);
     }
   else
     {
-      dolibarr_syslog("Erreur Fournisseur inexistant : ".$id_fourn);
+      dol_syslog("Erreur Fournisseur inexistant : ".$id_fourn);
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("Erreur recherche fournisseur");
+  dol_syslog("Erreur recherche fournisseur");
   exit ;
 }
 
@@ -177,7 +177,7 @@ $resql = $db->query($sql);
 if ($resql)
 {  
   $num = $db->num_rows($resql);
-  dolibarr_syslog ($num . " lignes charg�es");
+  dol_syslog ($num . " lignes charg�es");
   $i = 0;
   $ligneids = array();
 
@@ -190,8 +190,8 @@ if ($resql)
 }
 else
 {
-  dolibarr_syslog("Erreur chargement des lignes");
-  dolibarr_syslog($sql);
+  dol_syslog("Erreur chargement des lignes");
+  dol_syslog($sql);
   exit ;
 }
 
@@ -203,7 +203,7 @@ foreach ($newfiles as $xfile)
     {
       if ( _verif($db, $xfile) == 0)
 	{
-	  dolibarr_syslog("Lecture du fichier $xfile");
+	  dol_syslog("Lecture du fichier $xfile");
       
 	  $error = 0;
 	  $line = 0;
@@ -295,9 +295,9 @@ foreach ($newfiles as $xfile)
 				    }
 				  else
 				    {
-				      dolibarr_syslog("Erreur de traitement de ligne $index");
-				      dolibarr_syslog($db->error());
-				      dolibarr_syslog($sql);
+				      dol_syslog("Erreur de traitement de ligne $index");
+				      dol_syslog($db->error());
+				      dol_syslog($sql);
 				      $error++;
 				    }
 				}
@@ -309,14 +309,14 @@ foreach ($newfiles as $xfile)
 			    }
 			  else
 			    {
-			      dolibarr_syslog("Ligne : $ligne ignor�e!");
+			      dol_syslog("Ligne : $ligne ignor�e!");
 			      $error++;
 			    }
 			}
 		      else
 			{
-			  dolibarr_syslog("Mauvais format de fichier ligne $line ".sizeof($tabline));
-			  dolibarr_syslog($cont);
+			  dol_syslog("Mauvais format de fichier ligne $line ".sizeof($tabline));
+			  dol_syslog($cont);
 			  $error++;
 			}
 		    }
@@ -324,7 +324,7 @@ foreach ($newfiles as $xfile)
 		}
 	      if ($line <> $line_inserted)
 		{
-		  dolibarr_syslog($line."/".$line_inserted." lignes trait�es/insert effectu�s");
+		  dol_syslog($line."/".$line_inserted." lignes trait�es/insert effectu�s");
 		}
 	  
 	      if ($error == 0)
@@ -334,7 +334,7 @@ foreach ($newfiles as $xfile)
 	      else
 		{
 		  $db->query("ROLLBACK");
-		  dolibarr_syslog("ROLLBACK");
+		  dol_syslog("ROLLBACK");
 		}	  
 	    }      
 	  fclose($hf);
@@ -343,11 +343,11 @@ foreach ($newfiles as $xfile)
   else
     {
       print "Erreur lecture : $xfile";
-      dolibarr_syslog($xfile . " not readable");
+      dol_syslog($xfile . " not readable");
     }
 }
 
-dolibarr_syslog($line_inserted_total." insert effectu�s total");
+dol_syslog($line_inserted_total." insert effectu�s total");
 
 /*
  * Fin
@@ -375,19 +375,19 @@ function _verif($db, $file)
 	  $row = $db->fetch_row();
 	  if ($row[0] > 0)
 	    {
-	      dolibarr_syslog ("Fichier ".$file." d�j� charg� dans import-log");	     
+	      dol_syslog ("Fichier ".$file." d�j� charg� dans import-log");	     
 	      $result = -1;
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("Erreur v�rif du fichier");
+	  dol_syslog("Erreur v�rif du fichier");
 	  $result = -1;
 	}
     }
   else
     {
-      dolibarr_syslog("Erreur SQL v�rification du fichier");
+      dol_syslog("Erreur SQL v�rification du fichier");
       $result = -1;
     }
 
@@ -409,20 +409,20 @@ function _verif($db, $file)
 	  $row = $db->fetch_row();
 	  if ($row[0] > 0)
 	    {
-	      dolibarr_syslog ("Fichier ".$file." d�j� trait�");
+	      dol_syslog ("Fichier ".$file." d�j� trait�");
 	      $result = -1;
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("Erreur v�rif du fichier dans les comm");
+	  dol_syslog("Erreur v�rif du fichier dans les comm");
 	  $result = -1;
 	}
     }
   else
     {
-      dolibarr_syslog("Erreur SQL v�rification du fichier dans les comm");
-      dolibarr_syslog($sql);
+      dol_syslog("Erreur SQL v�rification du fichier dans les comm");
+      dol_syslog($sql);
       $result = -1;
     } 
 
diff --git a/htdocs/telephonie/script/import-cdr-ftp.php b/htdocs/telephonie/script/import-cdr-ftp.php
index adcad3a5c1f..8499c92bbb2 100644
--- a/htdocs/telephonie/script/import-cdr-ftp.php
+++ b/htdocs/telephonie/script/import-cdr-ftp.php
@@ -58,12 +58,12 @@ if (is_dir($file))
 	  if (is_file($file.$xfile) && substr($xfile, -4) == ".csv")
 	    {
 	      $files[$i] = $file.$xfile;
-	      dolibarr_syslog($xfile." ajout�");
+	      dol_syslog($xfile." ajout�");
 	      $i++;
 	    }
 	  else
 	    {
-	      dolibarr_syslog($xfile." ignor�");
+	      dol_syslog($xfile." ignor�");
 	    }
 	}
       
@@ -71,7 +71,7 @@ if (is_dir($file))
     }
   else
     {
-      dolibarr_syslog("Impossible de libre $file");
+      dol_syslog("Impossible de libre $file");
       exit ;
     }
 }
@@ -81,7 +81,7 @@ elseif (is_file($file))
 }
 else
 {
-  dolibarr_syslog("Impossible de libre $file");
+  dol_syslog("Impossible de libre $file");
   exit ;
 }
 
@@ -101,18 +101,18 @@ if ($db->query($sql))
   if ($num == 1)
     {
       $row = $db->fetch_row();
-      dolibarr_syslog ("Import fichier ".$file);
-      dolibarr_syslog("Fournisseur [".$row[0]."] ".$row[1]);
+      dol_syslog ("Import fichier ".$file);
+      dol_syslog("Fournisseur [".$row[0]."] ".$row[1]);
     }
   else
     {
-      dolibarr_syslog("Erreur Fournisseur inexistant : ".$id_fourn);
+      dol_syslog("Erreur Fournisseur inexistant : ".$id_fourn);
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("Erreur recherche fournisseur");
+  dol_syslog("Erreur recherche fournisseur");
   exit ;
 }
 
@@ -133,7 +133,7 @@ if ($db->query($sql))
 }
 else
 {
-  dolibarr_syslog("Erreur recherche fournisseur");
+  dol_syslog("Erreur recherche fournisseur");
 }
 $sql = "SELECT distinct(fichier)";
 $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_import_cdr";
@@ -147,7 +147,7 @@ if ($db->query($sql))
 }
 else
 {
-  dolibarr_syslog("Erreur recherche fournisseur");
+  dol_syslog("Erreur recherche fournisseur");
   exit ;
 }
 /*
@@ -163,7 +163,7 @@ $resql = $db->query($sql);
 if ($resql)
 {  
   $num = $db->num_rows($resql);
-  dolibarr_syslog ($num . " lignes charg�es");
+  dol_syslog ($num . " lignes charg�es");
   $i = 0;
   $ligneids = array();
 
@@ -176,8 +176,8 @@ if ($resql)
 }
 else
 {
-  dolibarr_syslog("Erreur chargement des lignes");
-  dolibarr_syslog($sql);
+  dol_syslog("Erreur chargement des lignes");
+  dol_syslog($sql);
   exit ;
 }
 
@@ -187,7 +187,7 @@ foreach ($files as $xfile)
     {
       if ( _verif($db, $xfile, $fichiers) == 0)
 	{      
-	  dolibarr_syslog("Lecture du fichier $xfile");
+	  dol_syslog("Lecture du fichier $xfile");
       
 	  $error = 0;
 	  $line = 0;
@@ -290,9 +290,9 @@ foreach ($files as $xfile)
 					    }
 					  else
 					    {
-					      dolibarr_syslog("Erreur de traitement de ligne $index");
-					      dolibarr_syslog($db->error());
-					      dolibarr_syslog($sql);
+					      dol_syslog("Erreur de traitement de ligne $index");
+					      dol_syslog($db->error());
+					      dol_syslog($sql);
 					      $error++;
 					    }
 					}
@@ -305,7 +305,7 @@ foreach ($files as $xfile)
 				}
 			      else
 				{
-				  dolibarr_syslog("Ligne : $ligne ignor�e ! log write in /tmp/$ligne.import");
+				  dol_syslog("Ligne : $ligne ignor�e ! log write in /tmp/$ligne.import");
 				  $fp = fopen("/tmp/$ligne.import","w");
 				  if ($fp)
 				    {
@@ -322,8 +322,8 @@ foreach ($files as $xfile)
 			    }
 			  else
 			    {
-			      dolibarr_syslog("Mauvais format de fichier ligne $line ".sizeof($tabline));
-			      dolibarr_syslog($cont);
+			      dol_syslog("Mauvais format de fichier ligne $line ".sizeof($tabline));
+			      dol_syslog($cont);
 			      $error++;
 			    }
 			}
@@ -331,8 +331,8 @@ foreach ($files as $xfile)
 		  $line++;
 		}
 	      
-	      dolibarr_syslog($line." lignes trait�es dans le fichier");
-	      dolibarr_syslog($line_inserted." insert effectu�s");
+	      dol_syslog($line." lignes trait�es dans le fichier");
+	      dol_syslog($line_inserted." insert effectu�s");
 	  
 	      if ($error == 0)
 		{	  
@@ -341,7 +341,7 @@ foreach ($files as $xfile)
 	      else
 		{
 		  $db->query("ROLLBACK");
-		  dolibarr_syslog("ROLLBACK");
+		  dol_syslog("ROLLBACK");
 		}
 	  
 	    }
@@ -352,7 +352,7 @@ foreach ($files as $xfile)
   else
     {
       print "Erreur lecture : $xfile";
-      dolibarr_syslog($xfile . " not readable");
+      dol_syslog($xfile . " not readable");
     }
 }
 
@@ -366,7 +366,7 @@ function _verif($db, $file, $fichiers)
    */
   if (in_array (basename($file), $fichiers))
     {
-      dolibarr_syslog ("Fichier ".basename($file)." d�j� charg�/trait�");
+      dol_syslog ("Fichier ".basename($file)." d�j� charg�/trait�");
       $result = -1;
     }
 
@@ -385,19 +385,19 @@ function _verif($db, $file, $fichiers)
 	  $row = $db->fetch_row();
 	  if ($row[0] > 0)
 	    {
-	      dolibarr_syslog ("Fichier ".$file." d�j� charg� dans import-log");	     
+	      dol_syslog ("Fichier ".$file." d�j� charg� dans import-log");	     
 	      $result = -1;
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("Erreur v�rif du fichier");
+	  dol_syslog("Erreur v�rif du fichier");
 	  $result = -1;
 	}
     }
   else
     {
-      dolibarr_syslog("Erreur SQL v�rification du fichier");
+      dol_syslog("Erreur SQL v�rification du fichier");
       $result = -1;
     }
  
@@ -414,20 +414,20 @@ function _verif($db, $file, $fichiers)
 	  $row = $db->fetch_row();
 	  if ($row[0] > 0)
 	    {
-	      dolibarr_syslog ("Fichier ".$file." d�j� trait�");
+	      dol_syslog ("Fichier ".$file." d�j� trait�");
 	      $result = -1;
 	    }
 	}
       else
 	{
-	  dolibarr_syslog("Erreur v�rif du fichier dans les comm");
+	  dol_syslog("Erreur v�rif du fichier dans les comm");
 	  $result = -1;
 	}
     }
   else
     {
-      dolibarr_syslog("Erreur SQL v�rification du fichier dans les comm");
-      dolibarr_syslog($sql);
+      dol_syslog("Erreur SQL v�rification du fichier dans les comm");
+      dol_syslog($sql);
       $result = -1;
     } 
   */
diff --git a/htdocs/telephonie/script/import-cdr.php b/htdocs/telephonie/script/import-cdr.php
index e3426aefe6d..9a605773d06 100644
--- a/htdocs/telephonie/script/import-cdr.php
+++ b/htdocs/telephonie/script/import-cdr.php
@@ -50,18 +50,18 @@ if ($db->query($sql))
   if ($num == 1)
     {
       $row = $db->fetch_row();
-      dolibarr_syslog ("Import fichier ".$file);
-      dolibarr_syslog("Fournisseur [".$row[0]."] ".$row[1]);
+      dol_syslog ("Import fichier ".$file);
+      dol_syslog("Fournisseur [".$row[0]."] ".$row[1]);
     }
   else
     {
-      dolibarr_syslog("Erreur Fournisseur inexistant : ".$id_fourn);
+      dol_syslog("Erreur Fournisseur inexistant : ".$id_fourn);
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("Erreur recherche fournisseur");
+  dol_syslog("Erreur recherche fournisseur");
   exit ;
 }
 
@@ -83,20 +83,20 @@ if ($db->query($sql))
       $row = $db->fetch_row();
       if ($row[0] > 0)
 	{
-	  dolibarr_syslog ("Fichier ".$file." d�j� charg� dans import-log");
+	  dol_syslog ("Fichier ".$file." d�j� charg� dans import-log");
 
 	  exit ;
 	}
     }
   else
     {
-      dolibarr_syslog("Erreur v�rif du fichier");
+      dol_syslog("Erreur v�rif du fichier");
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("Erreur SQL v�rification du fichier");
+  dol_syslog("Erreur SQL v�rification du fichier");
   exit ;
 }
 
@@ -118,20 +118,20 @@ if ($db->query($sql))
       $row = $db->fetch_row();
       if ($row[0] > 0)
 	{
-	  dolibarr_syslog ("Fichier ".$file." d�j� trait�");
+	  dol_syslog ("Fichier ".$file." d�j� trait�");
 	  exit ;
 	}
     }
   else
     {
-      dolibarr_syslog("Erreur v�rif du fichier dans les comm");
+      dol_syslog("Erreur v�rif du fichier dans les comm");
       exit ;
     }
 }
 else
 {
-  dolibarr_syslog("Erreur SQL v�rification du fichier dans les comm");
-  dolibarr_syslog($sql);
+  dol_syslog("Erreur SQL v�rification du fichier dans les comm");
+  dol_syslog($sql);
   exit ;
 }
 
@@ -148,7 +148,7 @@ $resql = $db->query($sql);
 if ($resql)
 {  
   $num = $db->num_rows($resql);
-  dolibarr_syslog ($num . " lignes charg�es");
+  dol_syslog ($num . " lignes charg�es");
   $i = 0;
   $ligneids = array();
 
@@ -161,8 +161,8 @@ if ($resql)
 }
 else
 {
-  dolibarr_syslog("Erreur chargement des lignes");
-  dolibarr_syslog($sql);
+  dol_syslog("Erreur chargement des lignes");
+  dol_syslog($sql);
   exit ;
 }
 
@@ -175,7 +175,7 @@ else
 if (is_readable($file))
 {
   
-  dolibarr_syslog("Lecture du fichier $file");
+  dol_syslog("Lecture du fichier $file");
   
   $error = 0;
   $line = 0;
@@ -235,9 +235,9 @@ if (is_readable($file))
 			    }
 			  else
 			    {
-			      dolibarr_syslog("Erreur de traitement de ligne $index");
-			      dolibarr_syslog($db->error());
-			      dolibarr_syslog($sql);
+			      dol_syslog("Erreur de traitement de ligne $index");
+			      dol_syslog($db->error());
+			      dol_syslog($sql);
 			      $error++;
 			    }
 			}
@@ -249,32 +249,32 @@ if (is_readable($file))
 		    }
 		  else
 		    {
-		      dolibarr_syslog("Ligne : $ligne ignor�e!");
+		      dol_syslog("Ligne : $ligne ignor�e!");
 		      $error++;
 		    }
 		  
 		}
 	      else
 		{
-		  dolibarr_syslog("Mauvais format de fichier ligne $line");
+		  dol_syslog("Mauvais format de fichier ligne $line");
 		  $error++;
 		}
 	    }
 	  $line++;
 	}
       
-      dolibarr_syslog(($line -1 )." lignes trait�es dans le fichier");
-      dolibarr_syslog($line_inserted." insert effectu�s");
+      dol_syslog(($line -1 )." lignes trait�es dans le fichier");
+      dol_syslog($line_inserted." insert effectu�s");
       
       if ($error == 0)
 	{	  
 	  $db->query("COMMIT");
-	  dolibarr_syslog("COMMIT");
+	  dol_syslog("COMMIT");
 	}
       else
 	{
 	  $db->query("ROLLBACK");
-	  dolibarr_syslog("ROLLBACK");
+	  dol_syslog("ROLLBACK");
 	}
       
     }
@@ -284,7 +284,7 @@ if (is_readable($file))
 else
 {
   print "Erreur lecture : $file";
-  dolibarr_syslog($file . " not readable");
+  dol_syslog($file . " not readable");
 }
 
 
diff --git a/htdocs/telephonie/script/import-rename-cdr.php b/htdocs/telephonie/script/import-rename-cdr.php
index 2847f367506..80bace0e590 100644
--- a/htdocs/telephonie/script/import-rename-cdr.php
+++ b/htdocs/telephonie/script/import-rename-cdr.php
@@ -55,12 +55,12 @@ if (is_dir($file))
 	  if (is_file($file.$xfile) && substr($xfile, -4) == ".csv")
 	    {
 	      $files[$i] = $file.$xfile;
-	      dolibarr_syslog($file.$xfile." ajout�");
+	      dol_syslog($file.$xfile." ajout�");
 	      $i++;
 	    }
 	  else
 	    {
-	      dolibarr_syslog($file.$xfile." ignor�");
+	      dol_syslog($file.$xfile." ignor�");
 	    }
 	}
       
@@ -68,7 +68,7 @@ if (is_dir($file))
     }
   else
     {
-      dolibarr_syslog("Impossible de libre $file");
+      dol_syslog("Impossible de libre $file");
       exit ;
     }
 }
@@ -78,7 +78,7 @@ elseif (is_file($file))
 }
 else
 {
-  dolibarr_syslog("Impossible de libre $file");
+  dol_syslog("Impossible de libre $file");
   exit ;
 }
 
diff --git a/htdocs/telephonie/script/plan-facturation.php b/htdocs/telephonie/script/plan-facturation.php
index aaf37d13a1a..8a53ba550f9 100644
--- a/htdocs/telephonie/script/plan-facturation.php
+++ b/htdocs/telephonie/script/plan-facturation.php
@@ -179,7 +179,7 @@ if ($resql)
     }
 
   $workbook->close();
-  dolibarr_syslog("Close $fname");
+  dol_syslog("Close $fname");
   
 }
 
diff --git a/htdocs/telephonie/script/rapport.php b/htdocs/telephonie/script/rapport.php
index f2729faeef4..a77e87b1713 100644
--- a/htdocs/telephonie/script/rapport.php
+++ b/htdocs/telephonie/script/rapport.php
@@ -1005,7 +1005,7 @@ foreach ($groupes as $keygroupe => $groupe)
     }
 
   $workbook->close();
-  dolibarr_syslog("Close $fname");
+  dol_syslog("Close $fname");
 
 }
 
diff --git a/htdocs/telephonie/script/retour-check.php b/htdocs/telephonie/script/retour-check.php
index 0cc8072cd3a..64049347220 100644
--- a/htdocs/telephonie/script/retour-check.php
+++ b/htdocs/telephonie/script/retour-check.php
@@ -44,14 +44,14 @@ if (! file_exists($dirback))
   umask(0);
   if (! @mkdir($dirback, 0755))
     {
-      dolibarr_syslog("Erreur: creation '$dir'");
+      dol_syslog("Erreur: creation '$dir'");
     }
 }
 
 
 $handle=opendir($dir);
 
-if ($verbose) dolibarr_syslog("Lecture repertoire $dir");
+if ($verbose) dol_syslog("Lecture repertoire $dir");
 
 while (($file = readdir($handle))!==false)
 {
@@ -59,14 +59,14 @@ while (($file = readdir($handle))!==false)
     {
       if (is_readable($dir.$file))
 	{	  
-	  if ($verbose) dolibarr_syslog("Lecture $file");	  
+	  if ($verbose) dol_syslog("Lecture $file");	  
 	  
 	  if (! file_exists($dirdone))
 	    {
 	      umask(0);
 	      if (! @mkdir($dirdone, 0755))
 		{
-		  dolibarr_syslog("Erreur: creation '$dirdone'");
+		  dol_syslog("Erreur: creation '$dirdone'");
 		}
 	    }
 	  
@@ -77,7 +77,7 @@ while (($file = readdir($handle))!==false)
 	}
       else
 	{
-	  dolibarr_syslog("Erreur Lecture $file permissions insuffisante");
+	  dol_syslog("Erreur Lecture $file permissions insuffisante");
 	}
     }
 }
diff --git a/htdocs/telephonie/script/retour-traitement.php b/htdocs/telephonie/script/retour-traitement.php
index 6307f1980e8..b1b3fef34dc 100644
--- a/htdocs/telephonie/script/retour-traitement.php
+++ b/htdocs/telephonie/script/retour-traitement.php
@@ -30,7 +30,7 @@ require_once (DOL_DOCUMENT_ROOT."/telephonie/communication.class.php");
 require_once (DOL_DOCUMENT_ROOT."/societe.class.php");
 require_once (DOL_DOCUMENT_ROOT."/telephonie/dolibarrmail.class.php");
 
-if ($verbose) dolibarr_syslog("retour-traitement");
+if ($verbose) dol_syslog("retour-traitement");
 
 $user = new User($db, 1);
 
@@ -57,7 +57,7 @@ if ($db->query($sql))
 
 $n = sizeof($row);
 
-if ($verbose) dolibarr_syslog($n . " lignes � traiter");
+if ($verbose) dol_syslog($n . " lignes � traiter");
 
 for ($i = 0 ; $i < $n ; $i++)
 { 
@@ -107,7 +107,7 @@ for ($i = 0 ; $i < $n ; $i++)
 		      
 		      if (! $db->query($sql))
 			{
-			  dolibarr_syslog("Erreur de traitement de ligne $numero");
+			  dol_syslog("Erreur de traitement de ligne $numero");
 			  $error++;
 			}
 		    }
@@ -115,19 +115,19 @@ for ($i = 0 ; $i < $n ; $i++)
 		  if ($error == 0)
 		    {
 		      $db->query("COMMIT");
-		      dolibarr_syslog("COMMIT");
+		      dol_syslog("COMMIT");
 		    }
 		  else
 		    {
 		      $db->query("ROLLBACK");
-		      dolibarr_syslog("ROLLBACK");
+		      dol_syslog("ROLLBACK");
 		    }
 		  
 		}
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Ligne $numero d�j� active");
+	      dol_syslog("Ligne $numero d�j� active");
 	    }
 	}
       /*
@@ -163,7 +163,7 @@ for ($i = 0 ; $i < $n ; $i++)
 		      
 		      if (! $db->query($sql))
 			{
-			  dolibarr_syslog("Erreur de traitement de ligne $numero");
+			  dol_syslog("Erreur de traitement de ligne $numero");
 			  $error++;
 			}
 		    }
@@ -171,18 +171,18 @@ for ($i = 0 ; $i < $n ; $i++)
 		  if ($error == 0)
 		    {
 		      $db->query("COMMIT");
-		      dolibarr_syslog("COMMIT");
+		      dol_syslog("COMMIT");
 		    }
 		  else
 		    {
 		      $db->query("ROLLBACK");
-		      dolibarr_syslog("ROLLBACK");
+		      dol_syslog("ROLLBACK");
 		    }		  
 		}
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Ligne $numero d�j� active");
+	      dol_syslog("Ligne $numero d�j� active");
 	    }
 	}
       
@@ -210,7 +210,7 @@ for ($i = 0 ; $i < $n ; $i++)
 		  
 		  if (! $db->query($sql))
 		    {
-		      dolibarr_syslog("Erreur de traitement de ligne $numero");
+		      dol_syslog("Erreur de traitement de ligne $numero");
 		      $error++;
 		    }
 		}
@@ -218,12 +218,12 @@ for ($i = 0 ; $i < $n ; $i++)
 	      if ($error == 0)
 		{
 		  $db->query("COMMIT");
-		  dolibarr_syslog("COMMIT");
+		  dol_syslog("COMMIT");
 		}
 	      else
 		{
 		  $db->query("ROLLBACK");
-		  dolibarr_syslog("ROLLBACK");
+		  dol_syslog("ROLLBACK");
 		}
 	      
 	    }
diff --git a/htdocs/telephonie/script/retour.php b/htdocs/telephonie/script/retour.php
index 9930594d444..6933f79dee9 100644
--- a/htdocs/telephonie/script/retour.php
+++ b/htdocs/telephonie/script/retour.php
@@ -30,57 +30,57 @@ $dirback = DOL_DATA_ROOT."/telephonie/ligne/commande/retour/backup/";
 
 if (! file_exists($dirback))
 {
-  umask(0);
-  if (! @mkdir($dirback, 0755))
-    {
-      dolibarr_syslog("Erreur: creation '$dir'");
-    }
+	umask(0);
+	if (! @mkdir($dirback, 0755))
+	{
+		dol_syslog("Erreur: creation '$dir'", LOG_ERR);
+	}
 }
 
 
 $handle=opendir($dir);
 
-if ($verbose) dolibarr_syslog("Lecture repertoire $dir");
+if ($verbose) dol_syslog("Lecture repertoire $dir");
 
 while (($file = readdir($handle))!==false)
 {
-  if (is_file($dir.$file))
-    {
-
-      if (is_readable($dir.$file))
+	if (is_file($dir.$file))
 	{
-	  
-	  if ($verbose) dolibarr_syslog("Lecture $file");	  
-	  
-	  if (! file_exists($dirdone))
-	    {
-	      umask(0);
-	      if (! @mkdir($dirdone, 0755))
+
+		if (is_readable($dir.$file))
 		{
-		  dolibarr_syslog("Erreur: creation '$dirdone'");
-		}
-	    }
-	  
-	  /* 
+
+	  if ($verbose) dol_syslog("Lecture $file");
+
+	  if (! file_exists($dirdone))
+	  {
+	  	umask(0);
+	  	if (! @mkdir($dirdone, 0755))
+	  	{
+	  		dol_syslog("Erreur: creation '$dirdone'", LOG_ERR);
+	  	}
+	  }
+
+	  /*
 	   * On verifie que le fichier n'a pas d�j� �t� trait�
 	   */
 	  if (! file_exists($dirdone.$file))
-	    {
-	      if ( import_file($db, $dir, $file) == 0)
+	  {
+	  	if ( import_file($db, $dir, $file) == 0)
+	  	{
+	  		rename($dir.$file, $dirdone.$file);
+	  	}
+	  }
+	  else
+	  {
+	  	dol_syslog("Le fichier $file a d�j� �t� trait�");
+	  }
+		}
+		else
 		{
-		  rename($dir.$file, $dirdone.$file);
+	  dol_syslog("Erreur Lecture $file permissions insuffisante");
 		}
-	    }
-	  else
-	    {
-	      dolibarr_syslog("Le fichier $file a d�j� �t� trait�");
-	    }	  
 	}
-      else
-	{
-	  dolibarr_syslog("Erreur Lecture $file permissions insuffisante");
-	}
-    }
 }
 
 closedir($handle);
@@ -93,63 +93,63 @@ closedir($handle);
 
 Function import_file($db,$dir,$file)
 {
-  $error = 0;
-  $line = 0;
-  $hf = fopen ($dir.$file, "r");
-
-  if ($db->query("BEGIN"))
-    {
+	$error = 0;
+	$line = 0;
+	$hf = fopen ($dir.$file, "r");
 
-      while (!feof($hf))
+	if ($db->query("BEGIN"))
 	{
+
+		while (!feof($hf))
+		{
 	  $cont = fgets($hf, 1024);
-	  
+
 	  $tabline = explode(";", $cont);
-	  
+
 	  if (substr($tabline, 0, 3) <> 'CLI')
-	    {
-	      if (sizeof($tabline) == 8)
-		{
-		  $numero            = $tabline[0];
-		  $mode              = $tabline[1];
-		  $situation         = $tabline[2];
-		  $date_mise_service = $tabline[3];
-		  $date_resiliation  = $tabline[4];
-		  $motif_resiliation = $tabline[5];
-		  $commentaire       = $tabline[6];
-		  $fichier = $file;
-		  
-		  $sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_commande_retour ";
-		  
-		  $sql .= " (cli,mode,situation,date_mise_service,date_resiliation,motif_resiliation,commentaire,fichier,fk_fournisseur) ";
-		  $sql .= " VALUES (";
-		  $sql .= "'$numero','$mode','$situation','$date_mise_service','$date_resiliation','$motif_resiliation','$commentaire','$fichier',1)";
-		  
-		  if (! $db->query($sql))
-		    {
-		      dolibarr_syslog("Erreur de traitement de ligne");
-		      dolibarr_syslog($db->error());
-		      $error++;
-		    }
-		}      
-	    }
+	  {
+	  	if (sizeof($tabline) == 8)
+	  	{
+	  		$numero            = $tabline[0];
+	  		$mode              = $tabline[1];
+	  		$situation         = $tabline[2];
+	  		$date_mise_service = $tabline[3];
+	  		$date_resiliation  = $tabline[4];
+	  		$motif_resiliation = $tabline[5];
+	  		$commentaire       = $tabline[6];
+	  		$fichier = $file;
+
+	  		$sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_commande_retour ";
+
+	  		$sql .= " (cli,mode,situation,date_mise_service,date_resiliation,motif_resiliation,commentaire,fichier,fk_fournisseur) ";
+	  		$sql .= " VALUES (";
+	  		$sql .= "'$numero','$mode','$situation','$date_mise_service','$date_resiliation','$motif_resiliation','$commentaire','$fichier',1)";
+
+	  		if (! $db->query($sql))
+	  		{
+	  			dol_syslog("Erreur de traitement de ligne");
+	  			dol_syslog($db->error());
+	  			$error++;
+	  		}
+	  	}
+	  }
 	  $line++;
-	}
+		}
 
-      if ($error == 0)
-	{	  
+		if ($error == 0)
+		{
 	  $db->query("COMMIT");
-	  dolibarr_syslog("COMMIT");
-	}
-      else
-	{
+	  dol_syslog("COMMIT");
+		}
+		else
+		{
 	  $db->query("ROLLBACK");
-	  dolibarr_syslog("ROLLBACK");
+	  dol_syslog("ROLLBACK");
+		}
+
 	}
-      
-    }
 
-  fclose($hf);
+	fclose($hf);
 
-  return $error;
+	return $error;
 }
diff --git a/htdocs/telephonie/script/tools/update-contrat-contact.php b/htdocs/telephonie/script/tools/update-contrat-contact.php
index 9e224ae2cf1..4400957eccc 100644
--- a/htdocs/telephonie/script/tools/update-contrat-contact.php
+++ b/htdocs/telephonie/script/tools/update-contrat-contact.php
@@ -48,7 +48,7 @@ else
   print "Errir";
 }
 
-dolibarr_syslog("Update contrats ".sizeof($contrats));
+dol_syslog("Update contrats ".sizeof($contrats));
 
 for ($i = 0 ; $i < sizeof($contrats) ; $i++)
 {  
@@ -83,11 +83,11 @@ for ($i = 0 ; $i < sizeof($contrats) ; $i++)
       
       if (!$db->query($sql))
 	{
-	  dolibarr_syslog("Erreur ");
+	  dol_syslog("Erreur ");
 	}
       else
 	{
-	  dolibarr_syslog("Update contrat ".$contrats[$i]);
+	  dol_syslog("Update contrat ".$contrats[$i]);
 	}
     }
   else
diff --git a/htdocs/telephonie/script/update-contrat-statut.php b/htdocs/telephonie/script/update-contrat-statut.php
index 1a6199d3745..6f5f68180ce 100644
--- a/htdocs/telephonie/script/update-contrat-statut.php
+++ b/htdocs/telephonie/script/update-contrat-statut.php
@@ -49,7 +49,7 @@ else
   die ("Error $sql");
 }
 
-dolibarr_syslog("Update contrats ".sizeof($contrats));
+dol_syslog("Update contrats ".sizeof($contrats));
 
 for ($i = 0 ; $i < sizeof($contrats) ; $i++)
 {  
diff --git a/htdocs/telephonie/script/update_presel.php b/htdocs/telephonie/script/update_presel.php
index bdbcdce3cd4..93b1f515e3f 100644
--- a/htdocs/telephonie/script/update_presel.php
+++ b/htdocs/telephonie/script/update_presel.php
@@ -90,7 +90,7 @@ if ($resql)
 function UpdatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
 {  
   global $verbose;
-  dolibarr_syslog("UpdatePreselection($host, $user_login, ****, $ligne, $id_person)");
+  dol_syslog("UpdatePreselection($host, $user_login, ****, $ligne, $id_person)");
 
   $url = "/AzurApp_websvc_b3gdb/account.asmx/UpdatePreselection?";
 
@@ -101,20 +101,20 @@ function UpdatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
   $url .= "&okPreselection=true";
 
   if ($verbose > 2)
-    dolibarr_syslog("$host");
+    dol_syslog("$host");
 
   if ($verbose > 2)
-    dolibarr_syslog("$url");
+    dol_syslog("$url");
 
   $fp = fsockopen($host, 80, $errno, $errstr, 30);
   if (!$fp)
     {
-      dolibarr_syslog("$errstr ($errno)");
+      dol_syslog("$errstr ($errno)");
     }
   else
     {
       if ($verbose > 2)
-	dolibarr_syslog("Socket Opened send data");
+	dol_syslog("Socket Opened send data");
 
       $out = "GET $url HTTP/1.1\r\n";
       $out .= "Host: $host\r\n";
@@ -123,7 +123,7 @@ function UpdatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
       fwrite($fp, $out);
       
       if ($verbose > 2)
-	dolibarr_syslog("Data sent, waiting for response");
+	dol_syslog("Data sent, waiting for response");
 
       $parse = 0;
       $result = "error";
@@ -135,14 +135,14 @@ function UpdatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
 	  $line = fgets($fp, 1024);
 	  
 	  if ($verbose > 2)
-	    dolibarr_syslog($line);
+	    dol_syslog($line);
 
 	  if ($parse == 1)
 	    {
 	      preg_match('/^<string xmlns=".*">(.*)<\/string>$/', $line, $results);
 	      
 	      $result = $results[1];
-	      dolibarr_syslog($line);
+	      dol_syslog($line);
 	      $parse = 0;
 	    }
 	  
@@ -158,16 +158,16 @@ function UpdatePreselection($host, $user_login, $user_passwd, $lint, $id_person)
     }
   
   if ($verbose > 1)
-    dolibarr_syslog("result = ".$result);
+    dol_syslog("result = ".$result);
 
   if (substr($result,0,2) == "OK")
     {
-      dolibarr_syslog("Presel OK  ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
+      dol_syslog("Presel OK  ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
       return 0;
     }
   else
     {
-      dolibarr_syslog("Presel ERR ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
+      dol_syslog("Presel ERR ".$lint->numero." ".$lint->support." id client ".$id_person." $result\n");
 
       $fp = fopen("/tmp/".$lint->numero.".presel","w");
       if ($fp)
diff --git a/htdocs/telephonie/script/verif-import-cdr.php b/htdocs/telephonie/script/verif-import-cdr.php
index b38e225bf12..8c804c4e8f4 100644
--- a/htdocs/telephonie/script/verif-import-cdr.php
+++ b/htdocs/telephonie/script/verif-import-cdr.php
@@ -57,7 +57,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_syslog("Erreur recherche fournisseur");
+  dol_syslog("Erreur recherche fournisseur");
   exit ;
 }
 
diff --git a/htdocs/telephonie/service/contrats.php b/htdocs/telephonie/service/contrats.php
index 9940ece79a5..bb8342553cf 100644
--- a/htdocs/telephonie/service/contrats.php
+++ b/htdocs/telephonie/service/contrats.php
@@ -83,7 +83,7 @@ if ($_GET["id"])
       $hselected = $h;
       $h++;
       
-      dolibarr_fiche_head($head, $hselected, 'Service : '.$service->id);
+      dol_fiche_head($head, $hselected, 'Service : '.$service->id);
       
       
       $sql = "SELECT s.rowid as socid, s.nom as nom_facture";
diff --git a/htdocs/telephonie/service/fiche.php b/htdocs/telephonie/service/fiche.php
index ae4fe6c8cf3..175adbb9198 100644
--- a/htdocs/telephonie/service/fiche.php
+++ b/htdocs/telephonie/service/fiche.php
@@ -147,7 +147,7 @@ else
 	      $head[$h][1] = "Contrats";
 	      $h++;
 
-	      dolibarr_fiche_head($head, $hselected, 'Service : '.$service->id);
+	      dol_fiche_head($head, $hselected, 'Service : '.$service->id);
 
 	      print_fiche_titre('Fiche Service', $mesg);
       
@@ -179,7 +179,7 @@ else
 	      $hselected = $h;
 	      $h++;
 
-	      dolibarr_fiche_head($head, $hselected, 'Service : '.$service->numero);
+	      dol_fiche_head($head, $hselected, 'Service : '.$service->numero);
 
 	      print_fiche_titre('Edition du service', $mesg);
 	      
diff --git a/htdocs/telephonie/service/modules/ServiceFactureTableur.class.php b/htdocs/telephonie/service/modules/ServiceFactureTableur.class.php
index 7e53e8afff5..e4195fd8170 100644
--- a/htdocs/telephonie/service/modules/ServiceFactureTableur.class.php
+++ b/htdocs/telephonie/service/modules/ServiceFactureTableur.class.php
@@ -35,7 +35,7 @@ class ServiceFactureTableur
 
   Function Process($contrat)
     {
-      dolibarr_syslog("ServiceFactureTableur::Process Contrat ".$contrat->id);
+      dol_syslog("ServiceFactureTableur::Process Contrat ".$contrat->id);
 
       $facids = array();
 
@@ -56,7 +56,7 @@ class ServiceFactureTableur
 	  $j = 0;
 	  $num2 = $contrat->db->num_rows($resql2);
 	  
-	  dolibarr_syslog("ServiceFactureTableur::Process Nb factures ".$num2);
+	  dol_syslog("ServiceFactureTableur::Process Nb factures ".$num2);
 	  
 	  while ($j < $num2)
 	    {
@@ -176,14 +176,14 @@ class ServiceFactureTableur
 		}
 	      else
 		{
-		  dolibarr_syslog($contrat->db->error());
+		  dol_syslog($contrat->db->error());
 		}
 	    }
 	  
 	  $workbook->close();
-	  dolibarr_syslog("Close $fname");
+	  dol_syslog("Close $fname");
 	  	  	  
-	  dolibarr_syslog("Conso m�moire ".memory_get_usage() );
+	  dol_syslog("Conso m�moire ".memory_get_usage() );
 	}           
     }
 }
diff --git a/htdocs/telephonie/service/vendus.php b/htdocs/telephonie/service/vendus.php
index 100111d4854..091471bec98 100644
--- a/htdocs/telephonie/service/vendus.php
+++ b/htdocs/telephonie/service/vendus.php
@@ -156,7 +156,7 @@ if ($result)
       print img_file();      
       print '</a>&nbsp;';
 
-      print '<a href="fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+      print '<a href="fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 
       print '<td><a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$obj->socid.'">'.stripslashes($obj->nom).'</a></td>';
       print '<td><a href="'.DOL_URL_ROOT.'/soc.php?socid='.$obj->sfidp.'">'.stripslashes($obj->nom_facture).'</a></td>';
diff --git a/htdocs/telephonie/stats/ProcessGraphContrats.class.php b/htdocs/telephonie/stats/ProcessGraphContrats.class.php
index 888930d51d1..2b45db485ce 100644
--- a/htdocs/telephonie/stats/ProcessGraphContrats.class.php
+++ b/htdocs/telephonie/stats/ProcessGraphContrats.class.php
@@ -207,7 +207,7 @@ class ProcessGraphContrats
       }
     else 
       {
-	dolibarr_syslog("Error");
+	dol_syslog("Error");
       }
   }
 
diff --git a/htdocs/telephonie/stats/ProcessGraphLignes.class.php b/htdocs/telephonie/stats/ProcessGraphLignes.class.php
index 222f53a2e77..e36fc979376 100644
--- a/htdocs/telephonie/stats/ProcessGraphLignes.class.php
+++ b/htdocs/telephonie/stats/ProcessGraphLignes.class.php
@@ -103,7 +103,7 @@ class ProcessGraphLignes
   
   function go($ligne)
   {
-    dolibarr_syslog("go $ligne");
+    dol_syslog("go $ligne");
     $this->ligne = $ligne;
 
     /* Lecture des donnees */
@@ -211,7 +211,7 @@ class ProcessGraphLignes
       }
     else 
       {
-	dolibarr_syslog("Error");
+	dol_syslog("Error");
       }
   }
 }
diff --git a/htdocs/telephonie/stats/clients/alerte.php b/htdocs/telephonie/stats/clients/alerte.php
index f3764e7f760..d5083349066 100644
--- a/htdocs/telephonie/stats/clients/alerte.php
+++ b/htdocs/telephonie/stats/clients/alerte.php
@@ -43,7 +43,7 @@ $head[$h][1] = "Alerte";
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Clients");
+dol_fiche_head($head, $hselected, "Clients");
 
 if ($_GET["marge"] > 0)
 {
diff --git a/htdocs/telephonie/stats/clients/gain.php b/htdocs/telephonie/stats/clients/gain.php
index b63d9304ccf..550644faeb4 100644
--- a/htdocs/telephonie/stats/clients/gain.php
+++ b/htdocs/telephonie/stats/clients/gain.php
@@ -39,7 +39,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/clients/alerte.php';
 $head[$h][1] = "Alerte";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Clients");
+dol_fiche_head($head, $hselected, "Clients");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/clients/index.php b/htdocs/telephonie/stats/clients/index.php
index d9039e94eaf..0af6ea0b961 100644
--- a/htdocs/telephonie/stats/clients/index.php
+++ b/htdocs/telephonie/stats/clients/index.php
@@ -42,7 +42,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/clients/alerte.php';
 $head[$h][1] = "Alerte";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Clients");
+dol_fiche_head($head, $hselected, "Clients");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/commerciaux/ca.php b/htdocs/telephonie/stats/commerciaux/ca.php
index 81a3dbb5b7e..fe532f77c0d 100644
--- a/htdocs/telephonie/stats/commerciaux/ca.php
+++ b/htdocs/telephonie/stats/commerciaux/ca.php
@@ -50,7 +50,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/contrats.php';
 $head[$h][1] = "Contrats";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Commerciaux");
+dol_fiche_head($head, $hselected, "Commerciaux");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 print '<tr><td width="30%" valign="top">';
diff --git a/htdocs/telephonie/stats/commerciaux/commercial.php b/htdocs/telephonie/stats/commerciaux/commercial.php
index 5c944e94bdf..07387cd6e9b 100644
--- a/htdocs/telephonie/stats/commerciaux/commercial.php
+++ b/htdocs/telephonie/stats/commerciaux/commercial.php
@@ -60,7 +60,7 @@ if ($_GET["commid"])
   $head[$h][1] = "Prises d'ordres";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Commerciaux");
+  dol_fiche_head($head, $hselected, "Commerciaux");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/commerciaux/commercialca.php b/htdocs/telephonie/stats/commerciaux/commercialca.php
index cf8db766fba..d3331f7f725 100644
--- a/htdocs/telephonie/stats/commerciaux/commercialca.php
+++ b/htdocs/telephonie/stats/commerciaux/commercialca.php
@@ -61,7 +61,7 @@ if ($_GET["commid"])
   $head[$h][1] = "Lignes";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Commerciaux");
+  dol_fiche_head($head, $hselected, "Commerciaux");
   stat_year_bar($year);
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
diff --git a/htdocs/telephonie/stats/commerciaux/commercialpo.php b/htdocs/telephonie/stats/commerciaux/commercialpo.php
index ac064911f26..ef3de89700d 100644
--- a/htdocs/telephonie/stats/commerciaux/commercialpo.php
+++ b/htdocs/telephonie/stats/commerciaux/commercialpo.php
@@ -67,7 +67,7 @@ if ($_GET["commid"])
   $hselected = $h;
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Commerciaux");
+  dol_fiche_head($head, $hselected, "Commerciaux");
   
   if ($page == -1) { $page = 0 ; }
 
diff --git a/htdocs/telephonie/stats/commerciaux/contrats.php b/htdocs/telephonie/stats/commerciaux/contrats.php
index 07a9b6c05a6..ef4701b3720 100644
--- a/htdocs/telephonie/stats/commerciaux/contrats.php
+++ b/htdocs/telephonie/stats/commerciaux/contrats.php
@@ -46,7 +46,7 @@ $head[$h][1] = "Contrats";
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Commerciaux");
+dol_fiche_head($head, $hselected, "Commerciaux");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/commerciaux/groupes/groupe.php b/htdocs/telephonie/stats/commerciaux/groupes/groupe.php
index 8b4283e457c..5e4708a8149 100644
--- a/htdocs/telephonie/stats/commerciaux/groupes/groupe.php
+++ b/htdocs/telephonie/stats/commerciaux/groupes/groupe.php
@@ -46,7 +46,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/contrats.php';
 $head[$h][1] = "Contrats";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Commerciaux");
+dol_fiche_head($head, $hselected, "Commerciaux");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/commerciaux/index.php b/htdocs/telephonie/stats/commerciaux/index.php
index 4f425b6e1f9..5640781dbed 100644
--- a/htdocs/telephonie/stats/commerciaux/index.php
+++ b/htdocs/telephonie/stats/commerciaux/index.php
@@ -51,7 +51,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/contrats.php';
 $head[$h][1] = "Contrats";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Commerciaux");
+dol_fiche_head($head, $hselected, "Commerciaux");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 print '<tr><td width="30%" valign="top">';
diff --git a/htdocs/telephonie/stats/commerciaux/lignes.php b/htdocs/telephonie/stats/commerciaux/lignes.php
index 02bee50add1..e8c76c22c79 100644
--- a/htdocs/telephonie/stats/commerciaux/lignes.php
+++ b/htdocs/telephonie/stats/commerciaux/lignes.php
@@ -56,7 +56,7 @@ if ($_GET["commid"])
   $hselected = $h;
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Commerciaux");
+  dol_fiche_head($head, $hselected, "Commerciaux");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/commerciaux/mensuel.php b/htdocs/telephonie/stats/commerciaux/mensuel.php
index a3ce9ce2bb8..a33b7ef7e3f 100644
--- a/htdocs/telephonie/stats/commerciaux/mensuel.php
+++ b/htdocs/telephonie/stats/commerciaux/mensuel.php
@@ -43,7 +43,7 @@ $head[$h][1] = "Mensuel";
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Commerciaux");
+dol_fiche_head($head, $hselected, "Commerciaux");
 
 if (strlen($_GET["month"]) == 0)
 {
diff --git a/htdocs/telephonie/stats/communications/analyse.php b/htdocs/telephonie/stats/communications/analyse.php
index 1d7e579281b..53d0c95d576 100644
--- a/htdocs/telephonie/stats/communications/analyse.php
+++ b/htdocs/telephonie/stats/communications/analyse.php
@@ -62,7 +62,7 @@ $hselected = $h;
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Communications");
+dol_fiche_head($head, $hselected, "Communications");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'."\n";
 
diff --git a/htdocs/telephonie/stats/communications/destmonth.php b/htdocs/telephonie/stats/communications/destmonth.php
index a34e01f4337..a60b4d7af0f 100644
--- a/htdocs/telephonie/stats/communications/destmonth.php
+++ b/htdocs/telephonie/stats/communications/destmonth.php
@@ -60,7 +60,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/analyse.php';
 $head[$h][1] = "Analyse";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Communications");
+dol_fiche_head($head, $hselected, "Communications");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/communications/index.php b/htdocs/telephonie/stats/communications/index.php
index 8176eef43f4..6e1d21e19c5 100644
--- a/htdocs/telephonie/stats/communications/index.php
+++ b/htdocs/telephonie/stats/communications/index.php
@@ -54,7 +54,7 @@ $head[$h][1] = "Analyse";
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Communications");
+dol_fiche_head($head, $hselected, "Communications");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'."\n";
 
diff --git a/htdocs/telephonie/stats/communications/lastmonth.php b/htdocs/telephonie/stats/communications/lastmonth.php
index 5be894b5537..419739fbc35 100644
--- a/htdocs/telephonie/stats/communications/lastmonth.php
+++ b/htdocs/telephonie/stats/communications/lastmonth.php
@@ -58,7 +58,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/analyse.php';
 $head[$h][1] = "Analyse";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Communications");
+dol_fiche_head($head, $hselected, "Communications");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/communications/rentabilite.php b/htdocs/telephonie/stats/communications/rentabilite.php
index a47329ec99c..f7153b774b6 100644
--- a/htdocs/telephonie/stats/communications/rentabilite.php
+++ b/htdocs/telephonie/stats/communications/rentabilite.php
@@ -60,7 +60,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/communications/analyse.php';
 $head[$h][1] = "Analyse";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Communications");
+dol_fiche_head($head, $hselected, "Communications");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/consultation/index.php b/htdocs/telephonie/stats/consultation/index.php
index e22a290a5fc..c96b79760c3 100644
--- a/htdocs/telephonie/stats/consultation/index.php
+++ b/htdocs/telephonie/stats/consultation/index.php
@@ -32,7 +32,7 @@ llxHeader('','Telephonie - Statistiques - Consultations');
  */
 
 include "./onglets.php";
-dolibarr_fiche_head($head, $hselected, "Consultations");
+dol_fiche_head($head, $hselected, "Consultations");
 
 print '<br /><table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/contrats/index.php b/htdocs/telephonie/stats/contrats/index.php
index 31e25802500..57288ab2111 100644
--- a/htdocs/telephonie/stats/contrats/index.php
+++ b/htdocs/telephonie/stats/contrats/index.php
@@ -32,7 +32,7 @@ llxHeader('','Telephonie - Statistiques - Contrats');
  */
 
 include "./onglets.php";
-dolibarr_fiche_head($head, $hselected, "Contrats");
+dol_fiche_head($head, $hselected, "Contrats");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/destinations/index.php b/htdocs/telephonie/stats/destinations/index.php
index be5c94e192a..2db47ba4c29 100644
--- a/htdocs/telephonie/stats/destinations/index.php
+++ b/htdocs/telephonie/stats/destinations/index.php
@@ -45,7 +45,7 @@ $head[$h][1] = "Destinations";
 $hselected = $h;
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Destinations");
+dol_fiche_head($head, $hselected, "Destinations");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/distributeurs/commercial.php b/htdocs/telephonie/stats/distributeurs/commercial.php
index 4175d2aaa76..789f61bffdf 100644
--- a/htdocs/telephonie/stats/distributeurs/commercial.php
+++ b/htdocs/telephonie/stats/distributeurs/commercial.php
@@ -51,7 +51,7 @@ if ($_GET["id"])
   $head[$h][1] = "CA";
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeurs");
+  dol_fiche_head($head, $hselected, "Distributeurs");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/distributeurs/commercialca.php b/htdocs/telephonie/stats/distributeurs/commercialca.php
index 6d1f7453123..23aebf4ef75 100644
--- a/htdocs/telephonie/stats/distributeurs/commercialca.php
+++ b/htdocs/telephonie/stats/distributeurs/commercialca.php
@@ -59,7 +59,7 @@ if ($_GET["id"])
   $hselected = $h;
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeurs");
+  dol_fiche_head($head, $hselected, "Distributeurs");
   stat_year_bar($year);
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
diff --git a/htdocs/telephonie/stats/distributeurs/distributeur.php b/htdocs/telephonie/stats/distributeurs/distributeur.php
index 2fb9ad03a9e..12c088999ad 100644
--- a/htdocs/telephonie/stats/distributeurs/distributeur.php
+++ b/htdocs/telephonie/stats/distributeurs/distributeur.php
@@ -49,7 +49,7 @@ if ($_GET["id"])
   $hselected = $h;
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeur");
+  dol_fiche_head($head, $hselected, "Distributeur");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/distributeurs/distributeur.po.month.class.php b/htdocs/telephonie/stats/distributeurs/distributeur.po.month.class.php
index 758ceeb3539..8be1d2d3112 100644
--- a/htdocs/telephonie/stats/distributeurs/distributeur.po.month.class.php
+++ b/htdocs/telephonie/stats/distributeurs/distributeur.po.month.class.php
@@ -71,7 +71,7 @@ class GraphDistributeurPoMensuel extends GraphBar {
       }
     else 
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
 
     if (sizeof($datas) > 0)
diff --git a/htdocs/telephonie/stats/distributeurs/index.php b/htdocs/telephonie/stats/distributeurs/index.php
index 5245e4e3a20..13e29220835 100644
--- a/htdocs/telephonie/stats/distributeurs/index.php
+++ b/htdocs/telephonie/stats/distributeurs/index.php
@@ -41,7 +41,7 @@ $h++;
 $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/distributeurs/resultats.php';
 $head[$h][1] = "R�sultats";
 $h++;
-dolibarr_fiche_head($head, $hselected, "Distributeurs");
+dol_fiche_head($head, $hselected, "Distributeurs");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/distributeurs/lignes.php b/htdocs/telephonie/stats/distributeurs/lignes.php
index a42c1590190..e0eddeba0bf 100644
--- a/htdocs/telephonie/stats/distributeurs/lignes.php
+++ b/htdocs/telephonie/stats/distributeurs/lignes.php
@@ -56,7 +56,7 @@ if ($_GET["commid"])
   $hselected = $h;
   $h++;
 
-  dolibarr_fiche_head($head, $hselected, "Distributeurs");
+  dol_fiche_head($head, $hselected, "Distributeurs");
 
   print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/distributeurs/resultats.php b/htdocs/telephonie/stats/distributeurs/resultats.php
index 9dfe54b79ad..7d6d5e1dd5e 100644
--- a/htdocs/telephonie/stats/distributeurs/resultats.php
+++ b/htdocs/telephonie/stats/distributeurs/resultats.php
@@ -52,7 +52,7 @@ if ($_GET["year"] > 0)
 }
 $total = 0;
 $var = True;
-dolibarr_fiche_head($head, $hselected, "Distributeurs");
+dol_fiche_head($head, $hselected, "Distributeurs");
 stat_year_bar($year);
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
diff --git a/htdocs/telephonie/stats/factures/gain.php b/htdocs/telephonie/stats/factures/gain.php
index 1c3a578dc35..232b55ff1ab 100644
--- a/htdocs/telephonie/stats/factures/gain.php
+++ b/htdocs/telephonie/stats/factures/gain.php
@@ -52,7 +52,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/type.php';
 $head[$h][1] = "M�thode de paiement";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Satistiques Factures");
+dol_fiche_head($head, $hselected, "Satistiques Factures");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/factures/index.php b/htdocs/telephonie/stats/factures/index.php
index b0484b39fe5..4c90a97810f 100644
--- a/htdocs/telephonie/stats/factures/index.php
+++ b/htdocs/telephonie/stats/factures/index.php
@@ -60,7 +60,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/type.php';
 $head[$h][1] = "M�thode de paiement";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Satistiques Factures");
+dol_fiche_head($head, $hselected, "Satistiques Factures");
 stat_year_bar($year);
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
diff --git a/htdocs/telephonie/stats/factures/lastmonth.php b/htdocs/telephonie/stats/factures/lastmonth.php
index 8ad76a14898..fa31ad4b0e6 100644
--- a/htdocs/telephonie/stats/factures/lastmonth.php
+++ b/htdocs/telephonie/stats/factures/lastmonth.php
@@ -49,7 +49,7 @@ $hselected = $h;
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Satistiques Factures");
+dol_fiche_head($head, $hselected, "Satistiques Factures");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/factures/marge.php b/htdocs/telephonie/stats/factures/marge.php
index 3a45cd136af..c199ac3bec2 100644
--- a/htdocs/telephonie/stats/factures/marge.php
+++ b/htdocs/telephonie/stats/factures/marge.php
@@ -54,7 +54,7 @@ $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/type.php';
 $head[$h][1] = "M�thode de paiement";
 $h++;
 
-dolibarr_fiche_head($head, $hselected, "Satistiques Factures $year");
+dol_fiche_head($head, $hselected, "Satistiques Factures $year");
 print '<div class="onglet_inf">';
 print '<a class="onglet_inf" href="marge.php?year=2004">2004</a>';
 print '<a class="onglet_inf" href="marge.php?year=2005">2005</a>';
diff --git a/htdocs/telephonie/stats/factures/type.php b/htdocs/telephonie/stats/factures/type.php
index a02e1f6617c..cbdafb7f5c5 100644
--- a/htdocs/telephonie/stats/factures/type.php
+++ b/htdocs/telephonie/stats/factures/type.php
@@ -57,7 +57,7 @@ $h++;
 //$head[$h][1] = "3 derniers mois";
 //$h++;
 
-dolibarr_fiche_head($head, $hselected, "Satistiques Factures");
+dol_fiche_head($head, $hselected, "Satistiques Factures");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/fournisseurs/index.php b/htdocs/telephonie/stats/fournisseurs/index.php
index 0773633e6f1..9638dc100af 100644
--- a/htdocs/telephonie/stats/fournisseurs/index.php
+++ b/htdocs/telephonie/stats/fournisseurs/index.php
@@ -43,7 +43,7 @@ $hselected = $h;
 $h++;
 
 
-dolibarr_fiche_head($head, $hselected, "Fournisseurs");
+dol_fiche_head($head, $hselected, "Fournisseurs");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'."\n";
 
diff --git a/htdocs/telephonie/stats/graph/comm.nbmensuel.class.php b/htdocs/telephonie/stats/graph/comm.nbmensuel.class.php
index 820ca1d2ebd..e360383cfbc 100644
--- a/htdocs/telephonie/stats/graph/comm.nbmensuel.class.php
+++ b/htdocs/telephonie/stats/graph/comm.nbmensuel.class.php
@@ -111,7 +111,7 @@ class GraphCommNbMensuel extends GraphBar{
       }
     else 
       {
-	dolibarr_syslog("Error");
+	dol_syslog("Error");
       }
   }
 }  
diff --git a/htdocs/telephonie/stats/graph/comm.nbminutes.class.php b/htdocs/telephonie/stats/graph/comm.nbminutes.class.php
index 327e65fa7fb..ea7c807cfda 100644
--- a/htdocs/telephonie/stats/graph/comm.nbminutes.class.php
+++ b/htdocs/telephonie/stats/graph/comm.nbminutes.class.php
@@ -108,8 +108,8 @@ class GraphCommNbMinutes extends GraphBar{
       }
     else 
       {
-	dolibarr_syslog("Error in GraphCommNbMinutes");
-	dolibarr_syslog($sql);
+	dol_syslog("Error in GraphCommNbMinutes");
+	dol_syslog($sql);
       }
   }
 }  
diff --git a/htdocs/telephonie/stats/lignes/commande.php b/htdocs/telephonie/stats/lignes/commande.php
index 015a9ad609b..da93753b1ed 100644
--- a/htdocs/telephonie/stats/lignes/commande.php
+++ b/htdocs/telephonie/stats/lignes/commande.php
@@ -36,7 +36,7 @@ llxHeader('','Telephonie - Statistiques - Lignes');
  */
 
 include "./onglets.php";
-dolibarr_fiche_head($head, $hselected, "Lignes");
+dol_fiche_head($head, $hselected, "Lignes");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/lignes/commandes.week.class.php b/htdocs/telephonie/stats/lignes/commandes.week.class.php
index 159d25d1674..a59fca1752d 100644
--- a/htdocs/telephonie/stats/lignes/commandes.week.class.php
+++ b/htdocs/telephonie/stats/lignes/commandes.week.class.php
@@ -73,7 +73,7 @@ class GraphLignesCommandesWeek extends GraphBarAcc {
       }
     else 
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
 
     /* Lignes rejet�es */
@@ -108,7 +108,7 @@ class GraphLignesCommandesWeek extends GraphBarAcc {
       }
     else 
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
 
     /* == */
diff --git a/htdocs/telephonie/stats/lignes/index.php b/htdocs/telephonie/stats/lignes/index.php
index 42723d71661..752e4bcaec7 100644
--- a/htdocs/telephonie/stats/lignes/index.php
+++ b/htdocs/telephonie/stats/lignes/index.php
@@ -32,7 +32,7 @@ llxHeader('','Telephonie - Statistiques - Lignes');
  */
 
 include "./onglets.php";
-dolibarr_fiche_head($head, $hselected, "Lignes");
+dol_fiche_head($head, $hselected, "Lignes");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/stats/lignes/resiliation.php b/htdocs/telephonie/stats/lignes/resiliation.php
index 077227adffc..2ea3ac83a6e 100644
--- a/htdocs/telephonie/stats/lignes/resiliation.php
+++ b/htdocs/telephonie/stats/lignes/resiliation.php
@@ -36,7 +36,7 @@ llxHeader('','Telephonie - Statistiques - Lignes');
  */
 
 include "./onglets.php";
-dolibarr_fiche_head($head, $hselected, "Lignes");
+dol_fiche_head($head, $hselected, "Lignes");
 
 print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 
diff --git a/htdocs/telephonie/tarifs/config/grille.php b/htdocs/telephonie/tarifs/config/grille.php
index 934702dcf08..d846a24f826 100644
--- a/htdocs/telephonie/tarifs/config/grille.php
+++ b/htdocs/telephonie/tarifs/config/grille.php
@@ -45,7 +45,7 @@ $h++;
 
 require_once DOL_DOCUMENT_ROOT."/telephonie/telephonie.tarif.grille.class.php";
 
-dolibarr_fiche_head($head, $hselected, "Grille de tarif");
+dol_fiche_head($head, $hselected, "Grille de tarif");
 
 $grille = new TelephonieTarifGrille($db);
 $grille->fetch($_GET["id"]);
diff --git a/htdocs/telephonie/tarifs/fiche.php b/htdocs/telephonie/tarifs/fiche.php
index 536b30a8f45..2aa97b46a81 100644
--- a/htdocs/telephonie/tarifs/fiche.php
+++ b/htdocs/telephonie/tarifs/fiche.php
@@ -50,15 +50,15 @@ if ($_GET["id"])
   $hselected = $h;
   $h++;
   
-  dolibarr_fiche_head($head, $hselected, 'Tarif : '.$soc->nom);
+  dol_fiche_head($head, $hselected, 'Tarif : '.$soc->nom);
   
   print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
   print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>';
   
   print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$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>'; }
   print '</td></tr>';
@@ -72,7 +72,7 @@ if ($_GET["id"])
   
   print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
 	  
-	  //print '<tr><td width="20%">Num�ro</td><td>'.dolibarr_print_phone($ligne->numero).'</td>';
+	  //print '<tr><td width="20%">Num�ro</td><td>'.dol_print_phone($ligne->numero).'</td>';
 	  //print '<td>Factur�e : '.$ligne->facturable.'</td></tr>';
 	  
 	  /* Lignes */
@@ -112,7 +112,7 @@ if ($_GET["id"])
       
 		      print '</a>&nbsp;';
 
-		      print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dolibarr_print_phone($obj->ligne,0,0,true)."</a></td>\n";
+		      print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">'.dol_print_phone($obj->ligne,0,0,true)."</a></td>\n";
 
 		      print '<td align="center">'.$ligne->statuts[$obj->statut]."</td>\n";
 
diff --git a/htdocs/telephonie/tarifs/tarif-log.php b/htdocs/telephonie/tarifs/tarif-log.php
index bdfeeb985f9..ae30069bd47 100644
--- a/htdocs/telephonie/tarifs/tarif-log.php
+++ b/htdocs/telephonie/tarifs/tarif-log.php
@@ -41,7 +41,7 @@ $head[$h][1] = $langs->trans("Historique");
 $head[$h][2] = 'history';
 $h++;
 
-dolibarr_fiche_head($head, 'history', $langs->trans("Tarif"));
+dol_fiche_head($head, 'history', $langs->trans("Tarif"));
 
 /*
  *
@@ -101,7 +101,7 @@ if ($resql)
       print "<td>".$obj->tarif."</td>\n";
       print "<td>".sprintf("%01.4f",$obj->temporel)."</td>\n";
       print "<td>".sprintf("%01.4f",$obj->fixe)."</td>\n";
-      print "<td>".dolibarr_print_date($obj->date,'dayhour')."</td>\n";
+      print "<td>".dol_print_date($obj->date,'dayhour')."</td>\n";
       print "<td>".stripslashes($obj->firstname)." ".stripslashes($obj->name)."</td>\n";
       print "</tr>\n";
       $i++;
@@ -167,7 +167,7 @@ if ($resql)
       print "<td>".$obj->tarif."</td>\n";
       print "<td>".sprintf("%01.4f",$obj->temporel)."</td>\n";
       print "<td>".sprintf("%01.4f",$obj->fixe)."</td>\n";
-      print "<td>".dolibarr_print_date($obj->date,'dayhour')."</td>\n";
+      print "<td>".dol_print_date($obj->date,'dayhour')."</td>\n";
       print "<td>".stripslashes($obj->firstname)." ".stripslashes($obj->name)."</td>\n";
       print "</tr>\n";
       $i++;
diff --git a/htdocs/telephonie/tarifs/tarif.php b/htdocs/telephonie/tarifs/tarif.php
index 423d97f8636..717fe1839cf 100644
--- a/htdocs/telephonie/tarifs/tarif.php
+++ b/htdocs/telephonie/tarifs/tarif.php
@@ -41,7 +41,7 @@ $head[$h][1] = $langs->trans("Historique");
 $head[$h][2] = 'history';
 $h++;
 
-dolibarr_fiche_head($head, 'card', $langs->trans("Tarif"));
+dol_fiche_head($head, 'card', $langs->trans("Tarif"));
 
 /*
  *
diff --git a/htdocs/telephonie/telephonie-tarif.class.php b/htdocs/telephonie/telephonie-tarif.class.php
index 06de3b68332..5675bcec7dc 100644
--- a/htdocs/telephonie/telephonie-tarif.class.php
+++ b/htdocs/telephonie/telephonie-tarif.class.php
@@ -104,8 +104,8 @@ class TelephonieTarif {
       }
     else
       {
-	dolibarr_syslog("TelephonieTarif::_load_tarif Erreur 1");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("TelephonieTarif::_load_tarif Erreur 1");
+	dol_syslog($this->db->error());
       }
 
     /*
diff --git a/htdocs/telephonie/telephonie.commercial.class.php b/htdocs/telephonie/telephonie.commercial.class.php
index 570d5422e1a..e058294774e 100644
--- a/htdocs/telephonie/telephonie.commercial.class.php
+++ b/htdocs/telephonie/telephonie.commercial.class.php
@@ -84,7 +84,7 @@ class CommercialTelephonie {
 		}
 	      else
 		{
-		  dolibarr_syslog("DistributeurTelephonie::Create");
+		  dol_syslog("DistributeurTelephonie::Create");
 		  $this->error_string["prenom"] = "Erreur SQL : $sql";
 		  $this->error_string["nom"] = $this->db->error();
 		  $error++;
diff --git a/htdocs/telephonie/telephonie.contrat.class.php b/htdocs/telephonie/telephonie.contrat.class.php
index 88fe9e4621c..96df7a216f0 100644
--- a/htdocs/telephonie/telephonie.contrat.class.php
+++ b/htdocs/telephonie/telephonie.contrat.class.php
@@ -110,8 +110,8 @@ class TelephonieContrat {
     else
       {
 	$this->error_message = "Echec de la cr�ation du contrat";
-	dolibarr_syslog("TelephonieContrat::Create Error -1");
-	dolibarr_syslog($this->db->error());
+	dol_syslog("TelephonieContrat::Create Error -1");
+	dol_syslog($this->db->error());
 	return -1;
       }
   }
@@ -126,7 +126,7 @@ class TelephonieContrat {
     if (!$this->db->begin())
       {
 	$error++;
-	dolibarr_syslog("TelephonieContrat::Update Error -1");
+	dol_syslog("TelephonieContrat::Update Error -1");
       }
 
     if (!$error)
@@ -146,7 +146,7 @@ class TelephonieContrat {
 	if (! $this->db->query($sql) )
 	  {
 	    $error++;
-	    dolibarr_syslog("TelephonieContrat::Update Error -2");
+	    dol_syslog("TelephonieContrat::Update Error -2");
 	  }
       }
 
@@ -164,7 +164,7 @@ class TelephonieContrat {
 	if (! $this->db->query($sql) )
 	  {
 	    $error++;
-	    dolibarr_syslog("TelephonieContrat::Update Error -3");
+	    dol_syslog("TelephonieContrat::Update Error -3");
 	  }
       }
 
@@ -238,7 +238,7 @@ class TelephonieContrat {
 	  }
 	else
 	  {
-	    dolibarr_syslog("TelephonieContrat::Fecth Erreur -2");
+	    dol_syslog("TelephonieContrat::Fecth Erreur -2");
 	    $result = -2;
 	  }
 	
@@ -249,7 +249,7 @@ class TelephonieContrat {
 	/* Erreur select SQL */
 	print $this->db->error();
 	$result = -1;
-	dolibarr_syslog("TelephonieContrat::Fecth Erreur -1");
+	dol_syslog("TelephonieContrat::Fecth Erreur -1");
       }
     
     $sql = "SELECT libelle";
@@ -485,7 +485,7 @@ class TelephonieContrat {
       }
     else
       {
-	dolibarr_syslog($sql);
+	dol_syslog($sql);
       }
     return $po;
   }
@@ -555,7 +555,7 @@ class TelephonieContrat {
 	      }
 	    else
 	      {
-		dolibarr_syslog($sql);
+		dol_syslog($sql);
 	      }
 	  }
 	else
@@ -574,7 +574,7 @@ class TelephonieContrat {
 	      }
 	    else
 	      {
-		dolibarr_syslog($sql);
+		dol_syslog($sql);
 	      }	    	    
 	  }
       }
@@ -635,7 +635,7 @@ class TelephonieContrat {
       }
     else
       {
-	dolibarr_syslog("Telephonie::Contrat Error". $sql);
+	dol_syslog("Telephonie::Contrat Error". $sql);
       }
   }
   /*
diff --git a/htdocs/telephonie/telephonie.service.class.php b/htdocs/telephonie/telephonie.service.class.php
index cb75049e87f..90358ce2804 100644
--- a/htdocs/telephonie/telephonie.service.class.php
+++ b/htdocs/telephonie/telephonie.service.class.php
@@ -120,7 +120,7 @@ class TelephonieService {
       {
 	
 	$this->error_message = "Echec de la cr�ation du service !";
-	dolibarr_syslog("TelephonieService::Create Error -1");
+	dol_syslog("TelephonieService::Create Error -1");
 	return -1;
       }
   }
diff --git a/htdocs/telephonie/telephonie.tarif.class.php b/htdocs/telephonie/telephonie.tarif.class.php
index db9355abafc..c7affdb4b7c 100644
--- a/htdocs/telephonie/telephonie.tarif.class.php
+++ b/htdocs/telephonie/telephonie.tarif.class.php
@@ -84,7 +84,7 @@ class TelephonieTarif {
       }
     else
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
                   
     return $result;
@@ -181,8 +181,8 @@ class TelephonieTarif {
       }
     else
       {
-	dolibarr_syslog("TelephonieTarif::_load_tarif Erreur SQL 1 (type=$type)", LOG_ERR);
-	dolibarr_syslog($sql, LOG_DEBUG);
+	dol_syslog("TelephonieTarif::_load_tarif Erreur SQL 1 (type=$type)", LOG_ERR);
+	dol_syslog($sql, LOG_DEBUG);
       }
     /*
      * Tarif Sp�cifique
@@ -219,8 +219,8 @@ class TelephonieTarif {
 	  }
 	else
 	  {
-	    dolibarr_syslog("TelephonieTarif::_load_tarif Erreur 59");
-	    dolibarr_syslog($this->db->error());
+	    dol_syslog("TelephonieTarif::_load_tarif Erreur 59");
+	    dol_syslog($this->db->error());
 	  }
       }
     /*
diff --git a/htdocs/telephonie/telephonie.tarif.grille.class.php b/htdocs/telephonie/telephonie.tarif.grille.class.php
index b7cbb53ebb5..cb27b48dd86 100644
--- a/htdocs/telephonie/telephonie.tarif.grille.class.php
+++ b/htdocs/telephonie/telephonie.tarif.grille.class.php
@@ -114,7 +114,7 @@ class TelephonieTarifGrille {
 	  }
 	else
 	  {
-	    dolibarr_syslog($this->db->error());
+	    dol_syslog($this->db->error());
 	    $result = -1;
 	  }
 	
@@ -152,7 +152,7 @@ class TelephonieTarifGrille {
       }
     else
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
 
     if (sizeof($tarifs) > 0)    
@@ -185,8 +185,8 @@ class TelephonieTarifGrille {
 	  }
 	else
 	  {
-	    dolibarr_syslog($this->db->error());
-	    dolibarr_syslog($sql);
+	    dol_syslog($this->db->error());
+	    dol_syslog($sql);
 	    $result = -1;
 	  }
 
@@ -195,7 +195,7 @@ class TelephonieTarifGrille {
 	
 	if (! $this->db->query($sql) )
 	  {
-	    dolibarr_syslog($this->db->error());
+	    dol_syslog($this->db->error());
 	    $result = -1;
 	  }
 
@@ -204,7 +204,7 @@ class TelephonieTarifGrille {
 	
 	if (! $this->db->query($sql) )
 	  {
-	    dolibarr_syslog($this->db->error());
+	    dol_syslog($this->db->error());
 	    $result = -1;
 	  }
 
@@ -217,7 +217,7 @@ class TelephonieTarifGrille {
 	  }
 	else
 	  {
-	    dolibarr_syslog($this->db->error());
+	    dol_syslog($this->db->error());
 	    $result = -1;
 	  }
 
@@ -327,7 +327,7 @@ class TelephonieTarifGrille {
       }
       else
       {
-      dolibarr_syslog($this->db->error());
+      dol_syslog($this->db->error());
       }
             
       foreach($tarifs_linked as $tarif)
@@ -359,7 +359,7 @@ class TelephonieTarifGrille {
       }
     else
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
     
     $sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_tarif_montant_log";
@@ -376,7 +376,7 @@ class TelephonieTarifGrille {
       }
     else
       {
-	dolibarr_syslog($this->db->error());
+	dol_syslog($this->db->error());
       }
            
     
diff --git a/htdocs/telephonie/telephonie.tarif.prefix.class.php b/htdocs/telephonie/telephonie.tarif.prefix.class.php
index 37db355a25e..21d1fa362f2 100644
--- a/htdocs/telephonie/telephonie.tarif.prefix.class.php
+++ b/htdocs/telephonie/telephonie.tarif.prefix.class.php
@@ -61,7 +61,7 @@ class TelephonieTarifPrefix {
 	  }
 	else
 	  {
-	    dolibarr_syslog($this->db->error());
+	    dol_syslog($this->db->error());
 	  }
       }
     else
@@ -80,7 +80,7 @@ class TelephonieTarifPrefix {
 	      }
 	    else
 	      {
-		dolibarr_syslog($this->db->error());
+		dol_syslog($this->db->error());
 	      }
 	  }
       }
diff --git a/htdocs/telephonie/workflowtel.class.php b/htdocs/telephonie/workflowtel.class.php
index 783fdef1e0d..fe6455a6504 100644
--- a/htdocs/telephonie/workflowtel.class.php
+++ b/htdocs/telephonie/workflowtel.class.php
@@ -53,7 +53,7 @@ class WorkflowTelephonie {
       }
     else
       {
-	dolibarr_syslog("WorkflowTelephonie::Create ".$this->db->error,LOG_ERR);
+	dol_syslog("WorkflowTelephonie::Create ".$this->db->error,LOG_ERR);
 	$res = -1;
       }
 
@@ -62,7 +62,7 @@ class WorkflowTelephonie {
 
   function Notify($module, $statut_id, $numero, $commentaire='')
   {
-    dolibarr_syslog("WorkflowTelephonie::Notify statut_id=$statut_id",LOG_DEBUG);
+    dol_syslog("WorkflowTelephonie::Notify statut_id=$statut_id",LOG_DEBUG);
 
 
     $sql = "SELECT u.rowid";
@@ -79,14 +79,14 @@ class WorkflowTelephonie {
       }       
     else
       {
-	dolibarr_syslog("WorkflowTelephonie::SendMail ".$this->db->error,LOG_ERR);
+	dol_syslog("WorkflowTelephonie::SendMail ".$this->db->error,LOG_ERR);
       }
   }
   
   
   function SendMail($user_id, $statut_id, $numero, $commentaire='')
   {
-    dolibarr_syslog("WorkflowTelephonie::SendMail user_id=$user_id,statut_id=$statut_id",LOG_DEBUG);
+    dol_syslog("WorkflowTelephonie::SendMail user_id=$user_id,statut_id=$statut_id",LOG_DEBUG);
 
     $comm = new User($this->db,$user_id);
     $comm->fetch();
@@ -135,7 +135,7 @@ class WorkflowTelephonie {
       }
     else
       {
-	dolibarr_syslog("WorkflowTelephonie::Delete ".$this->db->error,LOG_ERR);
+	dol_syslog("WorkflowTelephonie::Delete ".$this->db->error,LOG_ERR);
 	$res = -1;
       }
 
diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php
index a6e7afc9474..4425abcab77 100644
--- a/htdocs/translate.class.php
+++ b/htdocs/translate.class.php
@@ -351,7 +351,7 @@ class Translate {
         {
             // Translation is available
             $str=sprintf($this->tab_translate[$key],$param1,$param2,$param3,$param4);
-            if ($maxsize) $str=dolibarr_trunc($str,$maxsize);
+            if ($maxsize) $str=dol_trunc($str,$maxsize);
             // On remplace les tags HTML par __xx__ pour eviter traduction par htmlentities
             $newstr=ereg_replace('<','__lt__',$str);
             $newstr=ereg_replace('>','__gt__',$newstr);
diff --git a/htdocs/user.class.php b/htdocs/user.class.php
index 391b891c237..9de63befaea 100644
--- a/htdocs/user.class.php
+++ b/htdocs/user.class.php
@@ -166,7 +166,7 @@ class User extends CommonObject
 			$sql .= " WHERE u.rowid = ".$this->id;
 		}
 
-		dolibarr_syslog("User::Fetch sql=".$sql, LOG_DEBUG);
+		dol_syslog("User::Fetch sql=".$sql, LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -214,7 +214,7 @@ class User extends CommonObject
 			else
 			{
 				$this->error="USERNOTFOUND";
-				dolibarr_syslog("User::fetch user not found", LOG_DEBUG);
+				dol_syslog("User::fetch user not found", LOG_DEBUG);
 
 				$this->db->free($result);
 				return 0;
@@ -223,7 +223,7 @@ class User extends CommonObject
 		else
 		{
 			$this->error=$this->db->error();
-			dolibarr_syslog("User::fetch Error -1, fails to get user - ".$this->error." - sql=".$sql, LOG_ERR);
+			dol_syslog("User::fetch Error -1, fails to get user - ".$this->error." - sql=".$sql, LOG_ERR);
 			return -1;
 		}
 
@@ -249,7 +249,7 @@ class User extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("User::fetch Error -2, fails to get setup user - ".$this->error." - sql=".$sql, LOG_ERR);
+				dol_syslog("User::fetch Error -2, fails to get setup user - ".$this->error." - sql=".$sql, LOG_ERR);
 				return -2;
 			}
 		}
@@ -266,7 +266,7 @@ class User extends CommonObject
 	 */
 	function addrights($rid,$allmodule='',$allperms='')
 	{
-		dolibarr_syslog("User::addrights $rid, $allmodule, $allperms");
+		dol_syslog("User::addrights $rid, $allmodule, $allperms");
 		$err=0;
 		$whereforadd='';
 
@@ -290,7 +290,7 @@ class User extends CommonObject
 			}
 			else {
 				$err++;
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 			}
 
 			// Where pour la liste des droits a ajouter
@@ -336,7 +336,7 @@ class User extends CommonObject
 			else
 			{
 				$err++;
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 			}
 		}
 
@@ -384,7 +384,7 @@ class User extends CommonObject
 			}
 			else {
 				$err++;
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 			}
 
 			// Where pour la liste des droits a supprimer
@@ -427,7 +427,7 @@ class User extends CommonObject
 			else
 			{
 				$err++;
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 			}
 		}
 
@@ -480,7 +480,7 @@ class User extends CommonObject
 		$sql.= " WHERE r.id = ur.fk_id AND ur.fk_user= ".$this->id." AND r.perms IS NOT NULL";
 		if ($moduletag) $sql.= " AND r.module = '".addslashes($moduletag)."'";
 
-		dolibarr_syslog('User::getRights sql='.$sql, LOG_DEBUG);
+		dol_syslog('User::getRights sql='.$sql, LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -522,7 +522,7 @@ class User extends CommonObject
 		$sql.= " WHERE r.id = gr.fk_id AND gr.fk_usergroup = gu.fk_usergroup AND gu.fk_user = ".$this->id." AND r.perms IS NOT NULL";
 		if ($moduletag) $sql.= " AND r.module = '".addslashes($moduletag)."'";
 
-		dolibarr_syslog('User::getRights sql='.$sql, LOG_DEBUG);
+		dol_syslog('User::getRights sql='.$sql, LOG_DEBUG);
 		$result = $this->db->query($sql);
 		if ($result)
 		{
@@ -587,7 +587,7 @@ class User extends CommonObject
 		$sql.= " WHERE rowid = ".$this->id;
 		$result = $this->db->query($sql);
 
-		dolibarr_syslog("User::setstatus sql=".$sql);
+		dol_syslog("User::setstatus sql=".$sql);
 		if ($result)
 		{
 			// Appel des triggers
@@ -676,7 +676,7 @@ class User extends CommonObject
 		// Nettoyage parametres
 		$this->login = trim($this->login);
 
-		dolibarr_syslog("User::Create login=".$this->login.", user=".(is_object($user)?$user->id:''), LOG_DEBUG);
+		dol_syslog("User::Create login=".$this->login.", user=".(is_object($user)?$user->id:''), LOG_DEBUG);
 
 		$error=0;
 		$this->db->begin();
@@ -684,7 +684,7 @@ class User extends CommonObject
 		$sql = "SELECT login FROM ".MAIN_DB_PREFIX."user";
 		$sql.= " WHERE login ='".addslashes($this->login)."'";
 
-		dolibarr_syslog("User::Create sql=".$sql, LOG_DEBUG);
+		dol_syslog("User::Create sql=".$sql, LOG_DEBUG);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{
@@ -703,7 +703,7 @@ class User extends CommonObject
 				$sql.= " VALUES(".$this->db->idate(mktime()).",'".addslashes($this->login)."','".$this->ldap_sid."')";
 				$result=$this->db->query($sql);
 
-				dolibarr_syslog("User::Create sql=".$sql, LOG_DEBUG);
+				dol_syslog("User::Create sql=".$sql, LOG_DEBUG);
 				if ($result)
 				{
 					$table =  "".MAIN_DB_PREFIX."user";
@@ -753,7 +753,7 @@ class User extends CommonObject
 					else
 					{
 						$this->error=$interface->error;
-						dolibarr_syslog("User::Create ".$this->error, LOG_ERR);
+						dol_syslog("User::Create ".$this->error, LOG_ERR);
 						$this->db->rollback();
 						return -3;
 					}
@@ -761,7 +761,7 @@ class User extends CommonObject
 				else
 				{
 					$this->error=$this->db->lasterror();
-					dolibarr_syslog("User::Create ".$this->error, LOG_ERR);
+					dol_syslog("User::Create ".$this->error, LOG_ERR);
 					$this->db->rollback();
 					return -2;
 				}
@@ -770,7 +770,7 @@ class User extends CommonObject
 		else
 		{
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("User::Create ".$this->error, LOG_ERR);
+			dol_syslog("User::Create ".$this->error, LOG_ERR);
 			$this->db->rollback();
 			return -1;
 		}
@@ -808,7 +808,7 @@ class User extends CommonObject
 			$sql.= " WHERE rowid=".$this->id;
 			$resql=$this->db->query($sql);
 
-			dolibarr_syslog("User::create_from_contact sql=".$sql, LOG_DEBUG);
+			dol_syslog("User::create_from_contact sql=".$sql, LOG_DEBUG);
 			if ($resql)
 			{
 				$this->db->commit();
@@ -817,7 +817,7 @@ class User extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("User::create_from_contact ".$this->error, LOG_ERR);
+				dol_syslog("User::create_from_contact ".$this->error, LOG_ERR);
 
 				$this->db->rollback();
 				return -1;
@@ -826,7 +826,7 @@ class User extends CommonObject
 		else
 		{
 			// $this->error deja positionne
-			dolibarr_syslog("User::create_from_contact - 0");
+			dol_syslog("User::create_from_contact - 0");
 
 			$this->db->rollback();
 			return $result;
@@ -866,7 +866,7 @@ class User extends CommonObject
 			$sql.= " SET fk_member=".$member->id;
 			$sql.= " WHERE rowid=".$this->id;
 
-			dolibarr_syslog("User::create_from_member sql=".$sql, LOG_DEBUG);
+			dol_syslog("User::create_from_member sql=".$sql, LOG_DEBUG);
 			$resql=$this->db->query($sql);
 			if ($resql)
 			{
@@ -876,7 +876,7 @@ class User extends CommonObject
 			else
 			{
 				$this->error=$this->db->error();
-				dolibarr_syslog("User::create_from_member - 1 - ".$this->error, LOG_ERR);
+				dol_syslog("User::create_from_member - 1 - ".$this->error, LOG_ERR);
 
 				$this->db->rollback();
 				return -1;
@@ -885,7 +885,7 @@ class User extends CommonObject
 		else
 		{
 			// $this->error deja positionne
-			dolibarr_syslog("User::create_from_member - 2 - ".$this->error);
+			dol_syslog("User::create_from_member - 2 - ".$this->error);
 
 			$this->db->rollback();
 			return $result;
@@ -943,7 +943,7 @@ class User extends CommonObject
 		$nbrowsaffected=0;
 		$error=0;
 
-		dolibarr_syslog("User::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember);
+		dol_syslog("User::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember);
 
 		// Nettoyage parametres
 		$this->nom          = trim($this->nom);
@@ -982,7 +982,7 @@ class User extends CommonObject
 		$sql.= ", note = '".addslashes($this->note)."'";
 		$sql.= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog("User::update sql=".$sql, LOG_DEBUG);
+		dol_syslog("User::update sql=".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -1032,7 +1032,7 @@ class User extends CommonObject
 						if ($result < 0)
 						{
 							$this->error=$luser->error;
-							dolibarr_syslog("User::update ".$this->error,LOG_ERR);
+							dol_syslog("User::update ".$this->error,LOG_ERR);
 							$error++;
 						}
 					}
@@ -1070,7 +1070,7 @@ class User extends CommonObject
 			$this->db->rollback();
 
 			$this->error=$this->db->lasterror();
-			dolibarr_syslog("User::update ".$this->error,LOG_ERR);
+			dol_syslog("User::update ".$this->error,LOG_ERR);
 			return -1;
 		}
 
@@ -1091,7 +1091,7 @@ class User extends CommonObject
 		$sql.= " tms = tms";    // La date de derniere modif doit changer sauf pour la mise a jour de date de derniere connexion
 		$sql.= " WHERE rowid = ".$this->id;
 
-		dolibarr_syslog ("Update last login date for user->id=".$this->id." ".$sql, LOG_DEBUG);
+		dol_syslog ("Update last login date for user->id=".$this->id." ".$sql, LOG_DEBUG);
 		$resql = $this->db->query($sql);
 		if ($resql)
 		{
@@ -1122,7 +1122,7 @@ class User extends CommonObject
 
 		$error=0;
 
-		dolibarr_syslog("User::setPassword user=".$user->id." password=".eregi_replace('.','*',$password)." changelater=".$changelater." notrigger=".$notrigger, LOG_DEBUG);
+		dol_syslog("User::setPassword user=".$user->id." password=".eregi_replace('.','*',$password)." changelater=".$changelater." notrigger=".$notrigger, LOG_DEBUG);
 
 		// Si nouveau mot de passe non communique, on genere par module
 		if (! $password)
@@ -1151,8 +1151,8 @@ class User extends CommonObject
 			}
 			$sql.= " WHERE rowid = ".$this->id;
 
-			dolibarr_syslog("User::setPassword sql=hidden", LOG_DEBUG);
-			//dolibarr_syslog("User::Password sql=".$sql);
+			dol_syslog("User::setPassword sql=hidden", LOG_DEBUG);
+			//dol_syslog("User::Password sql=".$sql);
 			$result = $this->db->query($sql);
 			if ($result)
 			{
@@ -1177,7 +1177,7 @@ class User extends CommonObject
 							if ($result < 0)
 							{
 								$this->error=$adh->error;
-								dolibarr_syslog("User::setPassword ".$this->error,LOG_ERR);
+								dol_syslog("User::setPassword ".$this->error,LOG_ERR);
 								$error++;
 							}
 						}
@@ -1207,7 +1207,7 @@ class User extends CommonObject
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				return -1;
 			}
 		}
@@ -1219,7 +1219,7 @@ class User extends CommonObject
 			$sql.= " SET pass_temp = '".addslashes($password)."'";
 			$sql.= " WHERE rowid = ".$this->id;
 
-			dolibarr_syslog("User::setPassword sql=hidden", LOG_DEBUG);	// No log
+			dol_syslog("User::setPassword sql=hidden", LOG_DEBUG);	// No log
 			$result = $this->db->query($sql);
 			if ($result)
 			{
@@ -1227,7 +1227,7 @@ class User extends CommonObject
 			}
 			else
 			{
-				dolibarr_print_error($this->db);
+				dol_print_error($this->db);
 				return -3;
 			}
 		}
@@ -1288,7 +1288,7 @@ class User extends CommonObject
 			$url = "http://".$_SERVER["HTTP_HOST"].DOL_URL_ROOT.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordmd5=".md5($password);
 			$mesg.= $url."\n\n";
 			$mesg.= "If you didn't ask anything, just forget this email\n\n";
-			dolibarr_syslog("User::send_password url=".$url);
+			dol_syslog("User::send_password url=".$url);
 		}
 		$mailfile = new CMailFile($subject,$this->email,$conf->notification->email_from,$mesg,
 		array(),array(),array(),'', '', 0, $msgishtml);
@@ -1689,7 +1689,7 @@ class User extends CommonObject
 		else
 		{
 			$err++;
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 		return $err;
 	}
@@ -1725,7 +1725,7 @@ class User extends CommonObject
 		}
 		else
 		{
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 		}
 	}
 
diff --git a/htdocs/user/addon.php b/htdocs/user/addon.php
index 162a068d92a..a6155452ed2 100644
--- a/htdocs/user/addon.php
+++ b/htdocs/user/addon.php
@@ -53,7 +53,7 @@ if ($_GET["id"])
 	 */
 	$head = user_prepare_head($fuser);
 
-	dolibarr_fiche_head($head, 'other', $langs->trans("User"));
+	dol_fiche_head($head, 'other', $langs->trans("User"));
 
 
     /*
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index 1abffe63176..9c1dab4ca1d 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -65,7 +65,7 @@ if ($_GET["id"])
 	 */
 	$head = user_prepare_head($fuser);
 
-	dolibarr_fiche_head($head, 'clicktodial', $langs->trans("User"));
+	dol_fiche_head($head, 'clicktodial', $langs->trans("User"));
 
     /*
      * Fiche en mode visu
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 94769741c53..24cef122f03 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -750,7 +750,7 @@ else
 		 */
 		$head = user_prepare_head($fuser);
 
-		dolibarr_fiche_head($head, 'user', $langs->trans("User"));
+		dol_fiche_head($head, 'user', $langs->trans("User"));
 
 
 		/*
@@ -924,7 +924,7 @@ else
 				$contact->fetch($fuser->contact_id);
 				if ($fuser->societe_id > 0) print ' / ';
 				else print '<br>';
-				print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$fuser->contact_id.'">'.img_object($langs->trans("ShowContact"),'contact').' '.dolibarr_trunc($contact->getFullName($langs),32).'</a>';
+				print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$fuser->contact_id.'">'.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).'</a>';
 			}
 			print '</td>';
 			print "</tr>\n";
@@ -953,11 +953,11 @@ else
 			print '</td></tr>';
 
 			print '<tr><td width="25%" valign="top">'.$langs->trans("LastConnexion").'</td>';
-			print '<td>'.dolibarr_print_date($fuser->datelastlogin,"dayhour").'</td>';
+			print '<td>'.dol_print_date($fuser->datelastlogin,"dayhour").'</td>';
 			print "</tr>\n";
 
 			print '<tr><td width="25%" valign="top">'.$langs->trans("PreviousConnexion").'</td>';
-			print '<td>'.dolibarr_print_date($fuser->datepreviouslogin,"dayhour").'</td>';
+			print '<td>'.dol_print_date($fuser->datepreviouslogin,"dayhour").'</td>';
 			print "</tr>\n";
 
 			// Autres caracteristiques issus des autres modules
@@ -1092,7 +1092,7 @@ else
 				}
 			}
 			else {
-				dolibarr_print_error($db);
+				dol_print_error($db);
 			}
 			$db->free($resql);
 
@@ -1322,7 +1322,7 @@ else
 				{
 					$contact = new Contact($db);
 					$contact->fetch($fuser->contact_id);
-					print ' / '.'<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$fuser->contact_id.'">'.img_object($langs->trans("ShowContact"),'contact').' '.dolibarr_trunc($contact->getFullName($langs),32).'</a>';
+					print ' / '.'<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$fuser->contact_id.'">'.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).'</a>';
 				}
 			}
 			else
diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php
index 7454e2c4750..d395a1c06e1 100644
--- a/htdocs/user/group/fiche.php
+++ b/htdocs/user/group/fiche.php
@@ -212,7 +212,7 @@ else
 		 */
 		$head = group_prepare_head($group);
 
-		dolibarr_fiche_head($head, 'group', $langs->trans("Group").": ".$group->nom);
+		dol_fiche_head($head, 'group', $langs->trans("Group").": ".$group->nom);
 
 
         /*
@@ -299,7 +299,7 @@ else
                 }
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
 
             if ($caneditperms)
@@ -381,7 +381,7 @@ else
                 $db->free($result);
             }
             else {
-                dolibarr_print_error($db);
+                dol_print_error($db);
             }
         }
 
diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php
index 5bd57c85bc9..8ca5a4031ff 100644
--- a/htdocs/user/group/index.php
+++ b/htdocs/user/group/index.php
@@ -84,7 +84,7 @@ if ($resql)
 
         print "<tr $bc[$var]>";
         print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowGroup"),"group").' '.$obj->nom.'</a></td>';
-        print '<td width="100" align="center">'.dolibarr_print_date($obj->datec,"day").'</td>';
+        print '<td width="100" align="center">'.dol_print_date($obj->datec,"day").'</td>';
         print "</tr>\n";
         $i++;
     }
@@ -93,7 +93,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php
index 48c45690e6f..7aa0ba77485 100644
--- a/htdocs/user/group/ldap.php
+++ b/htdocs/user/group/ldap.php
@@ -62,7 +62,7 @@ $fgroup->getrights();
  */
 $head = group_prepare_head($fgroup);
 
-dolibarr_fiche_head($head, 'ldap', $langs->trans("Group").": ".$fgroup->nom);
+dol_fiche_head($head, 'ldap', $langs->trans("Group").": ".$fgroup->nom);
 
 
 
@@ -144,7 +144,7 @@ if ($result > 0)
 }
 else
 {
-	dolibarr_print_error('',$ldap->error);
+	dol_print_error('',$ldap->error);
 }
 
 print '</table>';
diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php
index ecfb83282ad..96a18ff83b4 100644
--- a/htdocs/user/group/perms.php
+++ b/htdocs/user/group/perms.php
@@ -74,7 +74,7 @@ if ($_GET["id"])
 	 */
 	$head = group_prepare_head($fgroup);
 
-	dolibarr_fiche_head($head, 'rights', $langs->trans("Group").": ".$fgroup->nom);
+	dol_fiche_head($head, 'rights', $langs->trans("Group").": ".$fgroup->nom);
 
 
     $db->begin();
@@ -130,7 +130,7 @@ if ($_GET["id"])
     }
     else
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 
 
diff --git a/htdocs/user/home.php b/htdocs/user/home.php
index 9bc34199068..8c83d6f11cf 100644
--- a/htdocs/user/home.php
+++ b/htdocs/user/home.php
@@ -111,7 +111,7 @@ if ($resql)
         }
         else print $langs->trans("InternalUser");
         print '</td>';
-        print "<td align=\"right\">".dolibarr_print_date($obj->datec,'dayhour')."</td>";
+        print "<td align=\"right\">".dol_print_date($obj->datec,'dayhour')."</td>";
         print '</tr>';
         $i++;
     }
@@ -121,7 +121,7 @@ if ($resql)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
@@ -150,7 +150,7 @@ if ( $db->query($sql) )
 
         print "<tr $bc[$var]>";
         print "<td><a href=\"".DOL_URL_ROOT."/user/group/fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowGroup"),"group")." ".$obj->nom."</a></td>";
-        print "<td width=\"80\" align=\"center\">".dolibarr_print_date($obj->datec)."</td>";
+        print "<td width=\"80\" align=\"center\">".dol_print_date($obj->datec)."</td>";
         print '</tr>';
         $i++;
     }
@@ -160,7 +160,7 @@ if ( $db->query($sql) )
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index a184e07a23b..2790060c682 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -117,10 +117,10 @@ if ($result)
         print '</td>';
 
         // Date creation
-        print '<td nowrap="nowrap" align="center">'.dolibarr_print_date($obj->datec,"day").'</td>';
+        print '<td nowrap="nowrap" align="center">'.dol_print_date($obj->datec,"day").'</td>';
 
         // Date last login
-        print '<td nowrap="nowrap" align="center">'.dolibarr_print_date($obj->datelastlogin,"dayhour").'</td>';
+        print '<td nowrap="nowrap" align="center">'.dol_print_date($obj->datelastlogin,"dayhour").'</td>';
 
 		// Statut
 		$userstatic->statut=$obj->statut;
@@ -133,7 +133,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 $db->close();
diff --git a/htdocs/user/info.php b/htdocs/user/info.php
index 0de745d22aa..6a6d1f8ecdc 100644
--- a/htdocs/user/info.php
+++ b/htdocs/user/info.php
@@ -51,7 +51,7 @@ $fuser->info($_GET["id"]);
 
 $head = user_prepare_head($fuser);
 
-dolibarr_fiche_head($head, 'info', $langs->trans("User"));
+dol_fiche_head($head, 'info', $langs->trans("User"));
 
 
 print '<table width="100%"><tr><td>';
diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php
index dcf70b75ac9..133f2a9e1df 100644
--- a/htdocs/user/ldap.php
+++ b/htdocs/user/ldap.php
@@ -92,7 +92,7 @@ $form = new Form($db);
  */
 $head = user_prepare_head($fuser);
 
-dolibarr_fiche_head($head, 'ldap', $langs->trans("User"));
+dol_fiche_head($head, 'ldap', $langs->trans("User"));
 
 
 
@@ -225,7 +225,7 @@ if ($result > 0)
 }
 else
 {
-	dolibarr_print_error('',$ldap->error);
+	dol_print_error('',$ldap->error);
 }
 
 print '</table>';
diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php
index a0ec668c8f4..63023a3c967 100644
--- a/htdocs/user/logout.php
+++ b/htdocs/user/logout.php
@@ -48,14 +48,14 @@ $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_destroy();
-dolibarr_syslog("End session in DOLSESSID_".$dolibarr_main_db_name);
+dol_syslog("End session in DOLSESSID_".$dolibarr_main_db_name);
 
 // Init session
 $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_start();
-dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
+dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
 
 session_unregister("dol_login");
 
diff --git a/htdocs/user/note.php b/htdocs/user/note.php
index b42781937c6..398a36a8486 100644
--- a/htdocs/user/note.php
+++ b/htdocs/user/note.php
@@ -82,7 +82,7 @@ if ($id)
 {
 	$head = user_prepare_head($fuser);
 	
-	dolibarr_fiche_head($head, 'note', $langs->trans("User"));
+	dol_fiche_head($head, 'note', $langs->trans("User"));
 
 	if ($msg) print '<div class="error">'.$msg.'</div>';
 
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index cbd5802cfe2..72b7ff3806c 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -113,7 +113,7 @@ llxHeader();
  */
 $head = user_prepare_head($fuser);
 
-dolibarr_fiche_head($head, 'guisetup', $langs->trans("User"));
+dol_fiche_head($head, 'guisetup', $langs->trans("User"));
 
 
 print '<table class="border" width="100%">';
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 3244c988eea..784d85c9668 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -35,7 +35,7 @@ $sessionname="DOLSESSID_".$dolibarr_main_db_name;
 if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
 session_name($sessionname);
 session_start();
-dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
+dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
 
 $user->getrights('user');
 
@@ -71,7 +71,7 @@ if ($_GET["action"] == 'validatenewpassword' && $_GET["username"] && $_GET["pass
 		if (md5($edituser->pass_temp) == $_GET["passwordmd5"])
 		{
 			$newpassword=$edituser->setPassword($user,$edituser->pass_temp,0);
-			dolibarr_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database");
+			dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database");
 			//session_start();
 			//$_SESSION["loginmesg"]=$langs->trans("PasswordChanged");
 			header("Location: ".DOL_URL_ROOT.'/');
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index e0a7bb79198..80a3d865baf 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -93,7 +93,7 @@ $fuser->getrights();
  */
 $head = user_prepare_head($fuser);
 
-dolibarr_fiche_head($head, 'rights', $langs->trans("User"));
+dol_fiche_head($head, 'rights', $langs->trans("User"));
 
 
 $db->begin();
@@ -154,7 +154,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 // Lecture des droits groupes
@@ -181,7 +181,7 @@ if ($result)
 }
 else
 {
-    dolibarr_print_error($db);
+    dol_print_error($db);
 }
 
 
diff --git a/htdocs/usergroup.class.php b/htdocs/usergroup.class.php
index 2986e117d18..cc3bcd5a45b 100644
--- a/htdocs/usergroup.class.php
+++ b/htdocs/usergroup.class.php
@@ -70,7 +70,7 @@ class UserGroup
         $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
         $sql.= " WHERE g.rowid = ".$this->id;
 
-        dolibarr_syslog("Usergroup::fetch sql=".$sql);
+        dol_syslog("Usergroup::fetch sql=".$sql);
 		$result = $this->db->query($sql);
         if ($result)
         {
@@ -90,7 +90,7 @@ class UserGroup
         else
         {
         	$this->error=$this->db->lasterror();
-        	dolibarr_syslog("UserGroup::Fetch ".$this->error, LOG_ERR);
+        	dol_syslog("UserGroup::Fetch ".$this->error, LOG_ERR);
 			return -1;
         }
 
@@ -112,7 +112,7 @@ class UserGroup
         $sql.= " AND ug.fk_user = ".$usertosearch->id;
         $sql.= " ORDER BY g.nom";
         
-        dolibarr_syslog("UserGroup::listGroupsForUser sql=".$sql,LOG_DEBUG);
+        dol_syslog("UserGroup::listGroupsForUser sql=".$sql,LOG_DEBUG);
         $result = $this->db->query($sql);
         if ($result)
         {
@@ -132,7 +132,7 @@ class UserGroup
 	    else
         {
         	$this->error=$this->db->lasterror();
-        	dolibarr_syslog("UserGroup::listGroupsForUser ".$this->error, LOG_ERR);
+        	dol_syslog("UserGroup::listGroupsForUser ".$this->error, LOG_ERR);
 			return -1;
         }		
 		return $ret;
@@ -170,7 +170,7 @@ class UserGroup
             }
             else {
                 $err++;
-                dolibarr_print_error($this->db);
+                dol_print_error($this->db);
             }
 
             // Where pour la liste des droits � ajouter
@@ -218,7 +218,7 @@ class UserGroup
             else
             {
                 $err++;
-                dolibarr_print_error($this->db);
+                dol_print_error($this->db);
             }
         }
 
@@ -266,7 +266,7 @@ class UserGroup
             }
             else {
                 $err++;
-                dolibarr_print_error($this->db);
+                dol_print_error($this->db);
             }
 
             // Where pour la liste des droits � supprimer
@@ -312,7 +312,7 @@ class UserGroup
             else
             {
                 $err++;
-                dolibarr_print_error($this->db);
+                dol_print_error($this->db);
             }
         }
 
@@ -416,7 +416,7 @@ class UserGroup
 		else
 		{
 			$this->db->rollback();
-			dolibarr_print_error($this->db);
+			dol_print_error($this->db);
 			return -1;
 		}
 	}
@@ -451,7 +451,7 @@ class UserGroup
 		}
 		else
 		{
-			dolibarr_syslog("UserGroup::Create");
+			dol_syslog("UserGroup::Create");
 			return -1;
 		}
 	}
@@ -494,7 +494,7 @@ class UserGroup
         }
         else
         {
-            dolibarr_print_error($this->db);
+            dol_print_error($this->db);
             return -2;
         }
 	}
diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php
index 2c5c7bb7e23..f64b2d941bb 100644
--- a/htdocs/viewimage.php
+++ b/htdocs/viewimage.php
@@ -323,9 +323,9 @@ if (! $accessallowed)
 if (eregi('\.\.',$original_file) || eregi('[<>|]',$original_file))
 {
 	$langs->load("main");
-	dolibarr_syslog("Refused to deliver file ".$original_file);
+	dol_syslog("Refused to deliver file ".$original_file);
 	// Do no show plain path in shown error message
-	dolibarr_print_error(0,$langs->trans("ErrorFileNameInvalid",$_GET["file"]));
+	dol_print_error(0,$langs->trans("ErrorFileNameInvalid",$_GET["file"]));
 	exit;
 }
 
@@ -358,12 +358,12 @@ else
 	// Output files on disk
 	$filename = basename($original_file);
 
-	dolibarr_syslog("viewimage.php return file $original_file $filename content-type=$type");
+	dol_syslog("viewimage.php return file $original_file $filename content-type=$type");
 
 	if (! file_exists($original_file))
 	{
 		$langs->load("main");
-		dolibarr_print_error(0,$langs->trans("ErrorFileDoesNotExists",$_GET["file"]));
+		dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$_GET["file"]));
 		exit;
 	}
 
diff --git a/htdocs/webcal/webcal.class.php b/htdocs/webcal/webcal.class.php
index 9b05e291704..6e018df2587 100644
--- a/htdocs/webcal/webcal.class.php
+++ b/htdocs/webcal/webcal.class.php
@@ -76,14 +76,14 @@ class Webcal {
 	{
         global $langs;
         
-        dolibarr_syslog("Webcal::add user=".$user->id);
+        dol_syslog("Webcal::add user=".$user->id);
 
         // Test si login webcal d�fini pour le user
         if (! $user->webcal_login)
 		{
 			$langs->load("other");
             $this->error=$langs->transnoentities("ErrorWebcalLoginNotDefined","<a href=\"".DOL_URL_ROOT."/user/fiche.php?id=".$user->id."\">".$user->login."</a>");
-			dolibarr_syslog("Webcal::add ERROR ".$this->error);
+			dol_syslog("Webcal::add ERROR ".$this->error);
             return -4; 
         }
         
@@ -112,7 +112,7 @@ class Webcal {
             $sql = "INSERT INTO webcal_entry (cal_id, cal_create_by,cal_date,cal_time,cal_mod_date, cal_mod_time,cal_duration,cal_priority,cal_type, cal_access, cal_name,cal_description)";
             $sql.= " VALUES ($cal_id, '$cal_create_by', '$cal_date', '$cal_time', '$cal_mod_date', '$cal_mod_time', $cal_duration, $cal_priority, '$cal_type', '$cal_access', '$cal_name','$cal_description')";
 
-			dolibarr_syslog("Webcal::add sql=".$sql);
+			dol_syslog("Webcal::add sql=".$sql);
 			$resql=$this->localdb->query($sql);
             if ($resql)
            	{
@@ -130,7 +130,7 @@ class Webcal {
         		{
                     $this->localdb->rollback();
         		    $this->error = $this->localdb->error() . '<br>' .$sql;
-					dolibarr_syslog("Webcal::add ERROR ".$this->error);
+					dol_syslog("Webcal::add ERROR ".$this->error);
                     return -1;
         		}
         	}
@@ -138,7 +138,7 @@ class Webcal {
         	{
                 $this->localdb->rollback();
             	$this->error = $this->localdb->error() . '<br>' .$sql;
-				dolibarr_syslog("Webcal::add ERROR ".$this->error);
+				dol_syslog("Webcal::add ERROR ".$this->error);
                 return -2;
         	}
         }
@@ -146,7 +146,7 @@ class Webcal {
         {
             $this->localdb->rollback();
         	$this->error = $this->localdb->error() . '<br>' .$sql;
-			dolibarr_syslog("Webcal::add ERROR ".$this->error);
+			dol_syslog("Webcal::add ERROR ".$this->error);
             return -3;
         }
     }
@@ -189,7 +189,7 @@ class Webcal {
 		
 		require_once (DOL_DOCUMENT_ROOT ."/lib/xcal.lib.php");
 
-		dolibarr_syslog("webcal::build_calfile Build cal file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".sizeof($filters), LOG_DEBUG);
+		dol_syslog("webcal::build_calfile Build cal file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".sizeof($filters), LOG_DEBUG);
 
 		// Check parameters
 		if (empty($format)) return -1;
@@ -223,7 +223,7 @@ class Webcal {
 			$sql.= " FROM webcal_entry";
 			$sql.= " order by cal_date";
 
-			dolibarr_syslog("Webcal::build_vcal select events sql=".$sql);
+			dol_syslog("Webcal::build_vcal select events sql=".$sql);
 			$resql=$this->localdb->query($sql);
 			if ($resql)
 			{
@@ -252,7 +252,7 @@ class Webcal {
 						$min=sprintf("%02d",$reg[2]);
 						$sec=sprintf("%02d",$reg[3]);
 					}
-					$datestart=dolibarr_mktime($hour,$min,$sec,$month,$day,$year);
+					$datestart=dol_mktime($hour,$min,$sec,$month,$day,$year);
 					$event['startdate']=$datestart;
 					//$event['duration']=$obj->cal_duration;	// Not required with type 'journal'
 					//$event['enddate']='';						// Not required with type 'journal'
@@ -273,7 +273,7 @@ class Webcal {
 			}
 			else
 			{
-				dolibarr_syslog("webcal::build_calfile ".$this->localdb->lasterror());
+				dol_syslog("webcal::build_calfile ".$this->localdb->lasterror());
 				return -1;
 			}
 			
diff --git a/htdocs/webservices/client.php b/htdocs/webservices/client.php
index d06b6ca3c5a..dd839367c79 100644
--- a/htdocs/webservices/client.php
+++ b/htdocs/webservices/client.php
@@ -35,7 +35,7 @@ $WS_METHOD  = 'getVersions';
 $parameters = array("param1"=>"value1");
 
 // Set the WebService URL
-dolibarr_syslog("Create soapclient_nusoap for URL=".$WS_DOL_URL);
+dol_syslog("Create soapclient_nusoap for URL=".$WS_DOL_URL);
 $soapclient = new soapclient_nusoap($WS_DOL_URL);
 if ($soapclient)
 {
@@ -43,7 +43,7 @@ if ($soapclient)
 }
 
 // Call the WebService method and store its result in $result.
-dolibarr_syslog("Call method ".$WS_METHOD);
+dol_syslog("Call method ".$WS_METHOD);
 $result = $soapclient->call($WS_METHOD,$parameters);
 
 // Show page with result
diff --git a/htdocs/webservices/server.php b/htdocs/webservices/server.php
index 4bf21de8a97..72b66ba73ed 100644
--- a/htdocs/webservices/server.php
+++ b/htdocs/webservices/server.php
@@ -29,7 +29,7 @@ require_once("../master.inc.php");
 require_once(NUSOAP_PATH.'/nusoap.php');		// Include SOAP
 
 
-dolibarr_syslog("Call Dolibarr webservices interfaces");
+dol_syslog("Call Dolibarr webservices interfaces");
 
 
 // Create the soap Object
@@ -63,7 +63,7 @@ $server->service($HTTP_RAW_POST_DATA);
 // Full methods code
 function getVersions()
 {
-	dolibarr_syslog("Function: getVersions");
+	dol_syslog("Function: getVersions");
 	
 	$versions_array=array();
 	
diff --git a/scripts/adherents/sync_member_dolibarr2ldap.php b/scripts/adherents/sync_member_dolibarr2ldap.php
index 932f52f896d..27212512556 100644
--- a/scripts/adherents/sync_member_dolibarr2ldap.php
+++ b/scripts/adherents/sync_member_dolibarr2ldap.php
@@ -109,13 +109,13 @@ if ($resql)
 		$result=$member->fetch($obj->rowid);
 		if ($result < 0)
 		{
-			dolibarr_print_error($db,$member->error);
+			dol_print_error($db,$member->error);
 			exit;
 		}
 		$result=$member->fetch_subscriptions();
 		if ($result < 0)
 		{
-			dolibarr_print_error($db,$member->error);
+			dol_print_error($db,$member->error);
 			exit;
 		}
 		
@@ -144,7 +144,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 return $error;
diff --git a/scripts/adherents/sync_member_ldap2dolibarr.php b/scripts/adherents/sync_member_ldap2dolibarr.php
index 930806cd047..1da3508c4b5 100644
--- a/scripts/adherents/sync_member_ldap2dolibarr.php
+++ b/scripts/adherents/sync_member_ldap2dolibarr.php
@@ -121,7 +121,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 	exit;
 }
 
@@ -277,7 +277,7 @@ if ($result >= 0)
 			if ($datelast)
 			{
 				// Cree derniere cotisation et met a jour datefin dans adherent
-				//print "yy".dolibarr_print_date($datelast)."\n";
+				//print "yy".dol_print_date($datelast)."\n";
 				$crowid=$member->cotisation($datelast, $pricelast, 0);
 			}
 			
@@ -296,13 +296,13 @@ if ($result >= 0)
 	}
 	else
 	{
-		dolibarr_print_error('',$ldap->error);
+		dol_print_error('',$ldap->error);
 		$error++;
 	}
 }
 else
 {
-	dolibarr_print_error('',$ldap->error);
+	dol_print_error('',$ldap->error);
 	$error++;
 }
 		
diff --git a/scripts/banque/graph-solde.php b/scripts/banque/graph-solde.php
index 81f687b3d4d..d2466dc1f0d 100644
--- a/scripts/banque/graph-solde.php
+++ b/scripts/banque/graph-solde.php
@@ -146,7 +146,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 //	print strftime("%Y%m%d",$max);
 
@@ -173,7 +173,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	// Calcul de $solde avant le debut du graphe
@@ -190,7 +190,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	// Chargement de labels et datas pour tableau 1
@@ -267,7 +267,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 	
 	// Calcul de $solde avant le debut du graphe
@@ -284,7 +284,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	// Chargement de labels et datas pour tableau 2
@@ -360,7 +360,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	// Calcul de $solde avant le debut du graphe
@@ -440,7 +440,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	$sql = "SELECT date_format(datev,'%m'), sum(amount)";
@@ -460,7 +460,7 @@ foreach ($accounts as $account)
 	}
 	else
 	{
-		dolibarr_print_error($db);
+		dol_print_error($db);
 	}
 
 	// Chargement de labels et data_xxx pour tableau 4
diff --git a/scripts/books/droits-editeurs.php b/scripts/books/droits-editeurs.php
index 4128341c4ed..6a95bcf49ce 100644
--- a/scripts/books/droits-editeurs.php
+++ b/scripts/books/droits-editeurs.php
@@ -48,7 +48,7 @@ if ($resql)
     {
       $id       = $obj->socid;
 
-      dolibarr_syslog("droits-editeurs.php id:$id", LOG_DEBUG );
+      dol_syslog("droits-editeurs.php id:$id", LOG_DEBUG );
 
       $coupdf = new pdf_courrier_editeur($db, $langs);
       $coupdf->write($id, $year);
@@ -301,7 +301,7 @@ class pdf_courrier_editeur
 	$pdf->Close();
 
 	$pdf->Output($file);
-	dolibarr_syslog("droits-editeurs.php write $file", LOG_DEBUG );
+	dol_syslog("droits-editeurs.php write $file", LOG_DEBUG );
 	return 0;
       }
     else
diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php
index 78d353aed34..f04dc802c6d 100644
--- a/scripts/company/sync_contacts_dolibarr2ldap.php
+++ b/scripts/company/sync_contacts_dolibarr2ldap.php
@@ -110,7 +110,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 return $error;
diff --git a/scripts/cron/stock-graph.php b/scripts/cron/stock-graph.php
index 99a30c88e7f..1fd2b8abd4d 100644
--- a/scripts/cron/stock-graph.php
+++ b/scripts/cron/stock-graph.php
@@ -86,7 +86,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db,$sql);
+	dol_print_error($db,$sql);
 }
 
 $now = time();
@@ -99,7 +99,7 @@ for ($i = 0 ; $i < strftime('%j',$now) ; $i++)
 		$values[$key][$i] = 0;
 	}
 	$values[0][$i] = 0;
-	$legends[$i] = strftime('%b',dolibarr_mktime(12,0,0,1,1,2006) + ($i * 3600 * 24));
+	$legends[$i] = strftime('%b',dol_mktime(12,0,0,1,1,2006) + ($i * 3600 * 24));
 	//print $legends[$i].strftime('%j',$now);
 }
 
@@ -144,7 +144,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db,$sql);
+	dol_print_error($db,$sql);
 }
 
 for ($i = $max_day + 1 ; $i < ($day + 1) ; $i++)
diff --git a/scripts/energie/graph-line.php b/scripts/energie/graph-line.php
index c3ebc371a8a..a92e3fe4395 100644
--- a/scripts/energie/graph-line.php
+++ b/scripts/energie/graph-line.php
@@ -201,8 +201,8 @@ if ($resql_c)
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Erreur SQL");
-	      dolibarr_syslog("$sql");
+	      dol_syslog("Erreur SQL");
+	      dol_syslog("$sql");
 	    }
 	  $i_c++;
 	}
@@ -210,7 +210,7 @@ if ($resql_c)
 }
 else
 {
-  dolibarr_syslog("Erreur SQL");
-  dolibarr_syslog($db->error($resql_c));
+  dol_syslog("Erreur SQL");
+  dol_syslog($db->error($resql_c));
 }
 ?>
diff --git a/scripts/energie/graph.php b/scripts/energie/graph.php
index 9e82529ccbc..cd606cd7725 100644
--- a/scripts/energie/graph.php
+++ b/scripts/energie/graph.php
@@ -280,8 +280,8 @@ if ($resql_c)
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Erreur SQL");
-	      dolibarr_syslog("$sql");
+	      dol_syslog("Erreur SQL");
+	      dol_syslog("$sql");
 	    }
 	  $i_c++;
 	}
@@ -289,8 +289,8 @@ if ($resql_c)
 }
 else
 {
-  dolibarr_syslog("Erreur SQL");
-  dolibarr_syslog($db->error($resql_c));
+  dol_syslog("Erreur SQL");
+  dol_syslog($db->error($resql_c));
 }
 /*************************************************************
  * Groupes
@@ -469,7 +469,7 @@ if ($resql_g)
 	}
       else
 	{
-	  dolibarr_syslog("Erreur SQL");
+	  dol_syslog("Erreur SQL");
 	  print $sql_c;
 	}
       $i_g++;
@@ -477,7 +477,7 @@ if ($resql_g)
 }
 else
 {
-  dolibarr_syslog("Erreur SQL");
+  dol_syslog("Erreur SQL");
   print $sql;
 }
 ?>
diff --git a/scripts/invoices/factures-impayees-commerciaux.php b/scripts/invoices/factures-impayees-commerciaux.php
index 075d70e4153..773589a5d22 100644
--- a/scripts/invoices/factures-impayees-commerciaux.php
+++ b/scripts/invoices/factures-impayees-commerciaux.php
@@ -62,7 +62,7 @@ if ( $db->query($sql) )
     $oldemail = '';
     $message = '';
     $total = '';
-    dolibarr_syslog("factures-impayees-commerciaux: ");
+    dol_syslog("factures-impayees-commerciaux: ");
 
     if ($num)
     {
@@ -84,7 +84,7 @@ if ( $db->query($sql) )
             $message .= "Facture ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->nom."\n";
             $total += $obj->total_ttc;
     
-            dolibarr_syslog("factures-impayees-commerciaux: ".$obj->email);
+            dol_syslog("factures-impayees-commerciaux: ".$obj->email);
             $i++;
         }
 
@@ -101,8 +101,8 @@ if ( $db->query($sql) )
 }
 else
 {
-    dolibarr_print_error($db);
-    dolibarr_syslog("factures-impayees-commerciaux: Error");
+    dol_print_error($db);
+    dol_syslog("factures-impayees-commerciaux: Error");
 }
 
 
@@ -116,7 +116,7 @@ function envoi_mail($oldemail,$message,$total)
 	$msgishtml = 0;
 	
     print "Envoi mail pour $oldemail, total: $total\n";
-    dolibarr_syslog("factures-impayees-commerciaux: send mail to $oldemail");
+    dol_syslog("factures-impayees-commerciaux: send mail to $oldemail");
 
     $allmessage = "Liste des factures impay�es � ce jour\n";
     $allmessage .= "Cette liste ne comporte que les factures des soci�t�s dont vous �tes r�f�renc�s comme commercial.\n";
diff --git a/scripts/mailing/mailing-prepare.php b/scripts/mailing/mailing-prepare.php
index cd6f1b91820..e9a72c59ec5 100644
--- a/scripts/mailing/mailing-prepare.php
+++ b/scripts/mailing/mailing-prepare.php
@@ -58,8 +58,8 @@ if ( $db->query($sql) )
     {
       $row = $db->fetch_row();
 
-      dolibarr_syslog("mailing-prepare: mailing $row[0]");
-      dolibarr_syslog("mailing-prepare: mailing module $row[1]");
+      dol_syslog("mailing-prepare: mailing $row[0]");
+      dol_syslog("mailing-prepare: mailing module $row[1]");
 
       require_once(DOL_DOCUMENT_ROOT.'/includes/modules/mailings/'.$row[1].'.modules.php');
 
diff --git a/scripts/mailing/mailing-send.php b/scripts/mailing/mailing-send.php
index 7a7d5bd068c..0e29242c796 100644
--- a/scripts/mailing/mailing-send.php
+++ b/scripts/mailing/mailing-send.php
@@ -87,7 +87,7 @@ if ($resql)
 	{
 		$obj = $db->fetch_object($resql);
 
-		dolibarr_syslog("mailing-send: mailing ".$id);
+		dol_syslog("mailing-send: mailing ".$id);
 
 		$id       = $obj->rowid;
 		$subject  = $obj->sujet;
@@ -119,14 +119,14 @@ if ($resql)
 
     if ($num)
     {
-        dolibarr_syslog("mailing-send: nb of targets = ".$num, LOG_DEBUG);
+        dol_syslog("mailing-send: nb of targets = ".$num, LOG_DEBUG);
 
         // Positionne date debut envoi
         $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=SYSDATE() WHERE rowid=".$id;
         $resql2=$db->query($sql);
         if (! $resql2)
         {
-            dolibarr_print_error($db);
+            dol_print_error($db);
         }
 
         // Boucle sur chaque adresse et envoie le mail
@@ -191,14 +191,14 @@ if ($resql)
                 // Mail envoye avec succes
                 $nbok++;
 
-		        dolibarr_syslog("mailing-send: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
+		        dol_syslog("mailing-send: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
 
                 $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
 				$sql.=" SET statut=1, date_envoi=SYSDATE() WHERE rowid=".$obj->rowid;
                 $resql2=$db->query($sql);
                 if (! $resql2)
                 {
-                    dolibarr_print_error($db);
+                    dol_print_error($db);
                 }
             }
             else
@@ -206,14 +206,14 @@ if ($resql)
                 // Mail en echec
                 $nbko++;
 
-		        dolibarr_syslog("mailing-send: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
+		        dol_syslog("mailing-send: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
 
                 $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
 				$sql.=" SET statut=-1, date_envoi=SYSDATE() WHERE rowid=".$obj->rowid;
                 $resql2=$db->query($sql);
                 if (! $resql2)
                 {
-                    dolibarr_print_error($db);
+                    dol_print_error($db);
                 }
             }
 
@@ -226,17 +226,17 @@ if ($resql)
     if (! $nbko) $statut=3;
 
     $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$id;
-    dolibarr_syslog("mailing-send: update global status sql=".$sql, LOG_DEBUG);
+    dol_syslog("mailing-send: update global status sql=".$sql, LOG_DEBUG);
     $resql2=$db->query($sql);
     if (! $resql2)
     {
-        dolibarr_print_error($db);
+        dol_print_error($db);
     }
 }
 else
 {
-    dolibarr_syslog($db->error());
-    dolibarr_print_error($db);
+    dol_syslog($db->error());
+    dol_print_error($db);
 }
 
 ?>
diff --git a/scripts/prelevement/prelevement-verif.php b/scripts/prelevement/prelevement-verif.php
index 06f10e02a5b..740a6ac897d 100644
--- a/scripts/prelevement/prelevement-verif.php
+++ b/scripts/prelevement/prelevement-verif.php
@@ -41,14 +41,14 @@ $error = 0;
 
 $puser = new user($db, PRELEVEMENT_USER);
 $puser->fetch();
-dolibarr_syslog("Pr�l�vements effectu�s par ".$puser->fullname." [".PRELEVEMENT_USER."]");
+dol_syslog("Pr�l�vements effectu�s par ".$puser->fullname." [".PRELEVEMENT_USER."]");
 
-dolibarr_syslog("Raison sociale : ".PRELEVEMENT_RAISON_SOCIALE);
-dolibarr_syslog("Num�ro Nation Emetteur : ".PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR);
+dol_syslog("Raison sociale : ".PRELEVEMENT_RAISON_SOCIALE);
+dol_syslog("Num�ro Nation Emetteur : ".PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR);
 
-dolibarr_syslog("Code etablissement : ".PRELEVEMENT_CODE_BANQUE);
-dolibarr_syslog("Code guichet       : ". PRELEVEMENT_CODE_GUICHET);
-dolibarr_syslog("Numero compte      : ".PRELEVEMENT_NUMERO_COMPTE);
+dol_syslog("Code etablissement : ".PRELEVEMENT_CODE_BANQUE);
+dol_syslog("Code guichet       : ". PRELEVEMENT_CODE_GUICHET);
+dol_syslog("Numero compte      : ".PRELEVEMENT_NUMERO_COMPTE);
 
 /*
  *
@@ -88,13 +88,13 @@ if (!$error)
 	  $i++;
 	}            
       $db->free();
-      dolibarr_syslog("$i factures � pr�lever");
+      dol_syslog("$i factures � pr�lever");
     }
   else
     {
       $error = 1;
-      dolibarr_syslog("Erreur -1");
-      dolibarr_syslog($db->error());
+      dol_syslog("Erreur -1");
+      dol_syslog($db->error());
     }
 }
 
@@ -111,7 +111,7 @@ if (!$error)
    *
    */
   $i = 0;
-  dolibarr_syslog("D�but v�rification des RIB");
+  dol_syslog("D�but v�rification des RIB");
 
   if (sizeof($factures) > 0)
     {      
@@ -134,27 +134,27 @@ if (!$error)
 		    }
 		  else
 		    {
-		      dolibarr_syslog("Erreur de RIB societe $fact->socid $soc->nom");
+		      dol_syslog("Erreur de RIB societe $fact->socid $soc->nom");
 		    }
 		}
 	      else
 		{
-		  dolibarr_syslog("Impossible de lire la soci�t�");
+		  dol_syslog("Impossible de lire la soci�t�");
 		}
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Impossible de lire la facture");
+	      dol_syslog("Impossible de lire la facture");
 	    }
 	}
     }
   else
     {
-      dolibarr_syslog("Aucune factures a traiter");
+      dol_syslog("Aucune factures a traiter");
     }
 }
 
-dolibarr_syslog(sizeof($factures_prev)." factures sur ".sizeof($factures)." seront pr�lev�es");
+dol_syslog(sizeof($factures_prev)." factures sur ".sizeof($factures)." seront pr�lev�es");
 
 $db->close();
 
diff --git a/scripts/prelevement/prelevement.php b/scripts/prelevement/prelevement.php
index d5afd7494aa..9fa70683e23 100644
--- a/scripts/prelevement/prelevement.php
+++ b/scripts/prelevement/prelevement.php
@@ -90,13 +90,13 @@ if (!$error)
 	  $i++;
 	}            
       $db->free();
-      dolibarr_syslog("$i factures � pr�lever");
+      dol_syslog("$i factures � pr�lever");
     }
   else
     {
       $error = 1;
-      dolibarr_syslog("Erreur -1");
-      dolibarr_syslog($db->error());
+      dol_syslog("Erreur -1");
+      dol_syslog($db->error());
     }
 }
 
@@ -113,7 +113,7 @@ if (!$error)
    *
    */
   $i = 0;
-  dolibarr_syslog("D�but v�rification des RIB");
+  dol_syslog("D�but v�rification des RIB");
 
   if (sizeof($factures) > 0)
     {      
@@ -135,23 +135,23 @@ if (!$error)
 		    }
 		  else
 		    {
-		      dolibarr_syslog("Erreur de RIB societe $fact->socid $soc->nom");
+		      dol_syslog("Erreur de RIB societe $fact->socid $soc->nom");
 		    }
 		}
 	      else
 		{
-		  dolibarr_syslog("Impossible de lire la soci�t�");
+		  dol_syslog("Impossible de lire la soci�t�");
 		}
 	    }
 	  else
 	    {
-	      dolibarr_syslog("Impossible de lire la facture");
+	      dol_syslog("Impossible de lire la facture");
 	    }
 	}
     }
   else
     {
-      dolibarr_syslog("Aucune factures a traiter");
+      dol_syslog("Aucune factures a traiter");
     }
 }
 
@@ -161,7 +161,7 @@ if (!$error)
  *
  */
 
-dolibarr_syslog(sizeof($factures_prev)." factures seront pr�lev�es");
+dol_syslog(sizeof($factures_prev)." factures seront pr�lev�es");
 
 if (sizeof($factures_prev) > 0)
 {
@@ -198,7 +198,7 @@ if (sizeof($factures_prev) > 0)
       else
 	{
 	  $error++;
-	  dolibarr_syslog("Erreur recherche reference");
+	  dol_syslog("Erreur recherche reference");
 	}
 
       $ref = $ref . substr("00".($row[0]+1), -2);
@@ -223,7 +223,7 @@ if (sizeof($factures_prev) > 0)
       else
 	{
 	  $error++;
-	  dolibarr_syslog("Erreur cr�ation du bon de prelevement");
+	  dol_syslog("Erreur cr�ation du bon de prelevement");
 	}
       
     }
@@ -235,8 +235,8 @@ if (sizeof($factures_prev) > 0)
    */
   if (!$error)
     {      
-      dolibarr_syslog("D�but g�n�ration des paiements");
-      dolibarr_syslog("Nombre de factures ".sizeof($factures_prev));
+      dol_syslog("D�but g�n�ration des paiements");
+      dol_syslog("Nombre de factures ".sizeof($factures_prev));
       
       if (sizeof($factures_prev) > 0)
 	{
@@ -256,7 +256,7 @@ if (sizeof($factures_prev) > 0)
 	      if ($pai->create($user, 1) == -1)  // on appelle en no_commit
 		{
 		  $error++;
-		  dolibarr_syslog("Erreur creation paiement facture ".$fac[0]);
+		  dol_syslog("Erreur creation paiement facture ".$fac[0]);
 		}
 	      else
 		{
@@ -302,15 +302,15 @@ if (sizeof($factures_prev) > 0)
 		  else
 		    {
 		      $error++;
-		      dolibarr_syslog("Erreur mise a jour des demandes");
-		      dolibarr_syslog($db->error());
+		      dol_syslog("Erreur mise a jour des demandes");
+		      dol_syslog($db->error());
 		    }
 
 		}
 	    }
 	}
   
-      dolibarr_syslog("Fin des paiements");
+      dol_syslog("Fin des paiements");
     }
 
   if (!$error)
@@ -321,8 +321,8 @@ if (sizeof($factures_prev) > 0)
        *
        */
 
-      dolibarr_syslog("Debut prelevement");
-      dolibarr_syslog("Nombre de factures ".sizeof($factures_prev));
+      dol_syslog("Debut prelevement");
+      dol_syslog("Nombre de factures ".sizeof($factures_prev));
 
       if (sizeof($factures_prev) > 0)
 	{
@@ -342,8 +342,8 @@ if (sizeof($factures_prev) > 0)
       
 	  $bonprev->generate();  
 	}
-      dolibarr_syslog( $filebonprev ) ;
-      dolibarr_syslog("Fin prelevement");
+      dol_syslog( $filebonprev ) ;
+      dol_syslog("Fin prelevement");
     }
 
   /*
@@ -358,8 +358,8 @@ if (sizeof($factures_prev) > 0)
   if (!$db->query($sql))
     {
       $error++;
-      dolibarr_syslog("Erreur mise � jour du total");
-      dolibarr_syslog($sql);
+      dol_syslog("Erreur mise � jour du total");
+      dol_syslog($sql);
     }
 
   /*
@@ -369,12 +369,12 @@ if (sizeof($factures_prev) > 0)
   if (!$error)
     {
       $db->query("COMMIT");
-      dolibarr_syslog("COMMIT");
+      dol_syslog("COMMIT");
     }
   else
     {
       $db->query("ROLLBAK");
-      dolibarr_syslog("ROLLBACK");
+      dol_syslog("ROLLBACK");
     }
 }
 
diff --git a/scripts/user/sync_group_dolibarr2ldap.php b/scripts/user/sync_group_dolibarr2ldap.php
index 1342a50ec84..e4b560924e8 100644
--- a/scripts/user/sync_group_dolibarr2ldap.php
+++ b/scripts/user/sync_group_dolibarr2ldap.php
@@ -110,7 +110,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 return $error;
diff --git a/scripts/user/sync_user_dolibarr2ldap.php b/scripts/user/sync_user_dolibarr2ldap.php
index 4f18cffaa9f..6cdbd4737f5 100644
--- a/scripts/user/sync_user_dolibarr2ldap.php
+++ b/scripts/user/sync_user_dolibarr2ldap.php
@@ -110,7 +110,7 @@ if ($resql)
 }
 else
 {
-	dolibarr_print_error($db);
+	dol_print_error($db);
 }
 
 return $error;
-- 
GitLab