Ajout permission et mise aux normes

This commit is contained in:
Rodolphe Quiedeville 2005-08-21 12:11:44 +00:00
parent 6f783419a9
commit 16e599a617

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Bariley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Bariley / Ocebo <marc@ocebo.com>
* *
@ -31,6 +31,8 @@
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->rights->projet->lire) accessforbidden();
$socid = ( is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 ); $socid = ( is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 );
$title = $langs->trans("Projects"); $title = $langs->trans("Projects");
@ -97,10 +99,10 @@ if ($_GET["search_societe"])
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
$var=true; $var=true;
$result = $db->query($sql); $resql = $db->query($sql);
if ($result) if ($resql)
{ {
$num = $db->num_rows(); $num = $db->num_rows($resql);
$i = 0; $i = 0;
//llxHeader("",$title,"Projet"); //llxHeader("",$title,"Projet");
@ -135,7 +137,7 @@ if ($result)
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object( $i); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print "<td><a href=\"fiche.php?id=$objp->projectid\">$objp->title</a></td>\n"; print "<td><a href=\"fiche.php?id=$objp->projectid\">$objp->title</a></td>\n";
@ -150,7 +152,7 @@ if ($result)
$i++; $i++;
} }
$db->free(); $db->free($resql);
} }
else else
{ {