* Copyright (C) 2006-2009 Laurent Destailleur * * 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. */ /** * \file htdocs/projet/tasks/task.php * \ingroup projet * \brief Fiche tāches d'un projet * \version $Id$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); if (!$user->rights->projet->lire) accessforbidden(); /* * Actions */ /* * View */ llxHeader("",$langs->trans("Task")); $html = new Form($db); $projectstatic = new Project($db); $userstatic = new User($db); if ($_GET["id"] > 0) { /* * Fiche projet en mode visu * */ $task = new Task($db); if ($task->fetch($_GET["id"]) >= 0 ) { $projet = new Project($db); $result=$projet->fetch($task->fk_projet); if (! empty($projet->socid)) $projet->societe->fetch($projet->socid); $head=task_prepare_head($task); dolibarr_fiche_head($head, 'who', $langs->trans("Task")); if ($mesg) print $mesg.'
'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; /* Liste des affectations */ $sql = "SELECT t.title, t.duration_effective, t.fk_task_parent, t.statut,"; $sql.= " u.login, u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as t,"; $sql.= " ".MAIN_DB_PREFIX."projet_task_actors as ta,"; $sql.= " ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE t.rowid =".$task->id; $sql.= " AND t.rowid = ta.fk_projet_task AND ta.fk_user = u.rowid"; $lines=array(); $var=true; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; $tasks = array(); while ($i < $num) { $row = $db->fetch_object($resql); $lines[$i] = $row; $i++; } $db->free($resql); } else { dolibarr_print_error($db); } print '
'.$langs->trans("Ref").''.$task->id.'
'.$langs->trans("Label").''.$task->title.'
'.$langs->trans("Project").''; print $projet->getNomUrl(1); print '
'.$langs->trans("Company").''; if ($projet->societe->id) print $projet->societe->getNomUrl(1); else print ' '; print '
'; print ''; /* * Actions */ print '
'; /*if ($user->rights->projet->creer) { print ''.$langs->trans('Delete').''; }*/ print '
'; print '
'; print ''; print ''; print ''; print ''; print "\n"; foreach ($lines as $xxx) { $var=!$var; print ""; $userstatic->id=$xxx->rowid; $userstatic->nom=$xxx->login; print ''; print "\n"; } print "
'.$langs->trans("User").'
'.$userstatic->getNomUrl(1).'
"; } } $db->close(); llxFooter('$Date$ - $Revision$'); ?>