Works on enhancement of project tasks
Fix: use task.class.php
This commit is contained in:
parent
062e9da861
commit
b8954be4e5
@ -213,11 +213,11 @@ class FormOther
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/tasks/task.class.php");
|
||||
|
||||
//print $modeproject.'-'.$modetask;
|
||||
$project=new Project($this->db);
|
||||
$tasksarray=$project->getTasksArray($modetask?$user:0, $modeproject?$user:0, $mode);
|
||||
$task=new Task($this->db);
|
||||
$tasksarray=$task->getTasksArray($modetask?$user:0, $modeproject?$user:0, $mode);
|
||||
if ($tasksarray)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
|
||||
@ -354,7 +354,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print $lines[$i]->title;
|
||||
print $lines[$i]->label;
|
||||
if ($showlineingray) print '</i>';
|
||||
else print '</a>';
|
||||
print "</td>\n";
|
||||
|
||||
@ -588,96 +588,6 @@ class Project extends CommonObject
|
||||
return $tasksrole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of task for all projects or a particular project
|
||||
* Sort order is on project, TODO then of position of task, and last on title of first level task
|
||||
* @param usert Object user to limit task affected to a particular user
|
||||
* @param userp Object user to limit projects of a particular user
|
||||
* @param mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @return array Array of tasks
|
||||
*/
|
||||
function getTasksArray($usert=0, $userp=0, $mode=0, $socid=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$tasks = array();
|
||||
|
||||
//print $usert.'-'.$userp.'<br>';
|
||||
|
||||
// List of tasks
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title as ptitle,";
|
||||
$sql.= " t.rowid, t.title, t.fk_task_parent, t.duration_effective,";
|
||||
$sql.= " up.name, up.firstname";
|
||||
if ($mode == 0)
|
||||
{
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."projet as p, ".MAIN_DB_PREFIX."projet_task as t";
|
||||
if (is_object($usert)) // Limit to task affected to a user
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta";
|
||||
}
|
||||
$sql.= ")";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as up on p.fk_user_resp = up.rowid";
|
||||
$sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($this->id) $sql .= " AND t.fk_projet =".$this->id;
|
||||
if (is_object($usert)) $sql .= " AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id;
|
||||
if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)";
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."projet as p";
|
||||
if (is_object($usert)) // Limit to task affected to a user
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= ")";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
}
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as up on p.fk_user_resp = up.rowid";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($this->id) $sql .= " AND t.fk_projet =".$this->id;
|
||||
if (is_object($usert)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id;
|
||||
if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)";
|
||||
}
|
||||
$sql.= " ORDER BY p.ref, t.title";
|
||||
|
||||
dol_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
|
||||
$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]->projectid = $obj->projectid;
|
||||
$tasks[$i]->projectref = $obj->ref;
|
||||
$tasks[$i]->projectlabel = $obj->title;
|
||||
$tasks[$i]->title = $obj->title;
|
||||
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
||||
$tasks[$i]->duration = $obj->duration_effective;
|
||||
$tasks[$i]->name = $obj->name; // Name of project leader
|
||||
$tasks[$i]->firstname = $obj->firstname; // Firstname of project leader
|
||||
$i++;
|
||||
}
|
||||
$this->db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -31,12 +31,12 @@ require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/tasks/task.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
|
||||
$projetid='';
|
||||
$projetid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["projetid"];
|
||||
$projectid='';
|
||||
$projectid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["projectid"];
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $projetid);
|
||||
$result = restrictedArea($user, 'projet', $projectid);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -62,24 +62,29 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer)
|
||||
$task_parent=$tmparray[1];
|
||||
if (empty($task_parent)) $task_parent=0; // If task_parent is ''
|
||||
|
||||
//print $_POST['task_parent'].'-'.$projectid.'-'.$task_parent;exit;
|
||||
$project = new Project($db);
|
||||
$result = $project->fetch($projectid);
|
||||
$task = new Task($db);
|
||||
|
||||
$task->fk_project = $projectid;
|
||||
$task->label = $_POST["label"];
|
||||
$task->description = $_POST['description'];
|
||||
$task->fk_task_parent = $task_parent;
|
||||
$task->datestart = $_POST['dateo'];
|
||||
$task->dateend = $_POST['datee'];
|
||||
|
||||
$result=$project->CreateTask($user, $_POST["task_name"], $task_parent, $_POST["userid"]);
|
||||
$result=$task->create($user);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (empty($projetid))
|
||||
if (empty($projectid))
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($_REQUEST["mode"])?'':'?mode='.$_REQUEST["mode"]));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projetid);
|
||||
Header("Location: ".DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projectid);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -126,15 +131,16 @@ $htmlother=new FormOther($db);
|
||||
$help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
llxHeader("",$langs->trans("Tasks"),$help_url);
|
||||
|
||||
$projet = new Project($db);
|
||||
$task = new Task($db);
|
||||
|
||||
$id = $_REQUEST['id'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$projet->fetch($_REQUEST["id"],$_GET["ref"]);
|
||||
if ($projet->societe->id > 0) $result=$projet->societe->fetch($projet->societe->id);
|
||||
if ($projet->user_resp_id > 0) $result=$projet->fetch_user($projet->user_resp_id);
|
||||
$project = new Project($db);
|
||||
$project->fetch($_REQUEST["id"],$_GET["ref"]);
|
||||
if ($project->societe->id > 0) $result=$project->societe->fetch($project->societe->id);
|
||||
if ($project->user_resp_id > 0) $result=$project->fetch_user($project->user_resp_id);
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
@ -143,7 +149,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
||||
|
||||
print '<form action="fiche.php" method="post">';
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="createtask">';
|
||||
if ($_GET['id']) print '<input type="hidden" name="id" value="'.$_GET['id'].'">';
|
||||
@ -151,20 +157,36 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td>'.$langs->trans("NewTask").'</td><td>';
|
||||
print '<input type="text" size="25" name="task_name" class="flat">';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>';
|
||||
print '<input type="text" size="25" name="label" class="flat">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
|
||||
print $htmlother->selectProjectTasks($projet->id, 'task_parent', $user->admin?0:1, 0, 1);
|
||||
print $htmlother->selectProjectTasks($project->id, 'task_parent', $user->admin?0:1, 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
print $form->select_users($user->id,'userid',1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->select_date('','dateo');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
||||
print $form->select_date(-1,'datee');
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
print '<textarea name="description" wrap="soft" cols="80" rows="'.ROWS_3.'"></textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
$tasksarray=$task->getTasksArray(0, $user, 1);
|
||||
|
||||
$project=new Project($db);
|
||||
$tasksarray=$project->getTasksArray(0, $user, 1);
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
if (sizeof($tasksarray))
|
||||
{
|
||||
@ -187,12 +209,12 @@ else
|
||||
$tab='tasks';
|
||||
if ($_REQUEST["mode"]=='mine') $tab='mytasks';
|
||||
|
||||
$head=project_prepare_head($projet);
|
||||
$head=project_prepare_head($project);
|
||||
dol_fiche_head($head, $tab, $langs->trans("Project"),0,'project');
|
||||
|
||||
$param=($_REQUEST["mode"]=='mine'?'&mode=mine':'');
|
||||
|
||||
print '<form name="addtime" method="POST" action="fiche.php?id='.$projet->id.'">';
|
||||
print '<form name="addtime" method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$project->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
@ -201,25 +223,25 @@ else
|
||||
print '<tr><td width="30%">';
|
||||
print $langs->trans("Ref");
|
||||
print '</td><td>';
|
||||
print $form->showrefnav($projet,'ref','',1,'ref','ref','',$param);
|
||||
print $form->showrefnav($project,'ref','',1,'ref','ref','',$param);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$project->title.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1);
|
||||
if (! empty($project->societe->id)) print $project->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Project leader
|
||||
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
||||
if ($projet->user->id) print $projet->user->getNomUrl(1);
|
||||
if ($project->user->id) print $project->user->getNomUrl(1);
|
||||
else print $langs->trans('SharedProject');
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$projet->getLibStatut(4).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$project->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -235,9 +257,9 @@ else
|
||||
|
||||
if ($user->rights->projet->creer)
|
||||
{
|
||||
if (empty($projet->user_resp_id) || $projet->user_resp_id == -1 || $projet->user_resp_id == $user->id)
|
||||
if (empty($project->user_resp_id) || $project->user_resp_id == -1 || $project->user_resp_id == $user->id)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$projet->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$project->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -252,9 +274,9 @@ else
|
||||
// Get list of tasks in tasksarray and taskarrayfiltered
|
||||
// We need all tasks (even not limited to a user because a task to user
|
||||
// can have a parent that is not affected to him).
|
||||
$tasksarray=$projet->getTasksArray(0, 0, 0);
|
||||
$tasksarray=$task->getTasksArray(0, 0, 0);
|
||||
// We load also tasks limited to a particular user
|
||||
$tasksrole=($_REQUEST["mode"]=='mine' ? $projet->getTasksRoleForUser($user) : '');
|
||||
$tasksrole=($_REQUEST["mode"]=='mine' ? $project->getTasksRoleForUser($user) : '');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -263,7 +285,7 @@ else
|
||||
print '<td>'.$langs->trans("LabelTask").'</td>';
|
||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||
print "</tr>\n";
|
||||
// Show all lines in taskarray (recusrive function to go down on tree)
|
||||
// Show all lines in taskarray (recursive function to go down on tree)
|
||||
$j=0;
|
||||
$nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 0, $tasksrole);
|
||||
print "</table>";
|
||||
|
||||
@ -90,16 +90,12 @@ class Task extends CommonObject
|
||||
$sql.= "fk_projet";
|
||||
$sql.= ", fk_task_parent";
|
||||
$sql.= ", label";
|
||||
$sql.= ", duration_effective";
|
||||
$sql.= ", fk_user_creat";
|
||||
$sql.= ", note_private";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= $this->fk_projet;
|
||||
$sql.= ", ".$this->fk_task_parent;
|
||||
$sql.= ", '".addslashes($this->label)."'";
|
||||
$sql.= ", ".(! isset($this->duration_effective)?'NULL':"'".$this->duration_effective."'").",";
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", '".addslashes($this->note_private)."'";
|
||||
$sql.= ")";
|
||||
|
||||
$this->db->begin();
|
||||
@ -409,6 +405,98 @@ class Task extends CommonObject
|
||||
$this->statut='';
|
||||
$this->note='';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of task for all projects or a particular project
|
||||
* Sort order is on project, TODO then of position of task, and last on title of first level task
|
||||
* @param usert Object user to limit task affected to a particular user
|
||||
* @param userp Object user to limit projects of a particular user
|
||||
* @param mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @return array Array of tasks
|
||||
*/
|
||||
function getTasksArray($usert=0, $userp=0, $mode=0, $socid=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$tasks = array();
|
||||
|
||||
//print $usert.'-'.$userp.'<br>';
|
||||
|
||||
// List of tasks
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel,";
|
||||
$sql.= " t.rowid, t.label, t.description, t.fk_task_parent, t.duration_effective,";
|
||||
$sql.= " up.name, up.firstname";
|
||||
if ($mode == 0)
|
||||
{
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."projet as p, ".MAIN_DB_PREFIX."projet_task as t";
|
||||
if (is_object($usert)) // Limit to task affected to a user
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta";
|
||||
}
|
||||
$sql.= ")";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as up on p.fk_user_resp = up.rowid";
|
||||
$sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($this->id) $sql .= " AND t.fk_projet =".$this->id;
|
||||
if (is_object($usert)) $sql .= " AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id;
|
||||
if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)";
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."projet as p";
|
||||
if (is_object($usert)) // Limit to task affected to a user
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= ")";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
}
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as up on p.fk_user_resp = up.rowid";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($this->id) $sql .= " AND t.fk_projet =".$this->id;
|
||||
if (is_object($usert)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id;
|
||||
if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)";
|
||||
}
|
||||
$sql.= " ORDER BY p.ref, t.label";
|
||||
|
||||
dol_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
|
||||
$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]->projectid = $obj->projectid;
|
||||
$tasks[$i]->projectref = $obj->ref;
|
||||
$tasks[$i]->projectlabel = $obj->plabel;
|
||||
$tasks[$i]->label = $obj->label;
|
||||
$tasks[$i]->description = $obj->description;
|
||||
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
||||
$tasks[$i]->duration = $obj->duration_effective;
|
||||
$tasks[$i]->name = $obj->name; // Name of project leader
|
||||
$tasks[$i]->firstname = $obj->firstname; // Firstname of project leader
|
||||
$i++;
|
||||
}
|
||||
$this->db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -111,16 +111,21 @@ if ($_GET["id"] > 0)
|
||||
print '</tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$task->title.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$task->label.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
print $projet->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<td>'.$langs->trans("Company").'</td><td>';
|
||||
print '<td>'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
if ($projet->societe->id) print $projet->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<td>'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
print nl2br($task->description);
|
||||
print '</td></tr>';
|
||||
|
||||
/* List of time spent */
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ if ($_GET["id"] > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$task->title.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$task->label.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
print $projet->getNomUrl(1);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -18,9 +19,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/projet/tasks/task.php
|
||||
* \ingroup projet
|
||||
* \brief Fiche t<EFBFBD>ches d'un projet
|
||||
* \file htdocs/projet/tasks/who.php
|
||||
* \ingroup project
|
||||
* \brief Fiche taches d'un projet
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
@ -79,7 +80,7 @@ if ($_GET["id"] > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$task->title.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$task->label.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
print $projet->getNomUrl(1);
|
||||
@ -93,13 +94,14 @@ if ($_GET["id"] > 0)
|
||||
|
||||
/* Liste des affectations */
|
||||
|
||||
$sql = "SELECT t.title, t.duration_effective, t.fk_task_parent, t.statut,";
|
||||
$sql = "SELECT t.label, t.duration_effective, t.fk_task_parent, t.fk_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";
|
||||
$sql.= " AND t.rowid = ta.fk_projet_task";
|
||||
$sql.= " AND ta.fk_user = u.rowid";
|
||||
|
||||
$lines=array();
|
||||
$var=true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user