From bc520b51a76b1a83c1a2f6d3eb940625dce026d5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 9 Mar 2006 11:43:13 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20permission=20"consulter=20tou?= =?UTF-8?q?s=20les=20clients"=20dans=20le=20module=20commercial,=20afin=20?= =?UTF-8?q?=20qu'un=20commercial=20puisse=20voir=20que=20les=20clients=20q?= =?UTF-8?q?ui=20lui=20sont=20affect=E9s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/projet/index.php | 1 + htdocs/projet/liste.php | 3 ++- htdocs/projet/tasks/index.php | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 356ef56f249..43d94c377c3 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2005-2006 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 diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index 7531f44cab8..eacb9ccc7aa 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -1,7 +1,8 @@ * Copyright (C) 2004-2006 Laurent Destailleur - * Copyright (C) 2005 Marc Bariley / Ocebo + * Copyright (C) 2005 Marc Bariley / Ocebo + * Copyright (C) 2005-2006 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 diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php index 80a892cb017..859ad007f33 100644 --- a/htdocs/projet/tasks/index.php +++ b/htdocs/projet/tasks/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2005-2006 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 @@ -60,9 +61,12 @@ print ''.$langs->trans("NbOpenTasks").''; print "\n"; $sql = "SELECT p.title, p.rowid, count(t.rowid)"; +if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " , ".MAIN_DB_PREFIX."projet_task as t"; +if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE t.fk_projet = p.rowid"; +if (!$user->rights->commercial->client->voir && !$socidp) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socidp) { @@ -111,11 +115,14 @@ print 'Nb heures'; print "\n"; $sql = "SELECT p.title, p.rowid, sum(tt.task_duration)"; +if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " , ".MAIN_DB_PREFIX."projet_task as t"; $sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; +if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE t.fk_projet = p.rowid"; $sql .= " AND tt.fk_task = t.rowid"; +if (!$user->rights->commercial->client->voir && !$socidp) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socidp) {