Mutualisation code

Ajout champ id tache sur liste des taches d'un projet
This commit is contained in:
Laurent Destailleur 2006-09-23 00:27:47 +00:00
parent f10ae4b4dd
commit 1b36283769
7 changed files with 769 additions and 821 deletions

View File

@ -0,0 +1,78 @@
<?php
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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.
* or see http://www.gnu.org/
*
* $Id$
* $Source$
*/
/**
\file htdocs/lib/project.lib.php
\brief Ensemble de fonctions de base pour le module projet
\ingroup societe
\version $Revision$
Ensemble de fonctions de base de dolibarr sous forme d'include
*/
function project_prepare_head($objsoc)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$objsoc->id;
$head[$h][1] = $langs->trans("Project");
$head[$h][2] = 'project';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$objsoc->id;
$head[$h][1] = $langs->trans("Tasks");
$head[$h][2] = 'tasks';
$h++;
if ($conf->propal->enabled)
{
$langs->load("propal");
$head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$objsoc->id;
$head[$h][1] = $langs->trans("Proposals");
$head[$h][2] = 'propal';
$h++;
}
if ($conf->commande->enabled)
{
$langs->load("orders");
$head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$objsoc->id;
$head[$h][1] = $langs->trans("Orders");
$head[$h][2] = 'order';
$h++;
}
if ($conf->facture->enabled)
{
$langs->load("bills");
$head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$objsoc->id;
$head[$h][1] = $langs->trans("Invoices");
$head[$h][2] = 'invoice';
$h++;
}
return $head;
}
?>

View File

@ -116,7 +116,6 @@ class Project
* \brief Charge objet projet depuis la base * \brief Charge objet projet depuis la base
* \param rowid id du projet à charger * \param rowid id du projet à charger
*/ */
function fetch($rowid) function fetch($rowid)
{ {
@ -158,7 +157,6 @@ class Project
* *
* *
*/ */
function get_propal_list() function get_propal_list()
{ {
$propales = array(); $propales = array();
@ -383,6 +381,8 @@ class Project
return $result; return $result;
} }
/* /*
* \brief Crée une tache dans le projet * \brief Crée une tache dans le projet
* \param user Id utilisateur qui crée * \param user Id utilisateur qui crée
@ -410,7 +410,6 @@ class Project
if ($result ==0) if ($result ==0)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task";
$sql .= " SET duration_effective = duration_effective + '".ereg_replace(",",".",$time)."'"; $sql .= " SET duration_effective = duration_effective + '".ereg_replace(",",".",$time)."'";
$sql .= " WHERE rowid = '".$task."';"; $sql .= " WHERE rowid = '".$task."';";
@ -427,11 +426,76 @@ class Project
} }
} }
return $result; return $result;
} }
function getTasksRoleForUser($user)
{
$tasksrole = array();
/* Liste des taches et role sur la tache du user courant dans $tasksrole */
$sql = "SELECT a.fk_projet_task, a.role";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_actors as a";
$sql .= " WHERE a.fk_user = ".$user->id;
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $this->db->fetch_row($resql);
$tasksrole[$row[0]] = $row[1];
$i++;
}
$this->db->free();
}
else
{
dolibarr_print_error($this->db);
}
return $tasksrole;
}
function getTasksArray()
{
$tasks = array();
/* Liste des tâches dans $tasks */
$sql = "SELECT t.rowid, t.title, t.fk_task_parent, t.duration_effective";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t";
$sql .= " WHERE t.fk_projet =".$this->id;
$sql .= " ORDER BY t.fk_task_parent";
$var=true;
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$tasks[$i]->id = $obj->rowid;
$tasks[$i]->title = $obj->title;
$tasks[$i]->fk_parent = $obj->fk_task_parent;
$tasks[$i]->duration = $obj->duration_effective;
$i++;
}
$this->db->free();
}
else
{
dolibarr_print_error($this->db);
}
return $tasks;
}
} }
?> ?>

View File

@ -31,6 +31,7 @@ require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
if ($conf->projet->enabled) $langs->load("projects"); if ($conf->projet->enabled) $langs->load("projects");
$langs->load("companies"); $langs->load("companies");
@ -72,43 +73,13 @@ llxHeader("","../");
$projet = new Project($db); $projet = new Project($db);
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Project");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Tasks");
$h++;
if ($conf->propal->enabled) {
$langs->load("propal");
$head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Proposals");
$h++;
}
if ($conf->commande->enabled) {
$langs->load("orders");
$head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Orders");
$hselected=$h;
$h++;
}
if ($conf->facture->enabled) {
$langs->load("bills");
$head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Bills");
$h++;
}
dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref);
$projet->societe->fetch($projet->societe->id); $projet->societe->fetch($projet->societe->id);
$head=project_prepare_head($projet);
dolibarr_fiche_head($head, 'order', $langs->trans("Project"));
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>'; print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';

View File

@ -31,6 +31,7 @@ require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
$langs->load("projects"); $langs->load("projects");
$langs->load("companies"); $langs->load("companies");
@ -73,43 +74,12 @@ llxHeader("","../");
$projet = new Project($db); $projet = new Project($db);
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Project");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Tasks");
$h++;
if ($conf->propal->enabled) {
$langs->load("propal");
$head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Proposals");
$h++;
}
if ($conf->commande->enabled) {
$langs->load("orders");
$head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Orders");
$h++;
}
if ($conf->facture->enabled) {
$langs->load("bills");
$head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Bills");
$hselected=$h;
$h++;
}
dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref);
$projet->societe->fetch($projet->societe->id); $projet->societe->fetch($projet->societe->id);
$head=project_prepare_head($projet);
dolibarr_fiche_head($head, 'invoice', $langs->trans("Project"));
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>'; print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';

View File

@ -31,6 +31,7 @@ require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
if (!$user->rights->projet->lire) accessforbidden(); if (!$user->rights->projet->lire) accessforbidden();
@ -116,10 +117,12 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user-
if ($projet->delete($user) == 0) if ($projet->delete($user) == 0)
{ {
Header("Location: index.php"); Header("Location: index.php");
exit;
} }
else else
{ {
Header("Location: fiche.php?id=".$projet->id); Header("Location: fiche.php?id=".$projet->id);
exit;
} }
} }
@ -167,41 +170,8 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$projet->societe->fetch($projet->societe->id); $projet->societe->fetch($projet->societe->id);
$h=0; $head=project_prepare_head($projet);
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; dolibarr_fiche_head($head, 'project', $langs->trans("Project"));
$head[$h][1] = $langs->trans("Project");
$hselected=$h;
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Tasks");
$h++;
if ($conf->propal->enabled)
{
$langs->load("propal");
$head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Proposals");
$h++;
}
if ($conf->commande->enabled)
{
$langs->load("orders");
$head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Orders");
$h++;
}
if ($conf->facture->enabled)
{
$langs->load("bills");
$head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Bills");
$h++;
}
dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref);
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')

View File

@ -31,6 +31,7 @@ require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
$langs->load("projects"); $langs->load("projects");
$langs->load("companies"); $langs->load("companies");
@ -72,45 +73,15 @@ llxHeader("","../");
$projet = new Project($db); $projet = new Project($db);
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$projet->societe->fetch($projet->societe->id);
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Project");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projet->id; $head=project_prepare_head($projet);
$head[$h][1] = $langs->trans("Tasks"); dolibarr_fiche_head($head, 'propal', $langs->trans("Project"));
$h++;
if ($conf->propal->enabled) {
$langs->load("propal");
$head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Proposals");
$hselected=$h;
$h++;
}
if ($conf->commande->enabled) {
$langs->load("orders");
$head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Orders");
$h++;
}
if ($conf->facture->enabled) {
$langs->load("bills");
$head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Bills");
$h++;
}
dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref);
$propales = array(); $propales = array();
$projet->societe->fetch($projet->societe->id);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>'; print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';

View File

@ -28,6 +28,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
$user->getrights('projet'); $user->getrights('projet');
@ -61,41 +62,46 @@ if ($projetid && !$user->rights->commercial->client->voir)
} }
} }
Function PLines(&$inc, $parent, $lines, &$level, $actors) Function PLines(&$inc, $parent, $lines, &$level, $tasksrole)
{ {
$form = new Form($db); // $db est null ici mais inutile pour la fonction select_date() $form = new Form($db); // $db est null ici mais inutile pour la fonction select_date()
global $user, $bc, $langs; global $user, $bc, $langs;
for ($i = 0 ; $i < sizeof($lines) ; $i++) for ($i = 0 ; $i < sizeof($lines) ; $i++)
{ {
if ($parent == 0) if ($parent == 0)
$level = 0; $level = 0;
if ($lines[$i][1] == $parent) if ($lines[$i]->fk_parent == $parent)
{ {
$var = !$var; $var = !$var;
print "<tr $bc[$var]>\n<td>"; print "<tr $bc[$var]>\n";
print "<td>".$lines[$i]->id."</td>";
print "<td>";
for ($k = 0 ; $k < $level ; $k++) for ($k = 0 ; $k < $level ; $k++)
{ {
print "&nbsp;&nbsp;&nbsp;"; print "&nbsp;&nbsp;&nbsp;";
} }
print '<a href="task.php?id='.$lines[$i][2].'">'.$lines[$i][0]."</a></td>\n"; print '<a href="task.php?id='.$lines[$i]->id.'">'.$lines[$i]->title."</a></td>\n";
$heure = intval($lines[$i][3]); $heure = intval($lines[$i]->duration);
$minutes = (($lines[$i][3] - $heure) * 60); $minutes = (($lines[$i]->duration - $heure) * 60);
$minutes = substr("00"."$minutes", -2); $minutes = substr("00"."$minutes", -2);
print '<td align="right">'.$heure."&nbsp;h&nbsp;".$minutes."</td>\n"; print '<td align="right">'.$heure."&nbsp;h&nbsp;".$minutes."</td>\n";
// TODO améliorer le test // TODO améliorer le test
if ($actors[$lines[$i][2]] == 'admin') if ($tasksrole[$lines[$i]->id] == 'admin')
{ {
print '<td><input size="4" type="text" class="flat" name="task'.$lines[$i][2].'" value="">'; print '<td><input size="4" type="text" class="flat" name="task'.$lines[$i]->id.'" value="">';
print '&nbsp;<input type="submit" class="button" value="'.$langs->trans("Save").'"></td>'; print '&nbsp;<input type="submit" class="button" value="'.$langs->trans("Save").'"></td>';
print "\n<td>"; print "\n<td>";
print $form->select_date('',$lines[$i][2],'','','',"addtime"); print $form->select_date('',$lines[$i]->id,'','','',"addtime");
print '</td>'; print '</td>';
} }
else else
@ -105,7 +111,7 @@ Function PLines(&$inc, $parent, $lines, &$level, $actors)
print "</tr>\n"; print "</tr>\n";
$inc++; $inc++;
$level++; $level++;
PLines($inc, $lines[$i][2], $lines, $level, $actors); PLines($inc, $lines[$i]->id, $lines, $level, $tasksrole);
$level--; $level--;
} }
else else
@ -122,21 +128,21 @@ Function PLineSelect(&$inc, $parent, $lines, &$level)
if ($parent == 0) if ($parent == 0)
$level = 0; $level = 0;
if ($lines[$i][1] == $parent) if ($lines[$i]->fk_parent == $parent)
{ {
$var = !$var; $var = !$var;
print '<option value="'.$lines[$i][2].'">'; print '<option value="'.$lines[$i]->id.'">';
for ($k = 0 ; $k < $level ; $k++) for ($k = 0 ; $k < $level ; $k++)
{ {
print "&nbsp;&nbsp;&nbsp;"; print "&nbsp;&nbsp;&nbsp;";
} }
print $lines[$i][0]."</option>\n"; print $lines[$i]->title."</option>\n";
$inc++; $inc++;
$level++; $level++;
PLineSelect($inc, $lines[$i][2], $lines, $level); PLineSelect($inc, $lines[$i]->id, $lines, $level);
$level--; $level--;
} }
} }
@ -181,6 +187,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
} }
Header("Location:fiche.php?id=".$pro->id); Header("Location:fiche.php?id=".$pro->id);
exit;
} }
} }
@ -226,41 +233,9 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$projet->societe->fetch($projet->societe->id); $projet->societe->fetch($projet->societe->id);
$h=0; $head=project_prepare_head($projet);
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; dolibarr_fiche_head($head, 'tasks', $langs->trans("Project"));
$head[$h][1] = $langs->trans("Project");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Tasks");
$hselected=$h;
$h++;
if ($conf->propal->enabled)
{
$langs->load("propal");
$head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Proposals");
$h++;
}
if ($conf->commande->enabled)
{
$langs->load("orders");
$head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Orders");
$h++;
}
if ($conf->facture->enabled)
{
$langs->load("bills");
$head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = $langs->trans("Bills");
$h++;
}
dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref);
print '<form method="POST" action="fiche.php?id='.$projet->id.'">'; print '<form method="POST" action="fiche.php?id='.$projet->id.'">';
print '<input type="hidden" name="action" value="createtask">'; print '<input type="hidden" name="action" value="createtask">';
@ -271,69 +246,16 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
print '<td>'.$langs->trans("Company").'</td><td>'.$projet->societe->getNomUrl(1).'</td></tr>'; print '<td>'.$langs->trans("Company").'</td><td>'.$projet->societe->getNomUrl(1).'</td></tr>';
$tasksrole=$projet->getTasksRoleForUser($user);
/* Liste des acteurs */ $tasksarray=$projet->getTasksArray();
$sql = "SELECT a.fk_projet_task, a.role";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_actors as a";
$sql .= " WHERE a.fk_user = ".$user->id;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$actors = array();
while ($i < $num)
{
$row = $db->fetch_row($resql);
$actors[$row[0]] = $row[1];
$i++;
}
$db->free();
}
else
{
dolibarr_print_error($db);
}
/* Liste des tâches */
$sql = "SELECT t.rowid, t.title, t.fk_task_parent, t.duration_effective";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t";
$sql .= " WHERE t.fk_projet =".$projet->id;
$sql .= " ORDER BY t.fk_task_parent";
$var=true;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$tasks = array();
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$tasks[$i][0] = $obj->title;
$tasks[$i][1] = $obj->fk_task_parent;
$tasks[$i][2] = $obj->rowid;
$tasks[$i][3] = $obj->duration_effective;
$i++;
}
$db->free();
}
else
{
dolibarr_print_error($db);
}
/* Nouvelle tâche */ /* Nouvelle tâche */
print '<tr><td>'.$langs->trans("NewTask").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("NewTask").'</td><td colspan="3">';
print '<input type="text" size="25" name="task_name" class="flat">&nbsp;'; print '<input type="text" size="25" name="task_name" class="flat">&nbsp;';
print '<select class="flat" name="task_parent">'; print '<select class="flat" name="task_parent">';
print '<option value="0" selected="true">&nbsp;</option>'; print '<option value="0" selected="true">&nbsp;</option>';
PLineSelect($j, 0, $tasks, $level); PLineSelect($j, 0, $tasksarray, $level);
print '</select>&nbsp;'; print '</select>&nbsp;';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '</td></tr>'; print '</td></tr>';
@ -342,13 +264,15 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
print '<form name="addtime" method="POST" action="fiche.php?id='.$projet->id.'">'; print '<form name="addtime" method="POST" action="fiche.php?id='.$projet->id.'">';
print '<input type="hidden" name="action" value="addtime">'; print '<input type="hidden" name="action" value="addtime">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("ID").'</td>';
print '<td>'.$langs->trans("Task").'</td>'; print '<td>'.$langs->trans("Task").'</td>';
print '<td align="right">'.$langs->trans("DurationEffective").'</td>'; print '<td align="right">'.$langs->trans("DurationEffective").'</td>';
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>'; print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
print "</tr>\n"; print "</tr>\n";
PLines($j, 0, $tasks, $level, $actors); PLines($j, 0, $tasksarray, $level, $tasksrole);
print '</form>'; print '</form>';