diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php
index 2e997c7341f4c464d77d29d686ce3a1ac4abafe0..065b1236b9966424fce7d3719958723a58effba0 100644
--- a/htdocs/actioncomm.class.php
+++ b/htdocs/actioncomm.class.php
@@ -374,7 +374,7 @@ class ActionComm
         global $conf, $user;
         
         $this->nbtodo=$this->nbtodolate=0;
-        $sql = "SELECT a.id,".$this->db->pdate("a.datea")." as da";
+        $sql = "SELECT a.id,".$this->db->pdate("a.datep")." as dp";
         if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
         $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
         if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -387,7 +387,7 @@ class ActionComm
             while ($obj=$this->db->fetch_object($resql))
             {
                 $this->nbtodo++;
-                if ($obj->da < (time() - $conf->actions->warning_delay)) $this->nbtodolate++;
+                if ($obj->dp < (time() - $conf->actions->warning_delay)) $this->nbtodolate++;
             }
             return 1;
         }
diff --git a/htdocs/index.php b/htdocs/index.php
index 36622f84af40182b0bdf5f441b010997f5720f48..b07c619b958a291af8f89fafb5451eaca187a836 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -254,12 +254,13 @@ print '</tr>';
 
 $nboflate=0;
 $var=true;
+
 //
 // Ne pas inclure de sections sans gestion de permissions
 //
 
 // Nbre actions � faire (en retard)
-if ($conf->commercial->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled)
+if ($conf->agenda->enabled && $user->rights->agenda->myactions->read)
 {
   include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
   $board=new ActionComm($db);