From 81b99269aa36d8f884918d2a6fdf31ba44cc3a01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Sat, 26 Jun 2004 17:43:07 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Am=E9lioration=20de=20la=20gestion=20du?= =?UTF-8?q?=20gestionnaire=20de=20manu=20du=20haut.=20Il=20est=20possible?= =?UTF-8?q?=20de=20mettre=20autant=20d'entr=E9e=20dans=20le=20menu=20du=20?= =?UTF-8?q?haut=20que=20voulu=20tout=20en=20gardant=20un=20alignement=20co?= =?UTF-8?q?rrect.=20Fix:=20Restauration=20de=20l'apparence=20du=20menu=20"?= =?UTF-8?q?s=E9lectionn=E9"=20qui=20ne=20fonctionnait=20plus.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/modules.php | 4 +- htdocs/comm/index.php | 62 +++++++- htdocs/compta/index.php | 4 +- htdocs/includes/menus/barre_top/default.php | 157 ++++++++------------ htdocs/includes/menus/barre_top/esprit.php | 20 +-- htdocs/index.php | 5 +- htdocs/main.inc.php | 51 ++++--- htdocs/theme/eldy/eldy.css | 21 +-- 8 files changed, 182 insertions(+), 142 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 0d5bec0c33a..4837cbc9ba6 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -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]>"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 1bb13a1cd69..c9fc1359a0a 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -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> "; + 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) { diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 82b59a4973d..2c0a69588c7 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -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; diff --git a/htdocs/includes/menus/barre_top/default.php b/htdocs/includes/menus/barre_top/default.php index e5681958fc1..47a3ec32f7f 100644 --- a/htdocs/includes/menus/barre_top/default.php +++ b/htdocs/includes/menus/barre_top/default.php @@ -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> </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>'; } + + 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>'; + }; + } -else -{ - print '<TD width="15%" class="menu" align="center">-</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 ' </TD>'; +print '</tr></table>'; ?> diff --git a/htdocs/includes/menus/barre_top/esprit.php b/htdocs/includes/menus/barre_top/esprit.php index 6493e067088..582b5581843 100644 --- a/htdocs/includes/menus/barre_top/esprit.php +++ b/htdocs/includes/menus/barre_top/esprit.php @@ -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>'; ?> diff --git a/htdocs/index.php b/htdocs/index.php index e4678e02d6a..ab6648a388d 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -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 * diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b100698f8c8..f0853d2b541 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -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"; } /* diff --git a/htdocs/theme/eldy/eldy.css b/htdocs/theme/eldy/eldy.css index 6094f5535aa..ddaf1984deb 100644 --- a/htdocs/theme/eldy/eldy.css +++ b/htdocs/theme/eldy/eldy.css @@ -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 -- GitLab