From 8d7632fb29cfbb21c51243ed5c188f34d878f635 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 5 Nov 2010 18:30:13 +0000 Subject: [PATCH] Fix: date (dp) is empty --- htdocs/comm/action/index.php | 5 +++-- htdocs/lib/company.lib.php | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index dd41c995107..80924e10759 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -183,8 +183,9 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; $sql.= ', '.MAIN_DB_PREFIX.'c_actioncomm as ca'; $sql.= ', '.MAIN_DB_PREFIX.'user as u'; $sql.= ' WHERE a.fk_action = ca.id'; -$sql.= ' AND a.fk_user_author = u.rowid'; // To limit to entity +$sql.= ' AND a.fk_user_author = u.rowid'; $sql.= ' AND u.entity in (0,'.$conf->entity.')'; // To limit to entity +if ($user->societe_id) $sql.= ' AND u.fk_societe = '.$user->societe_id; // To limit to user company if ($pid) $sql.=" AND a.fk_project=".addslashes($pid); if ($_GET["action"] == 'show_day') { diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index a5850f9d691..8d80509f8f4 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -575,16 +575,17 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='') { $var = !$var; - $datep=$obj->dp; - $obj = $db->fetch_object($result); + + $datep=$obj->dp; + print ""; print ''.dol_print_date($datep,'dayhour')."\n"; // Picto warning print ''; - if ($datep && $datep < time()) print ' '.img_warning("Late"); + if ($datep && $datep < time()) print ' '.img_warning($langs->trans("Late")); else print ' '; print '';