2006-02-03 17:42:39 +01:00
|
|
|
|
<?PHP
|
2007-04-07 13:54:20 +02:00
|
|
|
|
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2006-02-03 17:42:39 +01:00
|
|
|
|
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
2008-03-12 22:26:53 +01:00
|
|
|
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
2006-02-03 17:42:39 +01:00
|
|
|
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
|
|
|
|
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
2007-11-01 21:39:36 +01:00
|
|
|
|
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
2006-02-03 17:42:39 +01:00
|
|
|
|
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
2006-02-03 18:48:47 +01:00
|
|
|
|
* Copyright (C) 2006 Andre Cianfarani <andre.cianfarani@acdeveloppement.net>
|
2006-02-03 17:42:39 +01:00
|
|
|
|
*
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2007-04-07 13:54:20 +02:00
|
|
|
|
\file htdocs/master.inc.php
|
2008-04-19 23:52:14 +02:00
|
|
|
|
\brief File that define environment for install pages
|
2008-01-20 22:53:43 +01:00
|
|
|
|
\version $Id$
|
2006-02-03 17:42:39 +01:00
|
|
|
|
*/
|
|
|
|
|
|
|
2008-08-25 09:21:20 +02:00
|
|
|
|
define('DOL_VERSION','2.5-dev'); // Also defined in htdocs/install/inc.php
|
2006-11-07 23:56:04 +01:00
|
|
|
|
define('EURO',chr(128));
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
2007-05-10 20:25:19 +02:00
|
|
|
|
// La fonction clearstatcache ne doit pas etre appel<65>e de mani<6E>re globale car ralenti.
|
2006-02-03 19:08:46 +01:00
|
|
|
|
// Elle doit etre appel<65>e uniquement par les pages qui ont besoin d'un cache fichier vid<69>
|
2006-02-03 17:42:39 +01:00
|
|
|
|
// comme par exemple document.php
|
|
|
|
|
|
//clearstatcache();
|
|
|
|
|
|
|
2007-05-10 20:25:19 +02:00
|
|
|
|
// Definition des constantes syslog
|
2006-02-03 17:42:39 +01:00
|
|
|
|
if (function_exists("define_syslog_variables"))
|
|
|
|
|
|
{
|
|
|
|
|
|
define_syslog_variables();
|
|
|
|
|
|
}
|
2007-05-10 20:25:19 +02:00
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
// Pour PHP sans syslog (comme sous Windows)
|
|
|
|
|
|
define('LOG_EMERG',0);
|
|
|
|
|
|
define('LOG_ALERT',1);
|
|
|
|
|
|
define('LOG_CRIT',2);
|
|
|
|
|
|
define('LOG_ERR',3);
|
|
|
|
|
|
define('LOG_WARNING',4);
|
|
|
|
|
|
define('LOG_NOTICE',5);
|
|
|
|
|
|
define('LOG_INFO',6);
|
|
|
|
|
|
define('LOG_DEBUG',7);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Forcage du parametrage PHP error_reporting (Dolibarr non utilisable en mode error E_ALL)
|
2007-10-24 01:28:13 +02:00
|
|
|
|
//error_reporting(E_ALL);
|
2006-02-03 17:42:39 +01:00
|
|
|
|
error_reporting(E_ALL ^ E_NOTICE);
|
|
|
|
|
|
|
2008-03-17 03:53:48 +01:00
|
|
|
|
|
|
|
|
|
|
// Include configuration
|
2008-03-17 03:53:48 +01:00
|
|
|
|
$result=@include_once("conf/conf.php");
|
2008-03-17 23:34:09 +01:00
|
|
|
|
if (! $result && $_SERVER["GATEWAY_INTERFACE"])
|
|
|
|
|
|
{
|
|
|
|
|
|
// If install not done and we are in a web session
|
|
|
|
|
|
header("Location: install/index.php");
|
|
|
|
|
|
exit;
|
|
|
|
|
|
}
|
2008-03-17 03:53:48 +01:00
|
|
|
|
if (empty($dolibarr_main_db_host))
|
2006-02-03 17:42:39 +01:00
|
|
|
|
{
|
2008-03-17 03:53:48 +01:00
|
|
|
|
print 'Error: Dolibarr setup was run but was not completed.<br>'."\n";
|
2008-03-14 13:54:33 +01:00
|
|
|
|
print 'Please, run <a href="install/index.php">Dolibarr install process</a> until the end...'."\n";
|
2008-03-17 03:53:48 +01:00
|
|
|
|
exit;
|
2006-02-03 17:42:39 +01:00
|
|
|
|
}
|
2008-03-10 23:38:43 +01:00
|
|
|
|
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
|
|
|
|
|
if (empty($dolibarr_main_data_root))
|
|
|
|
|
|
{
|
|
|
|
|
|
// Si repertoire documents non defini, on utilise celui par defaut
|
|
|
|
|
|
$dolibarr_main_data_root=ereg_replace("/htdocs","",$dolibarr_main_document_root);
|
|
|
|
|
|
$dolibarr_main_data_root.="/documents";
|
2006-02-03 17:42:39 +01:00
|
|
|
|
}
|
2007-02-10 15:36:01 +01:00
|
|
|
|
define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem pages php (htdocs)
|
|
|
|
|
|
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem donnes (documents)
|
|
|
|
|
|
define('DOL_MAIN_URL_ROOT', $dolibarr_main_url_root); // URL racine absolue
|
2006-02-03 17:42:39 +01:00
|
|
|
|
$uri=eregi_replace('^http(s?)://','',$dolibarr_main_url_root);
|
|
|
|
|
|
$pos = strstr ($uri, '/'); // $pos contient alors url sans nom domaine
|
|
|
|
|
|
if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
|
2007-02-10 15:36:01 +01:00
|
|
|
|
define('DOL_URL_ROOT', $pos); // URL racine relative
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
2008-03-10 00:14:08 +01:00
|
|
|
|
// Special code for alternate dev directories (Used on dev env only)
|
|
|
|
|
|
if (! empty($dolibarr_main_document_root_bis)) define('DOL_DOCUMENT_ROOT_BIS', $dolibarr_main_document_root_bis);
|
|
|
|
|
|
|
2007-10-07 21:30:03 +02:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Controle validite fichier conf
|
|
|
|
|
|
*/
|
2008-04-05 16:18:13 +02:00
|
|
|
|
if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"))
|
2007-10-07 21:30:03 +02:00
|
|
|
|
{
|
|
|
|
|
|
print "Error: Dolibarr config file content seems to be not correctly defined.<br>\n";
|
|
|
|
|
|
print "Please run dolibarr setup by calling page <b>/install</b>.<br>\n";
|
|
|
|
|
|
exit;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-02-03 17:42:39 +01:00
|
|
|
|
/*
|
2006-06-03 01:20:36 +02:00
|
|
|
|
* Creation objet $conf
|
2006-02-03 17:42:39 +01:00
|
|
|
|
*/
|
2007-04-25 13:45:01 +02:00
|
|
|
|
|
|
|
|
|
|
// on d<>code le mot de passe de la base si besoin
|
2008-04-09 20:13:45 +02:00
|
|
|
|
require_once(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"); // Need 970ko memory (1.1 in 2.2)
|
2008-04-29 23:13:49 +02:00
|
|
|
|
if (! empty($dolibarr_main_db_encrypted_pass))
|
|
|
|
|
|
{
|
|
|
|
|
|
require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php");
|
|
|
|
|
|
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
|
|
|
|
|
|
}
|
2008-04-09 20:13:45 +02:00
|
|
|
|
//print memory_get_usage();
|
2008-01-10 18:35:45 +01:00
|
|
|
|
|
2006-02-03 17:42:39 +01:00
|
|
|
|
require_once(DOL_DOCUMENT_ROOT."/conf/conf.class.php");
|
2007-04-25 13:45:01 +02:00
|
|
|
|
|
2006-02-03 17:42:39 +01:00
|
|
|
|
$conf = new Conf();
|
2007-07-13 14:57:07 +02:00
|
|
|
|
// Identifiant propres au serveur base de donnee
|
2006-02-03 17:42:39 +01:00
|
|
|
|
$conf->db->host = $dolibarr_main_db_host;
|
2008-03-10 23:38:43 +01:00
|
|
|
|
if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=0; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
|
|
|
|
|
$conf->db->port = $dolibarr_main_db_port;
|
2006-02-03 17:42:39 +01:00
|
|
|
|
$conf->db->name = $dolibarr_main_db_name;
|
|
|
|
|
|
$conf->db->user = $dolibarr_main_db_user;
|
|
|
|
|
|
$conf->db->pass = $dolibarr_main_db_pass;
|
2008-03-10 23:38:43 +01:00
|
|
|
|
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
2006-02-03 17:42:39 +01:00
|
|
|
|
$conf->db->type = $dolibarr_main_db_type;
|
2007-12-15 19:44:25 +01:00
|
|
|
|
if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set='latin1';
|
2007-08-01 12:13:08 +02:00
|
|
|
|
$conf->db->character_set=$dolibarr_main_db_character_set;
|
2007-12-15 19:44:25 +01:00
|
|
|
|
if (empty($dolibarr_main_db_prefix)) $dolibarr_main_db_prefix='llx_';
|
2006-02-03 17:42:39 +01:00
|
|
|
|
$conf->db->prefix = $dolibarr_main_db_prefix;
|
2007-12-21 20:14:11 +01:00
|
|
|
|
if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation='latin1_swedish_ci';
|
|
|
|
|
|
$conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation;
|
2007-07-13 14:57:07 +02:00
|
|
|
|
// Identifiant autres
|
2007-06-02 17:12:49 +02:00
|
|
|
|
$conf->main_authentication = $dolibarr_main_authentication;
|
2008-04-06 22:17:11 +02:00
|
|
|
|
// Force https
|
|
|
|
|
|
$conf->main_force_https = $dolibarr_main_force_https;
|
2008-10-09 19:29:32 +02:00
|
|
|
|
// Define charset for HTML Output
|
|
|
|
|
|
$charset='ISO-8859-1'; // If not output format found in any conf file
|
|
|
|
|
|
if (empty($character_set_client)) $character_set_client=$charset;
|
|
|
|
|
|
$conf->character_set_client=strtoupper($character_set_client);
|
2007-05-25 22:02:23 +02:00
|
|
|
|
|
|
|
|
|
|
// Defini prefix
|
|
|
|
|
|
if (isset($_SERVER["LLX_DBNAME"])) $dolibarr_main_db_prefix=$_SERVER["LLX_DBNAME"];
|
2006-02-03 17:42:39 +01:00
|
|
|
|
define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
|
|
|
|
|
|
|
2006-09-17 17:51:52 +02:00
|
|
|
|
// Detection browser
|
|
|
|
|
|
if (isset($_SERVER["HTTP_USER_AGENT"]))
|
|
|
|
|
|
{
|
2007-04-07 13:54:20 +02:00
|
|
|
|
if (eregi('firefox',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
|
|
|
|
|
|
if (eregi('iceweasel',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
|
2006-09-17 17:51:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2007-12-30 19:47:45 +01:00
|
|
|
|
// Chargement des includes principaux de librairies communes
|
2008-01-10 18:35:45 +01:00
|
|
|
|
if (! defined('NOREQUIREUSER')) require_once(DOL_DOCUMENT_ROOT ."/user.class.php"); // Need 500ko memory
|
2007-09-09 13:16:33 +02:00
|
|
|
|
if (! defined('NOREQUIRETRAN')) require_once(DOL_DOCUMENT_ROOT ."/translate.class.php");
|
|
|
|
|
|
if (! defined('NOREQUIRESOC')) require_once(DOL_DOCUMENT_ROOT ."/societe.class.php");
|
2007-12-30 19:47:45 +01:00
|
|
|
|
if (! defined('NOREQUIREDB')) require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php");
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
2007-05-24 11:26:28 +02:00
|
|
|
|
/*
|
2007-12-30 19:47:45 +01:00
|
|
|
|
* Creation objet $langs (must be before all other code)
|
2007-05-24 11:26:28 +02:00
|
|
|
|
*/
|
2007-09-09 13:16:33 +02:00
|
|
|
|
if (! defined('NOREQUIRETRAN'))
|
|
|
|
|
|
{
|
2008-03-31 17:17:39 +02:00
|
|
|
|
$langs = new Translate("",$conf); // A mettre apres lecture de la conf
|
2007-09-09 13:16:33 +02:00
|
|
|
|
}
|
2007-05-23 23:10:11 +02:00
|
|
|
|
|
2006-06-03 01:20:36 +02:00
|
|
|
|
/*
|
|
|
|
|
|
* Creation objet $db
|
|
|
|
|
|
*/
|
2007-09-09 13:16:33 +02:00
|
|
|
|
if (! defined('NOREQUIREDB'))
|
|
|
|
|
|
{
|
2008-03-10 23:38:43 +01:00
|
|
|
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
2007-09-15 21:36:18 +02:00
|
|
|
|
|
|
|
|
|
|
if ($db->error)
|
2007-09-09 13:16:33 +02:00
|
|
|
|
{
|
2008-03-10 23:38:43 +01:00
|
|
|
|
dolibarr_print_error($db,"host=".$conf->db->host.", port=".$conf->db->port.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
|
2007-09-15 21:36:18 +02:00
|
|
|
|
exit;
|
2007-09-09 13:16:33 +02:00
|
|
|
|
}
|
2006-02-03 17:42:39 +01:00
|
|
|
|
}
|
2008-08-29 21:01:20 +02:00
|
|
|
|
// Now database connexion is known we can forget password
|
|
|
|
|
|
$dolibarr_main_db_pass='';
|
|
|
|
|
|
$conf->db->pass='';
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
|
|
|
|
|
/*
|
2006-06-03 01:20:36 +02:00
|
|
|
|
* Creation objet $user
|
2006-02-03 17:42:39 +01:00
|
|
|
|
*/
|
2007-09-09 13:16:33 +02:00
|
|
|
|
if (! defined('NOREQUIREUSER'))
|
|
|
|
|
|
{
|
|
|
|
|
|
$user = new User($db);
|
|
|
|
|
|
}
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
|
|
|
|
|
/*
|
2006-06-03 01:20:36 +02:00
|
|
|
|
* Chargement objet $conf
|
2007-10-07 16:49:36 +02:00
|
|
|
|
* After this, all parameters conf->global->CONSTANTS are loaded
|
2006-02-03 17:42:39 +01:00
|
|
|
|
*/
|
2007-09-09 13:16:33 +02:00
|
|
|
|
if (! defined('NOREQUIREDB'))
|
|
|
|
|
|
{
|
|
|
|
|
|
$conf->setValues($db);
|
|
|
|
|
|
}
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
|
|
|
|
|
/*
|
2008-07-15 20:09:22 +02:00
|
|
|
|
* Set default language (must be after the setValues of $conf)
|
2006-06-03 01:20:36 +02:00
|
|
|
|
*/
|
2007-09-09 13:16:33 +02:00
|
|
|
|
if (! defined('NOREQUIRETRAN'))
|
|
|
|
|
|
{
|
|
|
|
|
|
$langs->setDefaultLang($conf->global->MAIN_LANG_DEFAULT);
|
2008-07-15 20:09:22 +02:00
|
|
|
|
$langs->setPhpLang();
|
2007-09-09 13:16:33 +02:00
|
|
|
|
}
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Pour utiliser d'autres versions des librairies externes que les
|
2006-02-03 19:11:35 +01:00
|
|
|
|
* versions embarqu<EFBFBD>es dans Dolibarr, d<EFBFBD>finir les constantes adequates:
|
2006-02-03 17:42:39 +01:00
|
|
|
|
* Pour FPDF: FPDF_PATH
|
|
|
|
|
|
* Pour PHP_WriteExcel: PHP_WRITEEXCEL_PATH
|
|
|
|
|
|
* Pour MagpieRss: MAGPIERSS_PATH
|
2006-08-13 21:07:43 +02:00
|
|
|
|
* Pour PHPlot: PHPLOT_PATH
|
2006-07-13 14:58:59 +02:00
|
|
|
|
* Pour JPGraph: JPGRAPH_PATH
|
|
|
|
|
|
* Pour NuSOAP: NUSOAP_PATH
|
2006-07-20 10:57:10 +02:00
|
|
|
|
* Pour TCPDF: TCPDF_PATH
|
2006-02-03 17:42:39 +01:00
|
|
|
|
*/
|
2006-06-18 03:34:15 +02:00
|
|
|
|
// Les path racines
|
2006-02-03 17:42:39 +01:00
|
|
|
|
if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); }
|
2007-08-21 11:23:15 +02:00
|
|
|
|
if (! defined('FPDFI_PATH')) { define('FPDFI_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdfi/'); }
|
2006-02-03 17:42:39 +01:00
|
|
|
|
if (! defined('MAGPIERSS_PATH')) { define('MAGPIERSS_PATH', DOL_DOCUMENT_ROOT .'/includes/magpierss/'); }
|
|
|
|
|
|
if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); }
|
2006-07-13 14:58:59 +02:00
|
|
|
|
if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', DOL_DOCUMENT_ROOT .'/includes/nusoap/lib/'); }
|
2008-01-27 00:23:39 +01:00
|
|
|
|
if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
|
|
|
|
|
|
if (! defined('PHPEXCELREADER')) { define('PHPEXCELREADER', DOL_DOCUMENT_ROOT .'/includes/phpexcelreader/'); }
|
2006-06-18 03:34:15 +02:00
|
|
|
|
// Les autres path
|
2006-07-21 10:54:24 +02:00
|
|
|
|
if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); }
|
2006-06-18 03:34:15 +02:00
|
|
|
|
if (! defined('MAGPIE_DIR')) { define('MAGPIE_DIR', MAGPIERSS_PATH); }
|
2006-08-20 01:00:53 +02:00
|
|
|
|
if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', $conf->externalrss->dir_temp); }
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Creation objet mysoc
|
2006-02-03 19:08:46 +01:00
|
|
|
|
* Objet Societe qui contient carac de l'institution g<EFBFBD>r<EFBFBD> par Dolibarr.
|
2006-02-03 17:42:39 +01:00
|
|
|
|
*/
|
2007-09-09 13:16:33 +02:00
|
|
|
|
if (! defined('NOREQUIRESOC'))
|
2006-06-16 02:33:04 +02:00
|
|
|
|
{
|
2007-09-09 13:16:33 +02:00
|
|
|
|
$mysoc=new Societe($db);
|
|
|
|
|
|
$mysoc->id=0;
|
|
|
|
|
|
$mysoc->nom=$conf->global->MAIN_INFO_SOCIETE_NOM;
|
|
|
|
|
|
$mysoc->adresse=$conf->global->MAIN_INFO_SOCIETE_ADRESSE;
|
|
|
|
|
|
$mysoc->cp=$conf->global->MAIN_INFO_SOCIETE_CP;
|
|
|
|
|
|
$mysoc->ville=$conf->global->MAIN_INFO_SOCIETE_VILLE;
|
|
|
|
|
|
// Si dans MAIN_INFO_SOCIETE_PAYS on a un id de pays, on recupere code
|
|
|
|
|
|
if (is_numeric($conf->global->MAIN_INFO_SOCIETE_PAYS))
|
|
|
|
|
|
{
|
|
|
|
|
|
$mysoc->pays_id=$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
|
|
|
|
|
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
|
|
|
|
|
|
$sql .= " WHERE rowid = ".$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
|
|
|
|
|
$result=$db->query($sql);
|
|
|
|
|
|
if ($result)
|
|
|
|
|
|
{
|
|
|
|
|
|
$obj = $db->fetch_object();
|
|
|
|
|
|
$mysoc->pays_code=$obj->code;
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
dolibarr_print_error($db);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// Si dans MAIN_INFO_SOCIETE_PAYS on a deja un code, tout est fait
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
$mysoc->pays_code=$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
|
|
|
|
|
}
|
|
|
|
|
|
$mysoc->tel=$conf->global->MAIN_INFO_SOCIETE_TEL;
|
|
|
|
|
|
$mysoc->fax=$conf->global->MAIN_INFO_SOCIETE_FAX;
|
|
|
|
|
|
$mysoc->url=$conf->global->MAIN_INFO_SOCIETE_WEB;
|
|
|
|
|
|
// Anciens id prof
|
|
|
|
|
|
$mysoc->siren=$conf->global->MAIN_INFO_SIREN;
|
|
|
|
|
|
$mysoc->siret=$conf->global->MAIN_INFO_SIRET;
|
|
|
|
|
|
$mysoc->ape=$conf->global->MAIN_INFO_APE;
|
|
|
|
|
|
$mysoc->rcs=$conf->global->MAIN_INFO_RCS;
|
|
|
|
|
|
// Id prof g<>n<EFBFBD>riques
|
|
|
|
|
|
$mysoc->profid1=$conf->global->MAIN_INFO_SIREN;
|
|
|
|
|
|
$mysoc->profid2=$conf->global->MAIN_INFO_SIRET;
|
|
|
|
|
|
$mysoc->profid3=$conf->global->MAIN_INFO_APE;
|
|
|
|
|
|
$mysoc->profid4=$conf->global->MAIN_INFO_RCS;
|
|
|
|
|
|
$mysoc->tva_assuj=$conf->global->FACTURE_TVAOPTION;
|
|
|
|
|
|
$mysoc->tva_intra=$conf->global->MAIN_INFO_TVAINTRA;
|
|
|
|
|
|
$mysoc->capital=$conf->global->MAIN_INFO_CAPITAL;
|
|
|
|
|
|
$mysoc->forme_juridique_code=$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE;
|
|
|
|
|
|
$mysoc->email=$conf->global->MAIN_INFO_SOCIETE_MAIL;
|
|
|
|
|
|
$mysoc->adresse_full=$mysoc->adresse."\n".$mysoc->cp." ".$mysoc->ville;
|
|
|
|
|
|
$mysoc->logo=$conf->global->MAIN_INFO_SOCIETE_LOGO;
|
|
|
|
|
|
$mysoc->logo_small=$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
|
|
|
|
|
|
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
2006-06-16 02:33:04 +02:00
|
|
|
|
}
|
2006-02-03 17:42:39 +01:00
|
|
|
|
|
2006-06-03 01:20:36 +02:00
|
|
|
|
// Sert uniquement dans module telephonie
|
2006-02-03 17:42:39 +01:00
|
|
|
|
$yesno[0]="no";
|
|
|
|
|
|
$yesno[1]="yes";
|
|
|
|
|
|
|
2008-04-03 01:54:18 +02:00
|
|
|
|
if ( ! defined('MAIN_LABEL_MENTION_NPR') ) define('MAIN_LABEL_MENTION_NPR','NPR');
|
2008-01-10 23:21:18 +01:00
|
|
|
|
|
2006-05-05 22:01:58 +02:00
|
|
|
|
?>
|