2004-10-20 23:06:45 +02:00
|
|
|
|
<?php
|
2005-04-13 12:01:05 +02:00
|
|
|
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2004-01-28 01:25:15 +01:00
|
|
|
|
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
2005-01-09 19:10:37 +01:00
|
|
|
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
2004-09-01 23:23:20 +02:00
|
|
|
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
2004-09-08 13:47:48 +02:00
|
|
|
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
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-06-18 15:56:26 +02:00
|
|
|
|
|
2005-03-21 20:53:50 +01:00
|
|
|
|
/**
|
|
|
|
|
|
\file htdocs/main.inc.php
|
2005-08-11 22:04:33 +02:00
|
|
|
|
\brief Fichier de formatage g<EFBFBD>n<EFBFBD>rique des <EFBFBD>crans Dolibarr
|
2005-01-09 19:10:37 +01:00
|
|
|
|
\version $Revision$
|
2004-10-29 00:15:31 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
2004-09-08 13:47:48 +02:00
|
|
|
|
require("master.inc.php");
|
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
|
2004-08-21 04:17:12 +02:00
|
|
|
|
// \todo : Stocker les infos de $user en session persistente php et ajouter recup dans le fetch
|
2005-08-11 22:04:33 +02:00
|
|
|
|
// depuis la sessions pour ne pas avoir a acceder a la base a chaque acces de page.
|
2004-08-21 04:17:12 +02:00
|
|
|
|
// \todo : Utiliser $user->id pour stocker l'id de l'auteur dans les tables plutot que $_SERVER["REMOTE_USER"]
|
2004-03-28 20:57:11 +02:00
|
|
|
|
|
|
|
|
|
|
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"]);
|
2005-08-11 22:04:33 +02:00
|
|
|
|
dolibarr_syslog ("Authentification ok (en mode Basic)");
|
2005-03-26 14:38:30 +01:00
|
|
|
|
|
|
|
|
|
|
//exit;
|
|
|
|
|
|
}
|
2003-08-31 00:08:36 +02:00
|
|
|
|
else
|
2003-08-30 11:27:49 +02:00
|
|
|
|
{
|
2005-03-26 14:38:30 +01:00
|
|
|
|
// Authentification Apache KO ou non active
|
2005-08-11 22:04:33 +02:00
|
|
|
|
if (!empty ($dolibarr_auto_user))
|
2003-10-14 16:49:35 +02:00
|
|
|
|
{
|
2005-08-11 22:04:33 +02:00
|
|
|
|
// Mode forc<72> sur un utilisateur (pour debug, demo, ...)
|
|
|
|
|
|
$user->fetch($dolibarr_auto_user);
|
|
|
|
|
|
dolibarr_syslog ("Authentification ok (en mode force)");
|
|
|
|
|
|
if (isset($_POST["loginfunction"]))
|
|
|
|
|
|
{
|
|
|
|
|
|
// Si phase de login initial
|
|
|
|
|
|
$user->update_last_login_date();
|
|
|
|
|
|
}
|
2003-08-31 00:08:36 +02:00
|
|
|
|
}
|
2005-08-11 22:04:33 +02:00
|
|
|
|
else
|
2003-08-31 00:08:36 +02:00
|
|
|
|
{
|
2005-08-11 22:04:33 +02:00
|
|
|
|
// Pas d'authentification Apache ni de mode forc<72>, on demande le login
|
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT."/includes/pear/Auth/Auth.php";
|
|
|
|
|
|
|
|
|
|
|
|
$pear = $dolibarr_main_db_type.'://'.$dolibarr_main_db_user.':'.$dolibarr_main_db_pass.'@'.$dolibarr_main_db_host.'/'.$dolibarr_main_db_name;
|
|
|
|
|
|
|
|
|
|
|
|
$params = array(
|
|
|
|
|
|
"dsn" =>$pear,
|
|
|
|
|
|
"table" => MAIN_DB_PREFIX."user",
|
|
|
|
|
|
"usernamecol" => "login",
|
|
|
|
|
|
"passwordcol" => "pass",
|
|
|
|
|
|
"cryptType" => "none",
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$aDol = new DOLIAuth("DB", $params, "loginfunction");
|
|
|
|
|
|
$aDol->setSessionName("DOLSESSID_".$dolibarr_main_db_name);
|
|
|
|
|
|
$aDol->start();
|
|
|
|
|
|
$result = $aDol->getAuth();
|
|
|
|
|
|
if ($result)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Authentification Auth OK, on va chercher les infos du user
|
|
|
|
|
|
$user->fetch($aDol->getUsername());
|
|
|
|
|
|
dolibarr_syslog ("Authentification ok (en mode Pear)");
|
|
|
|
|
|
if (isset($_POST["loginfunction"]))
|
|
|
|
|
|
{
|
|
|
|
|
|
// Si phase de login initial
|
|
|
|
|
|
$user->update_last_login_date();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isset($_POST["loginfunction"]))
|
|
|
|
|
|
{
|
|
|
|
|
|
// Echec authentification
|
|
|
|
|
|
dolibarr_syslog("Authentification ko (en mode Pear) pour '".$_POST["username"]."'");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
// Non authentifi<66>
|
|
|
|
|
|
dolibarr_syslog("Authentification non r<>alis<69>");
|
|
|
|
|
|
}
|
|
|
|
|
|
// Le d<>but de la page a <20>t<EFBFBD> affich<63> par loginfunction. On ferme juste la page
|
|
|
|
|
|
print "</div>\n</div>\n</body>\n</html>";
|
|
|
|
|
|
exit;
|
|
|
|
|
|
}
|
2003-08-31 00:08:36 +02:00
|
|
|
|
}
|
2003-08-30 11:27:49 +02:00
|
|
|
|
}
|
2003-09-12 18:46:54 +02:00
|
|
|
|
|
2005-08-11 22:04:33 +02:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Overwrite configs global par configs perso
|
|
|
|
|
|
* ------------------------------------------
|
|
|
|
|
|
*/
|
|
|
|
|
|
if (isset($user->conf->SIZE_LISTE_LIMIT) && $user->conf->SIZE_LISTE_LIMIT > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
$conf->liste_limit = $user->conf->SIZE_LISTE_LIMIT;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (isset($user->conf->MAIN_LANG_DEFAULT) && $user->conf->MAIN_LANG_DEFAULT)
|
|
|
|
|
|
{
|
|
|
|
|
|
if ($conf->langage != $user->conf->MAIN_LANG_DEFAULT)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Si on a un langage perso diff<66>rent du langage global
|
|
|
|
|
|
$conf->langage=dolibarr_set_php_lang($user->conf->MAIN_LANG_DEFAULT);
|
|
|
|
|
|
|
|
|
|
|
|
$langs = new Translate(DOL_DOCUMENT_ROOT ."/langs", $conf->langage);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2005-08-13 00:10:34 +02:00
|
|
|
|
if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME)
|
|
|
|
|
|
{
|
|
|
|
|
|
$conf->theme=$user->conf->MAIN_THEME;
|
|
|
|
|
|
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
|
|
|
|
|
}
|
2005-09-25 00:11:04 +02:00
|
|
|
|
if (isset($user->conf->MAIN_DISABLE_JAVASCRIPT) && $user->conf->MAIN_DISABLE_JAVASCRIPT)
|
|
|
|
|
|
{
|
|
|
|
|
|
$conf->use_javascript=! $user->conf->MAIN_DISABLE_JAVASCRIPT;
|
|
|
|
|
|
}
|
2005-08-11 22:04:33 +02:00
|
|
|
|
|
2005-09-26 02:52:33 +02:00
|
|
|
|
// D<>fini gestionnaire de manu <20> utiliser
|
|
|
|
|
|
if (! $user->societe_id) // Si utilisateur interne
|
|
|
|
|
|
{
|
|
|
|
|
|
$conf->top_menu=$conf->global->MAIN_MENU_BARRETOP;
|
|
|
|
|
|
$conf->left_menu=$conf->global->MAIN_MENU_BARRELEFT;
|
|
|
|
|
|
// Pour compatibilit<69>
|
|
|
|
|
|
if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_frontoffice.php';
|
|
|
|
|
|
if ($conf->left_menu == 'eldy.php') $conf->left_menu='eldy_frontoffice.php';
|
|
|
|
|
|
}
|
|
|
|
|
|
else // Si utilisateur externe
|
|
|
|
|
|
{
|
|
|
|
|
|
$conf->top_menu=$conf->global->MAIN_MENUFRONT_BARRETOP;
|
|
|
|
|
|
$conf->left_menu=$conf->global->MAIN_MENUFRONT_BARRELEFT;
|
|
|
|
|
|
}
|
2005-08-11 22:04:33 +02:00
|
|
|
|
|
2005-03-26 14:38:30 +01:00
|
|
|
|
// Si le login n'a pu <20>tre r<>cup<75>r<EFBFBD>, on est identifi<66> avec un compte qui n'existe pas.
|
|
|
|
|
|
// Tentative de hacking ?
|
|
|
|
|
|
if (! $user->login) accessforbidden();
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-08-11 22:04:33 +02:00
|
|
|
|
dolibarr_syslog("Access to ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
|
|
2005-03-26 14:38:30 +01:00
|
|
|
|
|
2005-04-02 23:21:03 +02:00
|
|
|
|
if (! defined('MAIN_INFO_SOCIETE_PAYS'))
|
2004-11-04 21:00:15 +01:00
|
|
|
|
{
|
2005-04-02 23:21:03 +02:00
|
|
|
|
define('MAIN_INFO_SOCIETE_PAYS','1');
|
2004-11-04 21:00:15 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2004-10-31 16:54:14 +01:00
|
|
|
|
// On charge le fichier lang principal
|
|
|
|
|
|
$langs->load("main");
|
2003-03-11 17:25:07 +01:00
|
|
|
|
|
2004-07-13 23:25:53 +02:00
|
|
|
|
/*
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
2003-09-06 14:41:17 +02:00
|
|
|
|
if (defined("MAIN_NOT_INSTALLED"))
|
|
|
|
|
|
{
|
2005-04-17 17:23:39 +02:00
|
|
|
|
Header("Location: ".DOL_URL_ROOT."/install/index.php");
|
2003-09-06 14:41:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2004-02-21 01:15:04 +01:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
|
2005-01-01 20:48:22 +01:00
|
|
|
|
/**
|
2005-08-20 18:43:30 +02:00
|
|
|
|
* \brief Affiche en-t<EFBFBD>te html
|
2004-08-21 14:18:03 +02:00
|
|
|
|
* \param head lignes d'en-tete head
|
|
|
|
|
|
* \param title titre page web
|
2005-01-09 19:30:34 +01:00
|
|
|
|
* \param target target du menu Accueil
|
2002-12-31 15:10:59 +01:00
|
|
|
|
*/
|
2005-08-20 18:43:30 +02:00
|
|
|
|
function top_htmlhead($head, $title="", $target="")
|
2002-12-31 15:10:59 +01:00
|
|
|
|
{
|
2005-08-20 18:43:30 +02:00
|
|
|
|
global $user, $conf, $langs, $db;
|
2002-07-29 12:26:12 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
|
|
|
|
|
print "\n<html>";
|
2003-10-03 21:30:23 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
print $langs->lang_header();
|
|
|
|
|
|
print $head;
|
2003-06-19 15:12:01 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
// Affiche meta
|
|
|
|
|
|
print '<meta name="robots" content="noindex,nofollow">'."\n"; // Evite indexation par robots
|
|
|
|
|
|
print '<meta name="author" content="'.$langs->trans("DevelopmentTeam").'">'."\n";
|
2003-10-21 11:40:34 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
// Affiche title
|
|
|
|
|
|
if (strlen($title) > 0)
|
2003-06-18 16:06:35 +02:00
|
|
|
|
{
|
2005-08-20 18:43:30 +02:00
|
|
|
|
print '<title>Dolibarr - '.$title.'</title>';
|
2003-06-18 16:06:35 +02:00
|
|
|
|
}
|
2005-08-20 18:43:30 +02:00
|
|
|
|
else
|
2003-06-18 16:06:35 +02:00
|
|
|
|
{
|
2005-08-20 18:43:30 +02:00
|
|
|
|
if (defined("MAIN_TITLE"))
|
|
|
|
|
|
{
|
|
|
|
|
|
print "<title>".MAIN_TITLE."</title>";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
print '<title>Dolibarr</title>';
|
|
|
|
|
|
}
|
2003-06-18 16:06:35 +02:00
|
|
|
|
}
|
2005-08-20 18:43:30 +02:00
|
|
|
|
print "\n";
|
2002-07-29 12:26:12 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
// Affiche style sheets et link
|
|
|
|
|
|
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.'/'.$conf->css.'">'."\n";
|
|
|
|
|
|
print '<link rel="stylesheet" type="text/css" media="print" HREF="'.DOL_URL_ROOT.'/theme/print.css">'."\n";
|
2005-04-17 02:23:43 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
// Definition en alternate style sheet des feuilles de styles les plus maintenues
|
|
|
|
|
|
print '<link rel="alternate stylesheet" type="text/css" title="Eldy" href="'.DOL_URL_ROOT.'/theme/eldy/eldy.css">'."\n";
|
|
|
|
|
|
print '<link rel="alternate stylesheet" type="text/css" title="Freelug" href="'.DOL_URL_ROOT.'/theme/freelug/freelug.css">'."\n";
|
|
|
|
|
|
print '<link rel="alternate stylesheet" type="text/css" title="Yellow" href="'.DOL_URL_ROOT.'/theme/yellow/yellow.css">'."\n";
|
2005-04-17 02:23:43 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
print '<link rel="top" title="'.$langs->trans("Home").'" href="'.DOL_URL_ROOT.'/">'."\n";
|
|
|
|
|
|
print '<link rel="help" title="'.$langs->trans("Help").'" href="http://www.dolibarr.com/aide.fr.html">'."\n";
|
|
|
|
|
|
print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">'."\n";
|
|
|
|
|
|
print '<link rel="author" title="'.$langs->trans("DevelopmentTeam").'" href="http://www.dolibarr.com/dev.fr.html">'."\n";
|
2005-04-17 02:23:43 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
print "</head>\n";
|
|
|
|
|
|
}
|
2005-01-16 16:23:50 +01:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
/**
|
|
|
|
|
|
* \brief Affiche en-t<EFBFBD>te html + la barre de menu sup<EFBFBD>rieure
|
|
|
|
|
|
* \param head lignes d'en-tete head
|
|
|
|
|
|
* \param title titre page web
|
|
|
|
|
|
* \param target target du menu Accueil
|
|
|
|
|
|
*/
|
|
|
|
|
|
function top_menu($head, $title="", $target="")
|
|
|
|
|
|
{
|
|
|
|
|
|
global $user, $conf, $langs, $db;
|
|
|
|
|
|
|
|
|
|
|
|
top_htmlhead($head, $title, $target);
|
2002-05-04 01:01:45 +02:00
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
print '<body>';
|
|
|
|
|
|
print '<div class="body">';
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Si la constante MAIN_NEED_UPDATE est d<EFBFBD>finie (par le script de migration sql en g<EFBFBD>n<EFBFBD>ral), c'est que
|
|
|
|
|
|
* les donn<EFBFBD>es ont besoin d'un remaniement. Il faut passer le update.php
|
|
|
|
|
|
*/
|
|
|
|
|
|
if (defined("MAIN_NEED_UPDATE") && MAIN_NEED_UPDATE)
|
2003-10-29 13:39:13 +01:00
|
|
|
|
{
|
2005-08-20 18:43:30 +02:00
|
|
|
|
$langs->load("admin");
|
|
|
|
|
|
print '<div class="fiche">'."\n";
|
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
|
print '<tr><td>';
|
|
|
|
|
|
print $langs->trans("UpdateRequired",DOL_URL_ROOT.'/admin/system/update.php');
|
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
print "</table>";
|
|
|
|
|
|
llxFooter();
|
|
|
|
|
|
exit;
|
2003-10-29 13:39:13 +01:00
|
|
|
|
}
|
2004-08-21 14:18:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
2005-08-20 18:43:30 +02:00
|
|
|
|
/*
|
|
|
|
|
|
* Barre de menu sup<EFBFBD>rieure
|
|
|
|
|
|
*/
|
|
|
|
|
|
print '<div class="tmenu">'."\n";
|
|
|
|
|
|
|
|
|
|
|
|
// Charge le gestionnaire des entr<74>es de menu du haut
|
|
|
|
|
|
require_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
|
|
|
|
|
|
$menutop = new MenuTop($db);
|
|
|
|
|
|
$menutop->atarget=$target;
|
|
|
|
|
|
|
|
|
|
|
|
// Affiche le menu
|
|
|
|
|
|
$menutop->showmenu();
|
|
|
|
|
|
|
|
|
|
|
|
// Lien sur fiche du login
|
|
|
|
|
|
print '<a class="login" href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id.'"';
|
|
|
|
|
|
print $menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
|
|
|
|
|
|
print '>'.$user->login.'</a>';
|
|
|
|
|
|
|
|
|
|
|
|
// Lien logout
|
|
|
|
|
|
if (! isset($_SERVER["REMOTE_USER"]) || ! $_SERVER["REMOTE_USER"])
|
|
|
|
|
|
{
|
|
|
|
|
|
print '<a href="'.DOL_URL_ROOT.'/user/logout.php"';
|
|
|
|
|
|
print $menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
|
|
|
|
|
|
print '>';
|
|
|
|
|
|
print '<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png" alt="'.$langs->trans("Logout").'" title="'.$langs->trans("Logout").'"></a>';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "</div><!-- class=tmenu -->\n";
|
2004-08-21 16:21:32 +02:00
|
|
|
|
|
2003-01-13 22:33:41 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2004-08-21 14:18:03 +02:00
|
|
|
|
|
2005-01-01 20:48:22 +01:00
|
|
|
|
/**
|
2004-08-21 14:18:03 +02:00
|
|
|
|
* \brief Affiche barre de menu gauche
|
2005-03-01 22:44:32 +01:00
|
|
|
|
* \param menu_array Tableau des entr<EFBFBD>e de menu
|
2004-08-21 14:18:03 +02:00
|
|
|
|
* \param help_url Url pour le lien aide ('' par defaut)
|
2005-01-01 20:48:22 +01:00
|
|
|
|
* \param form_search Formulaire de recherche permanant suppl<EFBFBD>mentaire
|
2003-01-13 22:33:41 +01:00
|
|
|
|
*/
|
2005-09-08 23:10:06 +02:00
|
|
|
|
function left_menu($menu_array, $help_url='', $form_search='')
|
2003-01-13 22:33:41 +01:00
|
|
|
|
{
|
2005-09-08 23:10:06 +02:00
|
|
|
|
global $user, $conf, $langs, $db;
|
2002-05-09 16:57:48 +02:00
|
|
|
|
|
2005-09-08 23:10:06 +02:00
|
|
|
|
print '<div class="vmenuplusfiche">'."\n";
|
2004-08-21 16:21:32 +02:00
|
|
|
|
|
2005-09-08 23:10:06 +02:00
|
|
|
|
// Colonne de gauche
|
|
|
|
|
|
print "\n<!-- Debut left vertical menu -->\n";
|
|
|
|
|
|
print '<div class="vmenu">'."\n";
|
2002-05-09 16:57:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
2005-09-08 23:10:06 +02:00
|
|
|
|
// Autres entr<74>es du menu par le gestionnaire
|
|
|
|
|
|
require_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_left/".$conf->left_menu);
|
|
|
|
|
|
$menu=new MenuLeft($db,$menu_array);
|
|
|
|
|
|
$menu->showmenu();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Affichage des zones de recherche permanantes
|
|
|
|
|
|
$addzonerecherche=0;
|
2005-09-27 01:07:07 +02:00
|
|
|
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE) $addzonerecherche=1;
|
|
|
|
|
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT) $addzonerecherche=1;
|
|
|
|
|
|
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE) $addzonerecherche=1;
|
2005-09-08 23:10:06 +02:00
|
|
|
|
|
|
|
|
|
|
if ($addzonerecherche && ($user->rights->societe->lire || $user->rights->produit->lire))
|
2003-11-13 18:24:47 +01:00
|
|
|
|
{
|
2005-09-08 23:10:06 +02:00
|
|
|
|
print '<div class="blockvmenupair">';
|
|
|
|
|
|
|
2005-09-27 01:07:07 +02:00
|
|
|
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
2005-09-08 23:10:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
$langs->load("companies");
|
|
|
|
|
|
printSearchForm(DOL_URL_ROOT.'/societe.php',DOL_URL_ROOT.'/societe.php',$langs->trans("Companies"),'soc','socname');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2005-09-27 01:07:07 +02:00
|
|
|
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
2005-09-08 23:10:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
$langs->load("companies");
|
|
|
|
|
|
printSearchForm(DOL_URL_ROOT.'/contact/index.php',DOL_URL_ROOT.'/contact/index.php',$langs->trans("Contacts"),'contact','contactname');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2005-09-27 01:07:07 +02:00
|
|
|
|
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE && $user->rights->produit->lire)
|
2005-09-08 23:10:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
$langs->load("products");
|
2005-09-10 02:35:28 +02:00
|
|
|
|
printSearchForm(DOL_URL_ROOT.'/product/liste.php',DOL_URL_ROOT.'/product/index.php',$langs->trans("Products")."/".$langs->trans("Services"),'products','sall');
|
2005-09-08 23:10:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
if ($conf->categorie->enabled)
|
|
|
|
|
|
{
|
|
|
|
|
|
$langs->load("categories");
|
|
|
|
|
|
printSearchForm(DOL_URL_ROOT.'/categories/search.php',DOL_URL_ROOT.'/categories/',$langs->trans("Categories"),'categories','catname');
|
|
|
|
|
|
}
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
print '</div>';
|
2003-11-13 18:24:47 +01:00
|
|
|
|
}
|
2005-09-08 23:10:06 +02:00
|
|
|
|
|
|
|
|
|
|
// Zone de recherche suppl<70>mentaire
|
|
|
|
|
|
if ($form_search)
|
2003-10-11 12:51:49 +02:00
|
|
|
|
{
|
2005-09-08 23:10:06 +02:00
|
|
|
|
print $form_search;
|
2003-10-11 12:51:49 +02:00
|
|
|
|
}
|
2004-01-27 15:46:59 +01:00
|
|
|
|
|
2005-09-08 23:10:06 +02:00
|
|
|
|
// Lien vers l'aide en ligne (uniquement si langue fr_FR)
|
|
|
|
|
|
if ($help_url)
|
|
|
|
|
|
{
|
|
|
|
|
|
$helpbaseurl='';
|
|
|
|
|
|
if ($langs->defaultlang == "fr_FR") $helpbaseurl='http://www.dolibarr.com/wikidev/index.php/%s';
|
2005-08-13 11:35:29 +02:00
|
|
|
|
|
2005-09-08 23:10:06 +02:00
|
|
|
|
if ($helpbaseurl) print '<div class="help"><a class="help" target="_blank" href="'.sprintf($helpbaseurl,$help_url).'">'.$langs->trans("Help").'</a></div>';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2005-09-12 15:22:07 +02:00
|
|
|
|
if (MAIN_SHOW_BUGTRACK_LINK == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Lien vers le bugtrack
|
|
|
|
|
|
$bugbaseurl='http://savannah.nongnu.org/bugs/?';
|
|
|
|
|
|
$bugbaseurl.='func=additem&group=dolibarr&privacy=1&';
|
|
|
|
|
|
$bugbaseurl.="&details=";
|
|
|
|
|
|
$bugbaseurl.=urlencode("\n\n\n\n\n-------------\n");
|
|
|
|
|
|
$bugbaseurl.=urlencode($langs->trans("Version").": ".DOL_VERSION."\n");
|
|
|
|
|
|
$bugbaseurl.=urlencode($langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."\n");
|
|
|
|
|
|
$bugbaseurl.=urlencode($langs->trans("Url").": ".$_SERVER["REQUEST_URI"]."\n");
|
|
|
|
|
|
print '<div class="help"><a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a></div>';
|
|
|
|
|
|
}
|
2005-09-08 23:10:06 +02:00
|
|
|
|
print "\n";
|
|
|
|
|
|
print "</div>\n";
|
|
|
|
|
|
print "</div>\n";
|
|
|
|
|
|
print "<!-- Fin left vertical menu -->\n";
|
2004-07-25 18:52:26 +02:00
|
|
|
|
|
2005-09-08 23:10:06 +02:00
|
|
|
|
print '<div class="vmenuplusfiche">'."\n";
|
2004-07-25 18:52:26 +02:00
|
|
|
|
|
2005-09-08 23:10:06 +02:00
|
|
|
|
print '<div class="fiche">'."\n";
|
2002-05-04 01:01:45 +02:00
|
|
|
|
|
|
|
|
|
|
}
|
2004-08-13 23:45:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-01 20:48:22 +01:00
|
|
|
|
/**
|
2004-08-13 23:45:23 +02:00
|
|
|
|
* \brief Affiche une zone de recherche
|
|
|
|
|
|
* \param urlaction url du post
|
|
|
|
|
|
* \param urlobject url du lien sur titre de la zone de recherche
|
|
|
|
|
|
* \param title titre de la zone de recherche
|
2005-01-09 19:30:34 +01:00
|
|
|
|
* \param htmlmodesearch 'search'
|
2004-08-13 23:45:23 +02:00
|
|
|
|
* \param htmlinputname nom du champ input du formulaire
|
|
|
|
|
|
*/
|
2004-10-20 23:06:45 +02:00
|
|
|
|
|
2004-08-13 23:45:23 +02:00
|
|
|
|
function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$htmlinputname)
|
|
|
|
|
|
{
|
2004-10-31 14:46:59 +01:00
|
|
|
|
global $langs;
|
2004-08-20 11:04:51 +02:00
|
|
|
|
print '<form action="'.$urlaction.'" method="post">';
|
|
|
|
|
|
print '<a class="vmenu" href="'.$urlobject.'">'.$title.'</a><br>';
|
|
|
|
|
|
print '<input type="hidden" name="mode" value="search">';
|
|
|
|
|
|
print '<input type="hidden" name="mode-search" value="'.$htmlmodesearch.'">';
|
|
|
|
|
|
print '<input type="text" class="flat" name="'.$htmlinputname.'" size="10"> ';
|
2004-10-31 14:46:59 +01:00
|
|
|
|
print '<input type="submit" class="button" value="'.$langs->trans("Go").'">';
|
2004-08-22 12:05:33 +02:00
|
|
|
|
print "</form>";
|
2004-08-13 23:45:23 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-01 20:48:22 +01:00
|
|
|
|
/**
|
2004-08-13 23:45:23 +02:00
|
|
|
|
* \brief Impression du pied de page
|
|
|
|
|
|
* \param foot Non utilis<EFBFBD>
|
2002-12-31 15:10:59 +01:00
|
|
|
|
*/
|
2004-10-20 23:06:45 +02:00
|
|
|
|
|
2002-12-12 17:42:08 +01:00
|
|
|
|
function llxFooter($foot='')
|
|
|
|
|
|
{
|
2003-10-14 16:55:47 +02:00
|
|
|
|
global $dolibarr_auto_user;
|
2004-08-21 16:21:32 +02:00
|
|
|
|
|
2005-07-02 16:01:36 +02:00
|
|
|
|
print "\n".'</div><!-- div class="fiche" -->'."\n";
|
|
|
|
|
|
print "\n".'</div><!-- div class="vmenuplusfiche" -->';
|
|
|
|
|
|
print "\n".'</div><!-- div class="body" -->'."\n";
|
2004-08-21 16:21:32 +02:00
|
|
|
|
|
2004-08-20 11:04:51 +02:00
|
|
|
|
print "</body>\n</html>\n";
|
2002-05-09 16:57:48 +02:00
|
|
|
|
}
|
2002-04-30 12:56:25 +02:00
|
|
|
|
?>
|