2002-04-30 12:56:25 +02:00
< ? PHP
2004-02-07 19:00:03 +01:00
/* Copyright ( C ) 2002 - 2004 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2004-01-28 01:25:15 +01:00
* Copyright ( C ) 2003 Xavier Dutoit < doli @ sydesy . com >
* Copyright ( C ) 2004 Laurent Destailleur < eldy @ users . sourceforge . net >
2002-04-30 12:56:25 +02: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 .
*
2002-06-26 02:03:47 +02:00
* $Id $
* $Source $
*
2002-04-30 12:56:25 +02:00
*/
2003-11-03 17:53:33 +01:00
define ( 'DOL_VERSION' , '1.2.0-DEV' );
2003-06-18 15:56:26 +02:00
2004-02-11 16:39:50 +01:00
if ( ! @ include_once ( " conf/conf.php " ))
2003-06-18 15:56:26 +02:00
{
2004-02-13 14:40:44 +01:00
Header ( " Location: install/index.php " );
2004-02-11 16:39:50 +01:00
}
else
{
if ( ! isset ( $dolibarr_main_db_host ))
{
2004-02-13 14:40:44 +01:00
Header ( " Location: install/index.php " );
2004-02-11 16:39:50 +01:00
}
2003-06-18 15:56:26 +02:00
}
2004-06-30 18:29:34 +02:00
/*
*
*
*
$GLOBALS [ 'sessionid' ] = isset ( $_GET [ 'sessionid' ]) ? $_GET [ 'sessionid' ] : $_COOKIE [ 'sessionid' ];
if ( ! $GLOBALS [ 'sessionid' ])
{
Header ( 'Location: /login.php' );
exit ;
}
*
*
*
*/
2003-04-13 15:09:07 +02:00
2003-06-18 15:56:26 +02:00
define ( 'DOL_DOCUMENT_ROOT' , $dolibarr_main_document_root );
2004-07-20 15:20:41 +02:00
define ( 'DOL_DATA_ROOT' , $dolibarr_main_data_root );
2003-06-18 18:26:34 +02:00
if ( strtolower ( substr ( $dolibarr_main_url_root , 0 , 7 )) == 'http://' )
{
$uri = substr ( $dolibarr_main_url_root , 7 );
}
if ( strtolower ( substr ( $dolibarr_main_url_root , 0 , 7 )) == 'https:/' )
{
$uri = substr ( $dolibarr_main_url_root , 8 );
}
2003-06-18 18:32:23 +02:00
$pos = strstr ( $uri , '/' );
if ( $pos == '/' )
{
$pos = '' ;
}
2003-06-18 18:26:34 +02:00
define ( 'DOL_URL_ROOT' , $pos );
2003-06-19 15:12:01 +02:00
//define('DOL_URL_ROOT', $dolibarr_main_url_root);
2003-06-18 15:56:26 +02:00
2003-06-24 16:09:55 +02:00
require ( DOL_DOCUMENT_ROOT . " /conf/conf.class.php " );
2003-06-18 15:56:26 +02:00
/*
2003-09-12 18:46:54 +02:00
* Doit figurer apr<EFBFBD> s l 'inclusion de conf.class.php pour overider certaines variables, <20> terme conf.class.php devra etre un fichier qui ne sera pas modifi<66> par l' utilisateur
2003-06-18 15:56:26 +02:00
*/
2002-04-30 12:56:25 +02:00
$conf = new Conf ();
2004-02-01 03:00:25 +01:00
if ( ! strlen ( getenv ( " LLX_DBNAME " )))
2003-09-13 00:07:09 +02:00
{
$conf -> db -> host = $dolibarr_main_db_host ;
$conf -> db -> name = $dolibarr_main_db_name ;
$conf -> db -> user = $dolibarr_main_db_user ;
$conf -> db -> pass = $dolibarr_main_db_pass ;
}
2003-06-18 15:56:26 +02:00
2004-01-30 11:02:10 +01:00
// A terme cette constante sera d<> finie dans la base
define ( 'MAIN_DB_PREFIX' , 'llx_' );
2003-09-11 22:18:51 +02:00
require ( DOL_DOCUMENT_ROOT . " /lib/mysql.lib.php " );
require ( DOL_DOCUMENT_ROOT . " /lib/functions.inc.php " );
2003-06-18 15:56:26 +02:00
require ( DOL_DOCUMENT_ROOT . " /html.form.class.php " );
2003-10-17 19:48:06 +02:00
require DOL_DOCUMENT_ROOT . " /user.class.php " ;
//require "Smarty.class.php";
2002-04-30 12:56:25 +02:00
2002-07-29 12:26:12 +02:00
2004-03-28 20:57:11 +02:00
$db = new DoliDb ();
2002-04-30 12:56:25 +02:00
$user = new User ( $db );
2002-07-29 12:26:12 +02:00
2003-09-01 00:20:35 +02:00
clearstatcache ();
2003-08-30 12:33:23 +02:00
2004-03-28 20:57:11 +02:00
// Verification du login.
// Cette verification est faite pour chaque acc<63> s. Apr<70> s l'authentification,
// l'objet $user est initialis<69> e. Notament $user->id, $user->login et $user->nom, $user->prenom
// TODO : Stocker les infos de $user en session persistente php et ajouter recup dans le fetch
// depuis la sessions pour ne pas avoir a acceder a la base a chaque acces de page.
// TODO : Utiliser $user->id pour stocker l'id de l'auteur dans les tables plutot que $_SERVER["REMOTE_USER"]
if ( ! empty ( $_SERVER [ " REMOTE_USER " ]))
2003-08-31 00:08:36 +02:00
{
2004-03-28 20:57:11 +02:00
// Authentification Apache OK, on va chercher les infos du user
$user -> fetch ( $_SERVER [ " REMOTE_USER " ]);
2003-08-31 00:08:36 +02:00
}
else
2003-08-30 11:27:49 +02:00
{
2004-06-30 18:34:33 +02:00
// Authentification Apache OK ou non active
2003-10-14 16:49:35 +02:00
if ( ! empty ( $dolibarr_auto_user ))
{
$user -> fetch ( $dolibarr_auto_user );
2003-08-31 00:08:36 +02:00
}
2003-08-30 12:33:23 +02:00
else
2003-08-31 00:08:36 +02:00
{
2004-06-30 18:29:34 +02:00
// /usr/share/pear
2004-02-07 19:00:03 +01:00
2004-06-30 18:29:34 +02:00
//require_once "Auth/Auth.php";
require_once DOL_DOCUMENT_ROOT . " /includes/pear/Auth/Auth.php " ;
2003-09-12 18:46:54 +02:00
2003-10-14 16:49:35 +02:00
$params = array (
" dsn " => $conf -> db -> getdsn (),
2004-02-01 02:50:21 +01:00
" table " => MAIN_DB_PREFIX . " user " ,
2003-10-14 16:49:35 +02:00
" usernamecol " => " login " ,
" passwordcol " => " pass " ,
" cryptType " => " none " ,
);
2004-07-30 18:42:43 +02:00
2004-08-07 20:51:54 +02:00
$aDol = new DOLIAuth ( " DB " , $params , " loginfunction " );
2003-10-14 16:49:35 +02:00
$aDol -> start ();
$result = $aDol -> getAuth ();
if ( $result )
{
2004-03-28 20:57:11 +02:00
// Authentification Auth OK, on va chercher les infos du user
$user -> fetch ( $aDol -> getUsername ());
2003-10-14 16:49:35 +02:00
}
else
{
/*
* Le d<EFBFBD> but de la page est affich<EFBFBD> par
2004-08-07 20:51:54 +02:00
* loginfunction
2003-10-14 16:49:35 +02:00
*/
2004-02-14 14:56:19 +01:00
print " </div> \n </div> \n </body> \n </html> " ;
2003-10-14 16:49:35 +02:00
die ;
}
2003-08-31 00:08:36 +02:00
}
2003-08-30 11:27:49 +02:00
}
2003-09-12 18:46:54 +02:00
require ( DOL_DOCUMENT_ROOT . " /product.class.php " );
require ( DOL_DOCUMENT_ROOT . " /menu.class.php " );
require ( DOL_DOCUMENT_ROOT . " /societe.class.php " );
require ( DOL_DOCUMENT_ROOT . " /boxes.php " );
require ( DOL_DOCUMENT_ROOT . " /address.class.php " );
require ( DOL_DOCUMENT_ROOT . " /notify.class.php " );
2004-02-18 16:02:05 +01:00
require ( DOL_DOCUMENT_ROOT . " /includes/fpdf/fpdf152/fpdf.php " );
2003-09-12 18:46:54 +02:00
2004-07-13 23:25:53 +02:00
2004-02-18 16:02:05 +01:00
define ( 'FPDF_FONTPATH' , DOL_DOCUMENT_ROOT . '/includes/fpdf/fpdf152/font/' );
2004-07-13 23:25:53 +02:00
2003-02-10 17:13:52 +01:00
/*
2004-07-23 22:00:34 +02:00
* Definition de toutes les Constantes globales d ' environnement
2003-02-10 17:13:52 +01:00
*
*/
2004-02-01 02:50:21 +01:00
$sql = " SELECT name, value FROM " . MAIN_DB_PREFIX . " const " ;
2003-02-10 17:13:52 +01:00
$result = $db -> query ( $sql );
if ( $result )
{
2003-03-18 16:11:57 +01:00
$numr = $db -> num_rows ();
2003-02-10 17:13:52 +01:00
$i = 0 ;
2003-03-18 16:11:57 +01:00
while ( $i < $numr )
2003-02-10 17:13:52 +01:00
{
$objp = $db -> fetch_object ( $i );
2003-02-23 19:16:12 +01:00
define ( " $objp->name " , $objp -> value );
2003-02-10 17:13:52 +01:00
$i ++ ;
}
}
2004-07-13 23:25:53 +02:00
2003-02-10 17:13:52 +01:00
/*
2004-07-13 23:25:53 +02:00
* Positionne le langage et localisation dans $conf -> langage
* et charge l ' objet de traduction
2003-02-10 17:13:52 +01:00
*/
2004-07-13 23:25:53 +02:00
if ( ! defined ( MAIN_LANG_DEFAULT ))
{
define ( MAIN_LANG_DEFAULT , " fr_FR " );
}
$conf -> langage = MAIN_LANG_DEFAULT ;
// On corrige $conf->language si il ne vaut pas le code long: fr_FR par exemple
2004-07-14 12:34:26 +02:00
if ( strlen ( $conf -> langage ) <= 3 ) {
2004-07-13 23:25:53 +02:00
$conf -> langage = strtolower ( $conf -> langage ) . " _ " . strtoupper ( $conf -> langage );
}
2004-07-14 12:34:26 +02:00
setlocale ( LC_ALL , $conf -> langage );
2004-07-13 23:25:53 +02:00
//setlocale(LC_TIME, $conf->language);
require ( DOL_DOCUMENT_ROOT . " /translate.class.php " );
$langs = new Translate ( DOL_DOCUMENT_ROOT . " /langs " , $conf -> langage );
2003-03-11 17:25:07 +01:00
2003-02-27 18:09:50 +01:00
2004-07-13 23:25:53 +02:00
/*
*
*/
2003-09-06 14:41:17 +02:00
if ( defined ( " MAIN_NOT_INSTALLED " ))
{
2004-07-27 18:30:19 +02:00
Header ( " Location: install/index.php " );
2003-09-06 14:41:17 +02:00
}
2004-02-21 01:15:04 +01:00
2003-03-11 17:25:07 +01:00
/*
2004-02-21 01:15:04 +01:00
* Activation des modules
* et inclusion de librairies d<EFBFBD> pendantes
2003-03-11 17:25:07 +01:00
*/
2004-08-02 23:23:30 +02:00
if ( defined ( " MAIN_MODULE_EXTERNALRSS " ))
{
$conf -> externalrss -> enabled = MAIN_MODULE_EXTERNALRSS ;
}
2004-02-21 01:15:04 +01:00
if ( defined ( " MAIN_MODULE_COMMANDE " ))
{
$conf -> commande -> enabled = MAIN_MODULE_COMMANDE ;
}
if ( defined ( " MAIN_MODULE_EXPEDITION " ))
{
$conf -> expedition -> enabled = MAIN_MODULE_EXPEDITION ;
}
2004-02-21 15:01:01 +01:00
if ( defined ( " MAIN_MODULE_SOCIETE " ))
2004-02-21 01:15:04 +01:00
{
$conf -> societe -> enabled = MAIN_MODULE_SOCIETE ;
}
if ( defined ( " MAIN_MODULE_COMMERCIAL " ))
{
$conf -> commercial -> enabled = MAIN_MODULE_COMMERCIAL ;
}
if ( defined ( " MAIN_MODULE_COMPTABILITE " ))
{
$conf -> compta -> enabled = MAIN_MODULE_COMPTABILITE ;
}
2004-07-24 00:34:12 +02:00
if ( defined ( " MAIN_MODULE_BANQUE " ))
{
$conf -> banque -> enabled = MAIN_MODULE_BANQUE ;
}
if ( defined ( " MAIN_MODULE_CAISSE " ))
{
$conf -> caisse -> enabled = MAIN_MODULE_CAISSE ;
}
2004-02-21 15:01:01 +01:00
if ( defined ( " MAIN_MODULE_DON " ))
2004-02-21 01:15:04 +01:00
{
$conf -> don -> enabled = MAIN_MODULE_DON ;
}
if ( defined ( " MAIN_MODULE_FOURNISSEUR " ))
{
$conf -> fournisseur -> enabled = MAIN_MODULE_FOURNISSEUR ;
}
2004-02-21 15:01:01 +01:00
if ( defined ( " MAIN_MODULE_FICHEINTER " ))
2004-02-21 01:15:04 +01:00
{
require ( DOL_DOCUMENT_ROOT . " /includes/modules/fichinter/modules_fichinter.php " );
$conf -> fichinter -> enabled = MAIN_MODULE_FICHEINTER ;
}
if ( defined ( " MAIN_MODULE_ADHERENT " ))
{
$conf -> adherent -> enabled = MAIN_MODULE_ADHERENT ;
}
if ( defined ( " MAIN_MODULE_PRODUIT " ))
{
$conf -> produit -> enabled = MAIN_MODULE_PRODUIT ;
}
if ( defined ( " MAIN_MODULE_SERVICE " ))
{
$conf -> service -> enabled = MAIN_MODULE_SERVICE ;
}
2004-02-21 15:01:01 +01:00
if ( defined ( " MAIN_MODULE_STOCK " ))
{
$conf -> stock -> enabled = MAIN_MODULE_STOCK ;
}
2004-05-01 03:08:00 +02:00
if ( defined ( " MAIN_MODULE_CONTRAT " ))
{
$conf -> contrat -> enabled = MAIN_MODULE_CONTRAT ;
}
2004-02-21 01:15:04 +01:00
if ( defined ( " MAIN_MODULE_BOUTIQUE " ))
{
$conf -> boutique -> enabled = MAIN_MODULE_BOUTIQUE ;
}
if ( defined ( " MAIN_MODULE_PROJET " ))
{
$conf -> projet -> enabled = MAIN_MODULE_PROJET ;
}
if ( defined ( " BOUTIQUE_LIVRE " ))
{
$conf -> boutique -> livre -> enabled = BOUTIQUE_LIVRE ;
}
if ( defined ( " BOUTIQUE_ALBUM " ))
{
$conf -> boutique -> album -> enabled = BOUTIQUE_ALBUM ;
}
2004-02-21 15:01:01 +01:00
if ( defined ( " MAIN_MODULE_POSTNUKE " ))
{
2004-06-26 19:43:07 +02:00
$conf -> postnuke -> enabled = MAIN_MODULE_POSTNUKE ;
}
if ( defined ( " MAIN_MODULE_WEBCALENDAR " ))
{
2004-07-23 22:00:34 +02:00
$conf -> webcal -> enabled = MAIN_MODULE_WEBCALENDAR ;
2004-02-21 15:01:01 +01:00
}
if ( defined ( " MAIN_MODULE_FACTURE " ))
2003-03-11 17:25:07 +01:00
{
2004-07-23 22:00:34 +02:00
$conf -> facture -> enabled = MAIN_MODULE_FACTURE ;
2003-06-19 15:12:01 +02:00
require ( DOL_DOCUMENT_ROOT . " /includes/modules/facture/modules_facture.php " );
if ( defined ( " FACTURE_ADDON " ))
2003-09-01 00:05:36 +02:00
if ( is_readable ( DOL_DOCUMENT_ROOT . " /includes/modules/facture/ " . FACTURE_ADDON . " / " . FACTURE_ADDON . " .modules.php " ))
require ( DOL_DOCUMENT_ROOT . " /includes/modules/facture/ " . FACTURE_ADDON . " / " . FACTURE_ADDON . " .modules.php " );
2003-06-19 15:12:01 +02:00
if ( defined ( " FACTURE_ADDON_PDF " ))
2004-07-20 10:26:14 +02:00
if ( is_readable ( DOL_DOCUMENT_ROOT . " /includes/modules/facture/pdf_ " . FACTURE_ADDON_PDF . " .modules.php " ))
require ( DOL_DOCUMENT_ROOT . " /includes/modules/facture/pdf_ " . FACTURE_ADDON_PDF . " .modules.php " );
2003-03-11 17:25:07 +01:00
}
2004-07-23 22:00:34 +02:00
2004-02-21 15:01:01 +01:00
if ( defined ( " MAIN_MODULE_PROPALE " ))
2003-04-13 16:32:16 +02:00
{
2004-01-24 21:08:29 +01:00
$conf -> propal -> enabled = MAIN_MODULE_PROPALE ;
2003-06-19 15:12:01 +02:00
require ( DOL_DOCUMENT_ROOT . " /includes/modules/propale/modules_propale.php " );
2003-09-01 00:05:36 +02:00
2003-06-19 15:12:01 +02:00
if ( ! defined ( " PROPALE_OUTPUTDIR " ))
{
define ( 'PROPALE_OUTPUTDIR' , DOL_DOCUMENT_ROOT . " /document/propale/ " );
}
if ( ! defined ( " PROPALE_OUTPUT_URL " ))
{
define ( 'PROPALE_OUTPUT_URL' , " /document/propale " );
}
2003-09-23 13:57:29 +02:00
if ( ! defined ( " PROPALE_NEW_FORM_NB_PRODUCT " ))
{
define ( " PROPALE_NEW_FORM_NB_PRODUCT " , 4 );
}
2003-04-13 16:32:16 +02:00
}
2003-03-11 17:25:07 +01:00
2004-02-21 01:15:04 +01:00
2003-10-12 12:59:04 +02:00
/*
2004-02-12 00:28:34 +01:00
* Modification de quelques variable de conf en fonction des Constantes
2003-10-12 12:59:04 +02:00
*/
2004-02-12 00:28:34 +01:00
if ( defined ( " MAIN_MONNAIE " )) {
$conf -> monnaie = MAIN_MONNAIE ;
}
else {
$conf -> monnaie = 'euros' ;
define ( " MAIN_MONNAIE " , 'euros' ); // TODO Virer cette ligne et remplacer dans le code le MAIN_MONNAIE par $conf->monnaie
}
2004-02-14 02:49:20 +01:00
/*
2004-02-21 01:15:04 +01:00
* Option du module Compta : Defini le mode de calcul du CA
2004-02-14 02:49:20 +01:00
*/
2004-02-16 22:03:18 +01:00
$conf -> compta -> mode = 'RECETTES-DEPENSES' ; // Par d<> faut
if ( defined ( " COMPTA_MODE " )) {
$conf -> compta -> mode = COMPTA_MODE ; // Peut etre 'CREANCES-DETTES' pour un CA en creances-dettes
}
2004-02-21 01:15:04 +01:00
/*
* Option du module Facture
*/
if ( defined ( " FACTURE_TVAOPTION " ) && FACTURE_TVAOPTION == 'franchise' ) {
$conf -> defaulttx = '0' ; # Taux par d<> faut des factures clients
}
else {
$conf -> defaulttx = '' ; # Pas de taux par d<> faut des factures clients, le premier sera pris
}
2003-02-27 18:09:50 +01:00
/*
* SIZE_LISTE_LIMIT : constante de taille maximale des listes
*/
if ( defined ( " SIZE_LISTE_LIMIT " ))
{
$conf -> liste_limit = SIZE_LISTE_LIMIT ;
}
2003-06-24 17:21:05 +02:00
else
{
$conf -> liste_limit = 20 ;
}
2003-07-10 15:00:16 +02:00
if ( $user -> limite_liste > 0 )
2003-06-24 17:21:05 +02:00
{
$conf -> liste_limit = $user -> limite_liste ;
}
2003-02-27 18:09:50 +01:00
if ( defined ( " MAIN_THEME " ))
{
$conf -> theme = MAIN_THEME ;
$conf -> css = " theme/ " . $conf -> theme . " / " . $conf -> theme . " .css " ;
}
2003-03-03 18:39:23 +01:00
if ( defined ( " MAIN_MAIL_RESIL " ))
{
$conf -> adherent -> email_resil = MAIN_MAIL_RESIL ;
}
2003-03-04 16:23:13 +01:00
if ( defined ( " MAIN_MAIL_RESIL_SUBJECT " ))
{
$conf -> adherent -> email_resil_subject = MAIN_MAIL_RESIL_SUBJECT ;
}
2003-03-03 18:39:23 +01:00
if ( defined ( " MAIN_MAIL_VALID " ))
{
$conf -> adherent -> email_valid = MAIN_MAIL_VALID ;
}
2003-03-04 16:23:13 +01:00
if ( defined ( " MAIN_MAIL_VALID_SUBJECT " ))
{
$conf -> adherent -> email_valid_subject = MAIN_MAIL_VALID_SUBJECT ;
}
2003-03-03 18:39:23 +01:00
if ( defined ( " MAIN_MAIL_EDIT " ))
{
$conf -> adherent -> email_edit = MAIN_MAIL_EDIT ;
}
2003-03-04 16:23:13 +01:00
if ( defined ( " MAIN_MAIL_EDIT_SUBJECT " ))
{
$conf -> adherent -> email_edit_subject = MAIN_MAIL_EDIT_SUBJECT ;
}
2003-03-03 18:39:23 +01:00
if ( defined ( " MAIN_MAIL_NEW " ))
{
$conf -> adherent -> email_new = MAIN_MAIL_NEW ;
}
2003-03-04 16:23:13 +01:00
if ( defined ( " MAIN_MAIL_NEW_SUBJECT " ))
{
$conf -> adherent -> email_new_subject = MAIN_MAIL_NEW_SUBJECT ;
}
2003-03-05 18:22:02 +01:00
2003-03-11 20:19:28 +01:00
2002-07-29 12:26:12 +02:00
/*
*/
2002-05-06 21:10:48 +02:00
$bc [ 0 ] = " class= \" impair \" " ;
$bc [ 1 ] = " class= \" pair \" " ;
2002-04-30 12:56:25 +02:00
2002-12-31 15:10:59 +01:00
/*
* Barre de menu sup<EFBFBD> rieure
*
*/
2004-06-27 01:14:20 +02:00
function top_menu ( $head , $title = " " , $target = " " )
2002-12-31 15:10:59 +01:00
{
2004-06-11 01:38:00 +02:00
global $user , $conf , $langs ;
2002-07-29 12:26:12 +02:00
2003-10-12 16:42:03 +02:00
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' ;
2003-10-03 21:30:23 +02:00
print " \n <html> " ;
2004-07-13 23:25:53 +02:00
$langs -> load ( " main " );
2004-06-11 01:38:00 +02:00
print $langs -> lang_header ();
2002-05-04 01:01:45 +02:00
print $head ;
2003-06-19 15:12:01 +02:00
2004-07-25 18:19:33 +02:00
print '<link rel="top" title="' . $langs -> trans ( " Home " ) . '" href="' . DOL_URL_ROOT . '/">' ;
print '<link rel="help" title="' . $langs -> trans ( " Help " ) . '" href="http://www.dolibarr.com/aide.fr.html">' ;
2003-10-17 20:00:13 +02:00
2003-10-21 11:40:34 +02:00
print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">' . " \n " ;
2004-07-25 18:19:33 +02:00
print '<link rel="author" title="' . $langs -> trans ( " DevelopmentTeam " ) . '" href="http://www.dolibarr.com/dev.fr.html">' . " \n " ;
2003-10-17 20:00:13 +02:00
2004-01-31 13:26:42 +01:00
print '<link rel="stylesheet" type="text/css" media="print" HREF="' . DOL_URL_ROOT . '/theme/print.css">' . " \n " ;
print '<link rel="stylesheet" type="text/css" title="default" href="' . DOL_URL_ROOT . '/' . $conf -> css . '">' . " \n " ;
2004-06-26 19:43:07 +02:00
2004-08-04 00:28:01 +02:00
// Definition en laternate style sheet des feuilles de styles les plus maintenues
2004-02-13 14:40:44 +01:00
print '<link rel="alternate styleSheet" type="text/css" title="Rodolphe" href="' . DOL_URL_ROOT . '/theme/rodolphe/rodolphe.css">' . " \n " ;
print '<link rel="alternate styleSheet" type="text/css" title="Yellow" href="' . DOL_URL_ROOT . '/theme/yellow/yellow.css">' . " \n " ;
2004-08-04 00:28:01 +02:00
print '<link rel="alternate styleSheet" type="text/css" title="Eldy" href="' . DOL_URL_ROOT . '/theme/eldy/eldy.css">' . " \n " ;
2003-10-21 11:40:34 +02:00
2003-09-09 23:51:41 +02:00
if ( strlen ( $title ) > 0 )
2003-06-18 16:06:35 +02:00
{
2003-09-10 15:00:34 +02:00
print '<title>Dolibarr - ' . $title . '</title>' ;
2003-06-18 16:06:35 +02:00
}
else
{
2003-09-09 23:51:41 +02:00
if ( defined ( " MAIN_TITLE " ))
{
print " <title> " . MAIN_TITLE . " </title> " ;
}
else
{
print '<title>Dolibarr</title>' ;
}
2003-06-18 16:06:35 +02:00
}
2002-07-29 12:26:12 +02:00
print " \n " ;
2003-10-11 12:51:49 +02:00
print " </head> \n " ;
2003-10-14 17:03:11 +02:00
print '<body>' ;
2003-09-10 15:00:34 +02:00
/*
* Mise <EFBFBD> jour entre 2 versions
*
*/
if ( defined ( " MAIN_NEED_UPDATE " ))
{
print '<table class="topbarre" width="100%">' ;
print " <tr><td>Votre syst<73> me n<> cessite d'<27> tre mis <20> jour. " ;
2004-07-25 18:19:33 +02:00
print 'Pour cela cliquez sur <A href="' . DOL_URL_ROOT . '/admin/system/update.php">Mettre <20> jour</A> !!</td></tr>' ;
2003-09-10 15:00:34 +02:00
print " </table> " ;
}
2002-05-06 21:10:48 +02:00
/*
* Barre superieure
*
*/
2002-05-04 01:01:45 +02:00
2003-09-10 15:00:34 +02:00
print '<table class="topbarre" width="100%">' ;
2002-12-31 15:10:59 +01:00
print " <tr> " ;
2002-05-04 01:01:45 +02:00
2004-06-27 01:14:20 +02:00
// Sommet menu de gauche, lien accueil
2004-06-26 19:43:07 +02:00
$class = " " ;
if ( $_SESSION [ " topmenu " ] && $_SESSION [ " topmenu " ] == " accueil " ) { $class = " menusel " ; }
2004-07-25 18:52:26 +02:00
elseif ( ereg ( " ^ " . DOL_URL_ROOT . " \ /[^ \\ \ /]+ $ " , $_SERVER [ " PHP_SELF " ]) || ereg ( " ^ " . DOL_URL_ROOT . " \ /user \ / " , $_SERVER [ " PHP_SELF " ]) || ereg ( " ^ " . DOL_URL_ROOT . " \ /admin \ / " , $_SERVER [ " PHP_SELF " ])) { $class = " menusel " ; }
2004-07-25 18:19:33 +02:00
print '<td width="200" class="menu"><table cellpadding=0 cellspacing=0 width="100%"><tr><td class="' . $class . '" align=center><a class="' . $class . '" href="' . DOL_URL_ROOT . '/index.php"' . ( $target ? " target= $target " : " " ) . '>' . $langs -> trans ( " Home " ) . '</a></td></tr></table></td>' ;
2004-06-26 19:43:07 +02:00
// Sommet g<> r<EFBFBD> par gestionnaire de menu du haut
print '<td class="menu">' ;
2003-03-11 20:32:54 +01:00
if ( ! defined ( MAIN_MENU_BARRETOP ))
2003-10-11 12:51:49 +02:00
{
define ( " MAIN_MENU_BARRETOP " , " default.php " );
}
2003-06-18 15:56:26 +02:00
require ( DOL_DOCUMENT_ROOT . " /includes/menus/barre_top/ " . MAIN_MENU_BARRETOP );
2004-06-26 19:43:07 +02:00
print '</td>' ;
2002-05-04 01:01:45 +02:00
2004-06-26 19:43:07 +02:00
// Logout
2004-07-12 16:34:16 +02:00
print '<td width="120" class="menu" align="center" valign="center">' ;
2004-06-26 19:43:07 +02:00
if ( ! $_SERVER [ " REMOTE_USER " ]) // Propose ou non de se deloguer si authentication Apache ou non
2003-10-29 13:39:13 +01:00
{
2004-07-12 16:34:16 +02:00
print '<a href="' . DOL_URL_ROOT . '/user/fiche.php?id=' . $user -> id . '">' . $user -> login . '</a>' ;
print '<a href="' . DOL_URL_ROOT . '/user/logout.php">' ;
2004-07-25 18:19:33 +02:00
print '<img border="0" src="' . DOL_URL_ROOT . '/theme/' . $conf -> theme . '/img/logout.png" alt="' . $langs -> trans ( " Logout " ) . '" title="' . $langs -> trans ( " Logout " ) . '"></a>' ;
2004-07-12 16:34:16 +02:00
2003-10-29 13:39:13 +01:00
}
else
{
print $user -> login ;
}
2004-06-26 19:43:07 +02:00
print '</td>' ;
print " </tr> \n " ;
2002-12-31 15:10:59 +01:00
2002-05-06 21:10:48 +02:00
/*
* Table principale
*
*/
2004-06-26 19:43:07 +02:00
print '<tr><td valign="top">' ;
2002-05-09 16:57:48 +02:00
2003-01-13 22:33:41 +01:00
}
/*
* Barre de menu gauche
*
*
*
*
*/
2004-08-07 20:51:54 +02:00
function left_menu ( $menu , $help_url = '' , $form_search = '' , $author = '' )
2003-01-13 22:33:41 +01:00
{
2004-07-25 18:19:33 +02:00
global $user , $conf , $langs ;
2002-05-09 16:57:48 +02:00
/*
* Colonne de gauche
*
*/
2004-06-26 19:43:07 +02:00
print " \n <!-- Debut left menu --> \n " ;
2002-05-09 16:57:48 +02:00
2002-12-12 17:42:08 +01:00
for ( $i = 0 ; $i < sizeof ( $menu ) ; $i ++ )
{
2004-06-26 19:43:07 +02:00
print '<div class="leftmenu">' . " \n " ;
2004-02-13 14:40:44 +01:00
print '<a class="leftmenu" href="' . $menu [ $i ][ 0 ] . '">' . $menu [ $i ][ 1 ] . '</a>' ;
2002-05-09 16:57:48 +02:00
2002-12-12 17:42:08 +01:00
for ( $j = 2 ; $j < sizeof ( $menu [ $i ]) - 1 ; $j = $j + 2 )
{
2004-02-13 14:40:44 +01:00
print '<br><a class="leftsubmenu" href="' . $menu [ $i ][ $j ] . '">' . $menu [ $i ][ $j + 1 ] . '</a>' ;
}
2004-02-14 14:56:19 +01:00
print " </div> \n " ;
2002-05-09 16:57:48 +02:00
}
2003-08-11 19:58:48 +02:00
if (( defined ( " MAIN_SEARCHFORM_SOCIETE " ) && MAIN_SEARCHFORM_SOCIETE > 0 ) || ( defined ( " MAIN_SEARCHFORM_CONTACT " ) && MAIN_SEARCHFORM_CONTACT > 0 ))
2003-02-11 14:55:14 +01:00
{
2004-07-25 18:19:33 +02:00
$langs -> load ( " companies " );
2004-02-14 14:56:19 +01:00
print '<div class="leftmenu">' . " \n " ;
2003-02-23 19:16:12 +01:00
if ( defined ( " MAIN_SEARCHFORM_SOCIETE " ) && MAIN_SEARCHFORM_SOCIETE > 0 )
2003-02-11 14:55:14 +01:00
{
2004-03-28 20:57:11 +02:00
if ( strstr ( $_SERVER [ " SCRIPT_URL " ], " /comm/prospect/ " ))
2004-03-02 16:57:23 +01:00
{
print '<form action="' . DOL_URL_ROOT . '/comm/prospect/prospects.php">' ;
}
else
{
print '<form action="' . DOL_URL_ROOT . '/societe.php">' ;
}
2004-07-25 18:19:33 +02:00
print '<a class="menu" href="' . DOL_URL_ROOT . '/comm/clients.php">' . $langs -> trans ( " Companies " ) . '</a><br>' ;
2003-02-11 14:55:14 +01:00
print '<input type="hidden" name="mode" value="search">' ;
2004-03-02 16:57:23 +01:00
print '<input type="hidden" name="page" value="0">' ;
2003-02-11 14:55:14 +01:00
print '<input type="hidden" name="mode-search" value="soc">' ;
print '<input type="text" name="socname" class="flat" size="10"> ' ;
print '<input type="submit" class="flat" value="go">' ;
2004-01-24 21:08:29 +01:00
print " </form> \n " ;
2003-02-11 14:55:14 +01:00
}
2003-02-23 19:16:12 +01:00
if ( defined ( " MAIN_SEARCHFORM_CONTACT " ) && MAIN_SEARCHFORM_CONTACT > 0 )
2003-02-11 14:55:14 +01:00
{
2004-07-25 18:19:33 +02:00
print '<form action="' . DOL_URL_ROOT . '/contact/index.php">' ;
print '<A class="menu" href="' . DOL_URL_ROOT . '/contact/index.php">' . $langs -> trans ( " Contacts " ) . '</A><br>' ;
2003-02-11 14:55:14 +01:00
print '<input type="hidden" name="mode" value="search">' ;
print '<input type="hidden" name="mode-search" value="contact">' ;
print '<input type="text" class="flat" name="contactname" size="10"> ' ;
print '<input type="submit" class="flat" value="go">' ;
2004-01-24 21:08:29 +01:00
print " </form> \n " ;
2003-02-11 14:55:14 +01:00
}
2003-08-11 19:58:48 +02:00
2004-02-21 17:23:50 +01:00
if ( $conf -> produit -> enabled )
2003-08-11 19:58:48 +02:00
{
2004-07-25 18:19:33 +02:00
$langs -> load ( " products " );
2004-01-24 23:12:08 +01:00
print '<form action="' . DOL_URL_ROOT . '/product/liste.php" method="post">' ;
2004-07-25 18:19:33 +02:00
print '<A class="menu" href="' . DOL_URL_ROOT . '/product/">' . $langs -> trans ( " Products " ) . '</A><br>' ;
2003-08-12 15:52:46 +02:00
print '<input type="text" class="flat" name="sall" size="10"> ' ;
2003-08-11 19:58:48 +02:00
print '<input type="submit" class="flat" value="go">' ;
2004-01-24 21:08:29 +01:00
print " </form> \n " ;
2003-08-11 19:58:48 +02:00
}
2004-02-13 14:40:44 +01:00
print " </div> " ;
2003-02-11 14:55:14 +01:00
}
2003-10-11 12:51:49 +02:00
2003-11-13 18:24:47 +01:00
/*
* Formulaire de recherche
*/
if ( strlen ( $form_search ) > 0 )
{
2004-02-13 18:12:17 +01:00
print '<div class="leftmenu">' ;
2003-11-13 18:24:47 +01:00
print $form_search ;
2004-02-13 14:40:44 +01:00
print '</div>' ;
2003-11-13 18:24:47 +01:00
}
2003-10-11 12:51:49 +02:00
/*
* Lien vers l ' aide en ligne
*/
if ( strlen ( $help_url ) > 0 )
{
2004-02-13 14:40:44 +01:00
print '<div class="leftmenu">' ;
2004-07-21 16:22:48 +02:00
define ( 'MAIN_AIDE_URL' , 'http://www.dolibarr.com/wikidev/index.php' );
2004-07-25 18:52:26 +02:00
print '<a class="leftmenu" target="_blank" href="' . MAIN_AIDE_URL . '/' . $help_url . '">' . $langs -> trans ( " Help " ) . '</a></div>' ;
2003-10-11 12:51:49 +02:00
}
2004-01-27 15:46:59 +01:00
2004-07-25 18:52:26 +02:00
2004-06-26 19:43:07 +02:00
print " <!-- Fin left menu --> \n " ;
2004-02-14 14:56:19 +01:00
print " </td> " ;
2004-06-26 19:43:07 +02:00
print " <td valign= \" top \" colspan= \" 2 \" > \n " ;
2002-05-04 01:01:45 +02:00
}
2002-12-31 15:10:59 +01:00
/*
* Impression du pied de page
*
*
*
*/
2002-12-12 17:42:08 +01:00
function llxFooter ( $foot = '' )
{
2003-10-14 16:55:47 +02:00
global $dolibarr_auto_user ;
2003-10-14 17:13:36 +02:00
print " \n </td></tr> \n " ;
2002-05-09 16:57:48 +02:00
/*
*
*/
2003-07-24 15:10:49 +02:00
print " </table> \n " ;
2004-07-30 18:42:43 +02:00
/* Supression temporaire , mauvais affichage sur petit ecran
2003-07-24 15:10:49 +02:00
print '<p id="powered-by-dolibarr">' ;
print '<a href="http://savannah.gnu.org/bugs/?group_id=1915">Bug report</a> ' ;
2003-10-07 13:16:30 +02:00
// print '<a href="http://savannah.gnu.org/projects/dolibarr/">Source Code</a> '.$foot.'</p>';
// Suppression temporaire du footer
print '<a href="http://savannah.gnu.org/projects/dolibarr/">Source Code</a></p>' ;
2003-10-14 16:54:11 +02:00
if ( ! empty ( $dolibarr_auto_user ))
{
2004-07-30 18:42:43 +02:00
print ' < p >
2003-10-14 16:54:11 +02:00
< a href = " http://validator.w3.org/check/referer " >< img border = " 0 "
src = " http://www.w3.org/Icons/valid-html40 "
alt = " Valid HTML 4.0! " height = " 31 " width = " 88 " ></ a >
2004-07-30 18:42:43 +02:00
</ p > ' ;
2003-10-14 16:54:11 +02:00
}
2004-07-30 18:42:43 +02:00
*/
2003-07-24 15:10:49 +02:00
print " </body></html> " ;
2002-05-09 16:57:48 +02:00
}
2002-04-30 12:56:25 +02:00
?>