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 '
';
print '
';
print '';
print '| Famille | ';
-print 'Nom | ';
+print 'Module | ';
print 'Info | ';
print 'Actif | ';
print 'Action | ';
@@ -182,6 +182,8 @@ foreach ($orders as $key => $value)
$const_name = $objMod->const_name;
$const_value = $objMod->const_config;
+
+ if ($oldfamily && $family!=$oldfamily) { print '
|
'; }
print "";
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 '
';
}
+
+print '';
+
+/*
+ * 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 '';
+ print '| Dernières actions effectuées | ';
+ $var = true;
+ $i = 0;
+
+ while ($i < $num )
+ {
+ $obj = $db->fetch_object($i);
+ $var=!$var;
+
+ print "";
+ print "| id\">".img_file()." ";
+ print "id\">$obj->libelle $obj->label | ";
+ print "".strftime("%d %b %Y",$obj->da)." | ";
+ print ''.$obj->sname.' | ';
+ $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 " ";
+
+ $db->free();
+}
+else
+{
+ print $db->error();
+}
+
/*
* Actions commerciales a faire
*
*/
-print ' | ';
$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 '';
- print '| Les 5 dernières propositions commerciales traitées | ';
+ print '| Les 5 dernières propositions commerciales fermées | ';
$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 '';
- print '| Factures impayées | Montant TTC | Reçu | ';
+ print '| Factures clients impayées | Montant TTC | Reçu | ';
$var = True;
$total = $totalam = 0;
while ($i < $num)
@@ -314,7 +314,7 @@ if ($user->societe_id == 0)
if ($num)
{
print '';
- print '| Factures à payer | Montant TTC | ';
+ print '| Factures fournisseurs à payer | Montant TTC | ';
print "\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 '';
+
+if (! $nbofentries) {
+ print '| | ';
+}
+else {
+ $widthtd=floor(100/$nbofentries);
+
+ if ($conf->commercial->enabled)
{
- print '';
- }
- else
- {
- print '-';
- }
+ $class="";
+ if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial") { $class="menusel"; }
+ elseif (ereg('^\/comm\/',$PHP_SELF)) { $class="menusel"; }
+ print '';
+ print 'Commercial';
+ print ' | ';
}
- else
+
+ if ($conf->adherent->enabled)
{
- print '';
- }
- else
- {
- print '-';
- }
+ $class="";
+ if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "adherent") { $class="menusel"; }
+ elseif (ereg('^\/adherents\/',$PHP_SELF)) { $class="menusel"; }
+ print '';
+ print 'Adhérents';
+ print ' | ';
}
-}
-elseif (defined('MAIN_MODULE_ADHERENT') && MAIN_MODULE_ADHERENT == 1)
-{
- print '';
-}
-else
-{
- print '';
-}
-
-
-if (defined('MAIN_MODULE_COMPTABILITE') && MAIN_MODULE_COMPTABILITE == 1)
-{
- if (strstr($GLOBALS["SCRIPT_URL"],DOL_URL_ROOT.'/compta/'))
+
+ if ($conf->compta->enabled)
{
- print '';
- }
- else
- {
- print '-';
- }
+ $class="";
+ if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "compta") { $class="menusel"; }
+ elseif (ereg('^\/compta\/',$PHP_SELF)) { $class="menusel"; }
+ print '';
+ print 'Compta';
+ print ' | ';
}
- else
+
+ if ($conf->produit->enabled || $conf->service->enabled)
{
-
- print '';
- }
- 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 '';
+ print ''.$chaine.'';
+ print ' | ';
}
-}
-else
-{
- print '';
+
+ if ($conf->webcalendar->enabled)
+ {
+ $class="";
+ if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "webcalendar") { $class="menusel"; }
+ elseif (ereg('^\/webcalendar\/',$PHP_SELF)) { $class="menusel"; }
+ print '';
+ print 'Calendrier';
+ print ' | ';
+ };
+
}
-if (strstr($GLOBALS["SCRIPT_URL"],DOL_URL_ROOT.'/product/'))
-{
- $class = "menusel";
-}
-else
-{
- $class = "menu";
-}
-
-print '';
-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 ''.$chaine.'';
-}
-else
-{
- print '-';
-}
-
-
-print ' | ';
+print ' ';
?>
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 ' |