[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/ -> master.inc.php (source)

   1  <?PHP
   2  /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 

   3   * Copyright (C) 2003      Xavier Dutoit        <doli@sydesy.com>

   4   * Copyright (C) 2004      Laurent Destailleur  <eldy@users.sourceforge.net>

   5   * Copyright (C) 2004      Sebastien Di Cintio  <sdicintio@ressource-toi.org>

   6   * Copyright (C) 2004      Benoit Mortier       <benoit.mortier@opensides.be>

   7   * Copyright (C) 2005      Regis Houssin        <regis.houssin@cap-networks.com>

   8   * Copyright (C) 2005        Simon Tosser         <simon@kornog-computing.com> 

   9   *

  10   * This program is free software; you can redistribute it and/or modify

  11   * it under the terms of the GNU General Public License as published by

  12   * the Free Software Foundation; either version 2 of the License, or

  13   * (at your option) any later version.

  14   *

  15   * This program is distributed in the hope that it will be useful,

  16   * but WITHOUT ANY WARRANTY; without even the implied warranty of

  17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

  18   * GNU General Public License for more details.

  19   *

  20   * You should have received a copy of the GNU General Public License

  21   * along with this program; if not, write to the Free Software

  22   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

  23   *

  24   * $Id: master.inc.php,v 1.98.2.3 2006/02/08 00:58:47 eldy Exp $

  25   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/master.inc.php,v $

  26   */
  27  
  28  /**

  29          \file       htdocs/master.inc.php

  30          \brief      Fichier de preparation de l'environnement Dolibarr

  31          \version    $Revision: 1.98.2.3 $

  32  */
  33  
  34  define('DOL_VERSION','2.0.1');
  35  
  36  // La fonction clearstatcache ne doit pas etre appelé de manière globale car ralenti.

  37  // Elle doit etre appelée uniquement par les pages qui ont besoin d'un cache fichier vidé,

  38  // comme par exemple document.php

  39  //clearstatcache();     

  40  
  41  // Forcage du parametrage PHP error_reporting (Dolibarr non utilisable en mode error E_ALL)

  42  if (function_exists("define_syslog_variables"))
  43  {
  44      define_syslog_variables();
  45  }
  46  //error_reporting(E_ALL);

  47  error_reporting(E_ALL ^ E_NOTICE);
  48  
  49  // Test si install ok

  50  if (! @include_once("conf/conf.php"))
  51  {
  52      Header("Location: install/index.php");
  53      exit;
  54  }
  55  else
  56  {
  57      if (! isset($dolibarr_main_db_host))
  58      {
  59          Header("Location: install/index.php");
  60          exit;
  61      }
  62  }
  63  
  64  if (! isset($dolibarr_main_db_type))
  65  {    
  66    $dolibarr_main_db_type='mysql';   // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'

  67  }
  68  if (! $dolibarr_main_data_root) {
  69      // Si repertoire documents non defini, on utilise celui par defaut

  70      $dolibarr_main_data_root=ereg_replace("/htdocs","",$dolibarr_main_document_root);
  71      $dolibarr_main_data_root.="/documents";
  72  }
  73  define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root);
  74  define('DOL_DATA_ROOT', $dolibarr_main_data_root);
  75  
  76  $uri=eregi_replace('^http(s?)://','',$dolibarr_main_url_root);
  77  $pos = strstr ($uri, '/');      // $pos contient alors url sans nom domaine

  78  if ($pos == '/') $pos = '';     // si $pos vaut /, on le met a ''

  79  define('DOL_URL_ROOT', $pos);
  80  
  81  
  82  /*

  83   * Initialisation de l'objet $conf

  84   */
  85  require_once (DOL_DOCUMENT_ROOT."/conf/conf.class.php");
  86  $conf = new Conf();
  87  $conf->db->host   = $dolibarr_main_db_host;
  88  $conf->db->name   = $dolibarr_main_db_name;
  89  $conf->db->user   = $dolibarr_main_db_user;
  90  $conf->db->pass   = $dolibarr_main_db_pass;
  91  $conf->db->type   = $dolibarr_main_db_type;
  92  if (! $conf->db->type) { $conf->db->type = 'mysql'; }   // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'

  93  // Defini prefix

  94  if (isset($_SERVER["LLX_DBNAME"])) $dolibarr_main_db_prefix=$_SERVER["LLX_DBNAME"];
  95  if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_'; 
  96  $conf->db->prefix = $dolibarr_main_db_prefix;
  97  define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
  98  
  99  /*

 100   * Chargement des includes principaux

 101   */
 102  require_once(DOL_DOCUMENT_ROOT ."/lib/".$conf->db->type.".lib.php");
 103  require_once (DOL_DOCUMENT_ROOT ."/lib/functions.inc.php");
 104  require_once (DOL_DOCUMENT_ROOT ."/user.class.php");
 105  require_once (DOL_DOCUMENT_ROOT ."/menu.class.php");
 106  require_once (DOL_DOCUMENT_ROOT ."/html.form.class.php");
 107  
 108  
 109  $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
 110  if (! $db->connected) {
 111      dolibarr_print_error($db,"host=".$conf->db->host.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
 112      exit;   
 113  }
 114  
 115  
 116  $user = new User($db);
 117  
 118  /*

 119   * Definition de toutes les Constantes globales d'environnement

 120   * - En constante php (\todo a virer)

 121   * - En $conf->global->key=value

 122   */
 123  $sql = "SELECT name, value FROM ".MAIN_DB_PREFIX."const";
 124  $result = $db->query($sql);
 125  if ($result)
 126  {
 127      $numr = $db->num_rows($result);
 128      $i = 0;
 129  
 130      while ($i < $numr)
 131      {
 132          $objp = $db->fetch_object($result);
 133          $key=$objp->name;
 134          $value=$objp->value; // Pas de stripslashes (ne s'applique pas sur lecture base mais après POST quand get_magic_quotes_gpc()==1)

 135          define ("$key", $value);
 136          $conf->global->$key=$value;
 137          $i++;
 138      }
 139  }
 140  $db->free($result);
 141  
 142  /*

 143   * Nettoyage variables des gestionnaires de menu

 144   * conf->menu_top et conf->menu_left sont définis dans main.inc.php (selon user)

 145   */
 146  if (! $conf->global->MAIN_MENU_BARRETOP) $conf->global->MAIN_MENU_BARRETOP="default.php";
 147  if (! $conf->global->MAIN_MENUFRONT_BARRETOP) $conf->global->MAIN_MENUFRONT_BARRETOP="default.php";
 148  if (! $conf->global->MAIN_MENU_BARRELEFT) $conf->global->MAIN_MENU_BARRELEFT="default.php";
 149  if (! $conf->global->MAIN_MENUFRONT_BARRELEFT) $conf->global->MAIN_MENUFRONT_BARRELEFT="default.php";
 150  
 151  /*

 152   * Charge l'objet de traduction et positionne langage courant global 

 153   */
 154  if (! $conf->global->MAIN_LANG_DEFAULT) $conf->global->MAIN_LANG_DEFAULT="fr_FR";
 155  
 156  require_once (DOL_DOCUMENT_ROOT ."/translate.class.php");
 157  $langs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
 158  $langs->setDefaultLang($conf->global->MAIN_LANG_DEFAULT);
 159  $langs->setPhpLang($conf->global->MAIN_LANG_DEFAULT);
 160  
 161  
 162  /*

 163   * Pour utiliser d'autres versions des librairies externes que les

 164   * versions embarqu?es dans Dolibarr, définir les constantes adequates:

 165   * Pour FPDF:           FPDF_PATH

 166   * Pour PEAR:           PEAR_PATH

 167   * Pour PHP_WriteExcel: PHP_WRITEEXCEL_PATH

 168   * Pour PHPlot:         PHPLOT_PATH

 169   * Pour MagpieRss:      MAGPIERSS_PATH

 170   */
 171  if (! defined('FPDF_PATH'))           { define('FPDF_PATH',          DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); }
 172  if (! defined('PEAR_PATH'))           { define('PEAR_PATH',          DOL_DOCUMENT_ROOT .'/includes/pear/'); }
 173  if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
 174  if (! defined('PHPLOT_PATH'))         { define('PHPLOT_PATH',        DOL_DOCUMENT_ROOT .'/includes/phplot/'); }
 175  if (! defined('MAGPIERSS_PATH'))      { define('MAGPIERSS_PATH',     DOL_DOCUMENT_ROOT .'/includes/magpierss/'); }
 176  if (! defined('JPGRAPH_PATH'))        { define('JPGRAPH_PATH',       DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); }
 177  define('FPDF_FONTPATH', FPDF_PATH . 'font/');
 178  define('MAGPIE_DIR', MAGPIERSS_PATH);
 179  
 180  // \todo Ajouter la ligne

 181  // require_once(FPDF_PATH . "fpdf.php");

 182  // dans le fichier pdfdetail_standard_modeles du module telephonie afin de pouvoir la suivante

 183  if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(FPDF_PATH . "fpdf.php");
 184  
 185  /*

 186   * Autres parametres globaux de configurations

 187   */
 188  $conf->users->dir_output=DOL_DATA_ROOT."/users";
 189  
 190  /*

 191   * Utilise dans tous les upload de fichier

 192   * necessaire pour desactiver dans la demo

 193   */
 194  if (defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1)
 195  {
 196    $conf->upload = 1;
 197  }
 198  else
 199  {
 200    $conf->upload = 0;
 201  }
 202  
 203  
 204  /*

 205   * Definition des parametres d'activation de module et dependants des modules

 206   * Chargement d'include selon etat activation des modules

 207   */
 208  
 209  // Module bookmark4u

 210  $conf->bookmark4u->enabled=defined('MAIN_MODULE_BOOKMARK4U')?MAIN_MODULE_BOOKMARK4U:0;
 211  $conf->bookmark->enabled=defined('MAIN_MODULE_BOOKMARK')?MAIN_MODULE_BOOKMARK:0;
 212  // Module deplacement

 213  $conf->deplacement->enabled=defined("MAIN_MODULE_DEPLACEMENT")?MAIN_MODULE_DEPLACEMENT:0;
 214  // Module mailing

 215  $conf->mailing->enabled=defined("MAIN_MODULE_MAILING")?MAIN_MODULE_MAILING:0;
 216  // Module externalrss

 217  $conf->externalrss->enabled=defined("MAIN_MODULE_EXTERNALRSS")?MAIN_MODULE_EXTERNALRSS:0;
 218  // Module commande client

 219  $conf->commande->enabled=defined("MAIN_MODULE_COMMANDE")?MAIN_MODULE_COMMANDE:0;
 220  $conf->commande->dir_output=DOL_DATA_ROOT."/commande";
 221  $conf->commande->dir_images=DOL_DATA_ROOT."/commande/images";
 222  // Module expeditions

 223  $conf->expedition->enabled=defined("MAIN_MODULE_EXPEDITION")?MAIN_MODULE_EXPEDITION:0;
 224  $conf->expedition->dir_output=DOL_DATA_ROOT."/expedition";
 225  $conf->expedition->dir_images=DOL_DATA_ROOT."/expedition/images";
 226  // Module societe

 227  $conf->societe->enabled=defined("MAIN_MODULE_SOCIETE")?MAIN_MODULE_SOCIETE:0;
 228  $conf->societe->dir_output=DOL_DATA_ROOT."/societe";
 229  $conf->societe->dir_images=DOL_DATA_ROOT."/societe/images";
 230  if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $conf->societe->dir_output=SOCIETE_OUTPUTDIR; }    # Pour passer outre le rep par d?faut

 231  // Module commercial

 232  $conf->commercial->enabled=defined("MAIN_MODULE_COMMERCIAL")?MAIN_MODULE_COMMERCIAL:0;
 233  $conf->commercial->dir_output=DOL_DATA_ROOT."/rapport";
 234  // Module comptaexpert

 235  $conf->comptaexpert->enabled=defined("MAIN_MODULE_COMPTABILITE_EXPERT")?MAIN_MODULE_COMPTABILITE_EXPERT:0;
 236  $conf->comptaexpert->dir_output=DOL_DATA_ROOT."/comptaexpert";
 237  $conf->comptaexpert->dir_images=DOL_DATA_ROOT."/comptaexpert/images";
 238  // Module compta

 239  $conf->compta->enabled=defined("MAIN_MODULE_COMPTABILITE")?MAIN_MODULE_COMPTABILITE:0;
 240  $conf->compta->dir_output=DOL_DATA_ROOT."/compta";
 241  $conf->compta->dir_images=DOL_DATA_ROOT."/compta/images";
 242  // Module banque

 243  $conf->banque->enabled=defined("MAIN_MODULE_BANQUE")?MAIN_MODULE_BANQUE:0;
 244  $conf->banque->dir_output=DOL_DATA_ROOT."/banque";
 245  $conf->banque->dir_images=DOL_DATA_ROOT."/banque/images";
 246  // Module don

 247  $conf->don->enabled=defined("MAIN_MODULE_DON")?MAIN_MODULE_DON:0;
 248  $conf->don->dir_output=DOL_DATA_ROOT."/dons";
 249  $conf->don->dir_images=DOL_DATA_ROOT."/dons/images";
 250  // Module syslog

 251  $conf->syslog->enabled=defined("MAIN_MODULE_SYSLOG")?MAIN_MODULE_SYSLOG:0;
 252  // Module fournisseur

 253  $conf->fournisseur->enabled=defined("MAIN_MODULE_FOURNISSEUR")?MAIN_MODULE_FOURNISSEUR:0;
 254  // Module ficheinter

 255  $conf->fichinter->enabled=defined("MAIN_MODULE_FICHEINTER")?MAIN_MODULE_FICHEINTER:0;
 256  $conf->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter";
 257  $conf->fichinter->dir_images=DOL_DATA_ROOT."/ficheinter/images";
 258  if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $conf->fichinter->dir_output=FICHEINTER_OUTPUTDIR; }    # Pour passer outre le rep par defaut

 259  // Module adherent

 260  $conf->adherent->enabled=defined("MAIN_MODULE_ADHERENT")?MAIN_MODULE_ADHERENT:0;
 261  $conf->adherent->dir_output=DOL_DATA_ROOT."/adherent";
 262  // Module produit

 263  $conf->produit->enabled=defined("MAIN_MODULE_PRODUIT")?MAIN_MODULE_PRODUIT:0;
 264  $conf->produit->dir_output=DOL_DATA_ROOT."/produit";
 265  $conf->produit->dir_images=DOL_DATA_ROOT."/produit/images";
 266  // Module service

 267  $conf->service->enabled=defined("MAIN_MODULE_SERVICE")?MAIN_MODULE_SERVICE:0;
 268  $conf->service->dir_output=DOL_DATA_ROOT."/produit";
 269  $conf->service->dir_images=DOL_DATA_ROOT."/produit/images";
 270  // Module stock

 271  $conf->stock->enabled=defined("MAIN_MODULE_STOCK")?MAIN_MODULE_STOCK:0;
 272  // Module code barre

 273  $conf->barcode->enabled=defined("MAIN_MODULE_BARCODE")?MAIN_MODULE_BARCODE:0;
 274  // Module categorie

 275  $conf->categorie->enabled=defined("MAIN_MODULE_CATEGORIE")?MAIN_MODULE_CATEGORIE:0;
 276  // Module contrat

 277  $conf->contrat->enabled=defined("MAIN_MODULE_CONTRAT")?MAIN_MODULE_CONTRAT:0;
 278  // Module projet

 279  $conf->projet->enabled=defined("MAIN_MODULE_PROJET")?MAIN_MODULE_PROJET:0;
 280  // Module oscommerce

 281  $conf->boutique->enabled=defined("MAIN_MODULE_BOUTIQUE")?MAIN_MODULE_BOUTIQUE:0;
 282  $conf->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0;
 283  $conf->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
 284  // Module postnuke

 285  $conf->postnuke->enabled=defined("MAIN_MODULE_POSTNUKE")?MAIN_MODULE_POSTNUKE:0;
 286  // Module clicktodial

 287  $conf->clicktodial->enabled=defined("MAIN_MODULE_CLICKTODIAL")?MAIN_MODULE_CLICKTODIAL:0;
 288  // Module prelevement

 289  $conf->prelevement->enabled=defined("MAIN_MODULE_PRELEVEMENT")?MAIN_MODULE_PRELEVEMENT:0;
 290  $conf->prelevement->dir_output=DOL_DATA_ROOT."/prelevement";
 291  $conf->prelevement->dir_images=DOL_DATA_ROOT."/prelevement/images";
 292  // Module webcal

 293  $conf->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0;
 294  $conf->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'mysql';
 295  $conf->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:'';
 296  $conf->webcal->db->user=defined('PHPWEBCALENDAR_USER')?PHPWEBCALENDAR_USER:'';
 297  $conf->webcal->db->pass=defined('PHPWEBCALENDAR_PASS')?PHPWEBCALENDAR_PASS:'';
 298  $conf->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
 299  // Module facture

 300  $conf->facture->enabled=defined("MAIN_MODULE_FACTURE")?MAIN_MODULE_FACTURE:0;
 301  // \todo Ajouter la ligne

 302  // require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");

 303  // dans le fichier facturation-emission.php du module telephonie afin de pouvoir supprimer la suivante

 304  if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once (DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
 305  $conf->facture->dir_output=DOL_DATA_ROOT."/facture";
 306  $conf->facture->dir_images=DOL_DATA_ROOT."/facture/images";
 307  if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $conf->facture->dir_output=FAC_OUTPUTDIR; }                # Pour passer outre le rep par defaut

 308  // Module propal

 309  $conf->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0;
 310  if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
 311  $conf->propal->dir_output=DOL_DATA_ROOT."/propale";
 312  $conf->propal->dir_images=DOL_DATA_ROOT."/propale/images";
 313  if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $conf->propal->dir_output=PROPALE_OUTPUTDIR; }    # Pour passer outre le rep par defaut

 314  // Module telephonie

 315  $conf->telephonie->enabled=defined("MAIN_MODULE_TELEPHONIE")?MAIN_MODULE_TELEPHONIE:0;
 316  $conf->telephonie->dir_output=DOL_DATA_ROOT."/telephonie";
 317  $conf->telephonie->dir_images=DOL_DATA_ROOT."/telephonie/images";
 318  // Module energie

 319  $conf->energie->enabled=defined("MAIN_MODULE_ENERGIE")?MAIN_MODULE_ENERGIE:0;
 320  // Module domaine

 321  $conf->domaine->enabled=0;
 322  // Module voyage

 323  $conf->voyage->enabled=0;
 324  // Module actionscomm

 325  $conf->actionscomm->dir_output=DOL_DATA_ROOT."/action";
 326  // Module export

 327  $conf->export->enabled=0;
 328  
 329  
 330  /*

 331   * Modification de quelques variable de conf en fonction des Constantes

 332   */
 333  
 334  // conf->use_preview_tabs

 335  $conf->use_preview_tabs=1;
 336  if (isset($conf->global->MAIN_USE_PREVIEW_TABS)) $conf->use_preview_tabs=$conf->global->MAIN_USE_PREVIEW_TABS;
 337  
 338  // conf->use_javascript

 339  $conf->use_javascript=1;
 340  if (isset($conf->global->MAIN_DISABLE_JAVASCRIPT)) $conf->use_javascript=! $conf->global->MAIN_DISABLE_JAVASCRIPT;
 341  
 342  // conf->monnaie

 343  if (! $conf->global->MAIN_MONNAIE) $conf->global->MAIN_MONNAIE='EUR';    
 344  $conf->monnaie=$conf->global->MAIN_MONNAIE;
 345  
 346  // $conf->compta->mode = Option du module Compta: Defini le mode de calcul des etats comptables (CA,...)

 347  $conf->compta->mode = 'RECETTES-DEPENSES';  // Par défaut

 348  if (defined('COMPTA_MODE') && COMPTA_MODE) {
 349      // Peut etre 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'

 350      $conf->compta->mode = COMPTA_MODE;
 351  }
 352  
 353  // $conf->defaulttx

 354  if (defined('FACTURE_TVAOPTION') && FACTURE_TVAOPTION == 'franchise') {
 355      $conf->defaulttx='0';        // Taux par défaut des factures clients

 356  }
 357  else {
 358      $conf->defaulttx='';        // Pas de taux par défaut des factures clients, le premier sera pris

 359  }
 360  
 361  // $conf->liste_limit = constante de taille maximale des listes

 362  if (! $conf->global->SIZE_LISTE_LIMIT) $conf->global->SIZE_LISTE_LIMIT=20;
 363  $conf->liste_limit=$conf->global->SIZE_LISTE_LIMIT;
 364  
 365  // $conf->produit->limit_size = constante de taille maximale des select de produit

 366  if (! isset($conf->global->PRODUIT_LIMIT_SIZE)) $conf->global->PRODUIT_LIMIT_SIZE=50;
 367  $conf->produit->limit_size=$conf->global->PRODUIT_LIMIT_SIZE;
 368  
 369  // $conf->theme et $conf->css

 370  if (! $conf->global->MAIN_THEME) $conf->global->MAIN_THEME="eldy";
 371  $conf->theme=$conf->global->MAIN_THEME;
 372  $conf->css  = "theme/".$conf->theme."/".$conf->theme.".css";
 373  
 374  // $conf->email_from          = email pour envoi par Dolibarr des mails auto (notifications, ...)

 375  // $conf->mailing->email_from = email pour envoi par Dolibarr des mailings

 376  $conf->email_from="dolibarr-robot@domain.com";
 377  if (defined('MAIN_EMAIL_FROM'))
 378  {
 379      $conf->email_from=MAIN_EMAIL_FROM;
 380  }
 381  if (defined('MAILING_EMAIL_FROM'))
 382  {
 383      $conf->mailing->email_from=MAILING_EMAIL_FROM;
 384  }
 385  else $conf->mailing->email_from=$conf->email_from;
 386  
 387  // $conf->adherent->email_resil, ...

 388  if (defined("MAIN_MAIL_RESIL"))
 389  {
 390    $conf->adherent->email_resil=MAIN_MAIL_RESIL;
 391  }
 392  if (defined("MAIN_MAIL_RESIL_SUBJECT"))
 393  {
 394    $conf->adherent->email_resil_subject=MAIN_MAIL_RESIL_SUBJECT;
 395  }
 396  if (defined("MAIN_MAIL_VALID"))
 397  {
 398    $conf->adherent->email_valid=MAIN_MAIL_VALID;
 399  }
 400  if (defined("MAIN_MAIL_VALID_SUBJECT"))
 401  {
 402    $conf->adherent->email_valid_subject=MAIN_MAIL_VALID_SUBJECT;
 403  }
 404  if (defined("MAIN_MAIL_EDIT"))
 405  {
 406    $conf->adherent->email_edit=MAIN_MAIL_EDIT;
 407  }
 408  if (defined("MAIN_MAIL_EDIT_SUBJECT"))
 409  {
 410    $conf->adherent->email_edit_subject=MAIN_MAIL_EDIT_SUBJECT;
 411  }
 412  if (defined("MAIN_MAIL_NEW"))
 413  {
 414    $conf->adherent->email_new=MAIN_MAIL_NEW;
 415  }
 416  if (defined("MAIN_MAIL_NEW_SUBJECT"))
 417  {
 418    $conf->adherent->email_new_subject=MAIN_MAIL_NEW_SUBJECT;
 419  }
 420  
 421  // Format de la date

 422  // \todo Mettre format dans fichier langue

 423  $conf->format_date_text_short="%d %b %Y";
 424  $conf->format_date_short="%d/%m/%Y";
 425  
 426  
 427  /* 

 428   * Creation objet mysoc

 429   * Objet Societe qui contient carac de l'institution gérée par Dolibarr.

 430   */
 431  require_once (DOL_DOCUMENT_ROOT ."/societe.class.php");
 432  $mysoc=new Societe($db);
 433  $mysoc->id=0;
 434  $mysoc->nom=$conf->global->MAIN_INFO_SOCIETE_NOM;
 435  $mysoc->adresse=$conf->global->MAIN_INFO_SOCIETE_ADRESSE;
 436  $mysoc->cp=$conf->global->MAIN_INFO_SOCIETE_CP;
 437  $mysoc->ville=$conf->global->MAIN_INFO_SOCIETE_VILLE;
 438  $mysoc->pays_code=$conf->global->MAIN_INFO_SOCIETE_PAYS;
 439  $mysoc->tel=$conf->global->MAIN_INFO_SOCIETE_TEL;
 440  $mysoc->fax=$conf->global->MAIN_INFO_SOCIETE_FAX;
 441  $mysoc->url=$conf->global->MAIN_INFO_SOCIETE_WEB;
 442  $mysoc->siren=$conf->global->MAIN_INFO_SIREN;
 443  $mysoc->siret=$conf->global->MAIN_INFO_SIRET;
 444  $mysoc->ape=$conf->global->MAIN_INFO_APE;
 445  $mysoc->rcs=$conf->global->MAIN_INFO_RCS;
 446  $mysoc->tvaintra=$conf->global->MAIN_INFO_TVAINTRA;
 447  $mysoc->capital=$conf->global->MAIN_INFO_CAPITAL;
 448  $mysoc->forme_juridique_code=$conf->global->MAIN_INFO_FORME_JURIDIQUE;
 449  $mysoc->email=$conf->global->MAIN_INFO_SOCIETE_MAIL;
 450  
 451  
 452  /* \todo Ajouter une option Gestion de la TVA dans le module compta qui permet de désactiver la fonction TVA

 453   * (pour particuliers ou libéraux en franchise)

 454   * En attendant, valeur forcée à 1

 455   */
 456  $conf->compta->tva=1;
 457  
 458  // Delais de tolerance des alertes

 459  $conf->actions->warning_delay=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
 460  $conf->commande->traitement->warning_delay=$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS*24*60*60;
 461  $conf->propal->cloture->warning_delay=$conf->global->MAIN_DELAY_PROPALS_TO_CLOSE*24*60*60;
 462  $conf->propal->facturation->warning_delay=$conf->global->MAIN_DELAY_PROPALS_TO_BILL*24*60*60;
 463  $conf->facture->fournisseur->warning_delay=$conf->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY*24*60*60;
 464  $conf->facture->client->warning_delay=$conf->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED*24*60*60;
 465  $conf->contrat->services->inactifs->warning_delay=$conf->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES*24*60*60;
 466  $conf->contrat->services->expires->warning_delay=$conf->global->MAIN_DELAY_RUNNING_SERVICES*24*60*60;
 467  $conf->adherent->cotisation->warning_delay=$conf->global->MAIN_DELAY_MEMBERS*24*60*60;
 468  $conf->bank->rappro->warning_delay=$conf->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE*24*60*60;
 469  
 470  
 471  /*

 472   */
 473  $bc[0]="class=\"impair\"";
 474  $bc[1]="class=\"pair\"";
 475  $yesno[0]="no";
 476  $yesno[1]="yes";
 477  
 478  if ( ! defined('MENTION_NPR') ) define('MENTION_NPR','(npr)');
 479  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics