Qual: First change to remove pre.inc.php

This commit is contained in:
Laurent Destailleur 2010-02-28 04:32:18 +00:00
parent d6f7018be6
commit 40d42b56de
8 changed files with 146 additions and 124 deletions

View File

@ -46,10 +46,10 @@ class MenuLeft {
/**
* \brief Constructeur
* \param db Handler d'acc<EFBFBD>s base de donn<EFBFBD>e
* \param menu_array Tableau des entr<EFBFBD>e de menu d<EFBFBD>fini dans les fichier pre.inc.php
* \param db Handler d'acces base de donnee
* \param menu_array Tableau des entree de menu defini dans les fichier pre.inc.php
*/
function MenuLeft($db,&$menu_array)
function MenuLeft($db,&$menu_array='')
{
$this->db=$db;
$this->menu_array=$menu_array;
@ -142,7 +142,7 @@ class MenuLeft {
// Affichage du menu
$alt=0;
if (sizeof($this->menu_array))
if (is_array($this->menu_array))
{
$contenu = 0;
for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++)

View File

@ -46,10 +46,10 @@ class MenuLeft {
/**
* \brief Constructeur
* \param db Handler d'acc<EFBFBD>s base de donn<EFBFBD>e
* \param menu_array Tableau des entr<EFBFBD>e de menu d<EFBFBD>fini dans les fichier pre.inc.php
* \param db Handler d'acces base de donnee
* \param menu_array Tableau des entree de menu defini dans les fichier pre.inc.php
*/
function MenuLeft($db,&$menu_array)
function MenuLeft($db,&$menu_array='')
{
$this->db=$db;
$this->menu_array=$menu_array;
@ -142,7 +142,7 @@ class MenuLeft {
// Affichage du menu
$alt=0;
if (sizeof($this->menu_array))
if (is_array($this->menu_array))
{
$contenu = 0;
for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++)

View File

@ -47,7 +47,7 @@ class MenuLeft {
* \param db Handler d'acces base de donnee
* \param menu_array Tableau des entree de menu defini dans les fichier pre.inc.php
*/
function MenuLeft($db,&$menu_array)
function MenuLeft($db,&$menu_array='')
{
$this->db=$db;
$this->menu_array=$menu_array;
@ -906,7 +906,7 @@ class MenuLeft {
// Affichage du menu
$alt=0;
if (sizeof($this->menu_array))
if (is_array($this->menu_array))
{
$contenu = 0;
for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++)

View File

@ -46,7 +46,7 @@ class MenuLeft {
* \param db Handler d'acces base de donnee
* \param menu_array Tableau des entree de menu defini dans les fichier pre.inc.php
*/
function MenuLeft($db,&$menu_array)
function MenuLeft($db,&$menu_array='')
{
$this->db=$db;
$this->menu_array=$menu_array;
@ -914,7 +914,7 @@ class MenuLeft {
// Affichage du menu
$alt=0;
if (sizeof($this->menu_array))
if (is_array($this->menu_array))
{
$contenu = 0;
for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++)

View File

@ -36,7 +36,7 @@ class MenuLeft {
* \param db Dabatase handler
* \param menu_array Menu array that you will override in showmenu() function
*/
function MenuLeft($db,&$menu_array)
function MenuLeft($db,&$menu_array='')
{
$this->db=$db;
$this->menu_array=$menu_array;

View File

@ -43,10 +43,10 @@ class MenuLeft {
/**
* \brief Constructeur
* \param db Handler d'acc<EFBFBD>s base de donn<EFBFBD>e
* \param menu_array Tableau des entr<EFBFBD>e de menu d<EFBFBD>fini dans les fichier pre.inc.php
* \param db Handler d'acces base de donnee
* \param menu_array Tableau des entree de menu defini dans les fichier pre.inc.php
*/
function MenuLeft($db,&$menu_array)
function MenuLeft($db,&$menu_array='')
{
$this->db=$db;
$this->menu_array=$menu_array;

View File

@ -26,7 +26,7 @@
define('NOCSRFCHECK',1); // This is login page. We must be able to go on it from another web site.
require("./pre.inc.php");
require("./main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/boxes.php");
@ -42,6 +42,7 @@ $infobox=new InfoBox($db);
// No actions
/*
* View
*/
@ -125,7 +126,7 @@ if ($user->societe_id == 0)
! empty($conf->facture->enabled) && $user->rights->facture->lire,
! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire,
! empty($conf->societe->enabled) && $user->rights->contrat->activer);
// Class file containing the method load_state_board for each line
// Class file containing the method load_state_board for each line
$includes=array(DOL_DOCUMENT_ROOT."/client.class.php",
DOL_DOCUMENT_ROOT."/prospect.class.php",
DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php",
@ -161,7 +162,7 @@ if ($user->societe_id == 0)
'invoices',
'sign',
'Contracts');
// Dashboard Icon lines
// Dashboard Icon lines
$icons=array('company',
'company',
'company',
@ -185,7 +186,7 @@ if ($user->societe_id == 0)
"BillsCustomers",
"Lignes de telephonie suivis",
"Contracts");
// Dashboard Link lines
// Dashboard Link lines
$links=array(DOL_URL_ROOT.'/comm/clients.php',
DOL_URL_ROOT.'/comm/prospect/prospects.php',
DOL_URL_ROOT.'/fourn/index.php',

View File

@ -705,6 +705,131 @@ else
}
/**
* \brief Show HTML header HTML + BODY + Top menu + left menu + DIV
* \param head
* \param title
* \param help_url
* \param target
* \param disablejs
* \param disablehead
* \param arrayofjs
* \param arrayofcss
*/
if (! function_exists("llxHeader"))
{
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
{
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
left_menu('', $help_url);
}
}
/**
* \brief Show an HTML header + a BODY + The top menu bar
* \param head Lines in the HEAD
* \param title Title of web page
* \param target Target to use in menu links
* \param disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
* \param disablehead Do not output head section
* \param arrayofjs Array of js files to add in header
* \param arrayofcss Array of css files to add in header
*/
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
{
global $user, $conf, $langs, $db, $dolibarr_main_authentication;
if (! $conf->top_menu) $conf->top_menu ='eldy_backoffice.php';
if (! $conf->left_menu) $conf->left_menu='eldy_backoffice.php';
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
print '<body id="mainbody"><div id="dhtmltooltip"></div>';
/*
* Top menu
*/
print "\n".'<!-- Start top horizontal menu -->'."\n";
print '<div class="tmenu">'."\n";
// Load the top menu manager
$result=@include_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
if (! $result) // If failed to include, we try with standard
{
$conf->top_menu='eldy_backoffice.php';
include_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
}
$menutop = new MenuTop($db);
$menutop->atarget=$target;
// Affiche le menu
$menutop->showmenu();
// Link to login card
print '<a class="login" href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id.'"';
print $menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
print '>'.$user->login.'</a>';
// Link info
$htmltext=''; $text='';
if ($_SESSION["dol_authmode"] != 'forceuser'
&& $_SESSION["dol_authmode"] != 'http')
{
$htmltext=$langs->trans("Logout").'<br>';
$htmltext.="<br>";
$text.='<a href="'.DOL_URL_ROOT.'/user/logout.php"';
$text.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
$text.='>';
$text.='<img class="login" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
$text.=' alt="'.dol_escape_htmltag($langs->trans("Logout")).'" title=""';
$text.='>';
$text.='</a>';
}
else
{
$text.='<img class="login" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
$text.=' alt="'.dol_escape_htmltag($langs->trans("Logout")).'" title=""';
$text.='>';
}
$htmltext.='<u>'.$langs->trans("User").'</u>';
$htmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->fullname;
$htmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login;
$htmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
$htmltext.='<br><b>'.$langs->trans("Type").'</b>: '.($user->societe_id?$langs->trans("External"):$langs->trans("Internal"));
$htmltext.='<br>';
$htmltext.='<br><u>'.$langs->trans("Connection").'</u>';
if ($conf->global->MAIN_MODULE_MULTICOMPANY) $htmltext.='<br><b>'.$langs->trans("ConnectedOnMultiCompany").'</b>: '.$conf->entity.' (user entity '.$user->entity.')';
$htmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour");
$htmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dol_print_date($user->datepreviouslogin,"dayhour");
$htmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"];
$htmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
$htmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.$langs->getDefaultLang();
$htmltext.='<br><b>'.$langs->trans("Browser").'</b>: '.$conf->browser->name.' ('.$_SERVER['HTTP_USER_AGENT'].')';
if (! empty($conf->browser->phone)) $htmltext.='<br><b>'.$langs->trans("Phone").'</b>: '.$conf->browser->phone;
if (! empty($_SESSION["disablemodules"])) $htmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join('<br>',explode(',',$_SESSION["disablemodules"]));
// print '<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
// print ' alt="'.$title.'" title="'.$title.'"';
// print '>';
$html=new Form($db);
print $html->textwithtooltip('',$htmltext,2,1,$text);
// Link to print main content area
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->browser->phone))
{
$text ='<a href="'.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].'&optioncss=print" target="_blank">';
$text.='<img class="printer" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/printer.png"';
$text.=' title="'.dol_escape_htmltag($langs->trans("PrintContentArea")).'" alt="'.dol_escape_htmltag($langs->trans("PrintContentArea")).'">';
$text.='</a>';
print $text;
}
print "\n</div>\n<!-- End top horizontal menu -->\n";
}
/**
* \brief Show HTML header
@ -845,110 +970,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
}
}
/**
* \brief Show an HTML header + a BODY + The top menu bar
* \param head Lines in the HEAD
* \param title Title of web page
* \param target Target to use in menu links
* \param disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
* \param disablehead Do not output head section
* \param arrayofjs Array of js files to add in header
* \param arrayofcss Array of css files to add in header
*/
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
{
global $user, $conf, $langs, $db, $dolibarr_main_authentication;
if (! $conf->top_menu) $conf->top_menu ='eldy_backoffice.php';
if (! $conf->left_menu) $conf->left_menu='eldy_backoffice.php';
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
print '<body id="mainbody"><div id="dhtmltooltip"></div>';
/*
* Top menu
*/
print "\n".'<!-- Start top horizontal menu -->'."\n";
print '<div class="tmenu">'."\n";
// Load the top menu manager
$result=@include_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
if (! $result) // If failed to include, we try with standard
{
$conf->top_menu='eldy_backoffice.php';
include_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
}
$menutop = new MenuTop($db);
$menutop->atarget=$target;
// Affiche le menu
$menutop->showmenu();
// Link to login card
print '<a class="login" href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id.'"';
print $menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
print '>'.$user->login.'</a>';
// Link info
$htmltext=''; $text='';
if ($_SESSION["dol_authmode"] != 'forceuser'
&& $_SESSION["dol_authmode"] != 'http')
{
$htmltext=$langs->trans("Logout").'<br>';
$htmltext.="<br>";
$text.='<a href="'.DOL_URL_ROOT.'/user/logout.php"';
$text.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
$text.='>';
$text.='<img class="login" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
$text.=' alt="'.dol_escape_htmltag($langs->trans("Logout")).'" title=""';
$text.='>';
$text.='</a>';
}
else
{
$text.='<img class="login" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
$text.=' alt="'.dol_escape_htmltag($langs->trans("Logout")).'" title=""';
$text.='>';
}
$htmltext.='<u>'.$langs->trans("User").'</u>';
$htmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->fullname;
$htmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login;
$htmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
$htmltext.='<br><b>'.$langs->trans("Type").'</b>: '.($user->societe_id?$langs->trans("External"):$langs->trans("Internal"));
$htmltext.='<br>';
$htmltext.='<br><u>'.$langs->trans("Connection").'</u>';
if ($conf->global->MAIN_MODULE_MULTICOMPANY) $htmltext.='<br><b>'.$langs->trans("ConnectedOnMultiCompany").'</b>: '.$conf->entity.' (user entity '.$user->entity.')';
$htmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour");
$htmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dol_print_date($user->datepreviouslogin,"dayhour");
$htmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"];
$htmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
$htmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.$langs->getDefaultLang();
$htmltext.='<br><b>'.$langs->trans("Browser").'</b>: '.$conf->browser->name.' ('.$_SERVER['HTTP_USER_AGENT'].')';
if (! empty($conf->browser->phone)) $htmltext.='<br><b>'.$langs->trans("Phone").'</b>: '.$conf->browser->phone;
if (! empty($_SESSION["disablemodules"])) $htmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join('<br>',explode(',',$_SESSION["disablemodules"]));
// print '<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
// print ' alt="'.$title.'" title="'.$title.'"';
// print '>';
$html=new Form($db);
print $html->textwithtooltip('',$htmltext,2,1,$text);
// Link to print main content area
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->browser->phone))
{
$text ='<a href="'.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].'&optioncss=print" target="_blank">';
$text.='<img class="printer" border="0" width="14" height="14" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/printer.png"';
$text.=' title="'.dol_escape_htmltag($langs->trans("PrintContentArea")).'" alt="'.dol_escape_htmltag($langs->trans("PrintContentArea")).'">';
$text.='</a>';
print $text;
}
print "\n</div>\n<!-- End top horizontal menu -->\n";
}
/**
* \brief Show left menu bar