New: Amlioration de la gestion du gestionnaire de manu du haut. Il est possible de mettre autant d'entre dans le menu du haut que voulu tout en gardant un alignement correct.

Fix: Restauration de l'apparence du menu "slectionn" qui ne fonctionnait plus.
This commit is contained in:
Laurent Destailleur 2004-06-26 17:43:07 +00:00
parent d1ea08d84f
commit 81b99269aa
8 changed files with 182 additions and 142 deletions

View File

@ -113,7 +113,7 @@ print '<br>';
print '<table class="noborder" cellpadding="3" cellspacing="0">';
print '<tr class="liste_titre">';
print '<td>Famille</td>';
print '<td>Nom</td>';
print '<td>Module</td>';
print '<td>Info</td>';
print '<td align="center">Actif</td>';
print '<td align="center">Action</td>';
@ -182,6 +182,8 @@ foreach ($orders as $key => $value)
$const_name = $objMod->const_name;
$const_value = $objMod->const_config;
if ($oldfamily && $family!=$oldfamily) { print '<tr class="liste_titre"><td colspan="6"></td></tr>'; }
print "<tr $bc[$var]>";

View File

@ -161,6 +161,10 @@ if ($conf->commande->enabled)
$sql = "SELECT s.idp, s.nom,b.rowid as bid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b";
$sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id;
if ($socidp)
{
$sql .= " AND s.idp = $socidp";
}
$sql .= " ORDER BY lower(s.nom) ASC";
if ( $db->query($sql) )
@ -187,15 +191,67 @@ if ( $db->query($sql) )
print '</table>';
}
print '</td><td valign="top" width="70%">';
/*
* Dernières actions commerciales effectuées
*
*/
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE c.id=a.fk_action AND a.percent >= 100 AND s.idp = a.fk_soc";
if ($socidp)
{
$sql .= " AND s.idp = $socidp";
}
$sql .= " ORDER BY a.datea DESC limit 5";
if ( $db->query($sql) )
{
$num = $db->num_rows();
print '<table class="noborder" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre"><td colspan="4">Dernières actions effectuées</td></tr>';
$var = true;
$i = 0;
while ($i < $num )
{
$obj = $db->fetch_object($i);
$var=!$var;
print "<tr $bc[$var]>";
print "<td><a href=\"action/fiche.php?id=$obj->id\">".img_file()."</a>&nbsp;";
print "<a href=\"action/fiche.php?id=$obj->id\">$obj->libelle $obj->label</a></td>";
print "<td>".strftime("%d %b %Y",$obj->da)."</td>";
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->sname.'</a></td>';
$i++;
}
// TODO Ajouter rappel pour "il y a des contrats à mettre en service"
// TODO Ajouter rappel pour "il y a des contrats qui arrivent à expiration"
print "</table><br>";
$db->free();
}
else
{
print $db->error();
}
/*
* Actions commerciales a faire
*
*/
print '</td><td valign="top" width="70%">';
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc AND a.fk_user_action = $user->id";
$sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc";
if ($socidp)
{
$sql .= " AND s.idp = $socidp";
}
$sql .= " ORDER BY a.datea DESC";
if ( $db->query($sql) )
@ -338,7 +394,7 @@ if ($conf->propal->enabled) {
$i = 0;
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="3">';
print '<tr class="liste_titre"><td colspan="6">Les 5 dernières propositions commerciales traitées</td></tr>';
print '<tr class="liste_titre"><td colspan="6">Les 5 dernières propositions commerciales fermées</td></tr>';
$var=False;
while ($i < $num)
{

View File

@ -247,7 +247,7 @@ if ( $db->query($sql) )
if ($num)
{
print '<table class="noborder" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre"><td colspan="2">Factures impayées</td><td align="right">Montant TTC</td><td align="right">Reçu</td></tr>';
print '<tr class="liste_titre"><td colspan="2">Factures clients impayées</td><td align="right">Montant TTC</td><td align="right">Reçu</td></tr>';
$var = True;
$total = $totalam = 0;
while ($i < $num)
@ -314,7 +314,7 @@ if ($user->societe_id == 0)
if ($num)
{
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<tr class="liste_titre"><td colspan="2">Factures à payer</td><td align="right">Montant TTC</td></tr>';
print '<tr class="liste_titre"><td colspan="2">Factures fournisseurs à payer</td><td align="right">Montant TTC</td></tr>';
print "</tr>\n";
$i = 0;
$var = True;

View File

@ -21,107 +21,80 @@
*
*/
if (defined('MAIN_MODULE_COMMERCIAL') && MAIN_MODULE_COMMERCIAL == 1)
{
if (strstr($GLOBALS["SCRIPT_URL"],DOL_URL_ROOT.'/comm/'))
global $PHP_SELF;
$nbofentries=0;
if ($conf->commercial->enabled) $nbofentries++;
if ($conf->adherent->enabled) $nbofentries++;
if ($conf->compta->enabled) $nbofentries++;
if ($conf->produit->enabled || $conf->service->enabled) $nbofentries++;
if ($conf->webcalendar->enabled) $nbofentries++;
print '<table cellpadding=0 cellspacing=0 width="100%"><tr>';
if (! $nbofentries) {
print '<td>&nbsp;</td>';
}
else {
$widthtd=floor(100/$nbofentries);
if ($conf->commercial->enabled)
{
print '<TD width="15%" class="menusel" align="center">';
if ($user->comm > 0 && $conf->commercial )
{
print '<A class="menusel" href="'.DOL_URL_ROOT.'/comm/index.php">Commercial</A></TD>';
}
else
{
print '-</td>';
}
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial") { $class="menusel"; }
elseif (ereg('^\/comm\/',$PHP_SELF)) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/comm/index.php">Commercial</A>';
print '</td>';
}
else
if ($conf->adherent->enabled)
{
print '<TD width="15%" class="menu" align="center">';
if ($user->comm > 0 && $conf->commercial )
{
print '<A class="menu" href="'.DOL_URL_ROOT.'/comm/index.php">Commercial</A></TD>';
}
else
{
print '-</td>';
}
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "adherent") { $class="menusel"; }
elseif (ereg('^\/adherents\/',$PHP_SELF)) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/adherents/index.php">Adhérents</A>';
print '</td>';
}
}
elseif (defined('MAIN_MODULE_ADHERENT') && MAIN_MODULE_ADHERENT == 1)
{
print '<TD width="15%" class="menu" align="center">';
print '<A class="menu" href="'.DOL_URL_ROOT.'/adherents/index.php">Adhérents</A></TD>';
}
else
{
print '<TD width="15%" class="menu" align="center">-</td>';
}
if (defined('MAIN_MODULE_COMPTABILITE') && MAIN_MODULE_COMPTABILITE == 1)
{
if (strstr($GLOBALS["SCRIPT_URL"],DOL_URL_ROOT.'/compta/'))
if ($conf->compta->enabled)
{
print '<TD width="15%" class="menusel" align="center">';
if ($user->compta > 0)
{
print '<A class="menusel" href="'.DOL_URL_ROOT.'/compta/index.php">Compta</A></TD>';
}
else
{
print '-';
}
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "compta") { $class="menusel"; }
elseif (ereg('^\/compta\/',$PHP_SELF)) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/compta/index.php">Compta</A>';
print '</td>';
}
else
if ($conf->produit->enabled || $conf->service->enabled)
{
print '<TD width="15%" class="menu" align="center">';
if ($user->compta > 0)
{
print '<A class="menu" href="'.DOL_URL_ROOT.'/compta/index.php">Compta</A></TD>';
}
else
{
print '-';
}
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "product") { $class="menusel"; }
elseif (ereg('^\/product\/',$PHP_SELF)) { $class="menusel"; }
$chaine="";
if ($conf->produit->enabled) { $chaine.="Produits"; }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
if ($conf->service->enabled) { $chaine.="Services"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/product/?type=0">'.$chaine.'</a>';
print '</td>';
}
}
else
{
print '<TD width="15%" class="menu" align="center">-</td>';
if ($conf->webcalendar->enabled)
{
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "webcalendar") { $class="menusel"; }
elseif (ereg('^\/webcalendar\/',$PHP_SELF)) { $class="menusel"; }
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
print '<a class="'.$class.'" href="'. PHPWEBCALENDAR_URL .'">Calendrier</a>';
print '</td>';
};
}
if (strstr($GLOBALS["SCRIPT_URL"],DOL_URL_ROOT.'/product/'))
{
$class = "menusel";
}
else
{
$class = "menu";
}
print '<TD width="15%" class="'.$class.'" align="center">';
if ($conf->produit->enabled || $conf->service->enabled)
{
$chaine="";
if ($conf->produit->enabled) { $chaine.="Produits"; }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
if ($conf->service->enabled) { $chaine.="Services"; }
print '<A class="'.$class.'" href="'.DOL_URL_ROOT.'/product/?type=0">'.$chaine.'</a>';
}
else
{
print '-';
}
print '</td><td width="15%" class="menu" align="center">';
if(defined("MAIN_MODULE_WEBCALENDAR") && MAIN_MODULE_WEBCALENDAR)
{
print '<a class="menu" href="'. PHPWEBCALENDAR_URL .'">Calendrier</a>';
};
print '&nbsp;</TD>';
print '</tr></table>';
?>

View File

@ -20,22 +20,24 @@
*
*/
print '<TD width="15%" class="menu" align="center">';
print '<table cellpadding=0 cellspacing=0 width="100%"><tr>';
print '<A class="menu" href="/boutique/livre/">Livres</A></TD>';
print '<td width="25%" align="center">';
print '<TD width="15%" class="menu" align="center">';
print '<a href="/boutique/livre/">livres</a></td>';
print '<A class="menu" href="/boutique/client/">Clients</a>';
print '<td width="25%" align="center">';
print '<TD width="15%" class="menu" align="center">';
print '<a href="/boutique/client/">clients</a></td>';
print '<A class="menu" href="/product/critiques/">Critiques</A></TD>';
print '<td width="25%" align="center">';
print '</td><td width="15%" class="menu" align="center">';
print '<a href="/product/critiques/">critiques</a></td>';
print '<A class="menu" href="/product/categorie/">Catégories</a>';
print '</td><td width="25%" align="center">';
print '</TD>';
print '<a href="/product/categorie/">catégories</a></td>';
print '</tr></table>';
?>

View File

@ -23,10 +23,9 @@ require("./pre.inc.php");
llxHeader();
print_fiche_titre( "Dolibarr ".DOL_VERSION,'<a href="about.php">A propos</a>');
print_fiche_titre("<font class=\"body\">Nous sommes le</font> ".dolibarr_print_date(mktime()).'<font class="body">, vous êtes connecté en tant que</font> ' . $user->prenom . ' ' . $user->nom .' ['.$user->code.']', '<a href="about.php">A propos</a>');
print "<br>\n";
print '<div class="titre">Connecté en tant que : <b>' . $user->prenom . ' ' . $user->nom .'</b> ['.$user->code.']</div>';
print "<br>";
/*
* Boites
*

View File

@ -267,7 +267,11 @@ if (defined("BOUTIQUE_ALBUM"))
}
if (defined("MAIN_MODULE_POSTNUKE"))
{
$conf->postnuke->enabled=MAIN_MODULE_POSTNUKE;
$conf->postnuke->enabled=MAIN_MODULE_POSTNUKE;
}
if (defined("MAIN_MODULE_WEBCALENDAR"))
{
$conf->webcalendar->enabled=MAIN_MODULE_WEBCALENDAR;
}
if (defined("MAIN_MODULE_FACTURE"))
{
@ -420,11 +424,7 @@ function top_menu($head, $title="")
print "\n<html>";
print $langs->lang_header();
// print "<HTML><HEAD>";
print $head;
// print '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">';
// print '<BASE href="'.DOL_URL_ROOT.'/">';
print '<link rel="top" title="Accueil" href="'.DOL_URL_ROOT.'/">';
print '<link rel="help" title="Aide" href="http://www.dolibarr.com/aide.fr.html">';
@ -433,8 +433,8 @@ function top_menu($head, $title="")
print '<link rel="author" title="Equipe de développement" href="http://www.dolibarr.com/dev.fr.html">'."\n";
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";
// TODO implementer les alternate css
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";
@ -469,7 +469,7 @@ function top_menu($head, $title="")
print '<table class="topbarre" width="100%">';
print "<tr><td>Votre système nécessite d'être mis à jour. ";
print "Pour cela ";
print 'cliquez sur <A href="'.DOL_URL_ROOT.'/admin/system/update.php">Mise à jour</A> !!</td></tr>';
print 'cliquez sur <A href="'.DOL_URL_ROOT.'/admin/system/update.php">Mettre à jour</A> !!</td></tr>';
print "</table>";
}
@ -479,22 +479,27 @@ function top_menu($head, $title="")
*/
print '<table class="topbarre" width="100%">';
print "<tr>";
print '<td width="15%" class="menu" align="center"><A class="menu" href="'.DOL_URL_ROOT.'/index.php">Accueil</A></TD>';
// Sommet menu de gauche
global $PHP_SELF;
$class="";
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "accueil") { $class="menusel"; }
elseif (ereg('^\/[^\\\/]+$',$PHP_SELF) || ereg('^\/user\/',$PHP_SELF) || ereg('^\/admin\/',$PHP_SELF)) { $class="menusel"; }
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">Accueil</a></td></tr></table></td>';
// Sommet géré par gestionnaire de menu du haut
print '<td class="menu">';
if (!defined(MAIN_MENU_BARRETOP))
{
define("MAIN_MENU_BARRETOP","default.php");
}
require(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".MAIN_MENU_BARRETOP);
print '</td>';
print '<td width="15%" class="menu" align="center">'.strftime(" %d %B - %H:%M",time()).'</TD>';
print '<td width="10%" class="menu" align="center">' ;
if (empty ($_SERVER["REMOTE_USER"])) // Propose ou non de se deloguer si authentication Apache ou non
// Logout
print '<td width="120" class="menu" align="center">' ;
if (! $_SERVER["REMOTE_USER"]) // Propose ou non de se deloguer si authentication Apache ou non
{
print '<a href="'.DOL_URL_ROOT.'/user/logout.php" title="logout">'.$user->login.'</a>' ;
}
@ -502,16 +507,15 @@ function top_menu($head, $title="")
{
print $user->login ;
}
print '</td></tr>';
print '</td>';
print "</tr>\n";
// print '</table>';
/*
* Table principale
*
*/
// print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="3">';
print '<tr><td valign="top" align="right">';
print '<tr><td valign="top">';
}
@ -530,10 +534,11 @@ Function left_menu($menu, $help_url='', $form_search='', $author='')
* Colonne de gauche
*
*/
print "\n<!-- Debut left menu -->\n";
for ($i = 0 ; $i < sizeof($menu) ; $i++)
{
print "\n".'<div class="leftmenu">'."\n";
print '<div class="leftmenu">'."\n";
print '<a class="leftmenu" href="'.$menu[$i][0].'">'.$menu[$i][1].'</a>';
for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2)
@ -620,9 +625,9 @@ Function left_menu($menu, $help_url='', $form_search='', $author='')
print $author->fullname .'</td></tr>';
}
*/
print "<!-- Fin left menu -->\n";
print "</td>";
print "<!-- Fin menu -->\n";
print "<td valign=\"top\" width=\"85%\" colspan=\"6\">\n";
print "<td valign=\"top\" colspan=\"2\">\n";
}
/*

View File

@ -28,6 +28,11 @@ body {
margin-right: 0;
margin-left: 0;
}
.body {
background-color: #F1F1F1;
color: #101010;
font: 13px helvetica, verdana, arial, sans-serif;
}
/***** Styles par défaut *****/
a:link { font: helvetica, verdana, arial, sans-serif; font-weight: bold; color: #000000; text-decoration: none; }
@ -57,7 +62,6 @@ td.menu {
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
}
td.menusel {
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
@ -71,6 +75,13 @@ border-bottom: 1px solid #FFFFFF;
color: #000000;
text-decoration: none;
}
.menusel
{
background: #96B9C9;
font-size: 12px; font-weight: bold;
color: #000000;
text-decoration: none;
}
/*
@ -241,14 +252,6 @@ background: #c0d5dd;
font: helvetica, verdana, arial, sans-serif;
}
.menusel
{
background: #96B9C9;
font-size: 12px; font-weight: bold;
color: #000000;
text-decoration: none;
}
/*
* Boxes