From 976e6416a444964476daf5b18ea9b0214f31f1db Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 13 Apr 2007 11:52:08 +0000 Subject: [PATCH] Bugfix --- htdocs/telephonie/contrat/info.php | 6 +++--- htdocs/telephonie/contrat/services.php | 2 +- htdocs/telephonie/contrat/stats.php | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/telephonie/contrat/info.php b/htdocs/telephonie/contrat/info.php index 2386d9826de..77e4687b8f9 100644 --- a/htdocs/telephonie/contrat/info.php +++ b/htdocs/telephonie/contrat/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2007 Rodolphe Quiedeville * * 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 @@ -32,7 +32,7 @@ if ($_GET["id"]) $client_comm = new Societe($db); $contrat = new TelephonieContrat($db); - if ($contrat->fetch($_GET["id"]) > 0) + if ($contrat->fetch($_GET["id"]) == 0) { $result = 1; $client_comm->fetch($contrat->client_comm_id, $user); @@ -133,7 +133,7 @@ if ($_GET["id"]) $sql .= " , ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE p.fk_commercial =u.rowid"; - $sql .= " AND p.fk_user =uu.rowid"; + $sql .= " AND p.fk_user =u.rowid"; $sql .= " AND c.fk_soc = s.idp"; $sql .= " AND p.fk_contrat = c.rowid"; $sql .= " AND c.rowid =".$_GET["id"]; diff --git a/htdocs/telephonie/contrat/services.php b/htdocs/telephonie/contrat/services.php index 99fa8343e17..4ce6d83d3f0 100644 --- a/htdocs/telephonie/contrat/services.php +++ b/htdocs/telephonie/contrat/services.php @@ -54,7 +54,7 @@ if ($_GET["id"]) $client_comm = new Societe($db); $contrat = new TelephonieContrat($db); - if ($contrat->fetch($_GET["id"]) > 0) + if ($contrat->fetch($_GET["id"]) == 0) { $result = 1; $client_comm->fetch($contrat->client_comm_id, $user); diff --git a/htdocs/telephonie/contrat/stats.php b/htdocs/telephonie/contrat/stats.php index def31b9b924..9acfe82fa5a 100644 --- a/htdocs/telephonie/contrat/stats.php +++ b/htdocs/telephonie/contrat/stats.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2007 Rodolphe Quiedeville * * 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 @@ -24,7 +24,6 @@ require("./pre.inc.php"); llxHeader("","Téléphonie - Contrat"); - /* Affichage */ if ($_GET["id"]) @@ -32,7 +31,11 @@ if ($_GET["id"]) $client_comm = new Societe($db); $contrat = new TelephonieContrat($db); - $result = $contrat->fetch($_GET["id"]); + if ($contrat->fetch($_GET["id"]) == 0) + { + $result = 1; + } + $client_comm->fetch($contrat->client_comm_id, $user); if (!$client_comm->perm_read)