*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
/**
\file htdocs/projet/tasks/fiche.php
\ingroup projet
\brief Fiche tâches d'un projet
\version $Revision$
*/
require("./pre.inc.php");
$user->getrights('projet');
if (!$user->rights->projet->lire) accessforbidden();
/*
* Sécurité accés client
*/
$projetid='';
if ($_GET["id"]) { $projetid=$_GET["id"]; }
if ($projetid == '') accessforbidden();
if ($user->societe_id > 0)
{
$socidp = $user->societe_id;
}
// Protection restriction commercial
if ($projetid)
{
$sql = "SELECT sc.fk_soc, p.rowid, p.fk_soc";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."projet as p";
$sql .= " WHERE p.rowid = ".$projetid;
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= " AND sc.fk_soc = p.fk_soc AND fk_user = ".$user->id;
if ($socidp) $sql .= " AND p.fk_soc = ".$socidp;
if ( $db->query($sql) )
{
if ( $db->num_rows() == 0) accessforbidden();
}
}
Function PLines(&$inc, $parent, $lines, &$level, $actors)
{
$form = new Form($db); // $db est null ici mais inutile pour la fonction select_date()
global $user, $bc, $langs;
for ($i = 0 ; $i < sizeof($lines) ; $i++)
{
if ($parent == 0)
$level = 0;
if ($lines[$i][1] == $parent)
{
$var = !$var;
print "